tags:

views:

188

answers:

5

What is the best way to learn Android? I'm reading Rogers's at al.'s book Android Application Development. However, as I tried the following code, nothing outputs except a mobile phone:

package org.qwerty.com;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloWorld extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TextView tv = new TextView(this);
        tv.setText("Hello, Android");
        setContentView(tv);
    }
}

I tried also search for the Dalvik Debug Monitor http://stackoverflow.com/questions/1108820/android-emulator-output but I couldn't find the option where I can open my hello android project.

A: 

You may find this article useful. I just read it and it made sense.

grigy
A: 

You may be interested in the following articles on MobiForge:

Getting Started with Android Development

Understanding User Interface in Android - Part 1: Layouts

Understanding User Interface in Android - Part 2: Views

Matt Lacey
I would also suggest reading the development guides on http://android.com
cjstehno
I just read that article Getting Started with Android Development. I can compile my code and run it but I don't see any window like Figure 4 nor anything which displays "Hello Android".
Jaska
+2  A: 

I learned Android with the Google tutorials located here.

Scroll down on the left side and look for "Tutorials and Sample Code"

Will
A: 
fiXedd
I have waited half an hour but still I can't see my application anywhere.
Jaska
Well what DO you see?
fiXedd
It was just an emulator window. I had some problems with Built Target but now the code works well.
Jaska
A: 

The "Professional Android Development" from Wrox by Reto Meier is in my opinion the best book to start learning Android from. Besides the Google documentation

Riussi