android - Should I remove e.printStackTrace() from my code before publishing -


i reading the android publishing docs , said remove log calls code. have calls e.printstacktrace() in code can printed part of normal running of program (ie. if file not exist yet).

should remove these calls?

you shouldn't using e.printstacktrace() directly anyway — doing send info android log without displaying application (log tag) came from.

as others have mentioned, continue catch exception in question, use 1 of android.util.log methods logging. log message, not stack trace, or use verbose logging stack trace:

try {     object foo = null;     foo.tostring(); } catch (nullpointerexception ex) {     log.w(log_tag, "foo didn't work: "+ ex.getmessage());     log.d(log_tag, util.stacktracewriter(ex)); } 

you should strip debug or verbose log messages production builds. easiest way use proguard remove log.[dv] calls code.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -