Simply talk about building phonegap environments under Eclipse to develop Android programs-linux86 (GO)

Source: Internet
Author: User

Originally in the garden when accidentally found a new concept "PHONEGAP" abbreviation PG, I have always liked to chase new things, naturally produced a curiosity. So I was on Baidu above Google a bit phonegap is what thing. The simple thing is to develop an Android app in a different way, using some web technologies such as Html,css,javascript. Things past a period of time, originally also forget this matter, behold inadvertently found a particularly good-looking site, and I want to run it on the phone, but also to other small pot friends to see, then used a half-day time to consult the information, the environment is set up neatly, the following is my environment to build the steps of the introduction.

The first step, of course, is to download phonegap related things, the URL is:

http://www.phonegap.com/install/ 

Here's a list of the tables I really opened up this site.

As of the end of my press release, the version has reached 2.9.1, I just started to download the 2.9.1, found that no need to find the jar, and then downloaded is 2.9.0, in the inside found what I need, well, I pretend you have downloaded this thing, such as.

Open the Lib directory and find the Android directory, which will look something like this.

The drawing line needs to be used, OK to start the following work.

The second step is to create a generic Android project, omitting some words here.

Step three, start the deployment environment. Copy the XML folder to the Res directory below.

Add the following code to the Androidmanifest file.

1<Supports-screens2android:anydensity="True"3android:largescreens="True"4android:normalscreens="True"5android:resizeable="True"6android:smallscreens="True"7android:xlargescreens="True"/> 8 9<Uses-permissionAndroid:name="Android.permission.CAMERA"/>10<Uses-permissionAndroid:name="Android.permission.VIBRATE"/>11<Uses-permissionAndroid:name="Android.permission.ACCESS_COARSE_LOCATION"/>12<Uses-permissionAndroid:name="Android.permission.ACCESS_FINE_LOCATION"/>13<Uses-permissionAndroid:name="Android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>14<Uses-permissionAndroid:name="Android.permission.INTERNET"/>15<Uses-permissionAndroid:name="Android.permission.RECEIVE_SMS"/>16<Uses-permissionAndroid:name="Android.permission.RECORD_AUDIO"/>17<Uses-permissionAndroid:name="Android.permission.RECORD_VIDEO"/>18<Uses-permissionAndroid:name="Android.permission.MODIFY_AUDIO_SETTINGS"/>19<Uses-permissionAndroid:name="Android.permission.READ_CONTACTS"/>20<Uses-permissionandroid:name= "Android.permission.WRITE_CONTACTS"/>21 <uses-permission android: Name= "Android.permission.WRITE_EXTERNAL_STORAGE"/>22 < uses-permission android:name= "Android.permission.ACCESS_NETWORK_STATE"/>23 < Uses-permission android:name= "Android.permission.GET_ACCOUNTS"/> <uses-permission android: Name= "Android.permission.BROADCAST_STICKY"/>       

Next, copy the Cordova.jar file to the Libs directory below.

Add the jar package to the project, right-click the jar, and then proceed to the following.

This step is also completed, the following integration of HTML and other files.

Under the assets directory to create a new www directory, and then I set up a index.html, but also the JS file copied over, but this project I did not use the JS file.

I wrote a few lines of code in HTML, very simple.

<<<H1>hello</</</html>    

Finally, change your Java file to OK, the code is like this.

 1Import Org.apache.cordova.DroidGap;23Import Android.os.Bundle;4 5 public  class mainactivity extends Span class= "title" >droidgap {6 7  @Override 8 public void onCreate (Bundle savedinstancestate) {9 // TODO auto-generated Method stub 10 super.oncreate (savedinstancestate); super.loadurl ( }13 14}          

Fourth step, run your program.

To this basic end, simple to build and write a small program, personally try, half a day can be done.

Simply talk about building phonegap environments under Eclipse to develop Android programs-linux86 (GO)

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.