Android Tutorial Hello world - Installing Android Emulator

mikejsmith1985

Member
Licensed User
Longtime User
I was just thinking, I wonder if my PC could be the problem. I'm running Win7 Ultimate X86 on a virtual machine via parallels on my mac. this has caused some funny drive names and folder configs. I'm probably 6 months out from buying a new Windows based machine. Just a thought if I find any quirks to get it to run I'll post them up.
 

mikejsmith1985

Member
Licensed User
Longtime User
I have found that the Parallels virtual machine created a "psf" drive and when I add \\psf in front of the file paths I am able to run my emulator. I didn't really expect that to help but I guess that was the problem.

Thanks!
 

DST123

Member
I moved my Android folder to C, emulator didn't work. I also tried reinstalling sdk, didn't work. I went to download java from the link you provided and it said I had a newer version already installed. Could that be why it doesn't work? I looked at the last forum link you provided, but didn't know how to proceed. I run Windows 7, 32 bit.

Thank you very much for your time,
DST123
 
Last edited:

DST123

Member
I did some rearranging of files and now I get this error:

Failed to start emulator: Cannot run program "C:\Android\android-sdk-windows\tools\emulator.exe": CreateProcess error=2, The system cannot find the file specified

The emulator.exe is stored in my C drive, but the AVD folder automatically is stored in my Student Data folder on my desktop. When I try to move the AVD folder to C drive, i can't even create an emulator.

I'm wondering where I need to move the AVD folder so the manager can find the file?

Thanks!
Sawyer
 

DST123

Member
Yes, it's there. How can I change paths for my SDK, because that manager is taking the wrong path to find my AVD.

Thank you very much for your help!

DST123
 

DST123

Member
No, running it on my regular operating system. The path is:

C:\Android\android-sdk-windows

Thanks Again,
DST123
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I've asked before where the complete documentation is for B4a and was told that the tutorial web page is it; however, the tutorial web page only scratches the surface of a lot of things and I'm left not understanding how to do anything more advanced than what is in the tutorial.

For example, I have an Archos 70-250G (7" tablet, Android 2.2) with a screen res of 800x480. The A70-250G does not have an SD card but treats the 250GB hard drive as an SD, so I assumed that under "Size" on the AVD Manager, I should enter 250000 MiB. Given the way the AVD choked, I figure that must have been a mistake, but who knew?

Is there some reason to use "Default (HVGA)" resolution instead of the actual resolution? When I do put in the actual res of 800x480, it tells me that the resolution is 160, but in the designer, it says that it is 240 dpi.

For the "New" button under "Hardware"...
1. I don't know what to put for "cache partition size" or "cache partition support".
2. The tutorial doesn't mention having to specify "touch screen support", so is that not necessary?
3. How about "keyboard support"?
4. "Max VM application size"?
5. "Device RAM size"?

And this is just the start of the tutorial. I run into these kinds of questions all the way through. Is there really not a complete documentation anywhere? When we have to guess at everything, there are bound to be problems and it is very frustrating.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Thank you. Here's a few more questions:

It appears that it is not possible to edit an existing AVD, that instead a new AVD must be written with the modified specs and saved over the old one that I wish to change. Is this correct?

Do I understand correctly that a different layout variant must be created for every possible screen size? And in both horizontal and vertical orientations? I had assumed that Android just resized the layout for different screen sizes, or does it do a resize only if I don't create a specific layout variant for a particular screen size?

There is no need to add any more features than the ones described in this tutorial.

Why are the other features shown if they are not needed? (Serious question.)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It appears that it is not possible to edit an existing AVD, that instead a new AVD must be written with the modified specs and saved over the old one that I wish to change. Is this correct?
Yes.
Usually you will not need to create a variant for each layout.
There is a section about multiple layouts on this tutorial: http://www.b4x.com/forum/basic4andr...2-guess-my-number-visual-designer-events.html

You can also choose to lock your application to one orientation (Project - Oritenations supported).
Why are the other features shown if they are not needed? (Serious question.)
The emulator and AVD components are part of Android SDK. So there are some advanced features that you will usually not need to use.
You can see the official documentation here: Android Emulator | Android Developers
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User

Before reading the above link, I had created a layout using an AVD with 160 dpi. Per the tutorial, I changed the AVD's dpi to 240 which seems to have caused most of the layout I had created to be off the AVD's screen.

I figure that I'm now supposed to go back and create a new layout sized for the AVD at 240? The problem is that I don't know if that is really the right thing to do or if that is going to cause layout problems on an actual device.

I guess I need to figure out how to attach my tablet to my PC and use it instead of an AVD. I looked at some instructions somewhere for that, but they seemed pretty complicated. I don't suppose there's some easy way to do that?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should set the dpi value to match the value of the device you are trying to emulate. If this device is a high resolution device then you will usually need to set it to 240.

You can also run this code to check the values of your device:
B4X:
msgbox(GetDeviceLayoutValues,"")
I don't suppose there's some easy way to do that?
That depends on your device. For many devices all you need to do is enable USB debugging under the Applications settings menu and connect it. For some devices you will need to install a specific driver and some devices just don't support it.
 

wgodsoe

Member
Licensed User
Longtime User

I agree! A document would be a huge help, currently, there is an endless search for method, properties within examples all over the place. I realize this is not an easy feat, but a product as terrific and robust as B4A is requires a manual. Along the same lines what Android application development books would be suggested, to get the big picture. Thanks for your extraordinary work.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…