-
Book Overview & Buying
-
Table Of Contents
Android Native Development Kit Cookbook
By :
Android logging system provides a method for collecting logs from various applications into a series of circular buffers. The logcat command is
used to view the logs. Log message is the simplest method of debugging a program, yet one of the most powerful ones. This recipe focuses on message logging in NDK.
The following steps create our sample Android project:
Create an Android application named NDKLoggingDemo. Set the package name as cookbook.chapter3. Create an activity named NDKLoggingDemoActivity. Please refer to the Loading native libraries and registering native methods recipe of Chapter 2, Java Native Interface, if you want more detailed instructions.
Right-click on the project NDKLoggingDemo, select Android Tools | Add Native Support. A window appears, click on Finish to dismiss it.
Add a new file named mylog.h under the jni folder, and add the following content to it:
#ifndef COOKBOOK_LOG_H #define COOKBOOK_LOG_H...
Change the font size
Change margin width
Change background colour