According to my investigation, if i create my project by eclipse with
ADT, i have two ways to reference the jar.
1.modify the .classpath to add:
<classpathentry kind="lib" path="lib/3rd.jar"/>
2.add a user library by right click menu: build path -> add
libraries...
But if the 3rd part jar includes some resources files, the apk is
different:
If use .classpath file to add the library, the eclipse preserve
resource from 3rd party jar and there is a folder like: com.xxx.xx to
include resources file and the application work well.
If use the second way to add library, only the jar is put in the
apk and when i run the application , it will crash because the 3rd
part library can't find resources(the codes just like:
LibClass.class.getResource("xxx.png")).
Now i want to put my app to packages/apps directory and build it as
the system app.
I write the android.mk like this:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := 3rd-part-lib
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := MyApp
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:lib/3rd-part-
lib.jar\
include $(BUILD_MULTI_PREBUILT)
But result is the same as the way adding user library, can't find
resouces and crash in runtime.
I also test another way : use library project.It seems to work. but it
need to include the 3rd part library source codes.
How can i do the same thing in the android.mk file as the adt did in
eclipse with the .classpth file ?
could any body give me some comments?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en