Monday, July 1, 2013

Android Development Environment Setup with Eclipse

Very good tutorial to set up Android development environment on Linux:
http://www.wikihow.com/Install-Android-on-Ubuntu-Linux-With-Eclipse-Ide

For Windows, one of my friends wrote a nice blog, too.
http://blog.csdn.net/lihancheng/article/details/5783310

When I was trying to set up the development environment, I tried both Linux (Ubuntu 12.0.4, 32 bit) and Windows (Windows 7, 64 bit). Here are some problems I encountered:

  1. Change language encoding to GB2312 to enable Chineses characters

    Open project in Eclipse → Right click the project → Properties → Resource → Text file encoding → Other (Select or input GB2312, it's a combo box)

  2. Unable to resolve target 'android-8'

    This was because I didn't install the required level of Android API. I installed Android 4.2.2 (API 17) instead of Android 2.2 (API 8), but the project I was testing on required API 8. After I installed this version, the error disappeared.

    Windows menu in Eclipse → Android SDK Manager → Check Android 2.2 (API 8) in package list → Install packages

    On Ubuntu, I didn't see that version in the package list initially. I "remember" I did following to fix this:

    Open Android SDK Manager → Go to tab Tools → Click Options → Check "Force https://... sources to be fetched using http://" (The hint for this check item is: if you are not able to connect to the official Android repository using HTTPS, enable this setting to force accessing it via HTTP.)

  3. Virtual device is too large on the display

    Here is one reference to fix this: http://android.yaohuiji.com/archives/151

    More specifically,
    Run menu in Eclipse → Run Configurations → Select the project in Android Application fold → Target tab → Scroll down to "Additional Emulator Command Line Options" → Input "-scale 0.8" (or any other number you want to scale down)

  4. Chinese characters display on app

    After I successfully started up the emulator and launched the app, there are some unrecognizable encoding. This should be because of the Chinese language use in this app. After I enabled the Chinese language on the emulator and installed a Chinese input app to input Chinese, this error went away and the app can start up as expected.

  5. Special problem on Ubuntu (not resolved)
    Waiting for HOME ('android.process.acore') to be launched...
    [*** Emulator] Failed to load libGL.so
    Emulator-5554 disconnected! Cancelling 'xxx.yyy activity launch'!

    I searched online and tried almost all suggestions available but failed to resolve the issue. Not sure if this is related to my old computer or dual systems installed on the old machine. I turned over to a relatively newer Windows machine and was able to start the emulator correctly.

  6. Data files missing on SD card of the emulator

    Go to DDMS perspective → Open or activate Devices view → Select the emulator you want to add files to → Click File Explorer tab on the right → Locate the directory "/mnt/sdcard" → Click the right arrow on the upper right corner (to push files to the emulator) → Locate the file/directory you want to copy to SD card → Click Open and submit

3 comments:

  1. Please check it:Most easy way to set up android environment for windows

    http://computerexclusive.blogspot.com/2013/11/android-development-environment-setup_17.html

    ReplyDelete