Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  How to build a custom apk with a own packagename?

    Posted Mon March 08, 2021 02:36 PM
    To be able to upload a custom android apk to google customer store a unic name needs to be set on the application.

    I have tried to change the packageName in application-descriptor.xml to below but after build the application is still using default packagename.
    <packageName>com.xxxxx.maximoanywhere.workexecution</packageName>

    How can I build a custom apk with a custom packageName?

    ------------------------------
    mikael simonsson
    Architect
    IBM
    Stockholm
    ------------------------------



    #Maximo
    #MaximoAnywhere
    #AssetandFacilitiesManagement


  • 2.  RE: How to build a custom apk with a own packagename?

    Posted Tue March 09, 2021 02:56 AM
    Mikael,

    if you're working with AW 7.6.4 you get this option for free. You just need to update application-descriptor.xml and you're good to go.
    When it comes to 7.6.3 then:
    • for iOS - it's enough if you open XCode project and update bundle ID. It will not be overwritten until you run e.g. update-platform.
    • for Android - you need to make sure that applicationId and package values are updated accross a set of files like <aw-root>/apps/<app>/android/native/build.gradle, <aw-root>/apps/<app>/android/native/AndroidManifest.xml, <aw-root>/apps/<app>/android/native/res/xml/config.xml. Furthermore (due to package change you need to move application Java source code to the new folder structure matching your new package name. In order to be able to publish the app into Google Play Store (public or enterprise) you need to implement app signing as well and most likely increase android.defaultConfig.targetSdkVersion to 26 in build.gradle.
      NOTES: Most of these changes can be applied fairly dynamically during the build time by extending <aw-root>/apps/<app>/android/native/build.gradle.This way there is no need to redo changes manually after update-platform execution. 
      Furthermore in theory you could only set android.defaultConfig.applicationId to get APK generated with unique name and be able to publish it. In practice you need to change all "old" package references in all other places (as described above) in order to get MobileFirst plugins like camera, file upload, barcode scanner fully to work.
    Regards,
    Andrzej

    ------------------------------
    Andrzej Więcław
    Maximo Technical Consultant
    Trivalo AB
    Gothenburg, Sweden
    ------------------------------



  • 3.  RE: How to build a custom apk with a own packagename?

    Posted Tue March 09, 2021 04:51 AM
    Hi Mikael,

    Can you try the steps below please?

    STEPS:

    1. launch android studio

    2. select import project

    3. navigate to the \\MaximoAnywhere\apps\app_name\android\native

    4. Rename package to New_app_name as per YouTube video https://www.youtube.com/watch?v=x0UAuJno8Gw

    NOTE: do not modify the build.gradle file

    5. change the version to something else in AndroidManifest.xml

    android:versionCode="12" android:versionName="9.0" package="com.ibm.iot.maximoanywhere.New_app_name">​

    change the android version to 9.0 in application-descriptor.xml

    6. run build all command



    ------------------------------
    May On
    Tech Support
    IBM
    ------------------------------