Skip to Content

How to mobilize SAPUI5 cordova wrapped app with android studio?

Dear all

I am trying to make an android from my SAPUI5 application using cordova.

I have followed this blog post for reference

https://blogs.sap.com/2015/01/30/creating-a-ui5-app-and-integrating-with-cordova-plugins-part-1/

However after I add the contents of my SAPUI5 Webapp folder into the "android-assets-www" folder and recompile the project, the apk that gets created is showing error "Unfortunately, app has stopped" on my device.

The following are the softwares and their corresponding versions installed.

  • npm - 5.4.2
  • cordova - 7.0.1
  • java - 1.8.0-144 (jdk and jre)
  • Android Studio - 2.3.3

I have questions regarding running the application

1) I use the cordova command in the below order

- cordova create FirstApp com.sap.myui FirstApp

- cordova platform add android

- cordova prepare

- cordova compile

2) I am not using any cordova plugins

3) I make a reference of cordova.js in the index.html file after copying the contents of webapp folder into the www folder

4) I have also tried after adding SAPUI5 resources folder in android-assets-www folder, but no use.

5) I run the following commands again at the end to recompile.

- cordova prepare

- cordova compile

I am using Eclipse ADT for building path and adding Cordova library jar, even though it is written everywhere that android doesn't work with Eclipse anymore.

I want to build an apk for my app using Android Studio and run it on Studio itself or on my device.

However, if it is possible to run the apk generated using Eclipse ADT without getting "App stopped working" error, kindly suggest me how it is done.

Please help.

Regards,

Kalpesh B.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 07 at 02:29 PM

    Hello, maybe you should consider the use of SAP HAT on your project https://blogs.sap.com/2015/07/13/how-to-install-hybrid-application-toolkit-hat-on-windows-part-3-of-3/. HAT has the capability to create the .apk by informing the project name.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 12 at 07:10 AM

    Hi Kalpesh,

    If a real device is connected to your pc and it is recognized as well, then you can just use below command in Cmd
    cordova run android
    and the app will start on your device and check the logs to find the errors.

    Regards,

    Rehan Sayed

    Add comment
    10|10000 characters needed characters exceeded