Using the emulator on Windows

edited February 2014 in Android Mode

Has anybody got the Android emulator working on Processing 2.1.1 on Windows? It's not working on my machine; there's no specific error message, it just times out.

I'm currently using the latest Android SDK, 22.3, and wondered if I needed to install an earlier version instead?

Tagged:

Answers

  • edited February 2014

    This recent post may prove helpful: http://forum.processing.org/two/discussion/2928/has-anybody-had-success-with-procesing-2-0-3-and-android-#Item_11

    There are 3 or 4 more recent posts pertaining to emulator issues in the Android category you might read as well.

    Cheers.

  • @SiriusCG: doesn't look like the same problem, but useful to see that you've got it working. I note you installed an old version of the Android SDK, I can try that one. I also gather from a previous discussion that you have to create an AVD with a particular name, can you tell me what name your AVD has?

  • edited February 2014

    @harryjohnson: You'll need the 2.3.3 (API 10) version of the SDK installed as Processing uses it for it's Android support. Newer versions won't work. You may have missed this line in my referenced post:

    "Then I opened the Android SDK Manager and added Android 2.3.3 to be compatible with Processing.

    My AVD profile is named Processing-0217 and was created automatically when I installed Processing 2.1.1 and initialized Android mode. I know another user who had to create his AVD manually for some reason.

    Cheers.

  • edited February 2014

    @SiriusCG: Unfortunately changing to the 20130917 version of the SDK hasn't helped. Yes, I had already figured out how to install the Android 2.3.3 platform. In my case there's no mystery about why the AVD wasn't automatically created - I don't know how to properly install Android mode on a machine with no direct internet connection, so I just copied the files.

    It's possible that when the Android mode installer creates the AVD it does something special which I need to reproduce. I'll see if I can dig into the code and find the magic formula (if any).

    I do have another hunch; could you do me a favour, and with the emulator running, go to the Android platform-tools directory and enter "adb devices"? I'd like to know what it displays on your system. (On my system, when Processing tries to launch the sample code in the emulator, it is making repeated calls to "adb devices" and doesn't seem to be doing much else. I suspect it may be waiting for something in particular to appear.)

  • edited February 2014

    @harryjohnston, Executing adb devices yields "emulator-5554"

    You mentioned "I don't know how to properly install Android mode on a machine with no direct internet connection, so I just copied the files."

    I would consider this suspect. Was this a machine to machine directory copy? You can download the SDK or the ADT bundle (which I heartily recommend) as .zip from here if you haven't already:

    http://developer.android.com/sdk/index.html

    under the "Download for other platforms" section and install it. The installer may make some changes in the Windows registry that a simple file copy will not.

    Cheers.

  • Hi I'm new to processing working with arduino but I have a problem with 2.03 or 2.1.1 can't emulate or upload to tablet will show error compiler 734. where exactly in win xp computer property advance enviormental settings would I have to make additions or any other location ;thanks for your help ur

  • There is absolutely nothing in environmental settings, so do I have to program them in or you made one suggestion for java and bin, thanks

  • edited February 2014

    Here is a copy from my previous post which outlines how I installed Java, Android and Processing. After the installation, it worked fine. I suggest that before you start using Android or Arduino, that you run the Java examples first to make sure the basic installation is working correctly.

    Here is my setup. I run Windows 7 Professional 64-bit.

    Installed Java (64 bit) in C:\Program Files\java
    Added C:\Program Files\java\jdk1.7.0_21\bin to my PATH
    Installed Android SDK in D:\Tools\adt-bundle-windows-x86_64-20130917
    Unzipped and placed Processing in D:\Tools\Processing-2.1.1
    

    I don't think the actual file locations for the Android SDK or Processing are crucial. However, I've had issues with Java in the past if it wasn't installed in it's default directory on C:\

    I installed Java first, then the Android SDK. I used the Android SDK that comes bundled with Eclipse (ADT bundle) and had installed the Android 4.2.2 revision and updated it. Then I opened the Android SDK Manager and added Android 2.3.3 (API 10) to be compatible with Processing.

    I then installed Processing 2.1.1 from it's .zip file, ran few sketches in Java mode to make sure that part was working correctly and then added Android mode. I run the sketches in Android under the emulator. It takes a short bit to start and occasionally, I have to run the first sketch twice. Once the emulator is up and running, I leave it up until my session is done.

  • @SiriusCG: OK, that's the same as adb shows me, so that's not the problem. Thanks. It isn't the installation of the Android SDK that I can't do in the normal way but the installation of Processing's Android mode component. I did look about the forums and help pages for a bit but couldn't find any supported way of downloading and installing a Processing mode other than using Processing's own download tool (which doesn't appear to support authenticated proxies).

    I guess I'll have to set up a test machine with direct internet access and see if it works for me there. If so, I should be able to figure out the problem by directly comparing the working setup with the broken one. I may or may not be able to fix it, but that way at least I'll know what it is.

    On the other hand, if you upgraded some of the other Android SDK components when you installed the Android 2.3.3 (API 10) component, you may have a specific mix of component versions that can no longer be reproduced. (This is why I hate web installers; you can't reliably reproduce the same setup this month as last month, so proper troubleshooting is impossible!)

  • It should be possible to get Android mode installed on your computer. There's nothing magic about the built-in installer, except that many of the files that it uses now appear to be missing as common downloads (modes in particular). For example, it is still possible to install libraries the old-fashioned (pre-2.0) way - such as ControlP5.

    Modes work the same way. Processing stores modes in the modes folder within your sketchbook. If you install Android mode on another computer, simply copying the AndroidMode folder from that computer's modes folder into the folder on your destination computer should be sufficient.

  • @calsign: yes, that's exactly what I did, except that in my case the sketchbook is located on a network drive rather than on the local disk. But it isn't clear to me why some people apparently get an AVD automatically created and some people have to create it by hand, and the install process is a natural place to look.

    ... on the other hand, even if I had installed Android mode in the usual way, the installer would have had no way to know where the Android SDK was located, so I don't see how it could have created an AVD anyway.

  • edited March 2014

    @SiriusCG: Looks like my foremost problem was user error.

    The tutorial says to push the Run button to test the sketch in the emulator, so that's what I was doing. Turns out the Run button tries to launch the sketch on a physical device; no physical device -> timeout. If you want to use the emulator, you have to explicitly select "Run in Emulator" from the Sketch menu.

    I did make one perhaps useful discovery en route: the code (in AVD.java) that creates the AVD doesn't specify the --abi option, so if the ADK has more than one ABI installed it won't work. That may be why some users have to create the AVD manually.

    (Turns out this has already been filed as a bug: https://github.com/processing/processing-android/issues/41)

  • Answer ✓

    The main "Run" button used to launch the sketch in the emulator, but this was changed to run on a device at some point in time, and for good reason - a physical device (if you have one) is much better for development than an emulator. Consequently, all of the older tutorials are inaccurate, now...

Sign In or Register to comment.