{"id":176729,"date":"2013-04-15T15:19:04","date_gmt":"2013-04-15T11:19:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=176729"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=176729","title":{"rendered":"<span class=\"post_title\">\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 RESTful API \u043f\u043e\u0434 Android<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 API \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0430\u043b\u043e\u0432 &mdash; \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434 Android. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e &mdash; \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b, \u043d\u043e \u0434\u044c\u044f\u0432\u043e\u043b, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445.<br \/>  <img decoding=\"async\" align=\"right\" src=\"http:\/\/habrastorage.org\/storage2\/07b\/eaa\/f5f\/07beaaf5f6c52e3bb46cfe4aa4080efa.png\"\/><br \/>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b:  <\/p>\n<ul>\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u0434\u0430 Activity \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u0440\u0435\u0434\u0435 &mdash; \u0442\u0443\u0442 \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u0442.\u043a. \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0437\u0430\u043c\u043e\u0440\u043e\u0437\u043a\u0435 UI, \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0443\u0431\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c;<\/li>\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0437 \u043a\u043e\u0434\u0430 Activity \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AsyncTask &mdash; \u043f\u043b\u043e\u0445\u043e, \u0442.\u043a. \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043f\u043e\u0432\u0435\u0440\u043d\u0435\u0442 \u044d\u043a\u0440\u0430\u043d, Activity \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430;<\/li>\n<li>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f &mdash; \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0435\u043c\u0443 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0436\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c<\/h4>\n<p>  \u042d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u043d\u043e\u0432\u044b, \u0438 \u0432 2010 \u0433\u043e\u0434\u0443 \u043d\u0430 \u043a\u043e\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 Google I\/O <a href=\"https:\/\/plus.google.com\/101870761930221849874\/about\">Virgil Dobjanschi<\/a> <a href=\"http:\/\/www.youtube.com\/watch?v=xHXn3Kg2IQE\">\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b<\/a> \u0442\u0440\u0438 \u043f\u0430\u0442\u0435\u0440\u043d\u0430 \u0434\u043b\u044f REST \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 (<a href=\"http:\/\/dl.google.com\/googleio\/2010\/android-developing-RESTful-android-apps.pdf\">\u0441\u043b\u0430\u0439\u0434\u044b \u0441 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>). \u0418\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0447\u0435\u0440\u0442\u044b:  <\/p>\n<ul>\n<li>\u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u044d\u0448\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 SQLite, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043d\u0435\u0439 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 ContentProvider-\u0430, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438;<\/li>\n<li>\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 (\u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435), \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0439\u0434\u0435\u0442 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0434\u043e\u043a\u0430\u0447\u0430\u043b\u0438\u0441\u044c \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c.<\/li>\n<\/ul>\n<p>  \u0421\u0430\u043c\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b:<br \/>  &nbsp;&nbsp;&nbsp;&nbsp;A. <b>Activity \u2192 Service \u2192 ContentProvider<\/b>, Activity \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u0435\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 ContentProvider, \u043e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u0442\u043e\u043c Activity \u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442;<br \/>  &nbsp;&nbsp;&nbsp;&nbsp;B. <b>Activity \u2192 ContentProvider \u2192 Service<\/b>, Activity \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 ContentProvider, ContentProvider \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0438\u0441;<br \/>  &nbsp;&nbsp;&nbsp;&nbsp;C. <b>Activity \u2192 ContentProvider \u2192 SyncAdapter<\/b>, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, \u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e<br \/>  \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435 Google.<\/p>\n<h4>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c A \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u0435\u0433\u043e \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u043e\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 \u0442\u0432\u0438\u0442\u0442\u0435\u0440\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430:<br \/>  <img decoding=\"async\" align=\"center\" src=\"http:\/\/habrastorage.org\/storage2\/1db\/033\/a4e\/1db033a4ea8541a2c6872bf750966342.png\"\/><\/p>\n<h4>ContentProvider<\/h4>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b tweets, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0432\u0430 \u043f\u043e\u043b\u044f \u043a\u0440\u043e\u043c\u0435 _id: user_name \u0438 body &mdash; \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0442\u0435\u043a\u0441\u0442 \u0442\u0432\u0438\u0442\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. <br \/>  \u041e\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430:  <\/p>\n<pre><code class=\"java\">public final class Contract { \tpublic static final String AUTHORITY = &quot;com.example.rest_a&quot;; \t \tpublic static final Uri AUTHORITY_URI = Uri.parse(&quot;content:\/\/&quot; + AUTHORITY); \t \tpublic interface TweetsCoulmns { \t\tpublic static final String USER_NAME = &quot;user_name&quot;; \t\tpublic static final String BODY = &quot;body&quot;; \t\tpublic static final String DATE = &quot;date&quot;; \t} \t \tpublic static final class Tweets implements BaseColumns, TweetsCoulmns { \t\tpublic static final String CONTENT_PATH = &quot;tweets&quot;; \t\tpublic static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, CONTENT_PATH); \t\tpublic static final String CONTENT_TYPE = &quot;vnd.android.cursor.dir\/vnd.&quot; + AUTHORITY + &quot;.&quot; + CONTENT_PATH; \t} } <\/code><\/pre>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0432 \u043d\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 SQLite \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 DatabaseHelper-\u0430 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043d\u0435\u0439, \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u0432 <a href=\"http:\/\/developer.android.com\/guide\/topics\/providers\/content-provider-creating.html\">\u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0442\u044c \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u0435\u0439, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 insert() \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430  <\/p>\n<pre><code class=\"java\">getContext().getContentResolver().notifyChange(Contract.Tweets.CONTENT_URI, null); <\/code><\/pre>\n<p> \u0430 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 query(), \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e,  <\/p>\n<pre><code class=\"java\">cursor.setNotificationUri(getContext().getContentResolver(), Contract.Tweets.CONTENT_URI); <\/code><\/pre>\n<p>  <\/p>\n<h4>Service<\/h4>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u0442\u0435\u043a\u043e\u0439 <a href=\"http:\/\/datadroidlib.com\">DataDroid<\/a> \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0442\u0432\u0438\u0442\u0442\u0435\u0440\u0430 \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 DataDroid \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043b\u0430\u0441\u0441\u0435, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Operation:  <\/p>\n<pre><code class=\"java\">public final class TweetsOperation implements Operation { \t@Override \tpublic Bundle execute(Context context, Request request) \t\t\tthrows ConnectionException, DataException, CustomRequestException { \t\tNetworkConnection connection = new NetworkConnection(context, &quot;https:\/\/api.twitter.com\/1\/statuses\/user_timeline.json&quot;); \t\tHashMap&lt;String, String&gt; params = new HashMap&lt;String, String&gt;(); \t\tparams.put(&quot;screen_name&quot;, request.getString(&quot;screen_name&quot;)); \t\tconnection.setParameters(params); \t\tConnectionResult result = connection.execute(); \t\tContentValues[] tweetsValues; \t\ttry { \t\t\tJSONArray tweetsJson = new JSONArray(result.body); \t\t\ttweetsValues = new ContentValues[tweetsJson.length()]; \t\t\t \t\t\tfor (int i = 0; i &lt; tweetsJson.length(); ++i) { \t\t\t\tContentValues tweet = new ContentValues(); \t\t\t\ttweet.put(&quot;user_name&quot;, tweetsJson.getJSONObject(i).getJSONObject(&quot;user&quot;).getString(&quot;name&quot;)); \t\t\t\ttweet.put(&quot;body&quot;, tweetsJson.getJSONObject(i).getString(&quot;text&quot;)); \t\t\t\ttweetsValues[i] = tweet; \t\t\t} \t\t} catch (JSONException e) { \t\t\tthrow new DataException(e.getMessage()); \t\t} \t\t \t\tcontext.getContentResolver().delete(Contract.Tweets.CONTENT_URI, null, null); \t\tcontext.getContentResolver().bulkInsert(Contract.Tweets.CONTENT_URI, tweetsValues); \t\treturn null; \t} <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 screen_name \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044a\u0435\u043a\u0442 Request \u0438\u0437 DataDroid, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Parcelable \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u0447\u0435\u0440\u0435\u0437 Intent. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u0431\u044b Request-\u044b:  <\/p>\n<pre><code class=\"java\">public final class RequestFactory { \tpublic static final int REQUEST_TWEETS = 1; \t \tpublic static Request getTweetsRequest(String screenName) { \t\tRequest request = new Request(REQUEST_TWEETS); \t\trequest.put(&quot;screen_name&quot;, screenName); \t\treturn request; \t} \t \tprivate RequestFactory() { \t} } <\/code><\/pre>\n<p>  \u0438 \u043a\u043b\u0430\u0441\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f RequestService \u0438\u0437 DataDroid, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 Operation:  <\/p>\n<pre><code class=\"java\">public class RestService extends RequestService {  \t@Override \tpublic Operation getOperationForType(int requestType) { \t\tswitch (requestType) { \t\tcase RequestFactory.REQUEST_TWEETS: \t\t\treturn new TweetsOperation(); \t\tdefault: \t\t\treturn null; \t\t} \t} <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0438\u043d\u0433\u043b\u043e\u0442\u043e\u043d \u0442\u0438\u043f\u0430 RequestManager \u0438\u0437 DataDroid, \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441, \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u043e\u0442\u043e\u0432\u0430.<\/p>\n<h4>Activity<\/h4>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c Activity. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c layout \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c, \u043f\u0440\u0430\u0432\u0434\u0430, \u0432\u043c\u0435\u0441\u0442\u043e ListView \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/chrisbanes\/Android-PullToRefresh\/\">PullToRefreshListView<\/a> \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0435\u043d\u0442\u044b \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433\u043e\u043c \u0432\u043d\u0438\u0437. <br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c SimpleCursorAdapter \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a \u043d\u0435\u043c\u0443 CursorLoader, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e ContentProvider-\u0430:  <\/p>\n<pre><code class=\"java\">\tprivate static final int LOADER_ID = 1; \tprivate static final String[] PROJECTION = {  \t\tTweets._ID, \t\tTweets.USER_NAME, \t\tTweets.BODY \t}; \tprivate LoaderCallbacks&lt;Cursor&gt; loaderCallbacks = new LoaderCallbacks&lt;Cursor&gt;() {  \t\t@Override \t\tpublic Loader&lt;Cursor&gt; onCreateLoader(int loaderId, Bundle arg1) { \t\t\treturn new CursorLoader( \t\t\t\tMainActivity.this, \t\t\t\tTweets.CONTENT_URI, \t\t\t\tPROJECTION, \t\t\t\tnull, \t\t\t\tnull, \t\t\t\tnull \t\t\t); \t\t}  \t\t@Override \t\tpublic void onLoadFinished(Loader&lt;Cursor&gt; arg0, Cursor cursor) { \t\t\tadapter.swapCursor(cursor); \t\t}  \t\t@Override \t\tpublic void onLoaderReset(Loader&lt;Cursor&gt; arg0) { \t\t\tadapter.swapCursor(null); \t\t} \t}; \tprotected void onCreate(Bundle savedInstanceState) { \t\t\/\/ ... \t\tadapter = new SimpleCursorAdapter(this, \t\t\tR.layout.tweet_view,  \t\t\tnull,  \t\t\tnew String[]{ Tweets.USER_NAME, Tweets.BODY }, \t\t\tnew int[]{ R.id.user_name_text_view, R.id.body_text_view },  \t\t\t0); \t\tlistView.setAdapter(adapter); \t\tgetSupportLoaderManager().initLoader(LOADER_ID, null, loaderCallbacks); \t\t\/\/ ... \t} <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0442\u0432\u0438\u0442\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 RequestFactory \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0442\u0432\u0438\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 RequestManager-\u0430. \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0441\u0438\u043c \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 pull-down \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430. \u0412\u043e\u0442 \u043a\u043e\u0434:  <\/p>\n<pre><code>\tprivate RestRequestManager requestManager; \t\/\/ ... \tprotected void onCreate(Bundle savedInstanceState) { \t\t\/\/ ... \t\tlistView.setOnRefreshListener(new OnRefreshListener&lt;ListView&gt;() {  \t\t\t@Override \t\t\tpublic void onRefresh(PullToRefreshBase&lt;ListView&gt; refreshView) { \t\t\t\tupdate(); \t\t\t} \t\t}); \t\trequestManager = RestRequestManager.from(this); \t} \t\/\/ ... \tvoid update() { \t\tlistView.setRefreshing(); \t\tRequest updateRequest = new Request(RequestFactory.REQUEST_TWEETS); \t\tupdateRequest.put(&quot;screen_name&quot;, &quot;habrahabr&quot;); \t\trequestManager.execute(updateRequest, requestListener); \t} \t\tRequestListener requestListener = new RequestListener() { \t\t \t\t@Override \t\tpublic void onRequestFinished(Request request, Bundle resultData) { \t\t\tlistView.onRefreshComplete(); \t\t} \t\t \t\tvoid showError() { \t\t\tlistView.onRefreshComplete(); \t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); \t\t\tbuilder. \t\t\t\tsetTitle(android.R.string.dialog_alert_title). \t\t\t\tsetMessage(getString(R.string.faled_to_load_data)). \t\t\t\tcreate(). \t\t\t\tshow(); \t\t} \t\t \t\t@Override \t\tpublic void onRequestDataError(Request request) { \t\t\tshowError(); \t\t} \t\t \t\t@Override \t\tpublic void onRequestCustomError(Request request, Bundle resultData) { \t\t\tshowError(); \t\t} \t\t \t\t@Override \t\tpublic void onRequestConnectionError(Request request, int statusCode) { \t\t\tshowError(); \t\t} \t}; <\/code><\/pre>\n<p>  \u0412\u0441\u0435, \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c Service \u0438 ContentProvider \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a99\/b1d\/6d4\/a99b1d6d4b1aed4be674ce00add8a5b2.png\"\/><\/p>\n<h4>\u0421\u0441\u044b\u043b\u043a\u0438<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043d\u0430 github: <a href=\"https:\/\/github.com\/therussianphysicist\/rest_a\">github.com\/therussianphysicist\/rest_a<\/a><\/li>\n<li>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 O&#8217;Reilly \u00abProgramming Android\u00bb, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d B: <a href=\"https:\/\/github.com\/bmeike\/ProgrammingAndroidExamples\">github.com\/bmeike\/ProgrammingAndroidExamples<\/a> (\u043f\u0440\u043e\u0435\u043a\u0442\u044b FinchFramework \u0438 FinchVideo)<\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/176729\/\"> http:\/\/habrahabr.ru\/post\/176729\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 API \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0430\u043b\u043e\u0432 &mdash; \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u0434 Android. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e &mdash; \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b, \u043d\u043e \u0434\u044c\u044f\u0432\u043e\u043b, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445.<br \/>  <img decoding=\"async\" align=\"right\" src=\"http:\/\/habrastorage.org\/storage2\/07b\/eaa\/f5f\/07beaaf5f6c52e3bb46cfe4aa4080efa.png\"\/><br \/>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b:  <\/p>\n<ul>\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u0434\u0430 Activity \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u0440\u0435\u0434\u0435 &mdash; \u0442\u0443\u0442 \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u0442.\u043a. \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0437\u0430\u043c\u043e\u0440\u043e\u0437\u043a\u0435 UI, \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0443\u0431\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c;<\/li>\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0437 \u043a\u043e\u0434\u0430 Activity \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 AsyncTask &mdash; \u043f\u043b\u043e\u0445\u043e, \u0442.\u043a. \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043f\u043e\u0432\u0435\u0440\u043d\u0435\u0442 \u044d\u043a\u0440\u0430\u043d, Activity \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430;<\/li>\n<li>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f &mdash; \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0435\u043c\u0443 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0436\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<\/ul>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-176729","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=176729"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176729\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=176729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=176729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=176729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}