简体   繁体   English

调试android应用

[英]Debug android application

I am developing an Android application where I get the following exception while writing to the database: 我正在开发一个Android应用程序,在写入数据库时​​遇到以下异常:

An exception occurred: android.database.sqlite.SQLiteException

But it doest say anything else(not even the stack trace). 但是它没有说其他任何东西(甚至没有堆栈跟踪)。

In general I find it very difficult to debug android SDK exceptions. 总的来说,我发现调试android SDK异常非常困难。

Any suggestions/tips on how to debug while developing android applications? 关于在开发android应用程序时如何进行调试的任何建议/提示?

  • I am using Eclipse to develop the application. 我正在使用Eclipse开发应用程序。

You need to learn how to Debug in Eclipse and how to use the ADB and DDMS tools. 您需要学习如何在Eclipse中进行调试以及如何使用ADBDDMS工具。

In order to get more details about an exception/force close you need to look for a view in Eclipse called Logcat (you will find in the DDMS perspective) there you will find a detailed traceback when/what and on what line is the issue. 为了获得有关异常/强制关闭的更多详细信息,您需要在Eclipse中寻找一个称为Logcat的视图(您将在DDMS透视图中找到),在那里您将找到问题的详细追溯时间,原因和内容。

For this you should read a complete article about Debugging in Android using Eclipse 为此,您应该阅读有关使用Eclipse在Android中进行调试的完整文章。

替代文字
(source: droidnova.com ) (来源: droidnova.com

Have a look at this question and answers, also Developer Android . 看看这个问题和答案,还有Developer Android

I reckon you first get your head around handling exceptions before tackling the SQLiteException. 我认为您首先要处理异常,然后再处理SQLiteException。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM