Popular Posts

Apr 9, 2012

Print Messages to a Log File(Android)

To write log messages from your application:
  1. Import android.util.Log.
  2. Use Log.v(), Log.d(), Log.i(), Log.w(), or Log.e() to log messages.
    E.g., Log.e(this.toString(), "error: " + err.toString())
  3. Launch DDMS from a terminal by executing ddms in your Android SDK /tools path.
  4. Run your application in the Android emulator.
  5. From the DDMS application, select the emulator (e.g., "emulator-5554") and click Device > Run logcat... to view all the log data.
MORE http://developer.android.com/resources/faq/commontasks.html#newandroidprojectnoeclipse

No comments:

Post a Comment