android output,Android emulator Output

问题

I am running on helloword application as getting started with android application developement. but i cant able to see output in android emulator. it will show only android in the emulator screen. and i am just print "Hello from Brijesh". but it will not display in the emulator of the android. actually i follow the instruction in the following link.

http://developer.android.com/guide/tutorials/hello-world.html

but not getting out put.

can any one help me out.

thankx.

回答1:

If i understand correctly, you would like to output some debugging messages to the screen ?

In standard java you can use the System.out.println method, but with android i suggest you use the Dalvik debugger.

Use:

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

And se the output by using the Dalvik Debug Monitor

Start the Dalvik Debug Monitor with:

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

Just change the foldername to where you have installed the SDK.

Now the debugger application will start (next to the emulator), and your message will be shown with green text.

回答2:

You can also view System.out.println commands in the Dalvik Debug Monitor or in LogCat by creating a filter for a Log Tag containing "System.out".

回答3:

If you want to print "Hello from Brijesh" through XMl then use this code.

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_centerHorizontal="true"

android:layout_centerVertical="true"

android:text="@string/hello_world"

/>

And if you want to print that using java then,

TextView tv = new TextView(this);

//Set a text into view

tv.setText("Hello World");

//set the view into activity view container

setContentView(tv);

来源:https://stackoverflow.com/questions/1108820/android-emulator-output

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值