I want to write text file in sd card when I get an
exception from my application
How to implement this concept in my
application?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A general way to go about this, although in practice you should use buffered streams whenever possible.
In your
onCreate(Bundle savedInstanceState)callback or anywhere else you want to do this logging:Note that I omitted checking for the SD card, but you should always do this. See http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
Sorry for the crappy code formatting. This little text box is nothing like Eclipse.