com.burstly.presence
Class InstalledAppTracker

java.lang.Object
  extended by com.burstly.presence.InstalledAppTracker

public class InstalledAppTracker
extends java.lang.Object

InstalledAppTracker is a simple class which uses static functions to get information on installed applications.


Constructor Summary
InstalledAppTracker()
           
 
Method Summary
static java.util.HashMap<java.lang.String,AppInfo> checkInstalledApps(Context oContext, java.lang.String[] aAppPackages)
          checkInstalledApps(Context, String[]) checks the install state of the packages specified in the String[]
static java.lang.String createPubTargettingString(java.util.HashMap<java.lang.String,AppInfo> oAppInfo)
          Generates a pub targeting String.
static java.lang.String[] downloadPackageNames(java.lang.String sID)
          downloadPackageNames gets a String[] containing the package names associated with an org ID
static java.lang.Thread getPackageNamesAndCheckIstallAsync(Context oContext, java.lang.String sID, IInstalledAppListener oListener)
          Begins an Async task which will retrieve the package names associated with an org ID and check their install state. Results received through the IInstalledAppListener interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstalledAppTracker

public InstalledAppTracker()
Method Detail

downloadPackageNames

public static java.lang.String[] downloadPackageNames(java.lang.String sID)
downloadPackageNames gets a String[] containing the package names associated with an org ID

Parameters:
String - The organisation ID

getPackageNamesAndCheckIstallAsync

public static java.lang.Thread getPackageNamesAndCheckIstallAsync(Context oContext,
                                                                  java.lang.String sID,
                                                                  IInstalledAppListener oListener)
Begins an Async task which will retrieve the package names associated with an org ID and check their install state. Results received through the IInstalledAppListener interface.

Parameters:
Context - The current context
String - The organisation ID
IInstalledAppListener - The delegate which will receive a completion callback via IInstalledAppListener.downloadPackageNamesComplete
Returns:
Thread The thread on which the async task is being run on. Can be joined in order to wait for completion. null represents failure to start.

checkInstalledApps

public static java.util.HashMap<java.lang.String,AppInfo> checkInstalledApps(Context oContext,
                                                                             java.lang.String[] aAppPackages)
checkInstalledApps(Context, String[]) checks the install state of the packages specified in the String[]

Parameters:
Context - An android application context
String[] - An array of Strings containing the package names whose install status is to be checked
Returns:
HashMap A HashMap which uses the package name as a key to get the AppInfo.

createPubTargettingString

public static java.lang.String createPubTargettingString(java.util.HashMap<java.lang.String,AppInfo> oAppInfo)
Generates a pub targeting String. Uses the HashMap generated in checkInstalledApps(Context, String[]) to generate a string which can be passed to BurstlyView.setPubTargetingParams

Parameters:
HashMap - generated by checkInstalledApps(Context, String[])
Returns:
String containing the targeting params used for app presence targeting