MA2.1 Configure the REST API's endpoint

Mobile apps need to be re-compiled with the correct server’s IP address for it to be functional.

To do so:

  • Open Android Studio

  • Open the mobile app project you want to configure (available on openIMIS github)

  • Find the gradle file /app/build.gradle

  • update the "API_BASE_URL" and the "applicationId" , for the default, and other product flavor that you see fit

    productFlavors.all { buildConfigField "String", "API_BASE_URL", '""' buildConfigField "boolean", "SHOW_CONTROL_NUMBER_MENU", 'false' buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"' resValue "string", "app_name", "openIMIS Policies" } productFlavors { demoProd { applicationId "org.openimis.imispolicies.demoProd" buildConfigField "String", "API_BASE_URL", '""' buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"' resValue "string", "app_name", "Policies Demo" dimension = 'std' } demoRelease { applicationId "org.openimis.imispolicies.demoRelease" buildConfigField "String", "API_BASE_URL", '""' buildConfigField "boolean", "SHOW_CONTROL_NUMBER_MENU", 'true' resValue "string", "app_name", "Policies Release" dimension = 'std' } }

    Build the app via the tools menu

  • The new .apk file is now available in the release folder indicated by Android Studio

Previous step | Go to parent | Table of content | Next step 

Did you encounter a problem or do you have a suggestion?

Please contact our Service Desk

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.