{"id":55,"date":"2015-07-10T15:39:58","date_gmt":"2015-07-10T15:39:58","guid":{"rendered":"https:\/\/boochlin.com\/?p=55"},"modified":"2015-07-26T12:19:42","modified_gmt":"2015-07-26T12:19:42","slug":"android-local-build-use-third-parity-lib","status":"publish","type":"post","link":"https:\/\/boochlin.com\/?p=55","title":{"rendered":"Android Local build- use third parity lib."},"content":{"rendered":"<p>\u8001\u820a\u7b46\u8a18\u7cfb\u5217<\/p>\n<p>\u5728 FMRadio\u9019\u7a2e\u9700\u8981mm\u8ddf\u8005\u7cfb\u7d71\u4e00\u8d77build ap<br \/>\n\u4e26\u7121\u6cd5\u518declipse \u96a8\u610f\u52a0\u9032third party lib\uff0c\u800c\u662f\u53e6\u5916\u8981\u5beb\u4e00\u4e9b\u6771\u897f<\/p>\n<p><!--more--><\/p>\n<p>\u4f7f\u7528\u7b2c\u4e09\u65b9lib<br \/>\n1.\u5fc5\u9808\u518dAndroid.mk\u4e0b\u52a0\u5165<\/p>\n<pre>LOCAL_JNI_SHARED_LIBRARIES := libxxx\r\n<\/pre>\n<p>\u5c31\u662f\u628aso\u6587\u4ef6\u653e\u5230apk\u6587\u4ef6\u91cc\u7684libs\/armeabi\u91cc\uff0c\u800cinclude $(LOCAL_PATH)\/jni\/Android.mk\u4e3a\u4e86\u7f16\u8bd1so\u6587\u4ef6\u3002<\/p>\n<pre>LOCAL_JAVA_LIBRARIES := qcom.fmradio\r\n<\/pre>\n<p><strong><br \/>\n<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>LOCAL_JAVA_LIBRARIES<\/td>\n<td>When linking Java apps and libraries, LOCAL_JAVA_LIBRARIES specifies which sets of java classes to include. Currently there are two of these: core andframework. In most cases, it will look like this:LOCAL_JAVA_LIBRARIES := core framework<\/p>\n<p>Note that setting LOCAL_JAVA_LIBRARIES is not necessary (and is not allowed) when building an APK with &#8220;include $(BUILD_PACKAGE)&#8221;. The appropriate libraries will be included automatically.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2.\u518dandroid manifest application\u6b04\u4f4d\u5167\u52a0\u5165\u5f15\u7528lib\u7684\u5ba3\u544a<\/p>\n<p>2.1\u4e26\u4e14\u589e\u52a0\u5168\u57df\u7684activity<br \/>\nandroid:name=&#8221;.FMAdapterApp&#8221;<br \/>\nref:<br \/>\n\u8fd9\u4e2aname\u5c5e\u6027\u662f\u6765\u8bbe\u7f6e\u4f60\u6240\u6709activity\u6240\u5c5e\u4e8e\u54ea\u4e2aapplication\u7684\uff0c\u9ed8\u8ba4\u662fandroid.app.Application\uff0c\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5df1\u5b9a\u4e49\u4e00\u4e2a\u7c7b\u4f8b\u5982<\/p>\n<pre>public class MyApplication extends Application {}\r\n<\/pre>\n<p>\u7136\u540e<br \/>\n\u5c31\u662f\u8fd9\u513f\uff0c\u5c06\u6211\u4eec\u4ee5\u524d\u4e00\u76f4\u7528\u7684\u9ed8\u8ba4Application\u7ed9\u4ed6\u8bbe\u7f6e\u6210\u6211\u4eec\u81ea\u5df1\u505a\u7684MyApplication<br \/>\nMyApplication\u7c7b\u7684\u4f5c\u7528\u662f\u4e3a\u4e86\u653e\u4e00\u4e9b\u5168\u5c40\u7684\u548c\u4e00\u4e9b\u4e0a\u4e0b\u6587\u90fd\u8981\u7528\u5230\u53d8\u91cf\u548c\u65b9\u6cd5\u4e4b\u7c7b\u7684\u3002<br \/>\n3.\u518d\u7a0b\u5f0f\u78bc\u4e2d\u52a0\u5165\u8b93\u7cfb\u7d71\u6b63\u5f0f\u8b80\u5165lib<\/p>\n<pre>static {\r\nSystem.loadLibrary(\"qcomfm_jni\");\r\n}\r\n<\/pre>\n<p>\u6700\u597d\u653e\u5230static \u88e1\u57f7\u884c\uff0cjava\u6703\u6700\u5148\u57f7\u884c<\/p>\n<p>4.\u66f4\u52d5import \u7684\u4f4d\u5740<\/p>\n<p>reference:<br \/>\nhttp:\/\/yueguc.iteye.com\/blog\/820591<br \/>\nhttp:\/\/yueguc.iteye.com\/blog\/820591<br \/>\nhttp:\/\/www.kandroid.org\/online-pdk\/guide\/build_cookbook.html<\/p>\n<p>http:\/\/www.devdiv.com\/forum.php?mod=viewthread&#038;tid=45479<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8001\u820a\u7b46\u8a18\u7cfb\u5217 \u5728 FMRadio\u9019\u7a2e\u9700\u8981mm\u8ddf\u8005\u7cfb\u7d71\u4e00\u8d77build ap \u4e26\u7121\u6cd5\u518declipse \u96a8\u610f\u52a0\u9032third party lib\uff0c\u800c\u662f\u53e6\u5916\u8981\u5beb\u4e00\u4e9b\u6771\u897f<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50,2,10],"tags":[51],"_links":{"self":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/55"}],"collection":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=55"}],"version-history":[{"count":0,"href":"https:\/\/boochlin.com\/index.php?rest_route=\/wp\/v2\/posts\/55\/revisions"}],"wp:attachment":[{"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boochlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}