开发者

How to send -Dflag to android app

Is there a way to send 开发者_Go百科-D directives to an android app? On desktop java I would just do java -Dsomeflag=value.

How would you do this on android? I am building with eclipse.


I assume you want to do this because you want to have conditional if blocks for debugging. You can set android:debuggable="true" in your manifest:

<application android:icon="@drawable/icon" 
    android:name=".SomeApp"
    android:label="@string/app_name" android:debuggable="true">

and then test for it like this:

if(Log.isLoggable(TAG, Log.DEBUG)) {
    Log.d(TAG, "some log statement");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