1.下載phonegaphtml
2.將lib/android下xml拷進android工程的res,將cordova-2.9.0.jar拷進工程庫中,將cordova.js拷到assets/www中android
3.讓activity繼承自org.apache.cordova.DroidGap:
public class MyActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);web
// Set by <content src="index.html" /> in config.xml
super.loadUrl(Config.getStartUrl());
//super.loadUrl("file:///android_asset/www/index.html")
}
}apache
4.AndroidManifest.xml:
拷貝android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"到activity標籤內作爲activity標籤的一個屬性並增長你要的權限框架