Android development specification
Official Specification
地址: https://source.android.com/source/code-style
Replenish
NDK development: The method name of the native method starts with "native", and follows the small camel case nomenclature, and does not contain '_' in the name.
For example, the following example is from
Bitmap.java
:private static native Bitmap nativeCreateFromParcel(Parcel p);
Canvas
There are two ways at the same time, which are confusing :private native void native_drawBitmap(long nativeCanvas, Bitmap bitmap, float srcLeft, float srcTop, float srcRight, float srcBottom, float dstLeft, float dstTop, float dstRight, float dstBottom, long nativePaintOrZero, int screenDensity, int bitmapDensity); private static native void native_drawBitmap(long nativeCanvas, int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, long nativePaintOrZero);
native
The methods all useprivate
modifiers by using java method calls.