6/28/2016

Fail to remount user/userdebug device after Andriod M

  After Android M, by default, Android OS will turn on system verified boot for user or userdebug build. It means it will fail to change or push any files under system partition.

  If your ROM is userdebug, you can use the below commands to remount system partition which will be able to read/write.
  $ adb root 
  $ adb disable-verity 
  $ adb reboot 
  $ adb wait-for-device 
  $ adb remount
adb disable-verity/enable-verit can only be executed if your ROM is userdebug, and you cannot remount system partition if your image is user build.

  If you can flash the image by yourself, you can build eng ROM which eng build will disable verified boot. Alternatively, you can disable verified boot by setting ro.secure to be 0 even if it is userdebug build. You can change the value of ro.secure in [AOSP]/build/core/main.mk, you can refer to the below screenshot.

6/25/2016

Old versions of Android NDK and ndk download script

6/17/2016

OpenCL on Android

Introduction and setup
  In android, Android/Google doesn't support OpenCL officially. Fortunately, many chip vendors like Qualquam90/ Nvidia/ Intel / MTK provide their libraries to support OpenCL on Android. 

  To use OpenCL on Android. If you want to use OpenCL, you need to check if there is OpenCL library on the device. You can download apps from Google Play to query OpenCL information like the version of OpenCL, device type, and benchmark tests. You can also go through List of Android Device with OpenCL support to see the benchmarks. 
The OpenCL libraries for the major chip vendors can be found in the devices. The followings are the location of the OpenCL library:

Qualquam(QUALCOMM Adreno)/Intel(HD Graphics)/Nvidia
/system/vendor/lib/libOpenCL.so
or /system/lib/libOpenCL.so (older devices)
ARM Mali:
/system/vendor/lib/egl/libGLES_mali.so
or /system/lib/egl/libGLES_mali.so
PowerVR:
/system/vendor/lib/libPVROCL.so
  1. Create NDK project to include OpenCL headers, compile your C/C++ code and link to CL shared library, and test them on the device as executable. Moreover, you can write JNI glue code and Java code to run on Java layer.

Quick setup and use Boost.Compute which is a GPU/parallel-computing library for C++ based on OpenCL.

You can refer to Boost.Compute-AndroidIf you like it, please give a star to this git repository.









Image annotation tool / Create bounding box for training images