org.hermit.android.core
Class AppUtils

java.lang.Object
  extended by org.hermit.android.core.AppUtils

public class AppUtils
extends java.lang.Object

This class provides some simple application-related utilities.


Nested Class Summary
static class AppUtils.Detail
          Version info detail level.
 class AppUtils.Version
          Information on an application version.
 
Method Summary
 AppUtils.Version getAppVersion()
          Get the version info for the current app.
static AppUtils getInstance(Activity parent)
          Get the app utils instance for this Activity.
 java.lang.String getVersionString()
          Get a string containing the name and version info for the current app's package, in a simple format.
 java.lang.String getVersionString(AppUtils.Detail detail)
          Get a string containing the name and version info for the current app's package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AppUtils getInstance(Activity parent)
Get the app utils instance for this Activity.

Parameters:
parent - Activity for which we want information.
Returns:
The application utilities instance for this app.

getAppVersion

public AppUtils.Version getAppVersion()
Get the version info for the current app.

Returns:
App version info. null if the info could not be found.

getVersionString

public java.lang.String getVersionString()
Get a string containing the name and version info for the current app's package, in a simple format.

Returns:
Descriptive name / version string.

getVersionString

public java.lang.String getVersionString(AppUtils.Detail detail)
Get a string containing the name and version info for the current app's package.

Parameters:
detail - How much detail we want.
Returns:
Descriptive name / version string.