3

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

Community
  • 1
  • 1
user13267
  • 6,871
  • 28
  • 80
  • 138
  • By seeing your configuration of PC I think it will take some time to load emulator. After emulator is load (load means not seeing android with animation but it will look like device) then and then run your code and also check in eclise-device that whether emulator is online or not. – baldguy Jul 10 '13 at 07:37
  • what does it mean by checking if emulator is online or not? Do I have to let the emulator load completely for this? – user13267 Jul 10 '13 at 07:41
  • I used several different version OS (Mac), several different version Android Studio, different Java version etc. I never see Android Hello World works in first time. Afte years, this still happens. Why is Android Studio so bad? I never understand – Adem Aug 14 '22 at 09:56

6 Answers6

3

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?

Community
  • 1
  • 1
Piotr Chojnacki
  • 6,837
  • 5
  • 34
  • 65
  • what about the JDK thing? When I didn't have JDK installed there were no errors or warnings of any kind. Would such error have appeared only after the emulator finished loading? – user13267 Jul 10 '13 at 07:44
  • @user13267 Sorry, but I can't see what error are you talking about. You just said in your question that you don't have any errors. – Piotr Chojnacki Jul 10 '13 at 07:56
  • What I meant was that when I tried this for the first time, I didn't have JDK but did not get any errors when I clicked the run button in eclipse. Is it because the emulator had not loaded properly? – user13267 Jul 10 '13 at 08:01
2

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.

Kon
  • 10,702
  • 6
  • 41
  • 58
  • would setting the ram to a very low value like 64 help? or is it better to keep larger values for RAM? – user13267 Jul 10 '13 at 07:43
  • Don't set it too low. I think set it to about 512 MB to start, but be patient with how long it takes. – Kon Jul 10 '13 at 07:52
  • 1
    ok thank you for your reply. What about "Later you can make it persist"? After it loads once, does it load faster everytime after that? Or do I have to keep the emulator turned on until the end of the day? And how does saving and loading snapshots work? Does it happen by itself or can I take a snapshot whenever I want, and load whichever I want? – user13267 Jul 10 '13 at 07:59
  • Yes it becomes a lot faster. In my case, about 10x faster, but I mostly develop on my physical device since it's at real speed and no hassle. As I understand it, snapshots occur by writing the real state of the emulator to a file, so that as you update your program it loads the state, then installs the program and runs, but somebody with more experience may correct me. – Kon Jul 10 '13 at 08:03
1

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.

1

By seeing your configuration of PC I think it will take some time to load emulator. After emulator is load (see below image)

enter image description here

then and then run your code and also check in eclise-device that whether emulator is online or not.

For checking emulator in eclispe :

enter image description here

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.

baldguy
  • 2,090
  • 1
  • 16
  • 25
  • I'm sorry but how do I get to this tab in eclipse? – user13267 Jul 10 '13 at 08:19
  • Thank you very much, but that button is mot present in my version of eclipse. Anyway, I have found out that this tab can be opened by going to Window > open perspective > DDMS – user13267 Jul 10 '13 at 09:17
  • oh that's good and how about project is it working or not? Can you see your emulator as first image or not? – baldguy Jul 10 '13 at 09:18
  • It is working now I just needed to wait longer for it to load, I am now moving onto the next chapter of building simple user interface; however, the emulator is very jerky, like when a video stops between frames – user13267 Jul 10 '13 at 09:24
  • oh good and that's because your PC configuration. For android you minimum need 2GB RAM i personally think 4 GB with dual core processor. – baldguy Jul 10 '13 at 09:29
1

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.

Nexus4 vs. Nexus6

mofitty
  • 111
  • 1
  • 3
  • 10
0

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.

Sheng
  • 133
  • 1
  • 6