HTML5 Mobile Development Road (--PHONEGAP) build Android development environment __html

Source: Internet
Author: User

Detailed steps can be http://blog.csdn.net/jdfkldjlkjdl/article/details/9883995 to my blog.

First, download PhoneGap

Download Address: http://phonegap.com/install/I am downloading the latest PhoneGap 2.9.1

Will download the good PhoneGap decompression, can see inside has a example

Second, build the environment

1. Refer to this example we created our project and create a new WWW directory under the assets directory, creating an XML catalog in the Res directory (directly copy the directory in example)

2, add the Cordova-2.9.0.jar in the Libs directory


3, modify mainactivity as follows

package com.example.hellomobile;      import android.os.bundle;  // import android.app.activity;   import android.view.menu;   import  org.apache.cordova.*;      Public class mainactivity extends droidgap  {           @Override        public  void oncreate (bundle savedinstancestate)  {            super.oncreate (savedinstancestate);            //setcontentview (r.layout.activity_main);            Super.setintegerproperty ("SplashScreen",  r.drawable.splash);            super.loadurl ("file:///android_asset/www/index.html",  2000);        }  } &nbsp 4, add the permissions in the Androidmainfest.xml

<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&Nbsp;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 " </

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.