Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
chetali
Advisor
Advisor
477
If the version of your SAP BTP SDK for Android is 2.3 or below, refer to this blog post, else if the version of your SAP BTP SDK for Android is between 3.0 and 3.1 releases, this blog post will help you migrate Android Application configured with SAML from Neo environment to Cloud Foundry environment.

Following is the list of tools I used:

  • Android Studio 4.0.1

  • Android SDK 28

  • SAP BTP SDK Android 3.1.3

  • Java Development Kit 14.0.2


For getting more insights, read:

Follow the steps given below to migrate your android application from Neo environment to Cloud Foundry environment with SAML configuration:

Create an application in Neo environment with SAML configuration:

  1. Open mobile services cockpit (neo environment) and under Mobile Applications select Native/Hybrid.

  2. Click on the new button, a dialog box will appear. Enter the following details and click on Save.















    Config Templates Native
    Name com.sap.migrationSAML
    ID MigrationSAML


  3. Once the app is created, under the Assigned Features section, click on Connectivity.

  4. Click on create button.Enter the following details and click next:











    Type Mobile Destination
    Destination Name es5DemoSystem

    Enter the URL ‘https://sapes5.sapdevcenter.com/sap/opu/odata/sap/EPM_REF_APPS_SHOP_SRV’ and click next until you reach the SSO Mechanism page. Choose ‘Basic Authentication’ and click next.Enter your username and Password and click next and then click finish.

  5. Open your Android Studio, click on Start a new SAP Cloud Platform Android Project.

  6. Enter the following details and click on Next.



























    Account Name Neo Mobile Services
    Admin API URL Refer the note below.
    Admin UI URL Refer the note below.
    Authentication Type SAML
    Username Your BTP account username
    Password Your BTP account password

    NOTE: For the Admin API URL and Admin UI URL, click on the Important Links tab in the Mobile Services Cockpit, and copy the Admin API and Admin UI.

  7. Select com.sap.migrationSAML from the drop down and click next.

  8. Select es5DemoSystem and click next.

  9. Give the Project Name as MigrationSAML, Project Namespace as com.sap.migrationsaml and click next and then click finish.

  10. Wait for the application to load completely. Open app -> java -> com.sap.migrationsaml -> app -> WelcomeActivity.java. On line 104, you can see your Neo tenant’s URL. Now, run the app on your device.










You can see that the application is running on Neo environment.

 

Now export the application from your Neo mobile services cockpit. A zip file will be downloaded.


Open your Cloud foundry mobile services cockpit and under mobile applications select Native/Hybrid.


Click on Import and browse the location of your file and click Save.



Once import is complete, you will get a toast message “Application imported successfully”.

 

Now, click on Migration SAML and click on the API tab and download the configuration for your android device.



Open the defaultConfig.json file and copy the host value.


Go to your Android Studio and replace the URL with “ https://<the value you copied>/ ” in WelcomeActivity.java.


Uninstall the application you installed earlier and run the application again.








You will see that your app is pointing to Cloud Foundry environment now which means you successfully migrated your android application from Neo environment to Cloud Foundry environment with SAML configuration.

 

If the version of your SAP BTP SDK for Android is 3.2.0 or above, follow the steps given below:

  1. In your android project, go inside app -> res -> raw folder. Here, you will see sap_mobile_services.json file.

  2. Replace the service URL on line 9 with the host value you copied from defaultConfig.json file.



Now, uninstall the application you installed earlier and run the application.

 

You will see that your app is pointing to Cloud Foundry environment now which means you successfully migrated your android application from Neo environment to Cloud Foundry environment with SAML configuration.