Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Thursday, July 4, 2013

Android App Development Notes


  1. Error: "string_id" is not translated in es... (languages)

    Eclipse > Window > Preferences > Android > Lint Error Checking > Change the Severity for "MissingTranslation" to Warning

  2. Error: Attribute is missing the Android namespace prefix

    Add prefix "android:" to the element that complains, like "android:color="#A00080FF"

  3. Class requires API level 11 (current min is 8): android.view.ActionMode.Callback

    One solution is to change android:minSdkVersion from "8" to "11" in Manifest.xml.


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

Wednesday, June 19, 2013

Install Third Party Apps on Android

For 3rd-party apps that are not in Google Play, one can install them by manually downloading the .apk files to SD card and then installing with package installer.

Just a simple note here. By default, 3rd-party apps are not allowed on Android and users have to change the settings. I am using a Android 4.1.1 (Jelly Bean) and here is the setting change.

1. Go to Main Menu
2. Select "Settings"
3. In "Personal" section, select "Security"
4. In "Device administration" section, check "Unknown sources"