Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Follow the instructions below to configure WSO2 EMM for Android:

 

Step 1 - Register with Google Cloud Messaging

Follow the instructions below to register with Google Cloud Messaging (GCM):

  1. Go to the Google API Console.
    If you are new to the  Google API console, you will be directed to following screen:

    If you already have existing projects, you will be directed to your Dashboard page:

  2. On the Dashboard page, click Projects and thereafter click Create Project to create a new project for our application.
    After creating the project, you will see the Project Number in the created project. That project number will be our sender ID when you communicate with the GCM server; therefore, you need to copy that and keep it safely.

  3. Click APIs & auth and then click APIs

  4. Turn on “Google cloud messaging for Android".

  5. Click APIs & auth and then click Credentials.

  6. Click Create New Key to use the wizard to create a server key. You need to copy and keep the API key, as it will be used later in the EMM server configurations.

Step 2 - Configure and build the Android client application

Follow the instructions below to configure and build the Android client application:

  1. Get a GIT clone of the Android Agent application from GitHub.
  2. Open the project in your Eclipse IDE.
  3. Click Import and select Existing project to workspace wizard to import the project.
  4. 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.  
  5. 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.
  6. Clean and build ActionBarSherlock library project.

  7. 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 to emm_truststore.bks   and add it inside your Android project’s res/raw/ directory, replacing the sample provided.

    The BKS file needs to be generated only for testing purposes.

  8. Go to the java class named CommonUtilities.java in the com.wso2mdm.mdm.utils package and replace the SERVER_URL and TRUSTSTORE_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 {
            public static boolean DEBUG_MODE_ENABLED = true;
    		public static String SERVER_IP = "----ADD YOUR HOSTNAME HERE----";
            public static String SERVER_PORT = "9443";
            public static String SERVER_PROTOCOL = "https://";
            public static String SERVER_APP_ENDPOINT = "/mdm/api/";
            public static String SERVER_URL = SERVER_PROTOCOL+SERVER_IP+":"+SERVER_PORT+SERVER_APP_ENDPOINT;
            public static final String TRUSTSTORE_PASSWORD = "----ADD YOUR TRUST STORE PASSWORD HERE----";
    
    
            public static String getSERVER_URL() {
                    return SERVER_URL;
            }
    
    
            public static void setSERVER_URL(String sERVER_URL) {
                    SERVER_IP = sERVER_URL;
                    SERVER_URL = "https://"+sERVER_URL+":"+SERVER_PORT+"/mdm/api/";
            }
  9. Clean and build the project.
  10. Name the project emm, and export the project as an Android application. You will get an .apk file.

You have to carryout the Android server configurations after completing the Android client configurations.

  • No labels