How to debug Android app freezing, but not crashing, for end user

Viewed 1550

It's happening for an end user and I can't reproduce it on my end. I don't want to try to talk the end user through installing the devkit so they can view the LogCat, and since it's a freeze and not a crash, there's no "send crash report" kind of message.

Am I just out of luck until I can figure out how to reproduce it?

1 Answers

You can use StrictMode for detecting possible problems:

public void onCreate() {
     if (DEVELOPER_MODE) {
         StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                 .detectDiskReads()
                 .detectDiskWrites()
                 .detectNetwork()   // or .detectAll() for all detectable problems
                 .penaltyLog()
                 .build());
         StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                 .detectLeakedSqlLiteObjects()
                 .detectLeakedClosableObjects()
                 .penaltyLog()
                 .penaltyDeath()
                 .build());
     }
     super.onCreate();
 }
Related