android's hello world tutorial application is not working - java

I am new to java and android and wanted to see how developing for android works
I started by downloading the SDK FROM HERE
However after I finish making the Hello World project sample given in the website HERE, if I try to run it on the emulator as explained HERE, the emulator screen appears, but nothing seems to happen. I can see the word android on the middle of the screen with some animation happening, but that's it. The website says something about unlocking the emulator, but I have no idea what that means. What I have gathered from reading other posts is that the emulator is supposed to have some kind of slider switch as in real smart phones which should be dragged to unlock it, but I can't see it in my case. Now I have no idea why this is happening or what I should check out in order to fix this. Are there any installation logs or something else that I can check to see what the settings are?
What I have tried till now:
I downloaded the SDK ADT bundle from HERE and just unzipped it. Then looked for eclipse.exe and ran it directly. Is there anything else I should have done prior to this?
When I did it for the first time, I had only JRE installed and not JDK, which I realized after reading THIS POST. So I downloaded JDK from HERE, updated the required environment variables and restarted eclipse, but still it's the same thing.
I looked at the Eclipse isn't talking to the emulator section GIVEN HERE, but all it says is to restart eclipse and the emulator, and it doesn't do anything at all.
Rant:
I can understand if the program had failed to compile when I didn't have JDK , or if the IDE gave any indication at all of a faulty program install, but that isn't the case. Everything seems ok, there are no errors, but it just doesn't do anything. This is the type of thing that makes people pull their hair out, and personally, I think the With a single download, the ADT Bundle includes everything you need to begin developing apps: in the android website is very misleading, especially for complete beginners
Anyway, what should I do to make the tutorial program run on my computer? My computer is a bit old and slow so could that be an issue? My computer is Windows XP SP3 on Intel(R) Pentium(4) 4 CPU 3.20 GHz 3.19GHz 2.50GB RAM, but if that was the case I assume the emulator shouldn't even start up

You just have to wait a bit longer. Android loads pretty long on emulator.
Tutorial says about unlocking, because when Android is loaded, your screen on emulator will be locked.
If you find emulator too slow for you, you may want to check this topic out: Why is the Android emulator so slow? How can we speed up the Android emulator?

I had the exact same problem as you when I first got into Android development a week ago. The two things I did are simply
1) Set the usable RAM on your AVD to 768MB
2) When you run your Hello World program in your emulator, give it about 5-10 minutes. Don't touch or click the window at all, just let it load up. Later you can make it persist
3) If your home screen comes up, click and hold the mouse button in the center of the screen, then drag towards the sides and release, this should unlock the device.
Try these steps first, if they don't work then there is likely a problem with your AVD configuration.

If you are launching your app first time with emulator, it will take appropriate time.After that, on Lock icon click and slide to the right. then you can view you application. If not check for your app(icon) installed.

By seeing your configuration of PC I think it will take some time to load emulator. After emulator is load (see below image)
then and then run your code and also check in eclise-device that whether emulator is online or not.
For checking emulator in eclispe :
In second image just above windows logo you can see small rectangular button with plus sign click on that you will get list from which you can select devices. You can find similar button in you eclipse at the bottom.

I had the exact same problem and followed the exact same steps, but was also unsuccessful. I ended up creating a new AVD with a Nexus 4 instead of the latest Nexus 6. The resolution of the 4 is much lower, which I think is what solved my problem. It loaded much more quickly using the 4.
Also, When I was using the 6, I could only see "ndroi" because the size of the screen was much larger than the size of the phone. Now I can see the full device.
vs.

You may just need to relaunch the Android studio 3.6.3.
I got a similar problem. The hello world app does not install on the emulator.
Problem solved after relaunch.

Related

My Android Studio emulator is not working correctly

