tags:

views:

519

answers:

3

I want to add a external third party jar file in the inbuilt android app.

I've added the LOCAL_CLASSPATH variable in Android.mk due to which the compilation goes fine. But during runtime, it is not able to find the class definiation which is in the JAR.

Which is the variable I need to set to add the third party JARs in the .dex/.apk ?

TIA.

A: 

In Eclipse choose modify build path and choose add external jar, and select the jar you watn to include.

BrennaSoft
Actually, I want to do this in Android.mk.
Karan
create a lib directory in your android project and add the jar then
BrennaSoft
+1  A: 

Here is what I used to solve the problem :

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := path_to_jar_file.jar include $(BUILD_MULTI_PREBUILT)

This should be added in Android.mk after "include $(BUILD_PACKAGE)".

You also need to specify the library name in LOCAL_STATIC_JAVA_LIBRARIES for compilation.

Karan
A: 

You also might want to take a look this Google Groups page for examples:

http://groups.google.com/group/android-platform/browse_thread/thread/fdb565dfc884fa90/ce5d9b23f5498860?lnk=gst&q=a2ronus#ce5d9b23f5498860.

a2ronus