{"id":951,"date":"2023-03-11T18:59:57","date_gmt":"2023-03-11T10:59:57","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=951"},"modified":"2023-04-29T15:29:00","modified_gmt":"2023-04-29T07:29:00","slug":"several-issues-with-android-referencing-library","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/11\/several-issues-with-android-referencing-library\/","title":{"rendered":"Android\u5f15\u7528Library\u7684\u82e5\u5e72\u95ee\u9898"},"content":{"rendered":"<ul>\n<li>\n<p>\u5e93\u5de5\u7a0b\u91cc\u9762\u7684<code>assets<\/code>\u6587\u4ef6\u5939\u65e0\u7528\uff0c\u4e0d\u4f1a\u88ab\u6253\u5305\u5230apk<\/p>\n<\/li>\n<li>\n<p>\u5e93\u5de5\u7a0b\u91cc\u9762\u7684<code>AndroidManifest.xml<\/code>\u65e0\u7528\uff0c\u8981\u58f0\u660eActivity\uff0c\u5fc5\u987b\u5199\u5230\u4e3b\u5de5\u7a0b<\/p>\n<\/li>\n<li>\n<p>\u5f53\u5e93\u5de5\u7a0b\u6587\u4ef6\u4e2d\u7684\u8d44\u6e90ID\u548c\u4e3b\u5de5\u7a0b\u4e2d\u7684\u8d44\u6e90ID\u76f8\u540c\u65f6\uff0c\u4e3b\u5de5\u7a0b\u7684\u8d44\u6e90ID\u5c06\u4f1a\u8986\u76d6\u6389\u5e93\u5de5\u7a0b\u7684\u8d44\u6e90ID<\/p>\n<\/li>\n<\/ul>\n<p><!-- more --><\/p>\n<ul>\n<li>\n<p>\u5f53\u4e3b\u5de5\u7a0b\u6240\u5f15\u7528\u7684\u4e24\u4e2a\u5e93\u5de5\u7a0b\u4e2d\u6709\u76f8\u540c\u7684ID\u65f6\uff0cAndroid\u7f16\u8bd1\u5de5\u5177\u4f1a\u9009\u62e9\u4e00\u4e2a\u4f18\u5148\u7ea7\u9ad8\u7684ID\u8fdb\u884c\u5408\u5e76\u5230\u4e3b\u5de5\u7a0b\uff0c\u800c\u629b\u5f03\u53e6\u4e00\u4e2a\u5de5\u7a0b\u7684ID<\/p>\n<\/li>\n<li>\n<p>\u5e93\u5de5\u7a0b\u4f7f\u7528\u7684Android\u7248\u672c\u4e0d\u80fd\u9ad8\u4e8e\u8c03\u7528\u5b83\u7684\u4e3b\u5de5\u7a0b\u6240\u4f7f\u7528\u7684Anroid\u7248\u672c<\/p>\n<\/li>\n<li>\n<p>\u5e93\u5de5\u7a0b\u7684\u5305\u540d\uff0c\u4e0d\u5fc5\u6539\u53d8\uff0c\u4e3b\u5de5\u7a0b\u7684\u5305\u540d\uff0c\u624d\u662f\u751f\u6210apk\u7684\u5305\u540d\uff0c\u8ddf\u5e93\u5de5\u7a0b\u6ca1\u5173\u7cfb<\/p>\n<\/li>\n<li>\n<p>\u5e93\u5de5\u7a0b\u7684\u91cc\u9762\u7684\u8d44\u6e90id\uff0c\u4e0d\u518d\u662f<code>public static final int<\/code>\uff0c\u800c\u662f<code>public static int<\/code>\uff0c\u6ca1\u6709final\u4fee\u9970\u3002\u6700\u5927\u7684\u5f71\u54cd\u662f \u5728\u67d0\u4e9b\u70b9\u51fb\u4e8b\u4ef6\uff0c\u4f7f\u7528<code>switch<\/code>\u6765\u5224\u65ad<code>R.id.xx<\/code>\u7684\u65f6\u5019\uff0c\u5c31\u4e0d\u884c\u4e86\u3002\u6539\u4e3a<code>if else<\/code>\u5373\u53ef<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u5e93\u5de5\u7a0b\u7528\u5230<code>res\/values\/attrs.xml<\/code>\uff0c\u5373xml\u81ea\u5b9a\u4e49\u5c5e\u6027\u3002\u547d\u540d\u7a7a\u95f4\u5efa\u8bae\u4f7f\u7528\uff1a<code>xmlns:app=&quot;http:\/\/schemas.android.com\/apk\/res-auto&quot;<\/code><\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5e93\u5de5\u7a0b\u91cc\u9762\u7684assets\u6587\u4ef6\u5939\u65e0\u7528\uff0c\u4e0d\u4f1a\u88ab\u6253\u5305\u5230apk \u5e93\u5de5\u7a0b\u91cc\u9762\u7684AndroidManifest.xml\u65e0\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202],"tags":[],"class_list":["post-951","post","type-post","status-publish","format-standard","hentry","category-android-build"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=951"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/951\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}