Android with PhoneGap in Eclipse
You need the Android SDK installed on your computer to build an Android version of your application using the steps below.
To build the project in the workshop/platforms/android folder and run it on an Android device connected to your computer using a USB cable, type:
cordova run android
To build the project in the workshop/platforms/android folder and run it in the Android emulator, type:
cordova emulate android
Setting Up the Workshop Files
- Download the assets for the workshop here or clone this repository
- Unzip the file anywhere on your file system.
- Delete the contents of your project’s workshop/www folder with the exception of the config.xml file.
- Copy the contents of cordova-tutorial-master/www into your project’s workshop/www folder.
- Build and test your application: If you have a Mobile SDK installed on your system, repeat the steps in Part 2 above. If you don’t, simply open index.html in a browser on your computer.
- Type a few characters in the search box to search employees by name. Clicking an employee link doesn't produce any result at this time.
The following <uses-permission> XML nodes and paste them as children of the root <manifest> node in the AndroidManifest.xml file:<uses-permission android:name="android.permission.CAMERA" /> <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.INTERNET" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.RECORD_VIDEO"/> <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" /> The <uses-permission>XML values identify the features that you want to be enabled for your application. The lines above enable all permissions required for all features of PhoneGap to function. After you have built your application, you may want to remove any permissions that you are not actually using; this will remove security warnings during application installation. To read more about Android permissions and the <uses-permission> element, visit the Android developer topic on the uses-permission element.. After you have configured application permissions, you need to modify the existing <activity> node.Locate the <activity> node, which is a child of the <application> XML node. Add the following attribute to the <activity> node:android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">Thank you....
No comments:
Post a Comment