ddms

DDMS中的log

自古美人都是妖i 提交于 2020-03-03 09:12:34
DDMS中的log也无法定位到准确的出错位置。检查错误可以从下面几点入手: 1、检查Thread,确定没有在Background thread中直接调用adapter,如果有,请移除相关代码到Handler中处理; 2、尽量将数据放在adapter类中管理,不需要的时候清除信息(勤写clear()),及时用notifyDataSetChanged()刷新; 3、在Activity或者Fragment合适的位置(onPause/onStop)要及时检查thread,有adapter数据处理相关的应马上停止; 4、这个错误经常出现在Activity休眠起来之后,主要还是使用adapter不太小心造成的。如果实在找不到原因,在onPause()函数中停止所有的background thread,并且在onResume()函数最前面清空adapter中的数据,并且adapter.notifyDataSetChanged()。然后重新更新加载数据,这样一般可以解决问题。 来源: https://www.cnblogs.com/sode/archive/2013/03/11/2953427.html

Traceview

匆匆过客 提交于 2020-02-06 14:12:01
转: http://www.cnblogs.com/devinzhang/archive/2011/12/18/2291592.html Traceview是android平台配备的一个很好的性能分析工具。它可以通过图形化的方式让我们了解我们要跟踪的程序的性能,并且能具体到method。 进行Traceview的版本限制 对于 Android 1.5 及以下的版本: 不支持 。 对于 Android 1.5 以上 2.1 下(含2.1)的版本: 受限支持 。trace文件只能生成到 SD卡 ,且必须在程序中加入代码。 对于 Android 2.2 上(含2.2)的版本:全支持。可以 不用SD卡 ,不用在程序中加代码,直接自己用DDMS就可以进程Traceview。 一、Android 1.5以上2.1下(含2.1)的版本中Traceview的使用 首先,必须在程序当中加入代码,以便生成trace文件,有了这个trace文件我们才可以将其转化为图形。 1.1、 启动追踪 使用Debug的以下静态方法方法来启动: static void startMethodTracing (String traceName) Start method tracing, specifying the trace log file name. 使用指定trace文件的名字和默认最大容量(8M

Android Eclipse DDMS - Can't pull file from rooted device

半腔热情 提交于 2020-01-20 04:14:25
问题 I am testing my app on a rooted Nexus S phone. I finally have access to the /data/data folder thanks to some awesome help from this answer. Problem is when I try to use DDMS to "pull a file from the device" I get this error: [2012-03-20 18:15:26] Failed to pull selection [2012-03-20 18:15:26] (null) Anyone know how to pull a copy of the database so I can look at it in a SQLite editor? 回答1: I found out that to pull the actual database file (my_database.db) you have to use chmod on that

Why is my constructor not getting called?

北战南征 提交于 2020-01-16 20:19:23
问题 I'm trying to add some records to a SQLite table, but LogCat is telling me the table does not exist. And DDMS shows that, yes, that table is not being/has not been created. Yet I do create the table in the SQLiteOpenHelper class: public class SQLiteHandlerDeliveryItem extends SQLiteOpenHelper { . . . @Override public void onCreate(SQLiteDatabase sqLiteDatabase) { String CREATE_DELIVERYITEMS_TABLE = "CREATE TABLE " + TABLE_DELIVERYITEMS + "(" + COLUMN_ID + " INTEGER PRIMARY KEY," + COLUMN

Why is my constructor not getting called?

旧巷老猫 提交于 2020-01-16 20:19:23
问题 I'm trying to add some records to a SQLite table, but LogCat is telling me the table does not exist. And DDMS shows that, yes, that table is not being/has not been created. Yet I do create the table in the SQLiteOpenHelper class: public class SQLiteHandlerDeliveryItem extends SQLiteOpenHelper { . . . @Override public void onCreate(SQLiteDatabase sqLiteDatabase) { String CREATE_DELIVERYITEMS_TABLE = "CREATE TABLE " + TABLE_DELIVERYITEMS + "(" + COLUMN_ID + " INTEGER PRIMARY KEY," + COLUMN

How can I visualize Android call stack using Eclipse?

寵の児 提交于 2020-01-15 03:46:08
问题 Is there anyway I could visualize the call stack of an Android app? All I can find in Eclipse are the running threads: What I want, is to see how my subroutines are called in order to debug an issue related to the activities back stack. Thanks! 回答1: Add break points in your code somewhere and run in debug mode, you may see call stack then. AFAIK, While run mode it just displays number of threads and process. It doesn't display sequence of calls. 回答2: You can see the instantaneous call stack

Show frame rate in DDMS

早过忘川 提交于 2020-01-13 03:38:11
问题 As I wanted to compare several apps according to their graphics performance, I wanted to measure the frame rate for each app. In DDMS I discovered a tab "System Information" where I can choose "CPU load", "Memory usage" or "Frame render time". When I select the first two options a graph gets displayed on the right. But for "Frame render time" somehow I get no data displayed (of course I already tried to click the button "Update from Device" but that didn't change anything). I found no

Problem Pushing Large File to Emulator/SDcard with Eclipse DDMS

爷,独闯天下 提交于 2020-01-12 18:51:39
问题 I am using Eclipse DDMS to push a file over onto my Android Emulator sdcard. I select the file and press Open, a dialog pops up and starts pushing the file. In the view "File Explorer" in the DDMS perspective I can see the sdcard directory and can see my file created in it. Then in the popup the progress meter gets halfway then I get this error in the Console window: [2011-09-22 15:15:56] Failed to push the item(s). [2011-09-22 15:15:56] (null) Then the File Explorer completely refreshes and

Problem Pushing Large File to Emulator/SDcard with Eclipse DDMS

不羁的心 提交于 2020-01-12 18:51:29
问题 I am using Eclipse DDMS to push a file over onto my Android Emulator sdcard. I select the file and press Open, a dialog pops up and starts pushing the file. In the view "File Explorer" in the DDMS perspective I can see the sdcard directory and can see my file created in it. Then in the popup the progress meter gets halfway then I get this error in the Console window: [2011-09-22 15:15:56] Failed to push the item(s). [2011-09-22 15:15:56] (null) Then the File Explorer completely refreshes and

Android - profiling a specific thread (UI Thread) via DDMS

陌路散爱 提交于 2020-01-10 19:54:08
问题 I'm trying to find a cause of freezes on UI thread in my app in certain conditions. I have run the app through DDMS profiling. But in the bottom tree-table view I see all the methods called on all threads, whereas I would like to focus only on main thread. Is there a way to filter the bottom tree-table list of methods in DDMS, to include only statistics for a chosen thread (UI thread in my case) ? A sub-question: is there some good Android profiler out there? 回答1: The UI doesn't provide a way