Android Resource Manager Tools:aapt
August 29th, 2011===Aapt When I research multiple locale support, I found that aapt is a great tool which can used to dump internal information of apk file.
For exmple, aapt dump configurations apk_name can dump all the configuration used built in apk file.
===Locale support
AssertManager.getLocales() will invoke jni code in AssertManager.cpp, it will invoke ResTable.getLocales() in 'ResourceTypes.cpp`. This method will check all the avaliable configuration and figure out which kinds locales are supported.
How to delete SMS from android inbox?
July 23rd, 2011The first method is to use "content://sms/{sms_id}", but unfortunately, this metod doesn't work due to a unknown reason.
The workable solution is to use uri "content://sms", and use condition "id = {smsid}". It can delete SMS from inbox.
How to trun on Android SQLite Trace
July 23rd, 2011Based on the code of
JNI code output log in logcat
July 6th, 2011
#include <android/log.h>
#define LOG_TAG "SCWS"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
Tips about JNI code
July 6th, 2011Today, I fixed two stupid defects in my JNI code.
First one, I notice that return java string always contain a extra character, finally, it is caused by a mistake in my code: put 0 in [length+1] instead of [length]. VERY STUPID.
Second one, I notice the output of string is not correct. I write unicode string literatelly from txt file of windows notepad. At end, I found that java always uses Big Endian utf-16, but windows notpad using Little Endian utf-16.