I downloaded the Pixel emulator and Android API 25, but when running it
appears for a few seconds and then disappears
In the Event Log, this is what appears
I need help pls
The same Problem got me a few months ago:
I fixed it by doing this:
Whenever you run the project or app you have to clear the data of that AVD
To wipe the data of Emulator follow these steps-
Go To AVD Manager then you will see all emulators there then simply wipe data. ie- like in this image shown.
step 1
step 2
step 3
I also had random emulator crashes, everything would work for a short while, but then the emulator would just disappear as if it had stopped. The emulator.exe would still be running task manager, no way to recover the window and the .lock file couldn't be removed.
Even just starting the emulator and swiping the home screen left and right (not even starting my app), or going into the the apps drawer and back would cause the the emulator to stop working properly.
What worked for me was to always start Android Studio as "Run as administrator". So right click on the startmenu shortcut and select Run as administrator.
Not sure why it randomly stops working otherwise, I'm sure the Android Studio QA team thoroughly tests this on real-world laptops outside of Google labs right...? /s

Android Virtual Device loading then not appearing

I have recently fixed the 'd:skin' problem in eclipse. I have recently started learning android programming. I want to test an application so i open up the AVD manager create an AVD and i click start it takes about 15 seconds for the bar to get from 0% to 100%. The Loading window closes and no Virtual Device comes up. No error message nothing. I am running a Mac with 4GB RAM.
You state:
The Loading window closes and no Virtual Device comes up.
It sometimes comes up after a long time. Eventually, it will probably come up. If it still doesn't, take these steps:
Restart ADB
Restart IDE
Restart Computer
Because you stated that the loading window does come up, it is probably going to show up. After it does, I'm going to assume it looks something like this:
So, if you're lucky, this thing will start in 5 - 10 minutes. If you're anything like I was, it will never start, and you'll give up and download GenyMotion instead. GenyMotion emulator will run in about 30 seconds. It is still laggy, but a lot better than the default android one.
Let me know if this helped! :)

Eclipse Will Not Recognize Galaxy S 2 When Debugging Even Though It Will Recognise My Touch

I am a java beginner. I am going through a book right now actually called Java in 24 Hours sixth edition by Rogers Cadenhead learning java and android programming. Anyways, to my problem. I am using eclipse to make a simple app and I want to transfer it to my galaxy s 2. I am ready to debug it and pick my device.... except its not there. I have installed Kies, the drivers, made sure its in USB debug mode but it will not recognize it. Any suggestions? This is not a duplicate! It is different because even though its in debugging mode, even though Ive reinstalled kies twice, even though Ive made sure the USB port or cord is not a problem it still does not work! But whats strange is my My Touch will work perfectly with the app. What am I missing here? HELP PLEASE.
You are most likely having a problem with the adb in your platform-tools folder. It is the android device bridge. Go to the android-sdk folder and then go to platform-tools and inside you will see adb. Press shift + right click anywhere in an empty spot of that folder and click on 'open a command line here.' Type: adb devices. It should show you a list of usable devices. If that doesn't show your galaxy (it will be a big number/letter sequence like: 3ANIWRN42408) or anything than try adb kill-server then adb start-server. And then see if adb devices shows your device.
If that is hard to follow, check this out: adb/usb tutorial

The emulator runs slow [duplicate]

