Android Open Source - RingMyPhoneAndroid Os Util






From Project

Back to project page RingMyPhoneAndroid.

License

The source code is released under:

MIT License

If you think the Android project RingMyPhoneAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.darkrockstudios.apps.ringmyphone;
//from w  ww. j a v  a  2 s  . com
import android.os.Build;

import java.lang.reflect.Field;

/**
 * Created by Adam on 1/4/2015.
 */
public class OsUtil
{
  public static boolean atLeastICS()
  {
    return osAtLeast( Build.VERSION_CODES.ICE_CREAM_SANDWICH );
  }

  public static boolean atLeastLollipop()
  {
    return osAtLeast( Build.VERSION_CODES.LOLLIPOP );
  }

  private static int sVersion = -1;

  private static boolean osAtLeast( int requiredVersion )
  {
    if( sVersion == -1 )
    {
      try
      {
        Field field = Build.VERSION.class.getDeclaredField( "SDK_INT" );
        sVersion = field.getInt( null );
      }
      catch( Exception e )
      {
        // ignore exception - field not available
        sVersion = 0;
      }
    }

    return sVersion >= requiredVersion;
  }
}




Java Source Code List

com.darkrockstudios.apps.ringmyphone.AboutFragment.java
com.darkrockstudios.apps.ringmyphone.BillingActivity.java
com.darkrockstudios.apps.ringmyphone.BillingSecurity.java
com.darkrockstudios.apps.ringmyphone.Debug.java
com.darkrockstudios.apps.ringmyphone.MainActivity.java
com.darkrockstudios.apps.ringmyphone.NotificationId.java
com.darkrockstudios.apps.ringmyphone.OsUtil.java
com.darkrockstudios.apps.ringmyphone.PebbleApp.java
com.darkrockstudios.apps.ringmyphone.PebbleMessageReceiver.java
com.darkrockstudios.apps.ringmyphone.PreferencesBackupAgent.java
com.darkrockstudios.apps.ringmyphone.Preferences.java
com.darkrockstudios.apps.ringmyphone.Purchase.java
com.darkrockstudios.apps.ringmyphone.RingerService.java
com.darkrockstudios.apps.ringmyphone.SettingsActivity.java
com.darkrockstudios.apps.ringmyphone.SettingsFragment.java
com.darkrockstudios.apps.ringmyphone.StopRingingReceiver.java
com.darkrockstudios.apps.ringmyphone.UpgradeReceiver.java