Android emulator output

I am using the helloword application to get started with Android application development. but i can't see the output in android emulator. only android will be displayed on the emulator screen. and I just type "Hello from Brijesh". but it will not be displayed in android emulator. I actually follow the instructions in the following link. http://developer.android.com/guide/tutorials/hello-world.html but not thrown away. can someone help me.

Thankx.

+3
source share
3 answers

If I understand correctly, do you want to display some debug messages? In standard java, you can use the System.out.println method, but with android, I suggest you use the Dalvik debugger.

Using:

Log.i("mytag","My simple message");

And display the result using the Dalvik debug monitor

Launch the Dalvik debug monitor with:

c:\android-sdk\tools\ddms.bat

Just change the folder name to where you installed the SDK.

Now the debugger application will start (next to the emulator) and your message will be displayed in green text.

+12
source

You can also view the System.out.println commands in the Dalvik debug monitor or in LogCat by creating a filter for the log tag containing "System.out".

+1
source

"Hello from Brijesh" XMl, .

        <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/hello_world"
        />

java,

        TextView tv = new TextView(this);
        //Set a text into view
        tv.setText("Hello World");
        //set the view into activity view container
        setContentView(tv);
0

Source: https://habr.com/ru/post/1712283/


All Articles