A simple phone firmware example does not work in the Android emulator

I followed all the steps in the main Phonegap tutorial (Eclipse, Android SDK, ADT Phonegap), I created the index.html page (code from the phone mail site) and cordova-2.2.0.js in the assets/www and cordova-2.2.0.jar folder cordova-2.2.0.jar , when I ran it, it displayed this message on the console 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 is not working, and I did not find the lancher application icon! You can help me!

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; } } 
+4
source share
4 answers

I know that your index.html is placed in the assets folder, but try changing the line super.loadUrl to:

 super.loadUrl("file:///android_asset/www/index.html"); 

According to this guide PhoneGap Documentation - Getting Started with Android

+1
source

you need to continue trying until your console says β€œinstallation”, you can work, it starts one emulator, and then, if nothing happens, leave it and start another start with a second emulator, sometimes it does the trick. The adt emulator sucks in general, though, get a cheap Android phone, my advice.

0
source

Sometimes the application icon does not appear in the emulator. You can try one of the following options:

  • With the emulator open, try running the application again in the same emulator.

  • Clear all projects and try to erase all data in emulators (the option should be in the AVD manager), and then create the only project that you need to test. The application icon should be there DEFINITELY in the emulator.

  • You do not have enough emulator configurations. You do not have high level emulator configurations. A mine reads as 500 MB of RAM and 64 heaps of VMs. The internal storage should be 200. Run it on the Intel processor for the latest versions of Android, not ARM processors. You will get a Hex error in the console if you did not enable virtualization in Bios. But don't worry about it. You can check out the previously answered reg questions if you still feel that you need to know.

Let me know if that works. I ran into problems, and one of the above solutions definitely resolves this!

Thanks!

0
source
  • Are you looking at the right AVD -?

  • You can check if there are any problems with the project. Check the Problem View

    Window β†’ Show view β†’ Problems or window β†’ Show view β†’ Other-> Problems

  • Try to fix Android properties: Right-click on the project β†’ Android Tools β†’ Fix Project Properties

 By cleaning project it means select
 Steps:
     1. Select the menu Project-> Clean
     2. Build Project: Project -> Build
0
source

Source: https://habr.com/ru/post/1500714/


All Articles