Android_programmer_camera
Android_programmer_camera

Reputation: 13349

How to Enable Logging in Android programatically

I am working on an Android Application where I need to display log information when I execute the .apk file in release mode based on some condition. It can be like below:

if(debug)
   display log inf.
else
  normal execution

I will set this variable to true to enable debug mode to display log information. Can anyone help me in achieving this feature.

Thanks In Advance.

Upvotes: 1

Views: 1675

Answers (1)

dotcs
dotcs

Reputation: 2296

Why don't you use the Log-function of Android via

Log.v(YourClass.class.simpleName(), "this is your verbose log text");

If you connect your phone to your computer and install the apk-file on your mobile phone (via Eclipse) you can use the phone like the emulator and watch the log entries in the DDMS.

See also: http://developer.android.com/guide/developing/tools/ddms.html, http://developer.android.com/reference/android/util/Log.html

Upvotes: 3

Related Questions