Part 5/6 – Native packaging using Sencha Cmd – Packaging for Android Emulator


This article is about creating a package for Android and running it on an Android emulator.

Getting ready

Setup ADT (Android Development Toolkit) Eclipse with an AVD (Android Virtual Device). We will be using the setup to package and run the application inside the Android emulator.
Note down the path of Android SDK as we would need this in our configuration.

How to do it…

Follow the below mentioned steps:
1. Create androidsim.json file and save the following content inside it:

{
 "applicationName":"TouchApp",
 "applicationId":"com.sencha.touch.app",
 "versionString":"1.0",
 "versionCode":"1",
 "icon": {
 "36":"resources/icons/Icon_Android36.png",
 "48":"resources/icons/Icon_Android48.png",
 "57":"resources/icons/Icon.png"
 },
 "inputPath":"./",
 "outputPath":"../build/",
 "configuration":"Debug",
 "platform":"AndroidSimulator",
 "notificationConfiguration":"debug",
 "sdkPath":"/Users/ajitkumar/Softwares/adt-bundle-mac-x86_64/sdk", //mention the SDK path on your system
 "androidAPILevel":"16",
 "permissions":[ 
 "INTERNET",
 "ACCESS_NETWORK_STATE",
 "CAMERA",
 "VIBRATE",
 "ACCESS_FINE_LOCATION",
 "ACCESS_COARSE_LOCATION",
 "CALL_PHONE",
 "RECORD_AUDIO",
 "RECORD_VIDEO",
 "READ_CONTACTS",
 "WRITE_CONTACTS",
 "ACCESS_NETWORK_STATE"
 ],
 "orientations": [
 "portrait",
 "landscapeLeft",

 "landscapeRight",
 "portraitUpsideDown"
 ]
}

2. Run the Android emulator
3. Run the following command inside <your project folder>/native/TouchApp folder:
sencha app package run androidsim.json
The package for Android emulator is created, installed and the application is launched inside the emulator. You shall see the following screen when the application is run:

9185OS_11_05

References

Co-founder of Walking Tree, Speaker, Sencha Trainer, Author of Sencha Charts Essentials, Sencha Touch Cookbook, Sencha MVC Architecture, and ADempiere Cookbook.

Tagged with: , , , ,
Posted in Sencha Touch

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

We Have Moved Our Blog!

We have moved our blog to our company site. Check out https://walkingtree.tech/index.php/blog for all latest blogs.

Sencha Select Partner Sencha Training Partner
Xamarin Authorized Partner
Do More. With Sencha.

Recent Publication
%d bloggers like this: