RAD Studio’s ability to do remote debugging of Android apps on device is fantastic for tracking down issues. However sometimes you have issues where the debugger can’t help. Case in point is one of the projects we were doing for a customer recently. The Android portion included a Service, which needed to be auto-started when the Android device booted. It worked fine if it was started manually, but auto-starting at boot resulted in a crash. We couldn’t use the RAD Studio debugger as it was all over so quickly at boot time. Fortunately we were already logging messages out to the Android logs from within our app, so we were able to track down the problem. How?
Let’s go through the two necessary pieces:
- Logging a Message
- Viewing the Android log