Tuesday, December 14, 2010

Saturday, December 11, 2010

Android: Android ADT Problem

There are many warning instances you might encounter while starting up with Android. Error: minSdkVersion (7) is lower than the project target API level (9).

Change this setting in AndroidManifest.xml

<uses-sdk android:minSdkVersion="7" />
<uses-sdk android:minSdkVersion="8" />

Android: R cannot be resolved

If you have these error this article should show you how to resolve it. But first I need to explain why you have this error. The auto generated R class is invoked in the main class. You might be tempted to resolve it by importing. Well, that won't work either. If you notice the package is the same as that of the main. Oddly enough, you just need to restart eclipse and load your project. Viola!

public class Main extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        TextView t = new TextView(this);
        t.setText("Hello, textview!");        

Android IDE Setup Issues

If you have problem creating an Android project after installing Eclipse, Java, SDK, and everything in your system, chances are you failed to setup the SDK location. To set your ecplise up, follow this simple instruction:

Windows -> Preference -> SDK Location: {android_sdk_path} -> Apply.

Android Development for Non-Java Developers

Prepare the IDE
Eclipse is the defacto ide for android development. The android sdk is tightly coupled in this platform. This guide will help you get started, click here.

Learn Basic JAVA
You can skip this part now if you already got some basic Java. Since you're still reading this you need to learn java also using eclipse, click here.