INTERNET APPLICATION DEVELOPMENT
MID MARKET ERP DEVELOPMENT
by Jacky Xu
In a previous blog post, I talked about how to get the environment set up to create mobile apps with PhoneGap and jQuery. Once you have the environment set up, it’s time to get started:
1. Create new project like below.
Select Android Application Project and click next.
Input Application name, project name and package name. Otherwise, you can keep the default value (or you also can change them). Click next twice, select Blank Activity and click next. Finally click finish.
2. Configure the project to use PhoneGap Create a new folder “www” under the folder “assets” (note: the file and folder name are case sensitive). You can copy your html and javascript file to the folder.
Copy some files to the project folder.
Find the file “cordova-2.9.0.jar” from PhoneGap folder and copy it.
Paste to project libs folder. (Create the folder “android” and paste the file.)
Copy cordova.js to the www folder.
Copy the xml folder to the project res folder.
Now refresh your project. You can see the changes.
3. Next create a new file named index.html.
4. Add PhoneGap lib to the build path.
5. Update activity class like this.
6. Configure the project metadata (open the file AndroidManifest.xml with text editor).
Add some configuration values to the file.
Locate <activity> node and add following attribute to the node:
android:configChanges="orientation|keyboardHidden"
Create a new <activity> node with following.
7. Now you can run the App through a mobile simulator.