zoukankan      html  css  js  c++  java
  • Android开发规范

    Android开发规范

    官方规范

    地址: https://source.android.com/source/code-style
    

    补充

    1. ndk开发: native方法方法名以"native"开头,并遵循小驼峰命名法,且命名中不要包含'_'.

      例如,以下示例来自Bitmap.java:

      private static native Bitmap nativeCreateFromParcel(Parcel p);
      

      Canvas同时存在两种方式,比较混乱:

      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);
      
    2. native方法全部使用private修饰符,通过使用java方法调用.

  • 相关阅读:
    防抖函数
    video.js汉化
    vscode 设置
    webpack配置
    寄生组合继承
    数组排序
    操作节点的方法
    vscde软件
    vue目录详解
    前端
  • 原文地址:https://www.cnblogs.com/diql/p/8922401.html
Copyright © 2011-2022 走看看