I modified the Launcher app and it depends on a 3rd part jar library
with some resource(e.g. image and font). The resource is used by the
3rd part jar library(e.g LibClass.class.getResource("icon.png") ).
If i build the launcher app with eclipse through: adding
<classpathentry kind="lib" path="lib/3rd-part.jar"/>. The 3rd part jar
lib is build into dex file and eclipse seems preserving resources file
in the 3rd-part jar into a folder in the apk:
APK:
--com (this folder maps the resources in the 3rd part jar)
--res
--META-INF
--AndroidManifest.xml
--classes.dex
--resources.arsc
And the application works.
But when add my changes to android source codes, i modify the
android.mk in packages/apps/launcher2 like this:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := android-common\
3rd-part
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := Launcher2
LOCAL_CERTIFICATE := shared
LOCAL_OVERRIDES_PACKAGES := Home
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)
#########################################
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := 3rd-part:lib/3rd-part.jar
include $(BUILD_MULTI_PREBUILT)
now the jar lib is built into the classes.dex in apk. but there is no
com folder in the apk, and because andorid can't read resources from
jar, the app will be crash because the 3rd-part lib's codes can't get
the resouces?
how can i do the same thing with the eclipse adt did?
by the way, i have made some tests using library project, it also
works, but it need the sources code of the 3rd-part library.
could anybody give some comments?
Thx a lot.