在 vendor/<company_name>/products/<first_product_name>.mk 下配置相应的Product配置信息,
比如哪些应用需要build进去,就列在 PRODUCT_PACKAGES中,需要编译哪些语言和分辨率的资源进去,可以修改PRODUCT_LOCALES。
例如 PRODUCT_LOCALES += zh_CN,设置语言
PRODUCT_AAPT_CONFIG =normal ldpi mdpi 设置分辨率
这样编译的时候,就只会把app下的hdpi的资源编译进去,而不会编译mdpi,ldpi等目录下的资源。
android判断当前设备的支持哪些Feature可以使用 public abstract boolean hasSystemFeature (String name)判断是否支持某个属性在应用程序 中使用方法if(!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)){/**/} 还可以用 getSystemAvailableFeatures ()列出当前设备所有属性。 对于设备端来说,是否支持这些feature,就要放各种.xml文件到 /system/etc/permissions下面 诸如:android.hardware.camera.front.xml android.hardware.location.gps.xml android.hardware.sensor.accelerometer.xml android.hardware.telephony.gsm.xml android.hardware.touchscreen.multitouch.jazzhand.xml android.hardware.usb.accessory.xmlandroid.hardware.wifi.xml等等 要支持功能,需要在device.mk 里添加 PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ 需要添加到system/etc/permissions 目录下
从android官方网站上可以看到Product Definition Files的详细说明:
http://pdk.android.com/online-pdk/guide/build_new_device.html#androidBuildSystemProductDefFiles