Chinaunix首页 | 论坛 | 博客
  • 博客访问: 208412
  • 博文数量: 102
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1015
  • 用 户 组: 普通用户
  • 注册时间: 2013-06-05 16:45
文章存档

2014年(73)

2013年(29)

我的朋友

分类: Android平台

2013-12-18 09:08:38

01_17_调试程序
1、DDMS使用
2、常见程序的调试方法

1、DDMS使用
    1、使用LogCat 添加类似System.out。又如Log.d("MyDebug","myfirstdebug");添加  MyDebug   (Window->Show View->Other->LogCat
    2、DMBS->Devieces (倒三角->Reset adb)

2、常见程序的调试方法

1、
51     DatabaseHelper dbHelper =null;
52    //DatabaseHelper dbHelper = new DatabaseHelper(SQLiteActivity.this,"test_lwb_db");
53    SQLiteDatabase db =dbHelper.getReadableDatabase();

12-18 00:51:18.273: W/dalvikvm(7591): threadid=1: thread exiting with uncaught exception (group=0x40015560)
12-18 00:51:18.281: E/AndroidRuntime(7591): FATAL EXCEPTION: main
12-18 00:51:18.281: E/AndroidRuntime(7591): java.lang.NullPointerException
12-18 00:51:18.281: E/AndroidRuntime(7591): at com.lwb.mysqlite.SQLiteActivity$CreateListener.onClick(SQLiteActivity.java:53)
12-18 00:51:18.281: E/AndroidRuntime(7591): at android.view.View.performClick(View.java:2485)
12-18 00:51:18.281: E/AndroidRuntime(7591): at android.view.View$PerformClick.run(View.java:9080)
12-18 00:51:18.281: E/AndroidRuntime(7591): at android.os.Handler.handleCallback(Handler.java:587)
12-18 00:51:18.281: E/AndroidRuntime(7591): at android.os.Handler.dispatchMessage(Handler.java:92)
12-18 00:51:18.281: E/AndroidRuntime(7591): at android.os.Looper.loop(Looper.java:123)
12-18 00:51:18.281: E/AndroidRuntime(7591): at android.app.ActivityThread.main(ActivityThread.java:3683)
12-18 00:51:18.281: E/AndroidRuntime(7591): at java.lang.reflect.Method.invokeNative(Native Method)
12-18 00:51:18.281: E/AndroidRuntime(7591): at java.lang.reflect.Method.invoke(Method.java:507)
12-18 00:51:18.281: E/AndroidRuntime(7591): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-18 00:51:18.281: E/AndroidRuntime(7591): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-18 00:51:18.281: E/AndroidRuntime(7591): at dalvik.system.NativeStart.main(Native Method)

2、
Log.d("MyDebug","myfirstdebug");
阅读(889) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~