Finally got Android Emulator working

edited October 2013 in Android Mode

After about 5 hours of bouncing around through the forums and trying different things I finally got Android Mode to communicate with the emulator. I hope sharing can help someone out and save them some hassle.

I was following the tutorial at processing.org/tutorials/android/

On a mac in 10.8.5, I set up the Android SDK with homebrew,

brew install android-sdk

but many of the SDK's files would not download unless I launched 'android' using sudo. This is because homebrew set up a bunch of the folders as shortcuts to /var/lib/android-sdk. After installing the SDK this way I had to run processing with sudo in order for it to make the connection. I considered this to be bad for security. So, I moved all the folders into a links folder and recreated them locally at /usr/local/Cellar/android-sdk/22.2.../sdk. I did this right after installing the SDK (for the 4th or 5th time). Also, some helpful commands are

brew remove android-sdk

and

brew cleanup

Processing does not like the intel x86 atom system image installed in the Android 2.3.3 (API 10) section. But there is not problem with having the Atom and the Arm system image installed in API 18.

Make sure you have the emulator running all the way, and make sure it can connect to the web. Do this before you ask processing to Run the sketch in the emulator. Having an emulator running the API 18 or API 10 worked fine, just as long as it is already running before you try to send your sketch to it.

The mac preferences.txt file needed a line android.emulator.port=5554. where 5554 is the port number on the top of the emulator window.

In windows 8.1 it was a bit easier, I just had to make sure the path to the tools and platform-tools are in the PATH environmental variable by exporting it under CMD. I dont have that command, as I am just looking at windows for developing stuff now, I am kinda new to it.

And the emulator now works on both osx and win8 with processing! Yay! Now to figure out this animation thread error with g4p.

Also, a question.... It appears sending your sketch to an emulator basiclly installs the sketch as an app on the emulator. Does this work the same way on a device? if so, that is really easy to install an app to a device. Much easier then working with ios.

Comments

  • edited October 2013

    Thanks a lot ..! .. :) :) :) .. I really don't get what is wrong with this new forum. Nobody seems to reply an answer for contributed library and hardware sections. Why the hell they made these sections if nobody replies here ..

    But anyway keep your good work up and update ! Thanks again for sharing :)

Sign In or Register to comment.