{"id":267,"date":"2015-04-17T21:40:57","date_gmt":"2015-04-17T13:40:57","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=267"},"modified":"2015-05-03T21:53:04","modified_gmt":"2015-05-03T13:53:04","slug":"%e5%ae%89%e5%8d%93%e5%bc%80%e5%8f%91%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=267","title":{"rendered":"\u5b89\u5353\u5f00\u53d1\u6700\u4f73\u5b9e\u8df5"},"content":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4e3aFuturice\u516c\u53f8Android\u5f00\u53d1\u8005\u603b\u7ed3\u7684\u7ecf\u9a8c\u6559\u8bad\u3002\u9075\u5faa\u8fd9\u4e9b\u89c4\u8303\u53ef\u4ee5\u907f\u514d\u65e0\u8c13\u7684\u91cd\u590d\u52b3\u52a8\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u6458\u8981<\/h2>\n<ul>\n<li>\u4f7f\u7528Gradle\u548cGradle\u9ed8\u8ba4\u7684\u9879\u76ee\u7ed3\u6784<\/li>\n<li>\u5c06\u5bc6\u7801\u548c\u654f\u611f\u6570\u636e\u653e\u5728gradle.properties\u4e2d<\/li>\n<li>\u4e0d\u8981\u5b9e\u73b0\u81ea\u5df1\u7684HTTP\u5ba2\u6237\u7aef\uff0c\u4f7f\u7528Volley\u6216\u8005OkHttp\u5e93<\/li>\n<li>\u4f7f\u7528Jackson\u5e93\u89e3\u6790JSON\u6570\u636e<\/li>\n<li>\u7531\u4e8e65K\u7684\u65b9\u6cd5\u7a7a\u95f4\u9650\u5236\uff0c\u907f\u514d\u4f7f\u7528Guava\u5e76\u4f7f\u7528\u5c3d\u53ef\u80fd\u5c11\u7684\u5e93<\/li>\n<li>\u7528Fragment\u6765\u663e\u793aUI<\/li>\n<li>Activity\u53ea\u7528\u6765\u7ba1\u7406Fragment<\/li>\n<li>XML\u4e5f\u662f\u4ee3\u7801\uff0c\u7ba1\u7406\u597dXML\u4ee3\u7801<\/li>\n<li>\u4f7f\u7528\u6837\u5f0f\u6765\u51cf\u5c11\u5e03\u5c40XML\u4ee3\u7801\u4e2d\u91cd\u590d\u5c5e\u6027<\/li>\n<li>\u5c06\u6837\u5f0f\u5199\u5728\u591a\u4e2a\u6587\u4ef6\u4e2d\uff0c\u907f\u514d\u628a\u6837\u5f0f\u5168\u90e8\u5199\u5728\u5355\u4e00\u7684\u5927\u6587\u4ef6\u5f53\u4e2d<\/li>\n<li>\u4fdd\u6301colors.xml\u6587\u4ef6\u7684\u7b80\u77ed\u5e72\u51c0\uff0c\u53ea\u5b9a\u4e49\u8c03\u8272\u677f<\/li>\n<li>\u540c\u6837\u4e5f\u4fdd\u6301dimens.xml\u7b80\u77ed\u5e72\u51c0\uff0c\u53ea\u5b9a\u4e49\u901a\u7528\u7684\u5e38\u91cf<\/li>\n<li>\u907f\u514d\u6df1\u5c42\u7ea7\u7684ViewGroup<\/li>\n<li>\u907f\u514d\u5ba2\u6237\u7aef\u5904\u7406WebView\u8981\u663e\u793a\u7684\u5185\u5bb9\uff0c\u5e76\u4e14\u6ce8\u610f\u5185\u5b58\u6cc4\u9732<\/li>\n<li>\u4f7f\u7528Robolectric\u8fdb\u884c\u5355\u5143\u6d4b\u8bd5\uff0c\u4f7f\u7528Robotium\u8fdb\u884c\u8fde\u63a5\u8bbe\u5907\uff08UI\uff09\u7684\u6d4b\u8bd5<\/li>\n<li>\u4f7f\u7528Genymotion\u6a21\u62df\u5668<\/li>\n<li>\u4e00\u76f4\u4f7f\u7528ProGuard\u6216\u8005DexGuard<\/li>\n<\/ul>\n<h2>Android SDK<\/h2>\n<p>\u5c06<a href=\"https:\/\/developer.android.com\/sdk\/installing\/index.html?pkg=tools\">Android SDK<\/a>\u5b58\u653e\u5728home\u76ee\u5f55\u6216\u8005\u5176\u4ed6\u8ddf\u5e94\u7528\u5f00\u53d1\u65e0\u5173\u7684\u4f4d\u7f6e\u3002\u4e00\u4e9bIDE\u5728\u5b89\u88c5\u65f6\u5305\u542b\u4e86SDK\uff0c\u8fd9\u65f6SDK\u53ef\u80fd\u5b58\u653e\u5728IDE\u7684\u5b89\u88c5\u76ee\u5f55\u4e0b\u3002\u800c\u8fd9\u662f\u5f88\u4e0d\u597d\u7684\u505a\u6cd5\uff0c\u7279\u522b\u662f\u5f53\u4f60\u9700\u8981\u5347\u7ea7\uff08\u6216\u8005\u91cd\u65b0\u5b89\u88c5\uff09\u6216\u66f4\u6362IDE\u65f6\u3002\u540c\u65f6\u4e5f\u8981\u907f\u514d\u628aSDK\u5b58\u653e\u5728\u7cfb\u7edf\u76ee\u5f55\u4e0b\uff0c\u5426\u5219\uff0c\u5f53\u666e\u901a\u7528\u6237\uff08\u4e0d\u662froot\uff09\u4f7f\u7528IDE\u65f6\u5c31\u9700\u8981\u83b7\u53d6sudo\u6743\u9650\u3002<\/p>\n<h2>\u7f16\u8bd1\u7cfb\u7edf<\/h2>\n<p>\u7f16\u8bd1\u7cfb\u7edf\u9996\u9009<a href=\"http:\/\/android.jobbole.com\/80684\/tools.android.com\/tech-docs\/new-build-system\">Gradle<\/a>\u3002\u76f8\u6bd4\u4e8eGradle\uff0cAnt\u66f4\u52a0\u7684\u5c40\u9650\u5e76\u4e14\u66f4\u52a0\u7e41\u7410\u3002\u4f7f\u7528Gradle\u7f16\u8bd1\u7cfb\u7edf\u53ef\u4ee5\u5f88\u7b80\u5355\u7684\u505a\u5230\uff1a<\/p>\n<ul>\n<li>\u5c06\u5e94\u7528\u7f16\u8bd1\u6210\u4e0d\u540c\u7684\u7248\u672c<\/li>\n<li>\u5b8c\u6210\u7b80\u5355\u7684\u7c7b\u4f3c\u811a\u672c\u7684\u4efb\u52a1<\/li>\n<li>\u7ba1\u7406\u548c\u4e0b\u8f7d\u4f9d\u8d56<\/li>\n<li>\u81ea\u5b9a\u4e49\u79d8\u94a5\u4ed3\u5e93<\/li>\n<li>\u5176\u4ed6\u2026<\/li>\n<\/ul>\n<p>Google\u6b63\u79ef\u6781\u7684\u5f00\u53d1\u5b89\u5353Gradle\u63d2\u4ef6\uff0c\u4f5c\u4e3a\u65b0\u7684\u6807\u51c6\u7f16\u8bd1\u7cfb\u7edf\u3002<\/p>\n<h2>\u9879\u76ee\u7ed3\u6784<\/h2>\n<p>\u4e3b\u8981\u6709\u4e24\u4e2a\u4e3b\u6d41\u7684\u9879\u76ee\u7ed3\u6784\uff1a\u65e7\u7684Ant\u9879\u76ee\u7ed3\u6784\u548cEclipse ADT\u9879\u76ee\u7ed3\u6784\uff0c\u8f83\u65b0\u7684Gradle\u548cAndroid Studio\u9879\u76ee\u7ed3\u6784\u3002\u5f53\u7136\u9009\u62e9\u65b0\u7684\u9879\u76ee\u7ed3\u6784\u3002\u5982\u679c\u4f60\u7684\u9879\u76ee\u6b63\u5728\u7528\u65e7\u7684\u9879\u76ee\u7ed3\u6784\uff0c\u8003\u8651\u653e\u5f03\u65e7\u7684\u7ed3\u6784\uff0c\u8f6c\u79fb\u5230\u65b0\u7684\u9879\u76ee\u7ed3\u6784\u4e0b\u5427\u3002<\/p>\n<p>\u65e7\u9879\u76ee\u7ed3\u6784\uff1a<\/p>\n<p>[java]old-structure<br \/>\n\u251c\u2500 assets<br \/>\n\u251c\u2500 libs<br \/>\n\u251c\u2500 res&lt;\/code&gt;&lt;\/div&gt;<br \/>\n\u251c\u2500 src&lt;\/code&gt;&lt;\/div&gt;<br \/>\n\u2502\u00a0 \u2514\u2500 com&lt;\/code&gt;&lt;code class=&quot;bash plain&quot;&gt;\/futurice\/project<br \/>\n\u251c\u2500 AndroidManifest.xml<br \/>\n\u251c\u2500 build.gradle<br \/>\n\u251c\u2500 project.properties<br \/>\n\u2514\u2500 proguard-rules.pro[\/java]<\/p>\n<p>\u65b0\u7684\u9879\u76ee\u7ed3\u6784\uff1a<\/p>\n<p>[java]new-structure<br \/>\n\u2500 library-foobar<br \/>\n\u251c\u2500 app<br \/>\n\u2502\u00a0 \u251c\u2500 libs<br \/>\n\u2502\u00a0 \u251c\u2500 src<br \/>\n\u2502\u00a0 \u2502\u00a0 \u251c\u2500 androidTest<br \/>\n\u2502\u00a0 \u2502\u00a0 \u2502\u00a0 \u2514\u2500 java<br \/>\n\u2502\u00a0 \u2502\u00a0 \u2502\u00a0\u00a0\u00a0\u00a0 \u2514\u2500 com&lt;\/code&gt;&lt;code class=&quot;bash plain&quot;&gt;\/futurice\/project<br \/>\n\u2502\u00a0 \u2502\u00a0 \u2514\u2500 main<br \/>\n\u2502\u00a0 \u2502\u00a0\u00a0\u00a0\u00a0 \u251c\u2500 java<br \/>\n\u2502\u00a0 \u2502\u00a0\u00a0\u00a0\u00a0 \u2502\u00a0 \u2514\u2500 com\/futurice\/project<br \/>\n\u2502\u00a0 \u2502\u00a0\u00a0\u00a0\u00a0 \u251c\u2500 res<br \/>\n\u2502\u00a0 \u2502\u00a0\u00a0\u00a0\u00a0 \u2514\u2500 AndroidManifest.xml<br \/>\n\u2502\u00a0 \u251c\u2500 build.gradle<br \/>\n\u2502\u00a0 \u2514\u2500 proguard-rules.pro<br \/>\n\u251c\u2500 build.gradle<br \/>\n\u2514\u2500 settings.gradle<br \/>\n[\/java]<br \/>\n\u65b0\u65e7\u9879\u76ee\u7ed3\u6784\u6700\u5927\u7684\u4e0d\u540c\u70b9\u662f\u65b0\u9879\u76ee\u7ed3\u6784\u66f4\u52a0\u5408\u7406\u7684\u5206\u5f00\u4e86\u4ee3\u7801\u96c6\uff08main, androidTest\uff09\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u5728\u4ee3\u7801\u96c6src\u6587\u4ef6\u5939\u4e0b\u6dfb\u52a0\u2019paid\u2019\u548c\u2019free\u2019\u6587\u4ef6\u5939\uff0c\u5206\u522b\u7528\u4e8e\u5b58\u653e\u4ed8\u8d39\u7248\u5e94\u7528\u4ee3\u7801\u548c\u514d\u8d39\u7248\u5e94\u7528\u7684\u4ee3\u7801\u3002<\/p>\n<p>\u9876\u5c42app\u6587\u4ef6\u5939\u7528\u4e8e\u5c06\u4f60\u7684\u5e94\u7528\u548c\u5176\u4ed6\u5e93\uff08\u4f8b\u5982\uff1alibrary-foobar\uff09\u533a\u5206\u5f00\u6765\u3002Settings.gradle\u4e2d\u4fdd\u5b58\u4e86app\/build.gradle\u9700\u8981\u7528\u5230\u7684\u5e93\u7684\u5f15\u7528\u3002<\/p>\n<h2>Gradle\u914d\u7f6e<\/h2>\n<p><strong>\u666e\u901a\u9879\u76ee\u7ed3\u6784<\/strong>\u3002\u9075\u5faa<a href=\"http:\/\/android.jobbole.com\/80684\/tools.android.com\/tech-docs\/new-build-system\/user-guide\">Google\u5b89\u5353Gradle\u89c4\u8303<\/a>\u3002<br \/>\n<strong>\u7b80\u5355\u4efb\u52a1<\/strong>\u3002\u53ef\u4ee5\u7528Gradle\u5b8c\u6210\u4e00\u4e9b\u7b80\u5355\u4efb\u52a1\uff0c\u800c\u4e0d\u7528\u7279\u5730\u53bb\u5199\uff08shell, Python, Perl\u7b49\uff09\u811a\u672c\u3002\u5177\u4f53\u53c2\u8003<a href=\"http:\/\/www.gradle.org\/docs\/current\/userguide\/userguide_single.html#N10CBF\">Gradle\u6587\u6863<\/a>\u3002<br \/>\n<strong>\u5bc6\u7801<\/strong>\u3002\u4f60\u9700\u8981\u5728build.gradle\u4e2d\u914d\u7f6e\u5e94\u7528\u53d1\u884c\u7248\u672c\u7684\u7b7e\u540d\u914d\u7f6e\u3002\u4ee5\u4e0b\u8fd9\u4e9b\u60c5\u51b5\u662f\u9700\u8981\u907f\u514d\u7684\uff1a<\/p>\n<p>\u4e0d\u8981\u8fd9\u6837\u505a\u3002\u4e5f\u8bb8\u4f60\u4f1a\u5728\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u4e2d\u8fd9\u6837\u505a\u3002<br \/>\n[java]signingConfigs {<br \/>\n    release {<br \/>\n        storeFile file(&quot;myapp.keystore&quot;)<br \/>\n        storePassword &quot;password123&quot;<br \/>\n        keyAlias &quot;thekey&quot;<br \/>\n        keyPassword &quot;password789&quot;<br \/>\n    }<br \/>\n}[\/java]<br \/>\n\u6362\u4e00\u79cd\u65b9\u5f0f\uff0c\u65b0\u5efa\u4e00\u4e2agradle.properties\u6587\u4ef6\uff0c\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b\u3002\u6ce8\u610f\uff0c\u4e0d\u8981\u628aGradle.properties\u6dfb\u52a0\u5230\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u4e2d\u3002<\/p>\n<p>KEYSTORE_PASSWORD=password123<br \/>\nKEY_PASSWORD=password789<\/p>\n<p>Gradle\u4f1a\u81ea\u52a8\u5bfc\u5165gradle.properties\u6587\u4ef6\uff0c\u6240\u4ee5\u4f60\u53ef\u4ee5\u5728build.gradle\u4e2d\u8fd9\u6837\u5199\uff1a<br \/>\n[java]signingConfigs {<br \/>\n    release {<br \/>\n        try {<br \/>\n            storeFile file(&quot;myapp.keystore&quot;)<br \/>\n            storePassword KEYSTORE_PASSWORD<br \/>\n            keyAlias &quot;thekey&quot;<br \/>\n            keyPassword KEY_PASSWORD<br \/>\n        }<br \/>\n        catch (ex) {<br \/>\n            throw new InvalidUserDataException(&quot;You should define KEYSTORE_PASSWORD and KEY_PASSWORD in gradle.properties.&quot;)<br \/>\n        }<br \/>\n    }<br \/>\n}[\/java]<br \/>\n\u4f7f\u7528Maven\u7ba1\u7406\u9879\u76ee\u4f9d\u8d56\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u5bfc\u5165jar\u6587\u4ef6\u3002\u5982\u679c\u4f60\u663e\u5f0f\u7684\u5bfc\u5165jar\u6587\u4ef6\u5230\u9879\u76ee\u4e2d\uff0c\u90a3\u8fd9\u4e9b\u4f9d\u8d56\u7684jar\u6587\u4ef6\u53ea\u4f1a\u662f\u67d0\u4e2a\u56fa\u5b9a\u7684\u7248\u672c\uff0c\u4f8b\u59822.1.1\u3002\u4e0b\u8f7djar\u6587\u4ef6\u5e76\u7ba1\u7406\u66f4\u65b0\u8fd9\u79cd\u65b9\u5f0f\u7b28\u62d9\u4e0d\u582a\uff0c\u800cMaven\u5b8c\u5168\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\uff0c\u5e76\u4e14\uff0cMaven\u53ef\u4ee5\u96c6\u6210\u5728\u5b89\u5353Gradle\u7f16\u8bd1\u7cfb\u7edf\u4e2d\u3002\u4f60\u53ef\u4ee5\u6307\u5b9a\u7248\u672c\u7684\u8303\u56f4\uff0c\u4f8b\u59822.2.+\uff0c\u7136\u540eMaven\u5c31\u4f1a\u81ea\u52a8\u66f4\u65b0\u5230\u7248\u672c\u8303\u56f4\u5185\u7684\u6700\u65b0\u7248\u672c\u3002\u4f8b\u5982\uff1a<br \/>\n[java]ependencies {<br \/>\n    compile &#8216;com.netflix.rxjava:rxjava-core:0.19.+&#8217;<br \/>\n    compile &#8216;com.netflix.rxjava:rxjava-android:0.19.+&#8217;<br \/>\n    compile &#8216;com.fasterxml.jackson.core:jackson-databind:2.4.+&#8217;<br \/>\n    compile &#8216;com.fasterxml.jackson.core:jackson-core:2.4.+&#8217;<br \/>\n    compile &#8216;com.fasterxml.jackson.core:jackson-annotations:2.4.+&#8217;<br \/>\n    compile &#8216;com.squareup.okhttp:okhttp:2.0.+&#8217;<br \/>\n    compile &#8216;com.squareup.okhttp:okhttp-urlconnection:2.0.+&#8217;<br \/>\n}[\/java]<\/p>\n<h2>IDE\u548c\u6587\u672c\u7f16\u8f91\u5668<\/h2>\n<p>\u4e0d\u7ba1\u7528\u4ec0\u4e48\u7f16\u8f91\u5668\uff0c\u5b83\u90fd\u5fc5\u987b\u8981\u80fd\u591f\u5f88\u597d\u7684\u663e\u793a\u9879\u76ee\u7ed3\u6784\u3002\u7f16\u8bd1\u5668\u7684\u9009\u62e9\u770b\u4e2a\u4eba\u559c\u597d\uff0c\u4f46\u662f\u7f16\u8f91\u5668\u5fc5\u987b\u8981\u80fd\u591f\u663e\u793a\u9879\u76ee\u7ed3\u6784\u548c\u7f16\u8bd1\u3002<\/p>\n<p>\u73b0\u5728\u6700\u4e3a\u63a8\u8350\u7684IDE\u65f6<a href=\"https:\/\/developer.android.com\/sdk\/installing\/studio.html\">Android Studio<\/a>\uff0c\u56e0\u4e3aAndroid Studio\u7531Google\u5f00\u53d1\uff0c\u6700\u4e3a\u63a5\u8fd1Gradle\uff0c\u9ed8\u8ba4\u4f7f\u7528\u65b0\u7684\u9879\u76ee\u7ed3\u6784\uff0c\u4e5f\u7ec8\u4e8e\u53d1\u5e03\u4e86beta\u7248\uff0c\u53ef\u4ee5\u8bf4\u662f\u4e3aAndroid\u5f00\u53d1\u91cf\u8eab\u5b9a\u505a\u7684IDE\u3002<\/p>\n<p>\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528<a href=\"https:\/\/developer.android.com\/sdk\/installing\/index.html?pkg=adt\">Eclipse ADT<\/a>\uff0c\u4f46\u662f\u9700\u8981\u91cd\u65b0\u914d\u7f6e\uff0c\u56e0\u4e3aEcplise ADT\u9ed8\u8ba4\u4f7f\u7528\u65e7\u7684\u9879\u76ee\u7ed3\u6784\u548c\u4f7f\u7528Ant\u7f16\u8bd1\u3002\u751a\u81f3\uff0c\u53ef\u4ee5\u4f7f\u7528\u7eaf\u6587\u672c\u7f16\u8f91\u5668\uff0c\u6bd4\u5982Vim, Sublime Text, \u6216\u8005Emacs\u3002\u5982\u679c\u4f7f\u7528\u7eaf\u6587\u672c\u7f16\u8f91\u5668\uff0c\u5c31\u9700\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528Gradle\u548cadb\u3002\u5982\u679cEclipse\u96c6\u6210Gradle\u540e\u4ecd\u65e7\u4e0d\u80fd\u5de5\u4f5c\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u5728\u547d\u4ee4\u884c\u4e2d\u7f16\u8bd1\uff0c\u6216\u8005\u8fc1\u79fb\u81f3Android Studio\u3002<\/p>\n<p>\u4e0d\u7ba1\u4f7f\u7528\u4ec0\u4e48IDE\u548c\u6587\u672c\u7f16\u8f91\u5668\uff0c\u786e\u4fdd\u4f7f\u7528Gradle\u548c\u65b0\u7684\u9879\u76ee\u7ed3\u6784\u6765\u7f16\u8bd1\u5e94\u7528\u7a0b\u5e8f\uff0c\u540c\u65f6\u907f\u514d\u628a\u7f16\u8bd1\u5668\u7684\u914d\u7f6e\u6587\u4ef6\u6dfb\u52a0\u5230\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u5f53\u4e2d\u3002\u4f8b\u5982\uff0c\u907f\u514d\u6dfb\u52a0Ant\u7684\u914d\u7f6e\u6587\u4ef6build.xml\u3002\u8fd8\u6709\u9700\u8981\u5f3a\u8c03\u7684\u4e00\u70b9\uff0c\u5982\u679c\u4f60\u5728Ant\u4e2d\u66f4\u6539\u4e86\u7f16\u8bd1\u914d\u7f6e\uff0c\u4e0d\u8981\u5fd8\u8bb0\u66f4\u65b0build.gradle\uff0c\u4f7f\u5176\u80fd\u591f\u5b8c\u6210\u7f16\u8bd1\u3002\u53e6\u5916\uff0c\u5bf9\u5176\u4ed6\u7684\u5f00\u53d1\u8005\u53cb\u597d\u4e00\u70b9\uff0c\u4e0d\u8981\u5f3a\u8feb\u4ed6\u4eec\u53bb\u6539\u53d8\u4ed6\u4eec\u7684\u5de5\u5177\u7684\u504f\u597d\u8bbe\u7f6e\u3002<\/p>\n<h2>\u5e93<\/h2>\n<p><a href=\"http:\/\/wiki.fasterxml.com\/JacksonHome\">Jackson<\/a>\u662f\u4e00\u4e2a\u7528\u4e8e\u5c06\u5bf9\u8c61\u8f6c\u6362\u6210JSON\u6216\u8005\u5c06JSON\u8f6c\u6362\u6210\u5bf9\u8c61\u7684Java\u5e93\u3002\u4e3a\u4e86\u89e3\u51b3JSON\u548c\u5bf9\u8c61\u76f8\u4e92\u8f6c\u6362\u7684\u95ee\u9898\uff0c<a href=\"https:\/\/code.google.com\/p\/google-gson\/\">Gson<\/a>\u662f\u4e00\u4e2a\u53d7\u6b22\u8fce\u7684\u9009\u62e9\u3002\u4f46\u662f\u6211\u4eec\u53d1\u73b0\uff0c\u81ea\u4eceJackson\u652f\u6301\u591a\u79cdJSON\u5904\u7406\u65b9\u5f0f\uff1a\u6d41\uff0c\u5185\u5b58\u4e2d\u7684\u6811\u6a21\u578b\u548c\u4f20\u7edf\u7684JSON-POJO\u6570\u636e\u7ed1\u5b9a\uff0cJackson\u66f4\u52a0\u9ad8\u6548\u3002\u8bf7\u8bb0\u4f4f\uff0cJackson\u662f\u4e00\u4e2a\u6bd4GSON\u5927\u7684\u5e93\uff0c\u6240\u4ee5\u8bf7\u6839\u636e\u4f60\u81ea\u5df1\u7684\u5b9e\u9645\u60c5\u51b5\u505a\u51fa\u9009\u62e9\u3002\u8003\u8651\u523065K\u7684\u65b9\u6cd5\u7a7a\u95f4\u9650\u5236\uff0c\u4f60\u53ef\u80fd\u4f1a\u504f\u5411\u4e8e\u9009\u62e9GSON\u3002\u5176\u4ed6\u9009\u62e9\uff1a<a href=\"https:\/\/code.google.com\/p\/json-smart\/\">Json-smart<\/a>\u548c<a href=\"https:\/\/github.com\/RichardHightower\/boon\/wiki\/Boon-JSON-in-five-minutes\">Boon JSON<\/a><\/p>\n<p><strong>\u7f51\u7edc\uff0c\u7f13\u5b58\u548c\u56fe\u7247\u3002<\/strong>\u73b0\u5728\u5df2\u7ecf\u6709\u8bb8\u591a\u7ecf\u8fc7\u5b9e\u8df5\u8bc1\u660e\u7684\u5411\u540e\u7aef\u670d\u52a1\u5668\u8bf7\u6c42\u6570\u636e\u7684\u89e3\u51b3\u65b9\u6848\u3002\u4f60\u5e94\u8be5\u8003\u8651\u4f7f\u7528\u8fd9\u4e9b\u89e3\u51b3\u65b9\u6848\u6765\u5b9e\u73b0\u81ea\u5df1\u7684\u5ba2\u6237\u7aef\u3002\u4f7f\u7528<a href=\"https:\/\/android.googlesource.com\/platform\/frameworks\/volley\">Volley<\/a>\u6216\u8005<a href=\"http:\/\/square.github.io\/retrofit\/\">Retrofit<\/a>\u3002Volley\u4e5f\u63d0\u4f9b\u4e86\u52a0\u8f7d\u548c\u7f13\u5b58\u56fe\u7247\u7684\u5e2e\u52a9\u7c7b\u3002\u5982\u679c\u4f60\u9009\u62e9Retrofit\uff0c\u8003\u8651\u4f7f\u7528<a href=\"http:\/\/square.github.io\/picasso\/\">Picasso<\/a>\u6765\u52a0\u8f7d\u548c\u7f13\u5b58\u56fe\u7247\uff0c\u4f7f\u7528OkHttp\u6765\u5b9e\u73b0\u9ad8\u6548\u7684HTTP\u8bf7\u6c42\u3002Retrofit\uff0cPicasso\u548cOkHttp\u90fd\u7531\u540c\u4e00\u4e2a\u516c\u53f8\u5b9e\u73b0\uff0c\u6240\u4ee5\u8fd9\u4e09\u8005\u5951\u5408\u7684\u7279\u522b\u597d\u3002OkHttp\u4e5f\u53ef\u4ee5\u548cVolley\u914d\u5957\u4f7f\u7528\u3002<\/p>\n<p>RxJava\u662f\u4e00\u4e2a\u7528\u4e8e\u54cd\u5e94\u5f0f\u7f16\u7a0b\u7684\u5e93\uff0c\u4e5f\u5373\u662f\uff0c\u5904\u7406\u5f02\u6b65\u4e8b\u4ef6\u7684\u5e93\u3002RxJava\u8fd9\u4e2a\u8303\u4f8b\u975e\u5e38\u5f3a\u5927\uff0c\u800c\u4e14\u524d\u9014\u5149\u660e\u3002RxJava\u975e\u5e38\u4e0e\u4f17\u4e0d\u540c\uff0c\u56e0\u6b64\u4f7f\u7528RxJava\u65f6\u53ef\u80fd\u4f1a\u4ee4\u4eba\u8ff7\u60d1\u3002\u6211\u4eec\u63a8\u8350\u5728\u628aRxJava\u90e8\u7f72\u5230\u6574\u4e2a\u5e94\u7528\u524d\u5148\u82b1\u4e00\u4e9b\u65f6\u95f4\u4e86\u89e3RxJava\u3002\u73b0\u5728\u5df2\u7ecf\u6709\u4e00\u4e9b\u9879\u76ee\u662f\u5229\u7528RxJava\u6765\u5b8c\u6210\u7684\uff0c\u5982\u679c\u4f60\u9700\u8981\u5e2e\u52a9\uff0c\u8bf7\u5411\u8fd9\u4e9b\u4eba\u8be2\u95ee\uff1aTimo Tuominen, Olli Salonen, Andre Medeiros, Mark Voit, Antti Lammi, Vera Izrailit, Juha Ristolainen\u3002\u53e6\u5916\uff0c\u6211\u4eec\u4e5f\u5199\u4e86\u4e00\u4e9b\u535a\u5ba2\uff1a<a href=\"http:\/\/blog.futurice.com\/tech-pick-of-the-week-rx-for-net-and-rxjava-for-android\">[1]<\/a>, <a href=\"http:\/\/blog.futurice.com\/top-7-tips-for-rxjava-on-android\">[2]<\/a>, <a href=\"https:\/\/gist.github.com\/staltz\/868e7e9bc2a7b8c1f754\">[3]<\/a>, <a href=\"http:\/\/blog.futurice.com\/android-development-has-its-own-swift\">[4]<\/a>.<\/p>\n<p>\u5982\u679c\u4f60\u6ca1\u6709\u4f7f\u7528Rx\u7684\u7ecf\u9a8c\uff0c\u8bf7\u4ece\u5e94\u7528Rx\u7684\u54cd\u5e94API\u5f00\u59cb\u3002\u6216\u8005\uff0c\u4ece\u5e94\u7528Rx\u7684UI\u4e8b\u4ef6\u5904\u7406\u5f00\u59cb\uff0c\u6bd4\u5982\u70b9\u51fb\u4e8b\u4ef6\u6216\u8005\u5728\u641c\u7d22\u6846\u4e2d\u7684\u952e\u76d8\u4e8b\u4ef6\u3002\u5982\u679c\u4f60\u5bf9\u4f7f\u7528Rx\u5f88\u6709\u4fe1\u5fc3\uff0c\u60f3\u8981\u628aRx\u5e94\u7528\u5230\u6574\u4e2a\u5e94\u7528\u7a0b\u5e8f\u5f53\u4e2d\uff0c\u8bf7\u5728\u6bd4\u8f83\u96be\u5904\u7406\u3001\u5bb9\u6613\u4ee4\u4eba\u8ff7\u60d1\u7684\u90e8\u5206\u5199\u660eJavadocs\u3002\u8bb0\u4f4f\uff0c\u5176\u4ed6\u4e0d\u719f\u6089RxJava\u7684\u7a0b\u5e8f\u5458\u7ef4\u62a4\u9879\u76ee\u65f6\u53ef\u80fd\u4f1a\u975e\u5e38\u56f0\u96be\u3002\u8bf7\u5c3d\u529b\u53bb\u5e2e\u52a9\u4ed6\u53bb\u7406\u89e3\u4f60\u7684\u4ee3\u7801\u548cRx\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/evant\/gradle-retrolambda\"><strong>Retrolambda<\/strong><\/a>\u662f\u4e00\u4e2a\u5728Android\u5e73\u53f0\u6216\u8005\u5176\u4ed6\u4f4e\u4e8eJDK8\u7684\u5e73\u53f0\u4e0a\u5904\u7406Lambda\u8868\u8fbe\u5f0f\u8bed\u6cd5\u7684Java\u5e93\u3002\u5229\u7528\u8fd9\u4e2a\u5e93\uff0c\u53ef\u4ee5\u4fdd\u6301\u4f60\u7684\u4ee3\u7801\u7684\u6574\u6d01\u4e25\u8c28\u5e76\u4e14\u5177\u6709\u53ef\u8bfb\u6027\uff0c\u7279\u522b\u662f\u5f53\u4f60\u4f7f\u7528\u4e86\u51fd\u6570\u5f0f\u7f16\u7a0b\u98ce\u683c\uff08functional style\uff09\uff0c\u4f8b\u5982\u4f7f\u7528\u4e86RxJava\u3002\u4f7f\u7528\u524d\uff0c\u5148\u5b89\u88c5JDK8\uff0c\u5728Android Studio\u9879\u76ee\u7ed3\u6784\u5bf9\u8bdd\u6846\u4e2d\u5c06\u5b83\u8bbe\u7f6e\u4e3a\u4f60\u7684SDK\u8def\u5f84\uff0c\u8bbe\u7f6eJAVA8_HOME\u548cJAVA7_HOME\u73af\u5883\u53d8\u91cf\uff0c\u7136\u540e\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0bbuild.gradle\u4e2d\u589e\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<br \/>\n[java]dependencies {<br \/>\n    classpath &#8216;me.tatarka:gradle-retrolambda:2.4.+&#8217;<br \/>\n}[\/java]<br \/>\n\u7136\u540e\u5728\u6bcf\u4e00\u4e2a\u6a21\u5757\u4e0b\u7684build.gradle\u4e2d\uff0c\u589e\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<br \/>\n[java]apply plugin: &#8216;retrolambda&#8217;<br \/>\nandroid {<br \/>\n    compileOptions {<br \/>\n    sourceCompatibility JavaVersion.VERSION_1_8<br \/>\n    targetCompatibility JavaVersion.VERSION_1_8<br \/>\n}<br \/>\nretrolambda {<br \/>\n    jdk System.getenv(&quot;JAVA8_HOME&quot;)<br \/>\n    oldJdk System.getenv(&quot;JAVA7_HOME&quot;)<br \/>\n    javaVersion JavaVersion.VERSION_1_7<br \/>\n}[\/java]<br \/>\nAndroid Studio\u652f\u6301\u5bf9Java8\u7684lambda\u667a\u80fd\u63d0\u793a\u3002\u5982\u679c\u4f60\u662f\u7b2c\u4e00\u6b21\u4f7f\u7528lambda\uff0c\u4ece\u4ee5\u4e0b\u4e24\u6761\u89c4\u5219\u5f00\u59cb\uff1a<\/p>\n<ul>\n<li>\u6240\u6709\u53ea\u6709\u4e00\u4e2a\u65b9\u6cd5\u7684\u63a5\u53e3\u90fd\u662f\u300clambda\u53cb\u597d\u300d\u7684\uff0c\u80fd\u591f\u88ab\u8f6c\u6362\u6210\u66f4\u52a0\u6574\u6d01\u4e25\u8c28\u7684\u8bed\u6cd5\u3002<\/li>\n<li>\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u53c2\u6570\u6216\u8005\u5176\u4ed6\u4fe1\u606f\uff0c\u5199\u4e00\u4e2a\u666e\u901a\u7684\u533f\u540d\u5185\u90e8\u7c7b\uff0c\u7136\u540e\u8ba9Android Studio\u5c06\u5b83\u8f6c\u6362\u6210\u4e00\u4e2alamdba\u8868\u8fbe\u5f0f\u3002<\/li>\n<\/ul>\n<p><strong>\u8bf7\u6ce8\u610fdex\u65b9\u6cd5\u9650\u5236\uff0c\u907f\u514d\u4f7f\u7528\u8fc7\u591a\u7684\u5e93\u3002<\/strong>\u88ab\u6253\u5305\u6210dex\u6587\u4ef6\u7684\u5b89\u5353\u5e94\u7528\uff0c\u90fd\u6709\u4e00\u4e2a\u786c\u6027\u7684\u9650\u5236\uff1a\u6700\u591a\u80fd\u670965536\u4e2a\u65b9\u6cd5\u5f15\u7528<a href=\"https:\/\/medium.com\/@rotxed\/dex-skys-the-limit-no-65k-methods-is-28e6cb40cf71\">[1]<\/a> <a href=\"http:\/\/blog.persistent.info\/2014\/05\/per-package-method-counts-for-androids.html\">[2]<\/a> <a href=\"http:\/\/jakewharton.com\/play-services-is-a-monolith\/\">[3]<\/a>\u3002\u5982\u679c\u4f60\u8d85\u51fa\u4e86\u8fd9\u4e2a\u9650\u5236\uff0c\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u4f60\u5c31\u4f1a\u770b\u5230\u4e00\u4e2a\u4e25\u91cd\u7684\u7f16\u8bd1\u9519\u8bef\u3002\u56e0\u6b64\uff0c\u4f7f\u7528\u5c3d\u91cf\u5c11\u7684\u5e93\uff0c\u5e76\u4f7f\u7528<a href=\"https:\/\/github.com\/mihaip\/dex-method-counts\">dex-method-counts<\/a>\u5de5\u5177\u6765\u51b3\u5b9a\u5728\u4fdd\u8bc1\u4e0d\u8d85\u51fa\u9650\u5236\u7684\u524d\u63d0\u4e0b\uff0c\u6709\u54ea\u4e9b\u5e93\u53ef\u4ee5\u4f7f\u7528\u3002\u7279\u522b\u8981\u907f\u514d\u4f7f\u7528Guava\u5e93\uff0c\u56e0\u4e3a\u5b83\u5305\u542b\u4e86\u8d85\u8fc713k\u4e2a\u65b9\u6cd5\u3002<\/p>\n<p>\u5728Android\u5e94\u7528\u5f00\u53d1\u4e2d\uff0c\u9996\u9009Fragment\u6765\u663e\u793aUI\u3002Fragment\u662f\u53ef\u91cd\u7528\u7684\u7528\u6237\u4ea4\u4e92\u754c\u9762\uff0c\u5e76\u4e14\u53ef\u4ee5\u5c06Fragment\u7ec4\u5408\u5728\u4e00\u8d77\u3002\u6211\u4eec\u63a8\u8350\u4f7f\u7528Fragment\u6765\u663e\u793a\u7528\u6237\u4ea4\u4e92\u754c\u9762\uff0c\u800c\u4e0d\u662f\u4f7f\u7528Activity\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u7406\u7531\uff1a<\/p>\n<ul>\n<li>\u00a0<strong>\u5b9e\u73b0\u591a\u89c6\u56fe\u5e03\u5c40\u3002<\/strong>\u5c06\u624b\u673a\u5e94\u7528\u6269\u5c55\u81f3\u5e73\u677f\u7684\u4e3b\u8981\u65b9\u6cd5\u4fbf\u662f\u5229\u7528Fragment\u3002\u5229\u7528Fragment\uff0c\u53ef\u4ee5\u8ba9\u89c6\u56feA\u548cB\u90fd\u663e\u793a\u5728\u4e00\u4e2a\u5e73\u677f\u5c4f\u5e55\u4e0a\uff0c\u800c\u5728\u624b\u673a\u5c4f\u5e55\u4e0a\uff0c\u89c6\u56feA\u548cB\u90fd\u5360\u4e00\u6574\u5757\u5c4f\u5e55\u3002\u5982\u679c\u4f60\u7684\u5e94\u7528\u4ece\u4e00\u5f00\u59cb\u5c31\u7528Frament\u6765\u5b9e\u73b0\uff0c\u90a3\u4e48\u4f60\u5f88\u5bb9\u6613\u5c31\u80fd\u5c06\u4f60\u7684\u5e94\u7528\u9002\u914d\u5230\u5c4f\u5e55\u5927\u5c0f\u4e0d\u540c\u7684\u8bbe\u5907\u4e0a\u3002<\/li>\n<li><strong>\u5c4f\u4e0e\u5c4f\u4e4b\u95f4\u7684\u901a\u4fe1\u3002<\/strong> \u5b89\u5353API\u5e76\u6ca1\u6709\u63d0\u4f9b\u4e00\u4e2a\u6070\u5f53\u7684\u65b9\u6cd5\u5c06\u590d\u6742\u7684\u6570\u636e\uff08\u4f8b\u5982\uff0c\u4e00\u4e9bJava\u5bf9\u8c61\uff09\u4ece\u4e00\u4e2aActivity\u53d1\u9001\u5230\u53e6\u5916\u4e00\u4e2aActivity\u4e2d\u3002\u4f46\u662f\u5229\u7528Fragment\u65f6\uff0c\u4ee5activity\u5b9e\u4f8b\u4e3a\u901a\u4fe1\u7ba1\u9053\uff0c\u53ef\u4ee5\u5b9e\u73b0\u8be5activity\u4e0b\u7684\u5b50fragment\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u5373\u4f7f\u8fd9\u79cd\u65b9\u6cd5\u4f18\u4e8eActivity\u4e4b\u95f4\u7684\u901a\u4fe1\uff0c\u4f60\u53ef\u80fd\u4ecd\u65e7\u9700\u8981\u4e00\u4e2a\u4e8b\u4ef6\u603b\u7ebf\u7684\u67b6\u6784\uff0c\u8003\u8651\u4f7f\u7528<a href=\"https:\/\/square.github.io\/otto\/\">Otto<\/a>\u6216\u8005<a href=\"https:\/\/github.com\/greenrobot\/EventBus\">greenrobot EventBus<\/a>\u3002<\/li>\n<li><strong>Fragment\u6709\u66f4\u597d\u7684\u666e\u9002\u6027\uff0c\u800c\u4e0d\u4ec5\u4ec5\u53ea\u662f\u5b9e\u73b0UI\u3002<\/strong>\u4f60\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e2a\u6ca1\u6709UI\u7684fragment\uff0c\u4f5c\u4e3aactivity\u540e\u53f0\u8fd0\u884c\u7684\u300c\u5de5\u4eba\u300d\u3002\u4f60\u4e5f\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u70b9\u5b50\u53d1\u6325\u7684\u66f4\u6dcb\u6f13\u5c3d\u81f4\u4e00\u70b9\uff0c\u6bd4\u5982\u521b\u5efa\u4e00\u4e2afragment\u4e13\u95e8\u7528\u4e8e\u5b9e\u73b0fragment\u7684\u6539\u53d8\u903b\u8f91\uff0c\u800c\u4e0d\u662f\u5c06\u8fd9\u4e9b\u903b\u8f91\u5199\u5728activity\u4e2d\u3002<\/li>\n<li><strong>\u751a\u81f3ActionBar\u4e5f\u53ef\u4ee5\u5728fragment\u4e2d\u7ba1\u7406\u3002<\/strong>\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u6ca1\u6709UI\u7684fragment\uff0c\u53ea\u7528\u4e8e\u7ba1\u7406ActionBar\uff0c\u6216\u8005\u5728\u6bcf\u4e00\u4e2a\u5f53\u524d\u53ef\u89c1\u7684fragment\u4e2d\u628a\u81ea\u5df1\u9700\u8981\u7684action\u9879\u6dfb\u52a0\u5230\u7236activity\u7684ActionBar\u4e0a\u3002<a href=\"http:\/\/www.grokkingandroid.com\/adding-action-items-from-within-fragments\/\">\u9605\u8bfb\u66f4\u591a\u5185\u5bb9<\/a>\u3002<\/li>\n<\/ul>\n<p>\u867d\u7136\u6211\u4eec\u5efa\u8bae\u4f7f\u7528fragment\uff0c\u4f46\u662f\u6211\u4eec\u4e0d\u5efa\u8bae\u5927\u91cf\u4f7f\u7528<a href=\"https:\/\/developer.android.com\/about\/versions\/android-4.2.html#NestedFragments\">\u5d4c\u5957\u7684fragment<\/a>\uff0c\u56e0\u4e3a\u53ef\u80fd\u4f1a\u5f15\u8d77\u201c\u5957\u5a03\u5f0fbug\u201d\uff08<a href=\"http:\/\/delyan.me\/android-s-matryoshka-problem\/\">matryoshka bugs<\/a>\uff09\u3002\u53ea\u5728\u5408\u7406\u7684\u60c5\u51b5\u4e0b\uff08\u4f8b\u5982\uff0c\u6c34\u5e73\u6ed1\u52a8\u7684ViewPager\u4e2d\u7684fragment\u5d4c\u5957\u5728\u4e00\u4e2a\u6a21\u62df\u5c4f\u5e55\u7684fragment\u4e2d\uff09\u6216\u8005\u7ecf\u8fc7\u6df1\u601d\u719f\u8651\u65f6\uff0c\u624d\u4f7f\u7528\u5d4c\u5957\u7684fragment\u3002<\/p>\n<p>\u4ece\u67b6\u6784\u5c42\u9762\u6765\u8bb2\uff0c\u4f60\u7684\u5e94\u7528\u5e94\u8be5\u6709\u4e00\u4e2a\u9876\u5c42\u7684activity\uff0c\u5176\u4e2dactivity\u4e2d\u5305\u542b\u4e86\u5927\u90e8\u5206\u7684\u4e1a\u52a1\u76f8\u5173\u7684fragment\u3002\u4f60\u4e5f\u53ef\u4ee5\u6709\u5176\u4ed6\u7684\u8f85\u52a9activity\uff0c\u53ea\u8981\u8fd9\u4e9bactivity\u548c\u4e3bactivity\u7684\u901a\u4fe1\u8db3\u591f\u7b80\u5355\uff0c\u80fd\u591f\u901a\u8fc7<a href=\"http:\/\/developer.android.com\/reference\/android\/content\/Intent.html#setData%28android.net.Uri%29\"><code>Intent.setData()<\/code><\/a>\u6216\u8005<a href=\"http:\/\/developer.android.com\/reference\/android\/content\/Intent.html#setAction%28java.lang.String%29\"><code>Intent.setAction()<\/code><\/a>\u6216\u8005\u5176\u4ed6\u7b80\u5355\u7684\u65b9\u5f0f\u5b9e\u73b0\u5373\u53ef\u3002<\/p>\n<h2>Java\u5305\u7ed3\u6784<\/h2>\n<p>Android\u5e94\u7528\u7a0b\u5e8f\u7684Java\u5305\u7ed3\u6784\u53ef\u4ee5\u7528\u57fa\u672c\u4e0a\u8fd1\u4f3c\u4e8e<a href=\"http:\/\/en.wikipedia.org\/wiki\/Model%E2%80%93view%E2%80%93controller\">\u6a21\u578b-\u89c6\u56fe-\u63a7\u5236\u5668<\/a>\u7ed3\u6784\u3002\u5bf9\u4e8eAndroid\uff0c<a href=\"http:\/\/www.informit.com\/articles\/article.aspx?p=2126865\">Fragment\u548cActivity\u5b9e\u9645\u4e0a\u5c31\u662f\u63a7\u5236\u7c7b<\/a>\u3002\u540c\u65f6\uff0c\u8fd9\u4e24\u8005\u4e5f\u662f\u7528\u6237\u4ea4\u4e92\u754c\u9762\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u6b64\uff0c\u8fd9\u4e24\u8005\u4e5f\u662f\u89c6\u56fe\u3002<\/p>\n<p>\u7531\u4e8e\u4e0a\u8ff0\u539f\u56e0\uff0c\u5c06fragment\uff08\u6216\u8005activity\uff09\u4e25\u683c\u7684\u5f52\u7c7b\u4e3a\u63a7\u5236\u5668\u6216\u8005\u662f\u89c6\u56fe\u662f\u975e\u5e38\u56f0\u96be\uff0c\u4e0d\u5408\u7406\u7684\u3002\u6240\u4ee5\uff0c\u66f4\u5408\u7406\u7684\u505a\u6cd5\u662f\u628afragment\u5b58\u653e\u5728\u4e13\u6709\u7684fragment\u5305\u5185\u3002\u5982\u679c\u4f60\u9075\u5faa\u4e86\u524d\u4e00\u90e8\u5206\u7684\u5efa\u8bae\uff0c\u90a3\u4e48\u53ef\u4ee5\u5c06activity\u5b58\u653e\u5728\u6700\u9876\u5c42\u7684\u5305\u4e0b\u3002\u5982\u679c\u4f60\u8ba1\u5212\u521b\u5efa\u591a\u4e8e2\u4e2a\u62163\u4e2aactivity\uff0c\u90a3\u4e48\u521b\u5efa\u4e00\u4e2aactivities\u5305\u3002<\/p>\n<p>\u5426\u5219\uff08\u8bd1\u8005\u6ce8\uff1a\u5982\u679c\u6ca1\u6709fragment\u548cactivity\uff09\uff0c\u5305\u7ed3\u6784\u770b\u8d77\u6765\u5c31\u662f\u4e00\u4e2a\u5178\u578b\u7684MVC\u7ed3\u6784\u3002\u6709\u4e00\u4e2amodels\u5305\uff0c\u5b58\u653e\u4e3b\u8981\u7528\u4e8eJSON\u89e3\u6790\u65f6API\u8fd4\u56de\u503c\u7684POJO\u5bf9\u8c61\uff1b\u4e00\u4e2aviews\u5305\uff0c\u5b58\u653e\u4f60\u81ea\u5b9a\u4e49\u7684\u89c6\u56fe\uff0c\u901a\u77e5\uff0caction bar\u89c6\u56fe\u548c\u5c0f\u90e8\u4ef6\u7b49\u3002Adapter\u7684\u5f52\u7c7b\u6bd4\u8f83\u6a21\u7cca\uff0c\u662f\u5904\u4e8e\u6570\u636e\u548c\u89c6\u56fe\u4e4b\u95f4\u7684\u4f4d\u7f6e\u3002\u4f46\u662f\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0cadapter\u9700\u8981\u5728getView()\u51fd\u6570\u4e2d\u5f15\u5165\u4e00\u4e9b\u89c6\u56fe\uff0c\u6240\u4ee5\u53ef\u4ee5\u5728views\u5305\u4e0b\u5efa\u4e00\u4e2aadapters\u5305\u6765\u5b58\u653eadpater\u3002<\/p>\n<p>\u4e00\u4e9b\u63a7\u5236\u7c7b\u662f\u6574\u4e2a\u5e94\u7528\u7a0b\u5e8f\u90fd\u9700\u8981\u4f7f\u7528\u5230\u7684\uff0c\u4e5f\u66f4\u52a0\u63a5\u8fd1\u5b89\u5353\u7cfb\u7edf\u5e95\u5c42\u3002\u8fd9\u4e9b\u63a7\u5236\u7c7b\u5b58\u653e\u5728managers\u5305\u4e0b\u3002\u5404\u79cd\u6570\u636e\u5904\u7406\u7c7b\uff0c\u4f8b\u5982\u300cDateUtils\u300d\uff0c\u5b58\u653e\u5728utils\u5305\u4e0b\u3002\u8d1f\u8d23\u4e0e\u540e\u7aef\u670d\u52a1\u5668\u8fdb\u884c\u4ea4\u4e92\u7684\u7c7b\u5b58\u653e\u5728network\u5305\u4e0b\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u6309\u9760\u8fd1\u540e\u7aef\u670d\u52a1\u5668\u5230\u9760\u8fd1\u7528\u6237\u7684\u987a\u5e8f\u6392\u5217\uff0c\u5305\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<p>[java]com.futurice.project<br \/>\n\u251c\u2500 network<br \/>\n\u251c\u2500 models<br \/>\n\u251c\u2500 managers<br \/>\n\u251c\u2500 utils<br \/>\n\u251c\u2500 fragments<br \/>\n\u2514\u2500 views<br \/>\n   \u251c\u2500 adapters<br \/>\n   \u251c\u2500 actionbar<br \/>\n   \u251c\u2500 widgets<br \/>\n   \u2514\u2500 notifications[\/java]<\/p>\n<h2>\u00a0\u8d44\u6e90<\/h2>\n<p><strong>\u547d\u540d<\/strong>\u3002\u9075\u5faa\u4ee5\u7c7b\u578b\u4f5c\u4e3a\u524d\u7f00\u7684\u4e60\u60ef\uff0c\u50cftype_foo_bar.xml\u3002\u4f8b\u5982\uff1afragment_contact_details.xml\uff0cview_primary_button.xml\uff0cactivity_main.xml\u3002<\/p>\n<p><strong>\u7ba1\u7406\u597d\u5e03\u5c40XML\u4ee3\u7801<\/strong>\u3002\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u5982\u4f55\u6309\u7167\u4e00\u5b9a\u7684\u683c\u5f0f\u6765\u7ba1\u7406XML\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u51e0\u4e2a\u4e60\u60ef\uff1a<\/p>\n<ul>\n<li>\u4e00\u4e2a\u5c5e\u6027\u5360\u5355\u72ec\u7684\u4e00\u884c\uff0c\u7f29\u8fdb4\u4e2a\u7a7a\u683c<\/li>\n<li>android:id\u603b\u662f\u7b2c\u4e00\u4e2a\u5c5e\u6027<\/li>\n<li>android:layout_****\u5c5e\u6027\u653e\u5728\u9876\u90e8<\/li>\n<li>style\u5c5e\u6027\u653e\u5728\u5e95\u90e8<\/li>\n<li>\u6807\u7b7e\u5173\u95ed\/&gt;\u72ec\u5360\u4e00\u884c\uff0c\u4fbf\u4e8e\u8c03\u6574\u5c5e\u6027\u7684\u987a\u5e8f\u548c\u589e\u52a0\u5c5e\u6027<\/li>\n<li>\u4e0d\u8981\u5728android:text\u4e2d\u786c\u7f16\u7801\u5b57\u7b26\u4e32\uff0c\u8003\u8651\u4f7f\u7528Android Studio\u4e2d\u63d0\u4f9b\u7684<a href=\"http:\/\/tools.android.com\/tips\/layout-designtime-attributes\">Designtime attributes<\/a>\u529f\u80fd<\/li>\n<\/ul>\n<p>[java]&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br \/>\n&lt;LinearLayout<br \/>\n    xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;<br \/>\n    xmlns:tools=&quot;http:\/\/schemas.android.com\/tools&quot;<br \/>\n    android:layout_width=&quot;match_parent&quot;<br \/>\n    android:layout_height=&quot;match_parent&quot;<br \/>\n    android:orientation=&quot;vertical&quot;<br \/>\n    &gt;<br \/>\n    &lt;TextView<br \/>\n        android:id=&quot;@+id\/name&quot;<br \/>\n        android:layout_width=&quot;match_parent&quot;<br \/>\n        android:layout_height=&quot;wrap_content&quot;<br \/>\n        android:layout_alignParentRight=&quot;true&quot;<br \/>\n        android:text=&quot;@string\/name&quot;<br \/>\n        style=&quot;@style\/FancyText&quot;<br \/>\n        \/&gt;<br \/>\n    &lt;include layout=&quot;@layout\/reusable_part&quot; \/&gt;<br \/>\n&lt;\/LinearLayout&gt;[\/java]<br \/>\n\u6700\u91cd\u8981\u7684\u89c4\u5219\u662f\uff0c\u5728\u5e03\u5c40XML\u4e2d\u5b9a\u4e49android:layout_****\u5c5e\u6027\uff0c\u800c\u5176\u4ed6\u7684android:****\u5c5e\u6027\u5219\u5728\u6837\u5f0fXML\u4e2d\u5b9a\u4e49\u3002\u8fd9\u4e2a\u89c4\u5219\u6709\u4f8b\u5916\u7684\u60c5\u51b5\uff0c\u4f46\u662f\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u662f\u9002\u7528\u7684\u3002\u8fd9\u4e2a\u89c4\u5219\u4fdd\u8bc1\u53ea\u6709layout\u5c5e\u6027\uff08positioning, margin, sizing\uff09\u548c\u5185\u5bb9\u5c5e\u6027\u5728\u5e03\u5c40\u6587\u4ef6\u4e2d\uff0c\u5176\u4ed6\u7684\u5916\u89c2\u5c5e\u6027\uff08colors, padding, font)\u5219\u5b9a\u4e49\u5728\u6837\u5f0f\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u4f8b\u5916\u7684\u60c5\u51b5\u6709\uff1a<\/p>\n<ul>\n<li>android:id\u663e\u7136\u5e94\u8be5\u5728\u5e03\u5c40\u6587\u4ef6\u4e2d\u5b9a\u4e49<\/li>\n<li>LinearLayout\u7684android:orientation\u5c5e\u6027\u5728\u5e03\u5c40\u6587\u4ef6\u4e2d\u5b9a\u4e49\u66f4\u4e3a\u5408\u7406<\/li>\n<li>android:text\u5e94\u8be5\u5728\u5e03\u5c40\u6587\u4ef6\u4e2d\u5b9a\u4e49\uff0c\u56e0\u4e3a\u5b83\u5b9a\u4e49\u4e86\u7279\u5b9a\u7684\u5185\u5bb9\uff08\u8bd1\u8005\u6ce8\uff1a\u5c5e\u4e8e\u5185\u5bb9\u5c5e\u6027\uff09<\/li>\n<li>\u6709\u65f6\u5019\u521b\u5efa\u901a\u7528\u7684\u6837\u5f0f\u6587\u4ef6\u6765\u5b9a\u4e49android:layout_width\u548candroid:layout_height\u66f4\u52a0\u5408\u7406\uff0c\u4f46\u662f\u4e00\u822c\u60c5\u51b5\u4e0b\u8fd9\u4e24\u4e2a\u5c5e\u6027\u5e94\u8be5\u5728\u5e03\u5c40\u6587\u4ef6\u4e2d\u5b9a\u4e49\u3002<\/li>\n<\/ul>\n<p><strong>\u4f7f\u7528\u6837\u5f0f\u3002<\/strong>\u5728\u9879\u76ee\u4e2d\uff0c\u91cd\u590d\u7684view\u7684\u5916\u89c2\uff08\u8bd1\u8005\u6ce8\uff1a\u91cd\u590d\u7684view\u5c5e\u6027\uff09\u662f\u5f88\u5e38\u89c1\u7684\uff0c\u56e0\u6b64\uff0c\u57fa\u672c\u4e0a\u6bcf\u4e2a\u9879\u76ee\u90fd\u9700\u8981\u6070\u5f53\u7684\u4f7f\u7528\u6837\u5f0f\u3002\u5728\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u81f3\u5c11\u5e94\u8be5\u6709\u4e00\u4e2a\u901a\u7528\u7684\u6587\u672c\u5185\u5bb9\u7684\u6837\u5f0f\u3002\u4f8b\u5982\uff1a<br \/>\n[java]&lt;style name=&quot;ContentText&quot;&gt;<br \/>\n    &lt;item name=&quot;android:textSize&quot;&gt;@dimen\/font_normal&lt;\/item&gt;<br \/>\n    &lt;item name=&quot;android:textColor&quot;&gt;<br \/>\n     &lt;a href=&quot;http:\/\/www.jobbole.com\/members\/color\/&quot; rel=&quot;nofollow&quot;&gt;@color&lt;\/a&gt;\/basic_black&lt;\/item&gt;<br \/>\n&lt;\/style&gt;[\/java]<br \/>\n\u5e94\u7528\u5230TextView\u5f53\u4e2d\u5982\u4e0b\uff1a<br \/>\n[java]&lt;TextView<br \/>\n    android:layout_width=&quot;wrap_content&quot;<br \/>\n    android:layout_height=&quot;wrap_content&quot;<br \/>\n    android:text=&quot;@string\/price&quot;<br \/>\n    style=&quot;@style\/ContentText&quot;<br \/>\n    \/&gt;[\/java]<br \/>\n\u4f60\u4e5f\u53ef\u80fd\u9700\u8981\u7ed9button\u6309\u94ae\u5199\u4e00\u4e2a\u901a\u7528\u7684\u6837\u5f0f\uff0c \u4e0d\u8fc7\u4e0d\u8981\u53ea\u505c\u7559\u5728\u7ed9\u6587\u672c\u5185\u5bb9\u548c\u6309\u94ae\u5199\u901a\u7528\u6837\u5f0f\u4e0a\u3002\u7ee7\u7eed\u7684\u6df1\u5165\u5e94\u7528\u8fd9\u4e2a\u601d\u60f3\uff0c\u628aView\u7684\u76f8\u5173\u7684\u91cd\u590d\u7684\u5c5e\u6027\u5199\u6210\u901a\u7528\u7684\u6837\u5f0f\u3002<\/p>\n<p><strong>\u628a\u5927\u7684\u6837\u5f0f\u6587\u4ef6\u5206\u6210\u591a\u4e2a\u5c0f\u6837\u5f0f\u6587\u4ef6\u3002<\/strong>\u4f60\u4e0d\u4e00\u5b9a\u975e\u5f97\u53ea\u6709\u4e00\u4e2astyles.xml\u6587\u4ef6\u3002Android SDK\u652f\u6301\u4ee5\u975e\u4f20\u7edf\u65b9\u5f0f\u547d\u540d\u7684\u6837\u5f0f\u6587\u4ef6\u3002\u6587\u4ef6\u540dstyles\u5e76\u6ca1\u6709\u7279\u522b\u7684\u4f5c\u7528\uff0c\u8d77\u4f5c\u7528\u7684\u53ea\u662f\u6587\u4ef6\u4e2d\u7684XML\u6807\u7b7e&lt;style&gt;\u3002\u56e0\u6b64\uff0c\u4e00\u4e2a\u9879\u76ee\u4e2d\u53ef\u4ee5\u540c\u65f6\u6709\u8fd9\u4e9b\u6837\u5f0f\u6587\u4ef6<code>styles.xml<\/code>, <code>styles_home.xml<\/code>,<code>styles_item_details.xml<\/code>, <code>styles_forms.xml<\/code>\u3002\u4e0d\u50cf\u8d44\u6e90\u76ee\u5f55\u540d\u90a3\u6837\u5728\u7f16\u8bd1\u65f6\u6709\u7279\u6b8a\u610f\u4e49\uff0c\u5728res\/values\u4e0b\u7684\u6587\u4ef6\u540d\u662f\u4efb\u610f\u7684\u3002<\/p>\n<p><strong>colors.xml\u662f\u989c\u8272\u8c03\u8272\u677f\u3002<\/strong>colors.xml\u4e2d\u5e94\u8be5\u53ea\u5305\u542b\u4e00\u4e9b\u989c\u8272\u540d\u5b57\u5230RGBA\u989c\u8272\u503c\u7684\u6620\u5c04\u3002\u4e0d\u8981\u5728colors.xml\u4e2d\u4e3a\u4e0d\u540c\u7684\u6309\u94ae\u5b9a\u4e49\u4e0d\u540c\u7684\u989c\u8272\u3002<\/p>\n<p>\u4e0d\u8981\u50cf\u4e0b\u9762\u8fd9\u6837\u505a\uff1a<br \/>\n[java]&lt;resources&gt;<br \/>\n    &lt;color name=&quot;button_foreground&quot;&gt;#FFFFFF&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;button_background&quot;&gt;#2A91BD&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;comment_background_inactive&quot;&gt;#5F5F5F&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;comment_background_active&quot;&gt;#939393&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;comment_foreground&quot;&gt;#FFFFFF&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;comment_foreground_important&quot;&gt;#FF9D2F&lt;\/color&gt;<br \/>\n    &#8230;<br \/>\n    &lt;color name=&quot;comment_shadow&quot;&gt;#323232&lt;\/color&gt;[\/java]<br \/>\n\u5982\u679c\u4f60\u50cf\u4e0a\u9762\u8fd9\u79cd\u5f62\u5f0f\u6765\u5b9a\u4e49\u989c\u8272\uff0c\u4f60\u5f88\u5feb\u4fbf\u5f00\u59cb\u5b9a\u4e49\u91cd\u590d\u7684RGBA\u989c\u8272\u503c\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u6539\u53d8\u57fa\u7840\u8272\u503c\u65f6\uff0c\u5de5\u4f5c\u5c06\u4f1a\u53d8\u5f97\u975e\u5e38\u590d\u6742\u3002\u5e76\u4e14\uff0c\u8fd9\u4e9b\u989c\u8272\u5b9a\u4e49\u8ddf\u4e0a\u4e0b\u6587\u6709\u5173\uff0c\u50cf\u201dbutton\u201d\u548c\u201dcomment\u201d\u8fd9\u4e9b\uff0c\u5e94\u8be5\u5728\u6309\u94ae\u7684\u6837\u5f0f\u6587\u4ef6\u4e2d\u5b9a\u4e49\uff0c\u800c\u4e0d\u662f\u5728colors.xml\u4e2d\u5b9a\u4e49\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u8fd9\u6837\u505a\uff1a<br \/>\n[java]&lt;resources&gt;<br \/>\n    &lt;!&#8211; grayscale &#8211;&gt;<br \/>\n    &lt;color name=&quot;white&quot;     &gt;#FFFFFF&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;gray_light&quot;&gt;#DBDBDB&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;gray&quot;      &gt;#939393&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;gray_dark&quot; &gt;#5F5F5F&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;black&quot;     &gt;#323232&lt;\/color&gt;<br \/>\n    &lt;!&#8211; basic colors &#8211;&gt;<br \/>\n    &lt;color name=&quot;green&quot;&gt;#27D34D&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;blue&quot;&gt;#2A91BD&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;orange&quot;&gt;#FF9D2F&lt;\/color&gt;<br \/>\n    &lt;color name=&quot;red&quot;&gt;#FF432F&lt;\/color&gt;<br \/>\n&lt;\/resources&gt;[\/java]<br \/>\n\u50cf\u5e94\u7528\u7a0b\u5e8f\u7684\u8bbe\u8ba1\u8005\u8981\u8fd9\u4efd\u989c\u8272\u8c03\u8272\u677f\u3002\u540d\u5b57\u4e0d\u4e00\u5b9a\u975e\u5f97\u662f\u989c\u8272\u7684\u540d\u5b57\uff0c\u4f8b\u5982\u201dgreen\u201d, \u201cblue\u201d\u7b49\u3002\u50cf\u201dbrand_primary\u201d, \u201cbrand_secondary\u201d, \u201cbrand_negative\u201d\u8fd9\u4e2d\u7c7b\u578b\u7684\u540d\u5b57\u4e5f\u662f\u5b8c\u5168\u53ef\u4ee5\u63a5\u53d7\u7684\u3002\u4ee5\u8fd9\u79cd\u683c\u5f0f\u6765\u7ba1\u7406\u989c\u8272\uff0c\u5728\u6539\u53d8\u989c\u8272\u503c\u7684\u65f6\u5019\u4f1a\u5f88\u65b9\u4fbf\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u5f88\u76f4\u89c2\u7684\u770b\u5230\u4f7f\u7528\u4e86\u591a\u5c11\u4e2a\u4e0d\u540c\u7684\u989c\u8272\u3002\u5982\u679c\u8981\u5c55\u73b0\u4e00\u4e2a\u6f02\u4eae\u7684UI\u754c\u9762\uff0c\u51cf\u5c11\u989c\u8272\u79cd\u7c7b\u7684\u4f7f\u7528\u662f\u5f88\u91cd\u8981\u7684\u4e00\u70b9\u3002<\/p>\n<p><strong>\u50cf\u7ba1\u7406colors.xml\u90a3\u6837\u6765\u7ba1\u7406dimens.xml\u3002<\/strong>\u540c\u6837\uff0c\u4f60\u53ef\u4ee5\u5b9a\u4e49\u95f4\u9694\uff0c\u5b57\u4f53\u5927\u5c0f\u7b49\u5c5e\u6027\u7684\u201d\u8c03\u8272\u677f\u201d\uff0c\u7406\u7531\u548c\u7ba1\u7406\u989c\u8272\u7684\u7406\u7531\u4e00\u6837\u3002\u4e0b\u9762\u662fdimens\u6587\u4ef6\u7684\u4e00\u4e2a\u597d\u6837\u4f8b\uff1a<br \/>\n[java]&lt;resources&gt;<br \/>\n    &lt;!&#8211; font sizes &#8211;&gt;<br \/>\n    &lt;dimen name=&quot;font_larger&quot;&gt;22sp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;font_large&quot;&gt;18sp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;font_normal&quot;&gt;15sp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;font_small&quot;&gt;12sp&lt;\/dimen&gt;<br \/>\n    &lt;!&#8211; typical spacing between two views &#8211;&gt;<br \/>\n    &lt;dimen name=&quot;spacing_huge&quot;&gt;40dp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;spacing_large&quot;&gt;24dp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;spacing_normal&quot;&gt;14dp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;spacing_small&quot;&gt;10dp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;spacing_tiny&quot;&gt;4dp&lt;\/dimen&gt;<br \/>\n    &lt;!&#8211; typical sizes of views &#8211;&gt;<br \/>\n    &lt;dimen name=&quot;button_height_tall&quot;&gt;60dp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;button_height_normal&quot;&gt;40dp&lt;\/dimen&gt;<br \/>\n    &lt;dimen name=&quot;button_height_short&quot;&gt;32dp&lt;\/dimen&gt;<br \/>\n&lt;\/resources&gt;[\/java]<br \/>\n\u4f60\u5e94\u8be5\u4f7f\u7528\uff08\u8bd1\u8005\u6ce8\uff1adimens\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684\uff09spacing_****\u5c3a\u5bf8\u6765\u5b9e\u73b0\u89c6\u56fe\u5e03\u5c40\u7684margin\u548cpadding\u5c5e\u6027\uff0c\u800c\u4e0d\u662f\u5728\u5e03\u5c40\u6587\u4ef6\u4e2d\u786c\u7f16\u7801\u5c5e\u6027\u503c\uff0c\u8fd9\u4e00\u70b9\u5f88\u50cf\u5b57\u7b26\u4e32\u7684\u4e00\u822c\u5904\u7406\u65b9\u5f0f\u3002\u8fd9\u4f1a\u4f7f\u5e94\u7528\u4fdd\u6301\u4e00\u81f4\u7684\u89c2\u611f\uff0c\u540c\u65f6\u5728\u7ba1\u7406\u548c\u66f4\u6539\u6837\u5f0f\u548c\u5e03\u5c40\u65f6\u4e5f\u66f4\u52a0\u65b9\u4fbf\u3002<\/p>\n<p><strong>\u907f\u514d\u6df1\u5c42\u7ea7\u89c6\u56fe\u3002<\/strong>\u6709\u65f6\u5019\uff0c\u4f60\u60f3\u8981\u5728\u539f\u6709\u7684\u89c6\u56fexml\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684LinearLayout\uff0c\u4ee5\u6b64\u6765\u5b9e\u73b0\u4e00\u4e2a\u65b0\u7684\u89c6\u56fe\u3002\u90a3\u4e48\uff0c\u5f88\u6709\u53ef\u80fd\u53d1\u751f\u4e0b\u9762\u7684\u60c5\u51b5\uff1a<br \/>\n[java]&lt;LinearLayout<br \/>\n    android:layout_width=&quot;match_parent&quot;<br \/>\n    android:layout_height=&quot;match_parent&quot;<br \/>\n    android:orientation=&quot;vertical&quot;<br \/>\n    &gt;<br \/>\n    &lt;RelativeLayout<br \/>\n        &#8230;<br \/>\n        &gt;<br \/>\n        &lt;LinearLayout<br \/>\n            &#8230;<br \/>\n            &gt;<br \/>\n            &lt;LinearLayout<br \/>\n                &#8230;<br \/>\n                &gt;<br \/>\n                &lt;LinearLayout<br \/>\n                    &#8230;<br \/>\n                    &gt;<br \/>\n                &lt;\/LinearLayout&gt;<br \/>\n            &lt;\/LinearLayout&gt;<br \/>\n        &lt;\/LinearLayout&gt;<br \/>\n    &lt;\/RelativeLayout&gt;<br \/>\n&lt;\/LinearLayout&gt;[\/java]<br \/>\n\u5373\u4f7f\u4f60\u6ca1\u6709\u76f4\u63a5\u5728\u4e00\u4e2a\u5e03\u5c40\u6587\u4ef6\u4e2d\u770b\u5230\u4e0a\u8ff0\u7684\u60c5\u51b5\uff0c\u5f53\u4f60\u5728\u628a\u4e00\u4e2a\u89c6\u56fe\u586b\u5145\uff08\u5728Java\u4ee3\u7801\u4e2d\uff09\u5230\u53e6\u4e00\u4e2a\u89c6\u56fe\u4e2d\u65f6\uff0c\u4e0a\u8ff0\u7684\u60c5\u51b5\u4e5f\u6709\u53ef\u80fd\u53d1\u751f\u3002<\/p>\n<p>\u8fd9\u53ef\u80fd\u5f15\u53d1\u4e00\u7cfb\u5217\u7684\u95ee\u9898\u3002\u53ef\u80fd\u4f1a\u6709\u6027\u80fd\u95ee\u9898\uff0c\u56e0\u4e3a\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5904\u7406\u5668\u9700\u8981\u5904\u7406\u975e\u5e38\u590d\u6742\u7684UI\u6811\u3002\u53e6\u5916\u4e00\u4e2a\u66f4\u4e25\u91cd\u7684\u9519\u8bef\u662f<a href=\"http:\/\/stackoverflow.com\/questions\/2762924\/java-lang-stackoverflow-error-suspected-too-many-views\">\u6808\u6ea2\u51fa\u9519\u8bef<\/a>\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u5c3d\u53ef\u80fd\u7684\u51cf\u5c11\u89c6\u56fe\u7684\u5c42\u7ea7\uff1a\u5b66\u4e60\u5982\u4f55\u4f7f\u7528<a href=\"https:\/\/developer.android.com\/guide\/topics\/ui\/layout\/relative.html\">RelativeLayout<\/a>\uff0c\u5982\u4f55<a href=\"http:\/\/developer.android.com\/training\/improving-layouts\/optimizing-layout.html\">\u4f18\u5316\u5e03\u5c40<\/a>\u548c\u5982\u5982\u4f55\u4f7f\u7528<a href=\"http:\/\/stackoverflow.com\/questions\/8834898\/what-is-the-purpose-of-androids-merge-tag-in-xml-layouts\">&lt;merge&gt;\u6807\u7b7e<\/a>\u3002<\/p>\n<p><strong>\u8c28\u614e\u5904\u7406\u4e0eWebView\u76f8\u5173\u7684\u95ee\u9898\u3002<\/strong>\u5f53\u4f60\u5fc5\u987b\u663e\u793a\u4e00\u4e2a\u7f51\u9875\u65f6\uff0c\u4f8b\u5982\u4e00\u7bc7\u65b0\u95fb\uff0c\u4e0d\u8981\u5728\u5ba2\u6237\u7aef\u4e2d\u5904\u7406HTML\uff0c\u66f4\u597d\u7684\u505a\u6cd5\u662f\u5411\u540e\u7aef\u7a0b\u5e8f\u5458\u8bf7\u6c42\u201d\u7eaf\u51c0\u201d\u7684HTML\u4ee3\u7801\u3002\u5f53\u4f60\u628aWebView\u7ed1\u5b9a\u5230activity\u4e0a\uff0c\u800c\u4e0d\u662f\u7ed1\u5b9a\u5230ApplicationContext\u4e0a\u65f6\uff0c<a href=\"http:\/\/stackoverflow.com\/questions\/3130654\/memory-leak-in-webview\">WebView\u4e5f\u53ef\u80fd\u4f1a\u6cc4\u9732\u5185\u5b58<\/a>\u3002\u4e0d\u8981\u4f7f\u7528WebView\u6765\u5c55\u73b0\u7b80\u5355\u6587\u5b57\u6216\u8005\u6309\u94ae\uff0c\u7528TextView\u548cButton\u6765\u5b9e\u73b0\u3002<\/p>\n<h2>\u00a0\u6d4b\u8bd5\u6846\u67b6<\/h2>\n<p>Android SDK\u63d0\u4f9b\u7684\u6d4b\u8bd5\u6846\u67b6\u4ecd\u65e7\u4e0d\u591f\u5b8c\u5584\uff0c\u7279\u522b\u662fUI\u6d4b\u8bd5\u3002Android Gradle\u73b0\u5728\u5229\u7528\u4e00\u4e2a<a href=\"http:\/\/developer.android.com\/reference\/android\/test\/package-summary.html\">\u4e3a\u5b89\u5353\u5b9a\u5236\u7684JUnit\u5e2e\u52a9\u5de5\u5177\u63d2\u4ef6<\/a>\uff0c\u5b9e\u73b0\u4e86\u4e00\u4e2a\u6d4b\u8bd5\u6846\u67b6<a href=\"http:\/\/tools.android.com\/tech-docs\/new-build-system\/user-guide#TOC-Testing\">connectedAndroidTest<\/a>\u6765\u6267\u884c\u4f60\u521b\u5efa\u7684JUnit\u6d4b\u8bd5\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u8fdb\u884c\u6d4b\u8bd5\u65f6\uff0c\u4f60\u9700\u8981\u8fde\u63a5\u8bbe\u5907\u6216\u8005\u6a21\u62df\u5668\u3002\u8bf7\u6839\u636e\u5b98\u65b9\u7684\u6d4b\u8bd5\u6307\u5357<a href=\"http:\/\/developer.android.com\/tools\/testing\/testing_android.html\">[1]<\/a> <a href=\"http:\/\/developer.android.com\/tools\/testing\/activity_test.html\">[2]<\/a>\u6765\u64cd\u4f5c\u3002<\/p>\n<p><strong>\u53ea\u7528<a href=\"http:\/\/robolectric.org\/\">Robolectric<\/a>\u6765\u5355\u5143\u6d4b\u8bd5\uff0c\u4e0d\u7528\u4e8e\u89c6\u56feUI\u6d4b\u8bd5\u3002<\/strong>\u4e3a\u4e86\u4fdd\u8bc1\u5f00\u53d1\u901f\u5ea6\uff0cRobolectric\u8fd9\u4e2a\u6d4b\u8bd5\u6846\u67b6\u81f4\u529b\u4e8e\u63d0\u4f9b\u4e0d\u8fde\u63a5\u8bbe\u5907\u65f6\u7684\u6d4b\u8bd5\uff0c\u4e5f\u5373\u662f\u9002\u5408\u4e8e\u5bf9\u6a21\u578b\u548c\u89c6\u56fe\u6a21\u578b\u7684\u5355\u5143\u6d4b\u8bd5\u3002\u4f46\u662f\uff0c\u5728Robolectric\u7684\u6846\u67b6\u4e0b\u6d4b\u8bd5UI\u662f\u4e0d\u51c6\u786e\uff0c\u4e0d\u5b8c\u5168\u7684\u3002\u5728\u6d4b\u8bd5\u548c\u52a8\u753b\uff0c\u5bf9\u8bdd\u6846\u76f8\u5173\u7684UI\u5143\u7d20\u65f6\uff0c\u4f60\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\u3002\u7531\u6b64\uff0c\u4f60\u201d\u5760\u5165\u4e86\u6df1\u6e0a\u201d\uff08\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\u770b\u4e0d\u5230\u63a7\u5236\u5c4f\u5e55\uff09\uff0c\u8fd9\u4f7f\u6d4b\u8bd5\u53d8\u5f97\u975e\u5e38\u590d\u6742\u3002<\/p>\n<p><strong><a href=\"https:\/\/code.google.com\/p\/robotium\/\">Robotium<\/a>\u8ba9\u5199UI\u6d4b\u8bd5\u53d8\u5f97\u975e\u5e38\u5bb9\u6613\u3002<\/strong>\u5728Robotium\u6d4b\u8bd5\u6846\u67b6\u4e0b\u6d4b\u8bd5UI\uff0c\u4f60\u4e0d\u9700\u8981\u8fdb\u884c\u8fde\u63a5\u8bbe\u5907\u7684\u6d4b\u8bd5\uff0c\u4f46\u662f\u5229\u7528Robotium\u63d0\u4f9b\u7684\u5927\u91cf\u7684\u5e2e\u52a9\u5de5\u5177\uff0c\u4f60\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u7684\u5206\u6790\u89c6\u56feUI\u548c\u63a7\u5236\u5c4f\u5e55\u3002\u6d4b\u8bd5\u7528\u4f8b\u4e5f\u975e\u5e38\u7b80\u5355\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f8b\u5b50\uff1a<br \/>\n[java]solo.sendKey(Solo.MENU);<br \/>\nsolo.clickOnText(&quot;More&quot;); \/\/ searches for the first occurence of &quot;More&quot; and clicks on it<br \/>\nsolo.clickOnText(&quot;Preferences&quot;);<br \/>\nsolo.clickOnText(&quot;Edit File Extensions&quot;);<br \/>\nAssert.assertTrue(solo.searchText(&quot;rtf&quot;));[\/java]<\/p>\n<h2>\u6a21\u62df\u5668<\/h2>\n<p>\u5982\u679c\u4f60\u4ee5\u5f00\u53d1\u5b89\u5353\u5e94\u7528\u4e3a\u804c\u4e1a\uff0c\u90a3\u4e48\u4e70\u4e00\u4e2a\u6b63\u7248\u7684<a href=\"http:\/\/www.genymotion.com\/\">Genymotion\u6a21\u62df\u5668<\/a>\u5427\u3002\u76f8\u6bd4\u4e8eAVD\u6a21\u62df\u5668\uff0cGenymotion\u6a21\u62df\u5668\u5177\u6709\u66f4\u9ad8\u7684\u5e27\u7387\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5de5\u5177\u6765\u6f14\u793a\u4f60\u7684\u5e94\u7528\uff0c\u6a21\u62df\u7f51\u7edc\u8fde\u63a5\u8d28\u91cf\uff0cGPS\u5b9a\u4f4d\u7b49\u3002\u5f53\u7136\uff0cGenymotion\u4e5f\u9002\u5408\u4e8e\u8fdb\u884c\u8fde\u63a5\u8bbe\u5907\u7684\u6d4b\u8bd5\u3002\uff08\u8bd1\u8005\u6ce8\uff1a\u4e3a\u4e86\u5168\u9762\u7684\u6d4b\u8bd5\uff09\u4f60\u9700\u8981\u4e70\u5f88\u591a\uff08\u4f46\u4e0d\u662f\u5168\u90e8\uff09\u4e0d\u540c\u7684\u8bbe\u5907\uff0c\u56e0\u6b64\u82b1\u94b1\u4e70\u4e00\u4e2a\u6b63\u7248\u7684Genymotion\u6a21\u62df\u5668\u4f1a\u6bd4\u4e70\u5f88\u591a\u7269\u7406\u8bbe\u5907\u4fbf\u5b9c\u5f88\u591a\u3002<\/p>\n<p>\u6ce8\u610f\uff1aGenymotion\u6a21\u62df\u5668\u4e0d\u4f1a\u5b9e\u73b0\u6240\u6709\u7684\u8c37\u6b4c\u670d\u52a1\uff0c\u4f8b\u5982Google Play\u5546\u5e97\u548c\u5730\u56fe\u3002\u5982\u679c\u4f60\u9700\u8981\u6d4b\u8bd5\u4e09\u661f\u72ec\u6709\u7684API\uff0c\u90a3\u8fd8\u662f\u6709\u5fc5\u8981\u4e70\u4e00\u4e2a\u4e09\u661f\u7684\u8bbe\u5907\u3002<\/p>\n<h2>Proguard\u914d\u7f6e<\/h2>\n<p>\u4e00\u822c\u60c5\u51b5\u4e0b\uff0cProGuard\u7528\u4e8e\u7f29\u51cf\u548c\u6df7\u6dc6\u5b89\u5353\u9879\u76ee\u7684\u6253\u5305\u4ee3\u7801\u3002<\/p>\n<p>\u662f\u5426\u4f7f\u7528Proguard\u53d6\u51b3\u4e8e\u4f60\u7684\u9879\u76ee\u914d\u7f6e\u3002\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\uff0c\u5f53\u4f60\u7f16\u8bd1\u4e00\u4e2a\u53d1\u884c\u7248\u672c\u7684apk\u65f6\uff0c\u4f60\u9700\u8981\u914d\u7f6egradle\u6765\u8fd0\u884cProGuard\u3002<br \/>\n[java]buildTypes {<br \/>\n    debug {<br \/>\n        runProguard false<br \/>\n    }<br \/>\n    release {<br \/>\n        signingConfig signingConfigs.release<br \/>\n        runProguard true<br \/>\n        proguardFiles &#8216;proguard-rules.pro&#8217;<br \/>\n    }<br \/>\n}[\/java]<br \/>\n\u4e3a\u4e86\u5224\u65ad\u8981\u4fdd\u7559\u54ea\u4e9b\u4ee3\u7801\uff0c\u5ffd\u7565\u6216\u8005\u6df7\u6dc6\u54ea\u4e9b\u4ee3\u7801\uff0c\u4f60\u5fc5\u987b\u660e\u786e\u7684\u6307\u51fa\u4e00\u4e2a\u6216\u8005\u591a\u4e2a\u4ee3\u7801\u5165\u53e3\u3002 \u8fd9\u4e9b\u4ee3\u7801\u5165\u53e3\u4e00\u822c\u4e3a\u5305\u542b\u6709main\u51fd\u6570\u7684\u7c7b\uff0cJava\u5c0f\u7a0b\u5e8f\uff08applet\uff09\uff0c\u79fb\u52a8\u4fe1\u606f\u8bbe\u5907\u5c0f\u7a0b\u5e8f\uff08Midlet\uff09\uff0cactivity\u7b49\u3002\u4f60\u5728<code>SDK_HOME\/tools\/proguard\/proguard-android.txt<\/code>\u53ef\u4ee5\u627e\u5230\u5b89\u5353\u6846\u67b6\u63d0\u4f9b\u7684\u9ed8\u8ba4\u914d\u7f6e\u3002\u6bcf\u4e2a\u9879\u76ee\u5728<code>my-project\/app\/proguard-rules.pro<\/code>\u4e2d\u81ea\u5b9a\u4e49\u7684proguard\u89c4\u5219\uff0c\uff08\u8bd1\u8005\u6ce8\uff1a\u6267\u884cproguard\u65f6\uff09\u4f1a\u88ab\u9644\u52a0\u5230\u9ed8\u8ba4\u914d\u7f6e\u4e0a\u3002<\/p>\n<p>\u6709\u4e00\u4e2a\u8ddfProGuard\u76f8\u5173\u7684\u5e38\u89c1\u95ee\u9898\uff0c\u5728\u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u65f6\u56e0\u4e3a<code>ClassNotFoundException<\/code>\u6216\u8005<code>NoSuchFieldException<\/code>\u6216\u8005\u7c7b\u4f3c\u7684\u5f02\u5e38\u800c\u5d29\u6e83\uff0c\u5373\u4f7f\u4f60\u5728\u7f16\u8bd1\u547d\u4ee4\u884c\uff08\u4f8b\u5982\uff0cassmbleRelease\uff09\u4e2d\u6210\u529f\u7684\u5b8c\u6210\u7f16\u8bd1\u5e76\u4e14\u6ca1\u6709warning\u63d0\u793a\u3002\u4e0d\u5916\u4e4e\u4ee5\u4e0b\u4e24\u79cd\u60c5\u51b5\uff1a<\/p>\n<ol>\n<li>ProGuard\u8ba4\u4e3a\u4e00\u4e9b\u7c7b\uff0c\u679a\u4e3e\uff0c\u65b9\u6cd5\uff0c\u53d8\u91cf\u6216\u8005\u6ce8\u89e3\u4e0d\u9700\u8981\uff0c\u5c06\u5176\u79fb\u9664\u4e86\u3002<\/li>\n<li>ProGuard\u6df7\u6dc6\u4e86\u7c7b\uff0c\u679a\u4e3e\uff0c\u6216\u8005\u53d8\u91cf\uff0c\u4f46\u662f\u8fd9\u4e9b\u7c7b\u53ef\u80fd\u88ab\u901a\u8fc7\u5b83\u539f\u6765\u7684\u540d\u5b57\u95f4\u63a5\u5730\u8c03\u7528\u4e86\uff0c\u4f8b\u5982\uff0c\u901a\u8fc7Java\u7684\u53cd\u5c04\u673a\u5236\u8c03\u7528\u3002<\/li>\n<\/ol>\n<p>\u67e5\u770b<code>app\/build\/outputs\/proguard\/release\/usage.txt<\/code>\uff0c\u770b\u9020\u6210\u5d29\u6e83\u95ee\u9898\u7684\u5bf9\u8c61\u662f\u5426\u88ab\u79fb\u9664\u4e86\u3002\u67e5\u770b<code>app\/build\/outputs\/proguard\/release\/mapping.txt<\/code>\uff0c\u770b\u9020\u6210\u5d29\u6e83\u95ee\u9898\u7684\u5bf9\u8c61\u662f\u5426\u88ab\u6df7\u6dc6\u4e86\u3002<\/p>\n<p>\u4e3a\u4e86\u9632\u6b62ProGuard\u5254\u9664\u9700\u8981\u7528\u5230\u7684\u7c7b\u6216\u8005\u7c7b\u6210\u5458\uff0c\u5728\u4f60\u7684proguard\u914d\u7f6e\u4e2d\u6dfb\u52a0\u4e00\u4e2akeep\u9879\uff1a<br \/>\n[java]-keep class com.futurice.project.MyClass { *; }[\/java]<br \/>\n\u4e3a\u4e86\u9632\u6b62ProGuard\u6df7\u6dc6\u4e00\u4e9b\u7c7b\u6216\u8005\u7c7b\u6210\u5458\uff0c\u6dfb\u52a0\u4e00\u4e2akeepnames\u9879\uff1a<br \/>\n[java]-keepnames class com.futurice.project.MyClass { *; }[\/java]<br \/>\n\u5728\u8fd9\u4efd<a href=\"https:\/\/github.com\/futurice\/android-best-practices\/blob\/master\/templates\/rx-architecture\/app\/proguard-rules.pro\">ProGuard\u914d\u7f6e\u6a21\u677f<\/a>\u4e2d\u6709\u4e00\u4e9b\u4f8b\u5b50\u3002\u5728<a href=\"http:\/\/proguard.sourceforge.net\/#manual\/examples.html\">ProGuard\u6587\u6863<\/a>\u4e2d\u6709\u66f4\u591a\u7684\u4f8b\u5b50\u3002<\/p>\n<p><strong>\u63d0\u793a<\/strong>\uff1a\u628a\u6bcf\u4e00\u4e2a\u53d1\u884c\u7248\u672c\u7684mapping.txt\u6587\u4ef6\u90fd\u4fdd\u5b58\u4e0b\u6765\u3002\u8fd9\u6837\uff0c\u5f53\u7528\u6237\u9047\u5230\u4e00\u4e2abug\uff0c\u63d0\u4ea4\u4e86\u4e00\u4e2a\u6df7\u6dc6\u7684\u8c03\u7528\u6808\u65f6\uff0c\u4fbf\u53ef\u4ee5\u6839\u636e\u4fdd\u5b58\u7684mapping.txt\u6765\u8c03\u8bd5\uff0c\u627e\u5230\u95ee\u9898\u6240\u5728\u3002<\/p>\n<p><strong>DexGuard<\/strong>\u3002\u5982\u679c\u4f60\u9700\u8981\u4e00\u4e2a\u4e0d\u9519\u7684\u5de5\u5177\u6765\u4f18\u5316\u4ee3\u7801\uff0c\u7279\u522b\u662f\u7ecf\u8fc7\u6df7\u6dc6\u7684\u53d1\u884c\u7248\u4ee3\u7801\uff0c\u8003\u8651\u4f7f\u7528<a href=\"http:\/\/www.saikoa.com\/dexguard\">DexGuard<\/a>\u3002DexGuard\u662f\u6709ProGuard\u56e2\u961f\u505a\u7684\u4e00\u4e2a\u5546\u4e1a\u8f6f\u4ef6\u3002\u5229\u7528DexGuard\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u7684\u5206\u5272Dex\u6587\u4ef6\uff0c\u89e3\u51b3\u4e8665k\u65b9\u6cd5\u7a7a\u95f4\u9650\u5236\u7684\u95ee\u9898\u3002<\/p>\n<p>\u8f6c:http:\/\/android.jobbole.com\/80684\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4e3aFuturice\u516c\u53f8Android\u5f00\u53d1\u8005\u603b\u7ed3\u7684\u7ecf\u9a8c\u6559\u8bad\u3002\u9075\u5faa\u8fd9\u4e9b\u89c4\u8303\u53ef\u4ee5\u907f\u514d\u65e0\u8c13\u7684\u91cd\u590d\u52b3\u52a8\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[45],"tags":[],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/267"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=267"}],"version-history":[{"count":12,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/267\/revisions"}],"predecessor-version":[{"id":611,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/267\/revisions\/611"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}