com.kiddoware.kidsplace.sdk
Class KPUtility

java.lang.Object
  extended by com.kiddoware.kidsplace.sdk.KPUtility

public class KPUtility
extends java.lang.Object

Utility class for 3rd party apps to integrate with Kids Place

Author:
kiddoware

Field Summary
static int AMAZON_MARKET
          Constant to indicate Amazon App Store as the marketplace to download Kids Place
static boolean DEBUG_MODE
          Flag to enable debug mode.
static int GOOGLE_MARKET
          Constant to indicate Goolgle Play Store as the marketplace to download Kids Place.
static java.lang.String KIDSPLACE__OK
          Positive Button text on Alert Dialog displayed on Install/Upgrade prompt for Kids Place Developers can set this value from their Resource file.
static java.lang.String KIDSPLACE_INSTALL_MSG
          Message on Alert Dialog displayed if user does not have Kids Place app installed on their device.
static java.lang.String KIDSPLACE_INSTALL_TITLE
          Title on Alert Dialog displayed if user does not have Kids Place app installed on their device.
static java.lang.String KIDSPLACE_NO
          Negative Button text on Alert Dialog displayed on Install/Upgrade prompt for Kids Place.
static java.lang.String KIDSPLACE_UPGRADE_MSG
          Message on Alert Dialog displayed if user Kids Place app version is below the required version for API.
static java.lang.String KIDSPLACE_UPGRADE_TITLE
          Title on Alert Dialog displayed if user Kids Place app version is below the required version for API.
 
Constructor Summary
KPUtility()
           
 
Method Summary
static java.lang.String getPinHint(Context context)
          Returns the PIN hint set in Kids Place.
static boolean handleKPIntegration(Activity activity, int appMarketValue)
          Call this method from the activity where you would like to start Kids Place from.
static int isKidsPlaceInstalled(Context context)
          Checks if Kids Place is installed on users device or not.
static boolean isKidsPlaceRunning(Activity activity)
          Call to check if Kids Place app is currently running on users device
static void setMarketPlace(int markeplaceValue)
          Call to set marketplace to download Kids Place app from.
static void showKPInstallDialog(Activity activity)
          Call to prompt user to install Kids Place
static void showKPUpgradeDialog(Activity activity)
          Call to prompt user to upgrade Kids Place
static void startKPService(Activity activity)
          Call this method from the activity from where you would like to start Kids Place if you have already identified that Kids Place is installed on user's device.
static boolean validatePin(Context context, java.lang.String pin)
          Validates the PIN entered by user against the PIN set up in Kids Place
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_MODE

public static boolean DEBUG_MODE
Flag to enable debug mode. Default set to false


GOOGLE_MARKET

public static final int GOOGLE_MARKET
Constant to indicate Goolgle Play Store as the marketplace to download Kids Place. Default marketplace is set to this value.

See Also:
Constant Field Values

AMAZON_MARKET

public static final int AMAZON_MARKET
Constant to indicate Amazon App Store as the marketplace to download Kids Place

See Also:
Constant Field Values

KIDSPLACE_INSTALL_TITLE

public static java.lang.String KIDSPLACE_INSTALL_TITLE
Title on Alert Dialog displayed if user does not have Kids Place app installed on their device. Developers can set this value from their Resource file. Default Value: "Child Lock feature requires Kids Place App"


KIDSPLACE_INSTALL_MSG

public static java.lang.String KIDSPLACE_INSTALL_MSG
Message on Alert Dialog displayed if user does not have Kids Place app installed on their device. Developers can set this value from their Resource file. Default Value: "Install Kids Place - With Child Lock from App Store?\nIt is a free Parental Control app that lets parents choose apps their kids can access then locks them out of the rest of their device."


KIDSPLACE_UPGRADE_TITLE

public static java.lang.String KIDSPLACE_UPGRADE_TITLE
Title on Alert Dialog displayed if user Kids Place app version is below the required version for API. Developers can set this value from their Resource file. Default Value: "Update Kids Place?"


KIDSPLACE_UPGRADE_MSG

public static java.lang.String KIDSPLACE_UPGRADE_MSG
Message on Alert Dialog displayed if user Kids Place app version is below the required version for API. Developers can set this value from their Resource file. Default Value: "Child Lock feature requires Kids Place v 1.7.4 or higher. Get the latest version from App Store?"


KIDSPLACE_NO

public static java.lang.String KIDSPLACE_NO
Negative Button text on Alert Dialog displayed on Install/Upgrade prompt for Kids Place. Developers can set this value from their Resource file. Default Value: "No"


KIDSPLACE__OK

public static java.lang.String KIDSPLACE__OK
Positive Button text on Alert Dialog displayed on Install/Upgrade prompt for Kids Place Developers can set this value from their Resource file. Default Value: "OK"

Constructor Detail

KPUtility

public KPUtility()
Method Detail

handleKPIntegration

public static boolean handleKPIntegration(Activity activity,
                                          int appMarketValue)
Call this method from the activity where you would like to start Kids Place from.

Parameters:
activity - : Android activity from where Kids Place integration call need to be made
appMarketValue: - Use KPUtility.GOOGLE_MARKET or KPUtility.AMAZON_MARKET to indicate where user should be directed to upgrade/installed Kids Place if they do not have the correct KP version installed. Currently only Google and Amazon app stores are supported.

validatePin

public static boolean validatePin(Context context,
                                  java.lang.String pin)
Validates the PIN entered by user against the PIN set up in Kids Place

Parameters:
context: - Android context object
pin: - Pin entered by user

getPinHint

public static java.lang.String getPinHint(Context context)
Returns the PIN hint set in Kids Place. This information can be displayed in prompt for PIN from apps.

Parameters:
context: - Android context object

isKidsPlaceInstalled

public static int isKidsPlaceInstalled(Context context)
Checks if Kids Place is installed on users device or not.

Parameters:
context:Android - context object

isKidsPlaceRunning

public static boolean isKidsPlaceRunning(Activity activity)
Call to check if Kids Place app is currently running on users device

Parameters:
activity: - Android activity from where check needs to be made

startKPService

public static void startKPService(Activity activity)
Call this method from the activity from where you would like to start Kids Place if you have already identified that Kids Place is installed on user's device. Its recommended to use handleKPIntegration method instead of this.

Parameters:
activity: - Android activity from where Kids Place need to be started

showKPInstallDialog

public static void showKPInstallDialog(Activity activity)
Call to prompt user to install Kids Place

Parameters:
activity: - Android activity from where prompt needs to be displayed

showKPUpgradeDialog

public static void showKPUpgradeDialog(Activity activity)
Call to prompt user to upgrade Kids Place

Parameters:
activity: - Android activity from where prompt needs to be displayed

setMarketPlace

public static void setMarketPlace(int markeplaceValue)
                           throws java.lang.Exception
Call to set marketplace to download Kids Place app from.

Parameters:
markeplaceName:: - Use KPUtility.GOOGLE_MARKET or KPUtility.AMAZON_MARKET to indicate where user should be directed to upgrade/installed Kids Place if they do not have the correct KP version installed. Currently only Google and Amazon app stores are supported.
Throws:
java.lang.Exception