For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Register Android applications from the MobileFirst Platform CLI
We can use the IBM MobileFirstâ„¢ Platform Command Line Interface (CLI) to register your Android application to an instance of MobileFirst Server.
Before you begin
- You must have the IBM MobileFirst Platform Command Line Interface (CLI) installed. For more information, see Install the MobileFirst Platform CLI.
- You must have an instance of MobileFirst Server running. The server can be running locally, or it can be a remote server, but it must be reachable from your local computer. For more information, see Set up the MobileFirst Development Server, Install the IBM MobileFirst Platform Foundation Developer Kit, or Install IBM MobileFirst Platform Server.
- You must have an Android application on your local computer.
Once you have the client side of your Android application initially defined, we can prepare for further development tasks by registering it to a MobileFirst Server.
Procedure
- Check that the target MobileFirst Server is up and running.
- Navigate to the directory that contains your app, or one of its subdirectories.
- Register your app to the server. Use one of the following procedures:
- To register the app to the default server, run the following command:
mfpdev app register
Note: If you have not previously set a default server and a MobileFirst Server is running on the local system, this command registers the app to the local MobileFirst Server, and this server is made the default.
- To register your app to a server that is not the default server:
- Create a server profile by running the mfpdev server add command. For example:
mfpdev server add Server1 -url https://company.mobile.com:9080 -login admin -password secretPassword!For more information about the mfpdev server add command, run mfpdev help server add.
- To register your app to the server that you just defined, run the mfpdev app register command, and specify the server profile that you just created. For example:
mfpdev app register Server1
For more information about this command, including optional parameters, run mfpdev help app register.
Results
The app is registered to the target server. Data about the app that is obtained from the platform properties file (AndroidManifest.xml) such as application name, version number, and app ID is sent to the server. If the client properties file /app/src/main/assets/mfpclient.properties already exists, it is updated with the value of the server's URL. If the file did not exist, a /app/src/main/assets/mfpclient.properties file that includes the server's URL is created at the root of your project.
What to do next
We can proceed with other development tasks that depend on the MobileFirst Server. For example, we can preview your app, test your app's security features, and manage your app from the MobileFirst Operations Console.
Parent topic: Register Android applications to MobileFirst Server