Reputation: 1748
I followed all the steps in the basic Phonegap tutorial (Eclipse, Android SDK, ADT Phonegap), I created an index.html
page (code from phonegap site) and cordova-2.2.0.js
in the assets/www
folder and cordova-2.2.0.jar
, when i ran it it showed this message on the consol screen :
[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!
but the application dose not work and i did not found my application lancher icon ! can u help me please !
EDIT : 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;
}
}
Upvotes: 4
Views: 4100
Reputation: 3386
I know your index.html
is placed in the assets
folder, but try to change the super.loadUrl line to:
super.loadUrl("file:///android_asset/www/index.html");
As per this tutorial PhoneGap Documentation - Getting Started with Android
Upvotes: 1
Reputation: 417
Sometimes the app icon doesn't show up in the Emulator. You can try one of the options below:
Have the Emulator open, try launching the application again in the same emulator.
Clean all the projects, and try to wipe all the data in the emulators (option should be there in AVD manager) and then Build the only project which you will require to test. The application icon should be there DEFINITELY in the emulator.
Have Emulator configurations low. Don't have high end Emulator Configurations. Mine read as 500 MB RAM and 64 VM Heap. Internal Storage should be 200. Run it on Intel Processor for recent Android versions rather than ARM processors. You will get Hex error in Console, if you haven't enabled Virtualization in Bios. But, don't bother about that. You can check previously answered questions reg this, if you still feel you need to know.
Let me know, if this works. I had faced issues and one among the above solutions definitely resolves it!
Thanks!
Upvotes: 0
Reputation: 5002
Are you looking at the correct AVD - ?
Can you check if there is any problems with the project. Check the "Problems" view
Window -> Show View -> Problems or Window -> Show View -> Others-> Problems
Try to fix the android properties : Right click project -> Android tools -> Fix project properties
By cleaning project it means select Steps: 1. Select the menu Project->Clean 2. Build Project: Project -> Build
Upvotes: 0
Reputation: 359
you have to keep trying until your console says "installing", one might work is that run one emulator and then if nothing happens, leave that on and start another run with a second emulator, sometimes that does the trick. adt emulator sucks in general though, get a cheap android phone my advice.
Upvotes: 0