Category: Welcome
How to trun on Android SQLite Trace
July 23rd, 2011Based on the code of
Android UserAgent
July 4th, 2011frameworks/base/core/java/android/webkit/WebSettings.java#getUserAgentString() returns useragent string. Analyze it, it logic is:
if( user specify "DESKTOP like UA" or "IPHONE like UA ){
return this type UA.
}
if( user specify UA ){ return UA; }
return getCurrentUserAgent(); getCurrentUserAgent() retrieve string template from resource com.android.internal.R.string.webuseragent( defined in frameworks/base/core/res/res/values/ ), combine with BUILD and LANGUAGE information to generate default ANDROID user agent.
packages/apps/Browser/src/com/android/browser/BrowserSettings.java in this file, setUserAgentString() will be used to specify UserAgentString() for Browser.
Bank Address
May 10th, 2011Name: Bank Of China Beijing Branch Address: SONGYULI SUB-BRANCH, NO.37 SONGYULI, BEIJING,CHINA
SWIFT CODE:BKCHCNBJ110
Debug android memory of c program ( JNI )
April 2nd, 2011Command
setprop dalvik.vm.checkjni true setprop libc.debug.malloc 10 setprop setprop dalvik.vm.jniopts forcecopy start stop
In your DDMS configuration file (e.g. ~/.android/ddms.cfg on Linux), add "native=true".
libc.debug.malloc
bionic/libc/bionic/mallocdebugcommon.c
/* Handle to shared library where actual memory allocation is implemented.
263 * This library is loaded and memory allocation calls are redirected there
264 * when libc.debug.malloc environment variable contains value other than
265 * zero:
266 * 1 - For memory leak detections.
267 * 5 - For filling allocated / freed memory with patterns defined by
268 * CHK_SENTINEL_VALUE, and CHK_FILL_FREE macros.
269 * 10 - For adding pre-, and post- allocation stubs in order to detect
270 * buffer overruns.
271 * Note that emulator's memory allocation instrumentation is not controlled by
272 * libc.debug.malloc value, but rather by emulator, started with -memcheck
273 * option. Note also, that if emulator has started with -memcheck option,
274 * emulator's instrumented memory allocation will take over value saved in
275 * libc.debug.malloc. In other words, if emulator has started with -memcheck
276 * option, libc.debug.malloc value is ignored.
277 * Actual functionality for debug levels 1-10 is implemented in
278 * libc_malloc_debug_leak.so, while functionality for emultor's instrumented
279 * allocations is implemented in libc_malloc_debug_qemu.so and can be run inside
280 * the emulator only.
281 */
Travel or work after graduating from high school
March 31st, 2011Increasing number of students choose to travel or work instead of enrolling college directly. It is not limited to rich students. On the one hand, some people think it is a good trend, on the other hand, some people worry about it and argue these students wasting time.
Obviously, it has many benefits for the student himself. Travel and work can expand his outlook and contacts with other cultures.