How to add third party jar in compile time but not runtime

来源:互联网 发布:php 子类访问父类属性 编辑:程序博客网 时间:2024/06/01 13:45
原文在https://groups.google.com/forum/#!topic/android-developers/1L_O7XGXsoE
12-1-16
Jelly Chen There are two ways to build apk: ( I don't have the source of thirdparty.jar) 1. Use eclipse I have put the thirdparty.jar to lib dir( or any other dir on the filesystem). and then "Add Library" in the Eclipse. and compile ok. After building, i see
Jelly Chen 
12-1-17
将帖子翻译为中文  
The Android.mk I use is:

LOCAL_PATH:= $(call my-dir) 
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call find-other-java-files, src)
LOCAL_PACKAGE_NAME := Hello3RdJar
LOCAL_STATIC_JAVA_LIBRARIES := thirdparty_jelly 
include $(BUILD_PACKAGE)

include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := thirdparty_jelly:lib/thirdparty.jar

include $(BUILD_MULTI_PREBUILT)
Mark Murphy 
12-1-17
将帖子翻译为中文  
For questions about custom firmware, please visit http://source.android.com.

2012/1/16 Jelly Chen <sino...@gmail.com>:

- 显示引用文字 -
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-d...@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in DC: http://marakana.com/training/android/

Jelly Chen 
12-1-17
将帖子翻译为中文  
I found the solution.

1. Android.mk
replace LOCAL_STATIC_JAVA_LIBRARIES := thirdparty_jelly 
with      LOCAL_JAVA_LIBRARIES := thirdparty_jelly 

2. Eclipse
Use SDK addon.
copy an existing addon, replace the .jar, modify manifest.ini and source.properties a little.

lgaur 
13-7-31
将帖子翻译为中文  
Hi Jelly Chan,

I am trying to compile apk with some jar file and I don't want jar file to be part of .apk. I want at runtime apk should take jar file contents or .classes from system or device.

I am developing this using ADT . Could you please provide more info how to achieve it while using eclipse or ADT ?

Regards
Lokesh
- 显示引用文字 -
Kristopher Micinski 
13-8-1
Re: [android-developers] Re: How to add third party jar in compile time but not runtime
将帖子翻译为中文  
That's not possible unless you distribute the library as part of the firmware. 

Why wouldn't you want the code to be part of the APK?  Perhaps there's 
something else you could do. 

Kris 
- 显示引用文字 -
> -- 
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Android Developers" group. 
> To post to this group, send email to android-d...@googlegroups.com 
> To unsubscribe from this group, send email to 
> android-developers+unsubscribe@googlegroups.com 
> For more options, visit this group at 
> http://groups.google.com/group/android-developers?hl=en 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Android Developers" group. 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to android-developers+unsubscribe@googlegroups.com. 
> For more options, visit https://groups.google.com/groups/opt_out. 


Jelly Chen 
13-8-1
Re: [android-developers] Re: How to add third party jar in compile time but not runtime

Use android sdk add on, it's in sdk dir , like google map add on.

在 2013-7-31 下午9:23,"lgaur" <lokes...@gmail.com>写道:
- 显示引用文字 -
-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to a topic in the Google Groups "Android Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-developers/1L_O7XGXsoE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
0 0
原创粉丝点击