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");
}
精彩评论