{"id":340977,"date":"2022-11-08T21:00:29","date_gmt":"2022-11-08T21:00:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340977"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340977","title":{"rendered":"<span>Starting Kivy App and Service on bootup on Android<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"500\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/gu\/t_\/qy\/gut_qyz_3_l0m28xzeryxhr7a0m.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/gu\/t_\/qy\/gut_qyz_3_l0m28xzeryxhr7a0m.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 <strong>python<\/strong> \u043f\u043e\u0434 <strong>android<\/strong> \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0427\u0442\u043e \u0431\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <a href=\"https:\/\/github.com\/kivy\/buildozer\" rel=\"nofollow noopener noreferrer\">buildozer<\/a> \u0438 <a href=\"https:\/\/github.com\/kivy\/python-for-android\" rel=\"nofollow noopener noreferrer\">pythonforandroid<\/a>. \u0422.\u043a. \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c, \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 kivy \u043d\u0435 \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041e\u0442 \u0447\u0430\u0441\u0442\u0438 \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u0434\u0432\u0435 \u0441\u0442\u0430\u0442\u044c\u0438: <a href=\"https:\/\/habr.com\/ru\/post\/348226\/#:~:text=3.%20%D0%A1%D0%B5%D1%80%D0%B2%D0%B8%D1%81%D1%8B.%20%D0%90%D0%B2%D1%82%D0%BE%D0%B7%D0%B0%D0%BF%D1%83%D1%81%D0%BA%20%D0%B8%20%D0%BF%D0%B5%D1%80%D0%B5%D0%B7%D0%B0%D0%BF%D1%83%D1%81%D0%BA\">\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0433\u0440\u044b \u043f\u043e\u0434 Android \u043d\u0430 Python \u043d\u0430 \u0431\u0430\u0437\u0435 Kivy. \u041e\u0442 \u0410 \u0434\u043e \u042f: \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 \u0438 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0427\u0430\u0441\u0442\u044c 1<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/post\/271663\/\">Android. \u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435: \u0442\u0435\u043e\u0440\u0438\u044f \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/a>. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0430\u0432\u0442\u043e\u0440 \u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043b \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u0447\u0442\u043e, \u043a\u0430\u043a, \u043e\u0442\u043a\u0443\u0434\u0430 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u0435\u0440\u0435\u0442\u0441\u044f, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0442\u0430\u043c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430. \u0412\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 Android.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<p>  <\/p>\n<h2 id=\"nepravilnyy\">\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439<\/h2>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0431\u044b \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b <strong>BOOT_COMPLETED<\/strong> \u0438\u043b\u0438 <strong>QUICKBOOT_POWERON<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0448\u043b\u0435\u0442 Android \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c. \u0421\u0438\u0433\u043d\u0430\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>AndroidManifest.xml<\/strong>, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 <strong>kivy<\/strong> \u043e\u043d \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u0418 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">buildozer android debug<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0437\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0443. \u042d\u0442\u043e <a href=\"https:\/\/github.com\/kivy\/python-for-android\/blob\/develop\/pythonforandroid\/bootstraps\/sdl2\/build\/templates\/AndroidManifest.tmpl.xml\" rel=\"nofollow noopener noreferrer\">AndroidManifest.tmpl.xml<\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, <strong>buildozer<\/strong> \u0441\u043a\u0430\u0447\u0430\u0435\u0442 <strong>python-for-android<\/strong> \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442 \u0435\u0433\u043e \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">.\/kivy_service_test\/.buildozer\/android\/platform\/python-for-android\/<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e <strong>AndroidManifest.tmpl.xml<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">.\/kivy_service_test\/.buildozer\/android\/platform\/python-for-android\/pythonforandroid\/bootstraps\/sdl2\/build\/templates\/AndroidManifest.tmpl.xml<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043d \u0442\u043e \u043d\u0430\u043c \u0438 \u043d\u0443\u0436\u0435\u043d. \u0415\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;!-- Replace org.libsdl.app with the identifier of your game below, e.g.      com.gamemaker.game --> &lt;manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"       package=\"{{ args.package }}\"       android:versionCode=\"{{ args.numeric_version }}\"       android:versionName=\"{{ args.version }}\"       android:installLocation=\"auto\">      &lt;supports-screens             android:smallScreens=\"true\"             android:normalScreens=\"true\"             android:largeScreens=\"true\"             android:anyDensity=\"true\"             {% if args.min_sdk_version >= 9 %}             android:xlargeScreens=\"true\"             {% endif %}     \/>      &lt;!-- Android 2.3.3 -->     &lt;uses-sdk android:minSdkVersion=\"{{ args.min_sdk_version }}\" android:targetSdkVersion=\"{{ android_api }}\" \/>      &lt;!-- OpenGL ES 2.0 -->     &lt;uses-feature android:glEsVersion=\"0x00020000\" \/>      &lt;!-- Allow writing to external storage -->     &lt;uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" \/>     {% for perm in args.permissions %}     {% if '.' in perm %}     &lt;uses-permission android:name=\"{{ perm }}\" \/>     {% else %}     &lt;uses-permission android:name=\"android.permission.{{ perm }}\" \/>     {% endif %}     {% endfor %}      {% if args.wakelock %}     &lt;uses-permission android:name=\"android.permission.WAKE_LOCK\" \/>     {% endif %}      {% if args.billing_pubkey %}     &lt;uses-permission android:name=\"com.android.vending.BILLING\" \/>     {% endif %}      {{ args.extra_manifest_xml }}      &lt;!-- Create a Java class extending SDLActivity and place it in a          directory under src matching the package, e.g.             src\/com\/gamemaker\/game\/MyGame.java           then replace \"SDLActivity\" with the name of your class (e.g. \"MyGame\")          in the XML below.           An example Java class can be found in README-android.txt     -->     &lt;application android:label=\"@string\/app_name\"                  {% if debug %}android:debuggable=\"true\"{% endif %}                  android:icon=\"@mipmap\/icon\"                  android:allowBackup=\"{{ args.allow_backup }}\"                  {% if args.backup_rules %}android:fullBackupContent=\"@xml\/{{ args.backup_rules }}\"{% endif %}                  {{ args.extra_manifest_application_arguments }}                  android:theme=\"{{args.android_apptheme}}{% if not args.window %}.Fullscreen{% endif %}\"                  android:hardwareAccelerated=\"true\"                  android:extractNativeLibs=\"true\" >          {% for l in args.android_used_libs %}         &lt;uses-library android:name=\"{{ l }}\" \/>         {% endfor %}          {% for m in args.meta_data %}         &lt;meta-data android:name=\"{{ m.split('=', 1)[0] }}\" android:value=\"{{ m.split('=', 1)[-1] }}\"\/>{% endfor %}         &lt;meta-data android:name=\"wakelock\" android:value=\"{% if args.wakelock %}1{% else %}0{% endif %}\"\/>          &lt;activity android:name=\"{{args.android_entrypoint}}\"                   android:label=\"@string\/app_name\"                   android:configChanges=\"mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode{% if args.min_sdk_version >= 8 %}|uiMode{% endif %}{% if args.min_sdk_version >= 13 %}|screenSize|smallestScreenSize{% endif %}{% if args.min_sdk_version >= 17 %}|layoutDirection{% endif %}{% if args.min_sdk_version >= 24 %}|density{% endif %}\"                   android:screenOrientation=\"{{ args.orientation }}\"                   android:exported=\"true\"                   {% if args.activity_launch_mode %}                   android:launchMode=\"{{ args.activity_launch_mode }}\"                   {% endif %}                   >              {% if args.launcher %}             &lt;intent-filter>                 &lt;action android:name=\"org.kivy.LAUNCH\" \/>                 &lt;category android:name=\"android.intent.category.DEFAULT\" \/>                 &lt;data android:scheme=\"{{ url_scheme }}\" \/>             &lt;\/intent-filter>             {% else  %}             &lt;intent-filter>                 &lt;action android:name=\"android.intent.action.MAIN\" \/>                 &lt;category android:name=\"android.intent.category.LAUNCHER\" \/>             &lt;\/intent-filter>             {% endif %}              {%- if args.intent_filters -%}             {{- args.intent_filters -}}             {%- endif -%}         &lt;\/activity>          {% if args.launcher %}         &lt;activity android:name=\"org.kivy.android.launcher.ProjectChooser\"                   android:icon=\"@mipmap\/icon\"                   android:label=\"@string\/app_name\"                   android:exported=\"true\">            &lt;intent-filter>             &lt;action android:name=\"android.intent.action.MAIN\" \/>             &lt;category android:name=\"android.intent.category.LAUNCHER\" \/>           &lt;\/intent-filter>          &lt;\/activity>         {% endif %}          {% if service or args.launcher %}         &lt;service android:name=\"{{ args.service_class_name }}\"                  android:process=\":pythonservice\" \/>         {% endif %}         {% for name in service_names %}         &lt;service android:name=\"{{ args.package }}.Service{{ name|capitalize }}\"                  android:process=\":service_{{ name }}\" \/>         {% endfor %}         {% for name in native_services %}         &lt;service android:name=\"{{ name }}\" \/>         {% endfor %}          {% if args.billing_pubkey %}         &lt;service android:name=\"org.kivy.android.billing.BillingReceiver\"                  android:process=\":pythonbilling\" \/>         &lt;receiver android:name=\"org.kivy.android.billing.BillingReceiver\"                   android:process=\":pythonbillingreceiver\"                   android:exported=\"false\">             &lt;intent-filter>                 &lt;action android:name=\"com.android.vending.billing.IN_APP_NOTIFY\" \/>                 &lt;action android:name=\"com.android.vending.billing.RESPONSE_CODE\" \/>                 &lt;action android:name=\"com.android.vending.billing.PURCHASE_STATE_CHANGED\" \/>             &lt;\/intent-filter>         &lt;\/receiver>         {% endif %}     {% for a in args.add_activity  %}     &lt;activity android:name=\"{{ a }}\">&lt;\/activity>     {% endfor %}     &lt;\/application>  &lt;\/manifest><\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0444\u0430\u0439\u043b \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e buildozer <strong>AndroidManifest.xml<\/strong>. \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435, \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">{{ args.extra_manifest_application_arguments }}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044e \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u041f\u0440\u0430\u0432\u0434\u0430 \u043d\u0430 \u0435\u0433\u043e \u043f\u043e\u0438\u0441\u043a \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0443\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/pf\/hy\/lx\/pfhylxt90yfmy90-p4lh36su1cg.png\" data-src=\"https:\/\/habrastorage.org\/webt\/pf\/hy\/lx\/pfhylxt90yfmy90-p4lh36su1cg.png\"\/>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u044c \u0442\u044d\u0433\u0430 <strong>application<\/strong> \u043d\u0430\u0448 \u0442\u044d\u0433 <strong>receiver<\/strong> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u0438 \u043a\u0430\u043a\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;receiver android:name=\".MyBroadcastReceiver\" android:enabled=\"true\" android:exported=\"true\">     &lt;intent-filter>         &lt;action android:name=\"android.intent.action.BOOT_COMPLETED\" \/>         &lt;action android:name=\"android.intent.action.QUICKBOOT_POWERON\" \/>         &lt;action android:name=\"com.htc.intent.action.QUICKBOOT_POWERON\" \/>         &lt;action android:name=\"android.intent.action.MAIN\" \/>         &lt;action android:name=\"android.intent.action.DELETE\" \/>     &lt;\/intent-filter> &lt;\/receiver><\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">buildozer android clean buildozer android debug<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c <strong>clean<\/strong>, \u0442\u043e \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u043d\u0435 \u0444\u0430\u0439\u043b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">\/kivy_service_test\/.buildozer\/android\/platform\/python-for-android\/pythonforandroid\/bootstraps\/sdl2\/build\/templates\/AndroidManifest.tmpl.xml<\/code><\/pre>\n<p>  <\/p>\n<p>\u0430 \u0444\u0430\u0439\u043b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">.\/kivy_service_test\/.buildozer\/android\/platform\/build-arm64-v8a\/dists\/kivy_service_test\/templates\/AndroidManifest.tmpl.xml<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0443\u0434\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">buildozer android debug<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0434\u0430\u043b\u0435\u0435 \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f <strong>python-for-android<\/strong>. \u0418 \u043a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 buildozer.spec:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">android.archs = arm64-v8a<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439, \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"pravilnyy\">\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439<\/h2>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0439\u043b\u0430 <strong>buildozer.spec<\/strong> \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 <strong>AndroidManifest.xml<\/strong>. \u041d\u043e \u0432\u043e\u0442 \u0442\u0443, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0435\u043b\u044c\u0437\u044f. \u041f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 <strong>default.spec<\/strong> \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\"># (str) Extra xml to write directly inside the &lt;manifest> element of AndroidManifest.xml # use that parameter to provide a filename from where to load your custom XML code android.extra_manifest_xml = .\/src\/android\/extra_manifest.xml  # (str) Extra xml to write directly inside the &lt;manifest>&lt;application> tag of AndroidManifest.xml # use that parameter to provide a filename from where to load your custom XML arguments: android.extra_manifest_application_arguments = .\/src\/android\/extra_manifest_application_arguments.xml<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u0438\u0437 AndroidManifest.tmpl.xml<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">{{ args.extra_manifest_application_arguments }}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0444\u0430\u0439\u043b\u044b <strong>xml<\/strong> \u0438\u0437 \u0441\u0435\u043a\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u043c AndroidManifest.xml \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u0432\u043e\u044e \u0441\u0435\u043a\u0446\u0438\u044e \u0432 AndroidManifest.tmpl.xml:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">{{ args.extra_manifest_application }}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u043d\u0435\u0441\u0442\u0438 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/kivy\/buildozer\/pull\/1519\" rel=\"nofollow noopener noreferrer\">buildozer<\/a>, <a href=\"https:\/\/github.com\/kivy\/python-for-android\/pull\/2691\" rel=\"nofollow noopener noreferrer\">python-for-android<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 \u043c\u043e\u0435\u043c buildozer.spec \u0441\u0442\u0430\u043b\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043d\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">android.extra_manifest_application = %(source.dir)s\/xml\/receivers.xml<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e AndroidManifest.xml \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 receivers.xml<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0438 <strong>pull request<\/strong> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u043e\u0434\u043e\u0431\u0440\u0438\u043b\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li>buildozer \u2014 \/usr\/local\/lib\/python3.8\/dist-packages\/buildozer (\u0432\u0435\u0440\u0441\u0438\u044f python \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u0430)<\/li>\n<li>python-for-android \u2014 .\/kivy_service_test\/.buildozer\/android\/platform\/python-for-android\/<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"receiver\">Receiver<\/h2>\n<p>  <\/p>\n<p>receiver.xml<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;receiver android:name=\".MyBroadcastReceiver\" android:enabled=\"true\" android:exported=\"true\">     &lt;intent-filter>         &lt;action android:name=\"android.intent.action.BOOT_COMPLETED\" \/>         &lt;action android:name=\"android.intent.action.QUICKBOOT_POWERON\" \/>         &lt;action android:name=\"com.htc.intent.action.QUICKBOOT_POWERON\" \/>         &lt;action android:name=\"android.intent.action.MAIN\" \/>         &lt;action android:name=\"android.intent.action.DELETE\" \/>     &lt;\/intent-filter> &lt;\/receiver><\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 AndroidManifest.xml<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;application ...>     &lt;receiver> ... &lt;\/receiver> &lt;\/application> <\/code><\/pre>\n<p>  <\/p>\n<p><strong>MyBroadcastReceiver<\/strong> \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u044b, \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0432 MyBroadcastReceiver.java<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">package com.heattheatr.kivy_service_test;  import android.content.BroadcastReceiver; import android.content.Intent; import android.content.Context; import org.kivy.android.PythonActivity;  import java.lang.reflect.Method;  import com.heattheatr.kivy_service_test.ServiceTest;  public class MyBroadcastReceiver extends BroadcastReceiver {      public MyBroadcastReceiver() {      }      \/\/ pythonforandroid\/bootstraps\/webview\/build\/src\/main\/java\/org\/kivy\/android\/PythonActivity.java     \/\/ method _do_start_service()      \/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.     public void start_app(Context context, Intent intent) {         Intent ix = new Intent(context, PythonActivity.class);         ix.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);         context.startActivity(ix);     }      \/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430.     public void service_start(Context context, Intent intent) {         String package_root = context.getFilesDir().getAbsolutePath();         String app_root =  package_root + \"\/app\";         Intent ix = new Intent(context, ServiceTest.class);         ix.putExtra(\"androidPrivate\", package_root);         ix.putExtra(\"androidArgument\", app_root);         ix.putExtra(\"serviceEntrypoint\", \"service.py\");         ix.putExtra(\"pythonName\", \"test\");         ix.putExtra(\"pythonHome\", app_root);         ix.putExtra(\"pythonPath\", package_root);         ix.putExtra(\"serviceStartAsForeground\", \"true\");         ix.putExtra(\"serviceTitle\", \"ServiceTest\");         ix.putExtra(\"serviceDescription\", \"ServiceTest\");         ix.putExtra(\"pythonServiceArgument\", app_root + \":\" + app_root + \"\/lib\");         ix.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);         context.startService(ix);     }      public void service_stop(Context context, Intent intent) {         Intent intent_stop = new Intent(context, ServiceTest.class);          context.stopService(intent_stop);     }      \/\/ \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432.     public void onReceive(Context context, Intent intent) {         switch (intent.getAction()) {             case Intent.ACTION_BOOT_COMPLETED:                 System.out.println(\"python MyBroadcastReceiver.java MyBroadcastReceiver.class onReceive.method: ACTION_BOOT_COMPLETED\");                 this.service_start(context, intent);                 break;             case Intent.ACTION_DELETE:                 System.out.println(\"python MyBroadcastReceiver.java MyBroadcastReceiver.class onReceive.method: ACTION_DELETE\");                 this.service_stop(context, intent);                 break;             case Intent.ACTION_MAIN:                 System.out.println(\"python MyBroadcastReceiver.java MyBroadcastReceiver.class onReceive.method: ACTION_MAIN\");                 this.start_app(context, intent);                 break;             default:                break;         }     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u0437\u0430\u043f\u0443\u0441\u043a\/\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0437\u0430\u043f\u0443\u0441\u043a \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 (<strong>onReceive<\/strong> \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <strong>BroadcastReceiver<\/strong>).<\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u043e\u0431\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443 \u043c\u0435\u043d\u044f \u0432\u044b\u0437\u0432\u0430\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <strong>service_start<\/strong>. \u0422.\u043a. \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/348226\/#:~:text=%D0%9D%D0%BE%20%D0%BD%D0%B5%20%D0%B1%D1%83%D0%B4%D1%83%20%D1%82%D1%8F%D0%BD%D1%83%D1%82%D1%8C%2C%20%D1%80%D0%B0%D0%B1%D0%BE%D1%87%D0%B8%D0%B9%20%D0%BA%D0%BE%D0%B4%20%D0%B2%D1%8B%D0%B3%D0%BB%D1%8F%D0%B4%D0%B8%D1%82%20%D1%82%D0%B0%D0%BA%3A\">Intent<\/a> \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0431\u044b\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b. \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0448\u0435\u043b \u0437\u0434\u0435\u0441\u044c <a href=\"https:\/\/github.com\/kivy\/python-for-android\/blob\/develop\/pythonforandroid\/bootstraps\/webview\/build\/src\/main\/java\/org\/kivy\/android\/PythonActivity.java\" rel=\"nofollow noopener noreferrer\">PythonActivity.java<\/a>, \u043c\u0435\u0442\u043e\u0434 <strong>_do_start_service()<\/strong>.<\/p>\n<p>  <\/p>\n<h2 id=\"service\">Service<\/h2>\n<p>  <\/p>\n<p>\u041e\u0441\u043e\u0431\u043e \u0432\u044b\u0434\u0435\u043b\u044e <strong>ServiceTest<\/strong>, \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <strong>service.py<\/strong>.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3 #-*- coding: utf-8 -*-  import os  from time import sleep from kivy.utils import platform  from jnius import cast from jnius import autoclass  # \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 Android if platform == 'android':     PythonService = autoclass('org.kivy.android.PythonService')     # \u0410\u0432\u0442\u043e\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0443\u043f\u0430\u0432\u0448\u0435\u0433\u043e \u0441\u0440\u0435\u0432\u0438\u0441\u0430     PythonService.mService.setAutoRestartService(True)      CurrentActivityService = cast(\"android.app.Service\", PythonService.mService)     ContextService = cast('android.content.Context', CurrentActivityService.getApplicationContext())     ContextWrapperService = cast('android.content.ContextWrapper', CurrentActivityService.getApplicationContext())     Manager = CurrentActivityService.getPackageManager()      Intent = autoclass('android.content.Intent')      def application_start():         pm = CurrentActivityService.getPackageManager()         ix = pm.getLaunchIntentForPackage(CurrentActivityService.getPackageName())         ix.setAction(Intent.ACTION_VIEW)         ix.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)          CurrentActivityService.startActivity(ix)      while True:         print(\"python service running.....\", CurrentActivityService.getPackageName(), os.getpid())         sleep(10) else:     def application_start():         pass      while True:         print(\"python service running.....\", os.getpid())         sleep(10)<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f<\/strong> service.py \u0432 ServiceTest \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u0432 buildozer.spec \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\"># NAME_SERVICE:PATH_TO_PY # (list) List of service to declare services = Test:.\/service.py:foreground<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 <strong>Service<\/strong> + <strong>Test<\/strong>. \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 Test?, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0430\u043a \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c. \u041e\u043d\u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 Service.<\/p>\n<p>  <\/p>\n<p>\u041f\u0443\u0442\u044c \u0434\u043e service.py \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>%(source.dir)s<\/code>, \u0442.\u043a. \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043f\u0443\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0410\u0432\u0442\u043e\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0443\u043f\u0430\u0432\u0448\u0435\u0433\u043e \u0441\u0440\u0435\u0432\u0438\u0441\u0430 PythonService.mService.setAutoRestartService(True)<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"main\">Main<\/h2>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\/\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 python:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3 #-*- coding: utf-8 -*-  import kivy kivy.require(\"2.1.0\") from kivy.app import App from kivy.uix.button import Button  from kivy.utils import platform  import jnius from jnius import cast from jnius import autoclass  # \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 Android if platform == 'android':     # \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 System     System = autoclass('java.lang.System')     PythonActivity = autoclass('org.kivy.android.PythonActivity')     CurrentActivity = cast('android.app.Activity', PythonActivity.mActivity)  # \u041a\u043b\u0430\u0441\u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443 \u0434\u043b\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. class ButtonApp(App):      def build(self):         # use a (r, g, b, a) tuple         btn = Button(text =\"Push Me !\",                    font_size =\"20sp\",                    background_color = (1, 1, 1, 1),                    color = (1, 1, 1, 1),                    size_hint = (.2, .1),                    pos_hint = {'x':.4, 'y':.45})          # bind() use to bind the button to function callback         btn.bind(on_press = self.callback)         return btn      def on_start(self):         self.service = None          # \u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.         self.service_start()      # callback function tells when button pressed     def callback(self, event):         if platform == 'android':             CurrentActivity.finishAndRemoveTask()              System.exit(0)         else :             exit()      # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430     def service_start(self):         if platform == 'android':             self.service = autoclass(CurrentActivity.getPackageName() + \".ServiceTest\")             self.service.start(CurrentActivity, \"\")      # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430     def service_stop(self):         if self.service :             if platform == 'android':                 self.service.stop(CurrentActivity)  ## #  \u0421\u0442\u0430\u0440\u0442. ## if __name__ == \"__main__\":     # \u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f     ButtonApp().run()<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 Android \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0449\u0438\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0434\u0430\u0441\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\/\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0436\u0438\u0437\u043d\u044c.<br \/>  \u0427\u0442\u043e \u0431\u044b \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438\/\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0422.\u043a. \u0432 Android \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0449\u0438\u0442\u0430, \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0432 \u0446\u0435\u043b\u044f\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"otladka\">\u041e\u0442\u043b\u0430\u0434\u043a\u0430<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">adb logcat | egrep \"python|Test|test\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0432\u0438\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">11-08 18:34:01.214 12305 12318 I Test    : Android kivy bootstrap done. __name__ is __main__ 11-08 18:34:01.214 12305 12318 I python  : AND: Ran string 11-08 18:34:01.214 12305 12318 I python  : Run user program, change dir and execute entrypoint 11-08 18:34:01.630 12305 12318 I Test    : [INFO   ] [Logger      ] Record log in \/data\/user\/0\/com.heattheatr.kivy_service_test\/files\/app\/.kivy\/logs\/kivy_22-11-08_0.txt 11-08 18:34:01.631 12305 12318 I Test    : [INFO   ] [Kivy        ] v2.1.0 11-08 18:34:01.632 12305 12318 I Test    : [INFO   ] [Kivy        ] Installed at \"\/data\/user\/0\/com.heattheatr.kivy_service_test\/files\/app\/_python_bundle\/site-packages\/kivy\/__init__.pyc\" 11-08 18:34:01.633 12305 12318 I Test    : [INFO   ] [Python      ] v3.9.9 (main, Nov  7 2022, 09:58:48)  11-08 18:34:01.633 12305 12318 I Test    : [Clang 12.0.8 (https:\/\/android.googlesource.com\/toolchain\/llvm-project c935d99d 11-08 18:34:01.634 12305 12318 I Test    : [INFO   ] [Python      ] Interpreter at \"\" 11-08 18:34:01.636 12305 12318 I Test    : [INFO   ] [Logger      ] Purge log fired. Processing... 11-08 18:34:01.638 12305 12318 I Test    : [INFO   ] [Logger      ] Purge finished! 11-08 18:34:04.514 12305 12318 I Test    : python service running..... com.heattheatr.kivy_service_test 12305 11-08 18:34:14.524 12305 12318 I Test    : python service running..... com.heattheatr.kivy_service_test 12305<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0441\u0432\u043e\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">adb shell<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">am broadcast -a android.intent.action.BOOT_COMPLETED com.heattheatr.kivy_service_test am broadcast -a android.intent.action.DELETE com.heattheatr.kivy_service_test am broadcast -a android.intent.action.MAIN com.heattheatr.kivy_service_test<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"voprosy\">\u0412\u043e\u043f\u0440\u043e\u0441\u044b<\/h2>\n<p>  <\/p>\n<p>\u0422\u043e \u0441 \u0447\u0435\u043c \u043d\u0435 \u0441\u043c\u043e\u0433 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0438 \u0445\u043e\u0447\u0443 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0443 \u0437\u043d\u0430\u044e\u0449\u0438\u0445 \u043b\u044e\u0434\u0435\u0439.<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0417\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0442\u043e\u0436\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f (\u043e\u0431\u043e\u0448\u0435\u043b \u044d\u0442\u043e \u043a\u043e\u0441\u0442\u044b\u043b\u044f\u043c\u0438 \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0443). \u041a\u0430\u043a \u043d\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f?<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"ssylki\">\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dvjdjvu\/kivy_service_test\" rel=\"nofollow noopener noreferrer\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/348226\">\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0433\u0440\u044b \u043f\u043e\u0434 Android \u043d\u0430 Python \u043d\u0430 \u0431\u0430\u0437\u0435 Kivy. \u041e\u0442 \u0410 \u0434\u043e \u042f: \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 \u0438 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0427\u0430\u0441\u0442\u044c 1<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/271663\/\">Android. \u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435: \u0442\u0435\u043e\u0440\u0438\u044f \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/656453\/\">C\/C++ \u0438\u0437 Python (Kivy, ctypes) \u043d\u0430 Android<\/a> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Kivy \u043d\u0430 Android<\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/683536\/\">Java \u0438\u0437 Python (Kivy) \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 Android<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/694906\/\"> https:\/\/habr.com\/ru\/post\/694906\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"500\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/gu\/t_\/qy\/gut_qyz_3_l0m28xzeryxhr7a0m.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/gu\/t_\/qy\/gut_qyz_3_l0m28xzeryxhr7a0m.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 <strong>python<\/strong> \u043f\u043e\u0434 <strong>android<\/strong> \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0427\u0442\u043e \u0431\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <a href=\"https:\/\/github.com\/kivy\/buildozer\" rel=\"nofollow noopener noreferrer\">buildozer<\/a> \u0438 <a href=\"https:\/\/github.com\/kivy\/python-for-android\" rel=\"nofollow noopener noreferrer\">pythonforandroid<\/a>. \u0422.\u043a. \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c, \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 kivy \u043d\u0435 \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c \u043e\u0431 \u044d\u0442\u043e\u043c.<\/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-340977","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340977","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=340977"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340977\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}