OSUtils.java :  » UnTagged » android-shuffle » org » dodgybits » shuffle » android » core » util » Android Open Source

Android Open Source » UnTagged » android shuffle 
android shuffle » org » dodgybits » shuffle » android » core » util » OSUtils.java
package org.dodgybits.shuffle.android.core.util;

import java.lang.reflect.Field;

import android.os.Build;

public class OSUtils {

    public static boolean osAtLeastFroyo() {
        boolean isFroyoOrAbove = false;
        try {
            Field field = Build.VERSION.class.getDeclaredField("SDK_INT");
            int version = field.getInt(null);
            isFroyoOrAbove = version >= Build.VERSION_CODES.FROYO;
        } catch (Exception e) {
            // ignore exception - field not available
        }
        return isFroyoOrAbove;
    }
    
    
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.