This question already has answers here:
Making the Android emulator run faster
(19 answers)
Closed 7 years ago.
Recently I started to learn Android programming. I instaled Eclipse and Android SDK. All goes well, but every time when I run a project which has a error, the emulator and Eclipse begins to run very hard and I often have to close Eclips and the emulator.How can I solve this problem?
I answered this before, but it might help you too.
I prefere using the the Bluestacks Player. It runs Android 2.3.4 and is very fluent and fast. Sometimes even faster than a normal device. The only downsize is, that you can just test Apps on the API Level 10 and just on one screen size, but it's perfect just for testing if it's working or not. Just connect the Player with the adb by running
adb connect 127.0.0.1
After compiling it installs instantly. Very impressive, considering I have a rather average computer hardware(dual core with 4 GB of RAM)
Here are my suggestions:
Do a quick google search for "how to make the Android emulator run faster" (or something along those lines), because you are definitely not the first person to ask this question.
Buy a cheap, physical device to test with. It'll make your life a lot easier.
You don't have to close the emulator in order to iterate your development cycle. That should speed things up a lot for you. You can also enable emulator snapshots, so the emulator will start up quickly the next time. (It does slow down closing the emulator, however).
The other thing is, though, if your machine is underpowered or does not have sufficient RAM, it could be thrashing. Eclipse and the Android emulator do require a fair amount of memory. Ideally, you should have at least 500MB of free memory before starting Eclipse (1GB would be better).
In my experience, when you always install and re-install apps on the emulator to test, it gets clogged up and starts lagging.
Solution: Delete the AVD you have created from the Virtual Device Manager.
I hope this will help you.
Goto to your BIOS settings. Enable your Virtualization technology in your settings..
It solved my problem...

Logcat tab in Eclipse DDMS Persepctive (Android ADT plugin) Keeps Coming up Blank

I have seen this problem off and on while running the Eclipse (Galileo) under Fedora 11-13, whether the target is my device or an emulator. But now with my new device, the HTC T-Mobile G2 (Android 2.2), I see it much more frequently: I successfully download the app (complete with lots of Log.d() calls), the system successfully launches it, but the LogCat pane in the DDMS perspective is completely blank.
Sometimes, only sometimes, I seem to be able to kick it into action by clicking on the tool for Debug (the little bug one). But that doesn't even work all the time. Worse yet, it forces me to restart the whole program, which is very cumbersome.
And yes, I did remember to connect the device and make sure the device shows up under "adb devices", AND make sure that is the device the ADT downloaded to. I can even hit breakpoints in the code.
I suppose I could try relying only on the debugger, but I put a lot of work into writing those Log.d statements in the right place, it would be a giant leap backwards to do without them now. So any suggestions concerning what the problem might be, workarounds, or how to find relevant bugs logged against either ADT, SDK or the G2, would be welcome.
TIA
PS: Google searches such as "android ddms logcat" have not helped so far.
PS: I have also considered running ddms from the commandline, but the instructions on how to do this wtihout conflicting with the port already chosen by ADT for running DDMS are not clear enough to inspire confidence: so I always quit Eclipse before running the command line version of ddms. But then I lose the handy ability (provided by Eclipse) of navigating my source code while reading the log, so this too, is an inferior solution. Perhaps if someone can connect a few more of the dots in Google's instructions on this by explaining how to get the device and command-line DDMS to agree on a port while still running Eclipse, that would be a good solution.
Just to suggest the basics, when you click on the DDMS tab, is the device listed on the devices tab? (If devices isn't there, click Window->Show View->Devices) If it is listed, have you clicked on the device (on the name column). Sometimes if the device isn't clicked on it will not show the logcat.
If it is and you have selected the device - try clearing the log (the icon of a page with a red cross at the bottom right corener of it - located at the top right of the logcat panel) I find if I have had it running for a long time it sometimes fills up and stops displaying the log, although normally one line is shown.
It seems that ADT looses the connection with the device or is not re-connected when you reboot the device or emulator.
I've found that if you have more than one device or emulator you can click on the other one, click on the empty log window and the logs for this other device appear, then click the device that lost connection and will be re-connected.
Yes, sounds like black magic, but it's all we have...
It worked for me when I did following.
Remove the connection to the device (i.e. unplug the USB cable), then restart Eclipse. Next time it starts, you can see the LogCat is back on action writing logs.
Hope this helps.
I have experienced the same problem on and off.
Basically the logs were coming on console using "adb logcat" but not in the logcat view of eclipse. I've noticed that restarting the emulator , then restarting the eclipse and then relaunching the emulator from eclipse gets rid of this problem.

Categories