Quantcast
Channel: Jive Syndication Feed
Viewing all articles
Browse latest Browse all 10881

SAPUI5 Mobile App for cross platforms(iOS/Android) using PhoneGap: PART2

$
0
0

In my earlier blog, I have discussed about how to setup the Android development platform in Eclipse. This blog will cover the steps to run the SAPUI5 in Android devices.

 

Steps to deploy and run SAPUI5 in Android devices using Phone Gap.


     Download the phone gap(2.9.0) from the following URL. http://phonegap.com/download


1.JPG


   Copy the contents to your local directory and unzip them.

 

2.JPG

Open the Eclipse Project for Android, explained in my earlier blog, Select the “Assets” folder and create a new folder named “WWW” under it

3.JPG

Copy the cordova.js, cordova-2.9.0.jar folders that you have download from the phonegap 2.9.0 folder to your project(WWW and libs folder respectively) as shown in the below picture. The path to the phoneGap 2.9.0 would be "phonegap-2.9.0\lib\android"


4.JPG

Right click on the Libs folder and make sure the project has the correct build path as shown


5.JPG

In the MainActivity.java file, perform the below changes,

 

6.JPG

7.JPG

 

     Copy and paste the following content into the “AndroidManifest.xml.

 

< supports-screens android:largeScreens="true"

android:normalScreens="true"

android:smallScreens="true"

android:resizeable="true"

android:anyDensity="true" />

<uses-permission android:name="android.permission.VIBRATE" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.RECEIVE_SMS" />

<uses-permission android:name="android.permission.RECORD_AUDIO" />

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<uses-permission android:name="android.permission.READ_CONTACTS" />

<uses-permission android:name="android.permission.WRITE_CONTACTS" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.GET_ACCOUNTS" />

<uses-permission android:name="android.permission.BROADCAST_STICKY" />


8.JPG


Add the config changes attribute in the same file as highlighted below

9.JPG

Download the contents of SAPUI5 from SDN site.  http://scn.sap.com/community/developer-center/front-end

 

Copy the required mobile libraries from the downloaded contents as shown below and move it to WWW folder in your eclipse. I have other resources as well as it was required for my project.

10.JPG

 

11.JPG

 

Now copy your SAPUI5 developed application in to WWW folder of the project.

 

12.JPG

 

     Open the index.HTML file and add the cordova.js and Jquery files as shown

 

     <scripttype="text/javascript"src="resources/sap/ui/thirdparty/jquery/jquery-1.7.1.js"></script>

     <scripttype="text/javascript"src="resources/sap/ui/thirdparty/jqueryui/jquery-ui-position.js"></script>

     <script type="text/javascript" src="cordova.js"></script>

 

 

     Index.html file will look as below

 

13.JPG

    I have selected the Android Virtual device(AVD) and able to launch the SAPUI5 application.

 

14.JPG

 

15.jpg

 

Using the below option you can generate the .Apk file from Eclipse.


16.jpg


Thanks,

S.Rajkumar.



Viewing all articles
Browse latest Browse all 10881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>