我遵循基本Phonegap教程(Eclipse,Android SDK,ADT Phonegap)中的所有步骤,我在assets/www
文件夹中创建了index.html
页面(来自phonegap站点的代码)和cordova-2.2.0.js
, cordova-2.2.0.jar
,当我跑它,它表明这个消息康寿屏幕上:phonegap简单的例子不能在android模拟器中工作
[2013-09-05 12:44:14 - phonegape-test] ------------------------------
[2013-09-05 12:44:14 - phonegape-test] Android Launch!
[2013-09-05 12:44:14 - phonegape-test] adb is running normally.
[2013-09-05 12:44:14 - phonegape-test] No Launcher activity found!
[2013-09-05 12:44:14 - phonegape-test] The launch will only sync the application package on the device!
[2013-09-05 12:44:14 - phonegape-test] Performing sync
[2013-09-05 12:44:14 - phonegape-test] Automatic Target Mode: launching new emulator with compatible AVD 'STest'
[2013-09-05 12:44:14 - phonegape-test] Launching a new emulator with Virtual Device 'STest'
[2013-09-05 12:44:27 - phonegape-test] New emulator found: emulator-5554
[2013-09-05 12:44:27 - phonegape-test] Waiting for HOME ('android.process.acore') to be launched...
[2013-09-05 12:46:25 - phonegape-test] HOME is up on device 'emulator-5554'
[2013-09-05 12:46:25 - phonegape-test] Uploading phonegape-test.apk onto device 'emulator-5554'
[2013-09-05 12:46:26 - phonegape-test] Installing phonegape-test.apk...
[2013-09-05 12:47:35 - phonegape-test] Success!
[2013-09-05 12:47:35 - phonegape-test] \phonegape-test\bin\phonegape-test.apk installed on device
[2013-09-05 12:47:35 - phonegape-test] Done!
,但应用程序没有作用,我没有找到我的应用程序图标lancher!请你帮助我!
编辑: MainActivity.java:
package com.example.phonegape;
import android.os.Bundle;
import android.view.Menu;
import org.apache.cordova.*;
//import com.phonegap.DroidGap;
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.init();
super.loadUrl("file:///assets/www/index.html");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
你说的 “不工作” 是什么意思?有没有空白的屏幕或什么?应用程序中断?请明确说明。 – Math
没有空白屏幕,没有应用程序中断!模拟器已启动且没有任何事情发生 – Nomade
你能发布你的活动吗? (我想你只有一个吧?) – Math