Follow the instructions below to configure WSO2 EMM for Android:
Table of Contents | ||||
---|---|---|---|---|
|
Step 1 - Register with Google Cloud Messaging
Follow the instructions below to register with Google Cloud Messaging (GCM):
...
and
...
Click APIs & auth and then click APIs.
...
Turn on “Google cloud messaging for Android".
...
Click APIs & auth and then click Credentials.
...
build
...
Follow the instructions below to configure and build the Android client application:
- Get a GIT clone of the Android Agent application from GitHub.
- Open the project in your Eclipse IDE.
- Click Import and select Existing project to workspace wizard to import the project.
- Click Import and select Existing Android Code to workspace, to import the
ActionBarSherlock
project from the<MDMAgent Project folder>/Plugins/ActionBarSherlock/library/
directory, to the same workspace. - Check whether the library is linked to the
MDMAgent
project as follows:- Click project properties and select Android.
- At the bottom of the interface that appears, you will see the Library section. Verify that the ActionBarSherlock project is correctly referenced.
- If it is incorrectly referenced, remove the existing reference and add it again using the ActionBarSherlock library that you imported into workspace.
Clean and build
ActionBarSherlock
library project.
Use the CA certificate PEM file that is generated for iOS to create a BKS file, which is compatible with Android. Rename the BKS file toAnchor step7 step7 emm_truststore.bks
and and add it inside your Android project’s res/raw/ directory, replacing the sample provided.Info The BKS file needs to be generated only for testing purposes.
Go to the java class named
CommonUtilities.java
in By default, the Android agent communicates with the server through http. For production, this needs to be changed to https, by configuring the following parameters in the Java class namedCommonUtilities.java,
which is in theorg.wso2.emm.
agentagent.utils
package and replace theSERVER_URL
andTRUSTSTORE_PASSWORD
(Password used to generate the BKS file in step 7) as seen below: /** * Helper class providing methods and constants common to other classes in the * app. */ public class CommonUtilities {Code Block :
SERVER_IP, SERVER_PORT
andSERVER_PROTOCOL.
Info If the SSL certificate is self signed, then the BKS file (step 7) should be generated using the CA certificate and the BKS file password needs to be added as the value for the
TRUSTSTORE_PASSWORD
parameter.
For a production environment replace theCode Block public static boolean DEBUG_MODE_ENABLED = false; public static boolean LOCAL_NOTIFICATIONS_ENABLED = true; public static boolean GCM_ENABLED = false; public static String SERVER_IP = ""; public static String SERVER_PORT = "9763"; public static String SERVER_PROTOCOL = "http://"; public static String API_VERSION = "1.0.0"; public static String SERVER_APP_ENDPOINT = "/emm/api/";
SERVER_PORT
to9443
andSERVER_PROTOCOL
tohttps
./"; public static String OAUTH_ENDPOINT = "/oauth2/token"; public static String SENDER_ID_ENDPOINT = "devices/sender_id/"; public static String IS_REGISTERED_ENDPOINT = "devices/isregistered/"; public static String LICENSE_ENDPOINT = "devices/license/"; public static String REGISTER_ENDPOINT = "devices/register/"; public static String UNREGISTER_ENDPOINT = "devices/unregister/"; public static String NOTIFICATION_ENDPOINT = "notifications/pendingOperations/"; public static String SERVER_URL = SERVER_PROTOCOL + SERVER_IP + ":" + SERVER_PORT + SERVER_APP_ENDPOINT; public static final String TRUSTSTORE_PASSWORD = ""; public static final String EULA_TITLE = "POLICY AGREEMENT";
- Clean and build the project.
- Name the project
emm
, and export the project as an Android application. You will get an.apk
file.
...