标签:
今天第一次看Android.mk文件,内容如下
# Copyright 2007-2008 The Android Open Source Project 2 3 LOCAL_PATH:= $(call my-dir) 4 include $(CLEAR_VARS) 5 # Include res dir from chips 6 chips_dir := ../../../frameworks/ex/chips/res 7 res_dirs := $(chips_dir) res 8 9 $(shell rm -f $(LOCAL_PATH)/chips) 10 11 LOCAL_MODULE_TAGS := optional 12 13 LOCAL_SRC_FILES := $(call all-java-files-under, src) 14 15 LOCAL_PACKAGE_NAME := Mms 16 LOCAL_JAVA_LIBRARIES += mediatek-framework 17 LOCAL_JAVA_LIBRARIES += CustomProperties 18 # Builds against the public SDK 19 #LOCAL_SDK_VERSION := current 20 21 LOCAL_JAVA_LIBRARIES += telephony-common mms-common 22 LOCAL_JAVA_LIBRARIES += mediatek-telephony-common 23 LOCAL_STATIC_JAVA_LIBRARIES += android-common 24 LOCAL_STATIC_JAVA_LIBRARIES += jsr305 25 LOCAL_STATIC_JAVA_LIBRARIES += CellConnUtil 26 #LOCAL_STATIC_JAVA_LIBRARIES += wappush 27 LOCAL_STATIC_JAVA_LIBRARIES += com.android.vcard 28 LOCAL_STATIC_JAVA_LIBRARIES += android-common-chips 29 LOCAL_STATIC_JAVA_LIBRARIES += com.mediatek.mms.ext 30 31 LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs)) 32 LOCAL_AAPT_FLAGS := --auto-add-overlay 33 LOCAL_AAPT_FLAGS += --extra-packages com.android.ex.chips 34 35 LOCAL_REQUIRED_MODULES := SoundRecorder 36 37 LOCAL_PROGUARD_FLAG_FILES := proguard.flags 38 39 LOCAL_PRIVILEGED_MODULE := true 40 41 include $(BUILD_PACKAGE) 42 43 # This finds and builds the test apk as well, so a single make does both. 44 include $(call all-makefiles-under,$(LOCAL_PATH))
chips_dir := ../../../frameworks/ex/chips/res:说的是,它编译的时候会自动把这个路径下生成的文件编译进来,当然,前提是你这个路径也要进行单独编译才行
com.android.vcard:联系人
com.mediatek.mms.ext:mediatek目录
这个android.mk的工作原理还不是很清除,不过,第一感觉就是,如果一个目录下没有这个文件,那么这个目录就不可以进行编译
我们以MMS为例
mms接收者输入框在你输入某个数字的时候,它会自动下拉一个联系人列表。而这个输入框你会发现,它最终继承自
/mediatek/frameworks-ext/ex/chips/src/com/android/ex/chips$
下的
MTKRecipientEditTextView.java
你进入MTKRecipientEditTextView.java,会发现它的包名是
package com.android.ex.chips;
它的包名跟
frameworks/ex/chips/src/com/android/ex/chips/
路径是一样的
所以,我们修改了mediatek/frameworks-ext/ex/chips/src/com/android/ex/chips$ 的内容的时候,我们编译的话,使用的命令就是
./makeMtk mm frameworks/ex/chips/;./makeMtk mm package/app/Mms
另外还有一点就是,你在MTKRecipientEditTextView.java代码中会发现如下命令
mDefaultContactPhoto = BitmapFactory.decodeResource(r, R.drawable.ic_contact_picture);
它资源引用的是R.
所以,我们可以断定这个图片资源是存在frameworks/ex/chips目录下的
标签:
原文地址:http://www.cnblogs.com/zhangshuli-1989/p/zhangshuli_mk_150311103.html