org.solovyev.android
Class Android

java.lang.Object
  extended by org.solovyev.android.Android

public final class Android
extends Object

This class contains static methods for working with some android classes


Field Summary
static String LINE_SEPARATOR
           
 
Method Summary
static void addIntentFlags(android.content.Intent intent, boolean detached, android.content.Context context)
           
static int getAppVersionCode(android.content.Context context)
           
static int getAppVersionCode(android.content.Context context, String appPackageName)
          Method returns version of application identified by it's package name.
static android.os.Parcelable.Creator<String> getStringParcelableCreator()
           
static boolean isComponentEnabled(android.content.Context context, Class<? extends android.content.Context> componentClass)
           
static boolean isDebuggable(android.content.Context context)
           
static boolean isPhoneModel(DeviceModel phoneModel)
           
static String saveBitmap(android.graphics.Bitmap bitmap, String path, String fileName)
           
static void toggleComponent(android.content.Context context, Class<? extends android.content.Context> componentClass, boolean enable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static final String LINE_SEPARATOR
Method Detail

getAppVersionCode

public static int getAppVersionCode(@Nonnull
                                    android.content.Context context,
                                    @Nonnull
                                    String appPackageName)
                             throws android.content.pm.PackageManager.NameNotFoundException
Method returns version of application identified by it's package name.

Parameters:
context - context
appPackageName - full name of the package of an app, 'com.example.app' for example.
Returns:
version number of application
Throws:
PackageManager.NameNotFoundException - if application is not found

getAppVersionCode

public static int getAppVersionCode(@Nonnull
                                    android.content.Context context)
Parameters:
context - context
Returns:
version number of current application

isPhoneModel

public static boolean isPhoneModel(@Nonnull
                                   DeviceModel phoneModel)

isDebuggable

public static boolean isDebuggable(@Nonnull
                                   android.content.Context context)

getStringParcelableCreator

@Nonnull
public static android.os.Parcelable.Creator<String> getStringParcelableCreator()

addIntentFlags

public static void addIntentFlags(@Nonnull
                                  android.content.Intent intent,
                                  boolean detached,
                                  @Nonnull
                                  android.content.Context context)

toggleComponent

public static void toggleComponent(@Nonnull
                                   android.content.Context context,
                                   @Nonnull
                                   Class<? extends android.content.Context> componentClass,
                                   boolean enable)

isComponentEnabled

public static boolean isComponentEnabled(@Nonnull
                                         android.content.Context context,
                                         @Nonnull
                                         Class<? extends android.content.Context> componentClass)

saveBitmap

public static String saveBitmap(@Nonnull
                                android.graphics.Bitmap bitmap,
                                @Nonnull
                                String path,
                                @Nonnull
                                String fileName)


Copyright © 2013. All Rights Reserved.