{"id":268979,"date":"2015-11-25T14:53:07","date_gmt":"2015-11-25T11:53:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=268979"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=268979","title":{"rendered":"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"},"content":{"rendered":"<p>       \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0430 <a href=\"http:\/\/stackoverflow.com\/search?tab=newest&amp;q=boot_completed\">stackoverflow.com<\/a> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ACTION_BOOT_COMPLETED \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u043e\u0432\u0438\u0447\u043a\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439: \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 ACTION_BOOT_COMPLETED. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u044f \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0440\u0435\u0437\u044e\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043e\u043f\u044b\u0442 \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0437 stackoverflow.com, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442. \u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0436\u0435 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u00ab\u043a\u043e\u0432\u0430\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0430\u0433\u0430\u00bb \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abACTION_BOOT_COMPLETED\u00bb?<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>1. \u0422\u0435\u043e\u0440\u0438\u044f<\/h4>\n<p>  \u0412\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"http:\/\/developer.android.com\/intl\/ru\/training\/scheduling\/alarms.html#boot\">\u044d\u0442\u043e\u0442<\/a> \u0438 <a href=\"http:\/\/developer.android.com\/intl\/ru\/training\/tv\/discovery\/recommendations.html#run-service\">\u044d\u0442\u043e\u0442<\/a>) \u0438 \u0438\u0437\u0443\u0447\u0438\u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 stackoverflow.com, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<\/p>\n<ol>\n<li>\u0412 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u00abmanifest\u00bb \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435:\n<pre><code class=\"xml\">&lt;uses-permission android:name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot; \/&gt; <\/code><\/pre>\n<p>  <\/li>\n<li> \u0412 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u00abapplication\u00bb \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u0440\u0435\u0441\u0438\u0432\u0435\u0440 \u043d\u0430 \u043f\u0440\u0438\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ACTION_BOOT_COMPLETED:\n<pre><code class=\"xml\">&lt;receiver android:name=&quot;com.example.app.MyBroadcastReceiver&quot;&gt;       &lt;intent-filter&gt;           &lt;action android:name=&quot;android.intent.action.BOOT_COMPLETED&quot; \/&gt;       &lt;\/intent-filter&gt;   &lt;\/receiver&gt; <\/code><\/pre>\n<p>  \u0438\u043b\u0438<\/p>\n<pre><code class=\"xml\">&lt;receiver android:name=&quot;.MyBroadcastReceiver&quot;&gt;       &lt;intent-filter&gt;           &lt;action android:name=&quot;android.intent.action.BOOT_COMPLETED&quot; \/&gt;       &lt;\/intent-filter&gt;   &lt;\/receiver&gt; <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0430\u0448\u0435\u0433\u043e broadcast-\u0440\u0435\u0441\u0438\u0432\u0435\u0440\u0430. \u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0440\u0435\u0441\u0438\u0432\u0435\u0440\u0430 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0439\u0442\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u00abenabled\u00bb, \u00abexported\u00bb \u0438 \u0442.\u0434. \u0412\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\u041a\u043e\u0434 \u0432\u0430\u0448\u0435\u0433\u043e broadcast-\u0440\u0435\u0441\u0438\u0432\u0435\u0440\u0430:\n<pre><code class=\"java\">public class BootCompletedReceiver extends BroadcastReceiver {     public BootCompletedReceiver() {     }     public void onReceive(Context context, Intent intent) {         if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {           \/\/ \u0432\u0430\u0448 \u043a\u043e\u0434 \u0437\u0434\u0435\u0441\u044c         }     } } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u0440\u0435\u0441\u0438\u0432\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ACTION_BOOT_COMPLETED, \u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u00abif\u00bb \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0440\u0435\u0441\u0438\u0432\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0439\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 onReceive.<\/p>\n<\/li>\n<li>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u041e\u0421 Android \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 ACTION_BOOT_COMPLETED \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u043f\u0435\u0440\u0435\u0434 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, <a href=\"http:\/\/developer.android.com\/intl\/ru\/guide\/topics\/data\/install-location.html#ShouldNot\">\u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/a>. \u0427\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u041d\u0415 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;@android:installLocation&quot; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u00abauto\u00bb \u0438\u043b\u0438 \u00abpreferExternal\u00bb. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d, \u041e\u0421 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"http:\/\/developer.android.com\/intl\/ru\/guide\/topics\/data\/install-location.html\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u043b\u0443\u0447\u0448\u0435 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u00abinternalOnly\u00bb, \u0447\u0442\u043e\u0431\u044b \u0443 \u0432\u0430\u0441 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u0438\u0441\u043a\u0443\u0448\u0435\u043d\u0438\u0435 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.\n<pre><code class=\"xml\">&lt;manifest xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:installLocation=&quot;internalOnly&quot;     ... &gt; <\/code><\/pre>\n<p>  <\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 (force stop) \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u00ab\u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b\u0430\u00bb \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0435\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ACTION_BOOT_COMPLETED. \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"http:\/\/developer.android.com\/intl\/ru\/about\/versions\/android-3.1.html#launchcontrols\">Android 3.1<\/a> \u0432 \u0446\u0435\u043b\u044f\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412 \u0447\u0435\u043c \u0441\u0443\u0442\u044c? \u0412\u0441\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u00abstopped\u00bb (\u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0441 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438, \u0442.\u043a. \u041e\u0421 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443). \u0412 \u044d\u0442\u043e \u0436\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u00ab\u0443\u0445\u043e\u0434\u0438\u0442\u00bb, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442. \u041f\u043e\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u043e\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043d\u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 ACTION_BOOT_COMPLETED), \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0430\u043c\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0430\u043a\u043e\u043c\u0443 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u043d\u0435\u043c\u0430\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c\u00ab\u0432\u0438\u0440\u0443\u0441\u043d\u0438 \u0438 \u0442\u0440\u043e\u044f\u043d\u0446\u0435\u0432\u00bb \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442.\u043a. \u0443\u0436\u0435 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.\n<p>  <img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/0Aluf.png\" alt=\"image\"\/><\/p>\n<\/li>\n<li>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0436\u0438\u043c\u0430 Fast boot \u0432 HTC-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e HTC-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442\u0430\u043a \u043d\u0430\u0437. \u0440\u0435\u0436\u0438\u043c Fast boot (\u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0444\u043e\u0440\u043c \u0433\u0438\u0431\u0435\u0440\u043d\u0430\u0446\u0438\u0438), \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041e\u0421 \u043d\u0430 \u0434\u0438\u0441\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 ACTION_BOOT_COMPLETED \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u0442.\u043a. \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 (<a href=\"http:\/\/stackoverflow.com\/questions\/2784441\/trying-to-start-a-service-on-boot-on-android?rq=1#comment50779775_16542461\">\u0441\u043c. \u0437\u0434\u0435\u0441\u044c<\/a>). \u0412\u043c\u0435\u0441\u0442\u043e ACTION_BOOT_COMPLETED \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:\n<pre><code class=\"xml\">&lt;action android:name=&quot;android.intent.action.QUICKBOOT_POWERON&quot; \/&gt; &lt;action android:name=&quot;com.htc.intent.action.QUICKBOOT_POWERON&quot; \/&gt; <\/code><\/pre>\n<p>  \u0412 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0432 \u0442\u0435\u0433\u0435 \u00abreceiver\u00bb \u043a\u0440\u043e\u043c\u0435 ACTION_BOOT_COMPLETED \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u043f.1:<\/p>\n<pre><code class=\"xml\">&lt;uses-permission android:name=&quot;android.permission.QUICKBOOT_POWERON&quot; \/&gt; <\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h4>2. \u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430: \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438<\/h4>\n<p>  \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u044e\u0442 \u043d\u043e\u0432\u0438\u0447\u043a\u0438 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<ol>\n<li> \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 force stop \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c (\u0441\u043c. \u043f.1.5).\n<\/li>\n<li> \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0435 \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043d\u0435\u0441 \u0435\u0433\u043e \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c (\u0441\u043c. \u043f. 1.4).\n<\/li>\n<li> \u0423 <a href=\"http:\/\/stackoverflow.com\/questions\/16671619\/android-intentservice-wont-start-on-boot\">\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/a> \u043f\u0440\u0438\u0435\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0435\u0441\u0438\u0432\u0435\u0440\u0430.\n<\/li>\n<li> \u0422\u0430\u043a\u0436\u0435 <a href=\"http:\/\/stackoverflow.com\/a\/17228402\/5323812\">\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438<\/a>, \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432 logcat \u043d\u0435 \u0432\u0438\u0434\u0435\u043b\u0438 \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0437 \u0440\u0435\u0441\u0438\u0432\u0435\u0440\u0430. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Toast \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438:\n<pre><code class=\"java\">Toast toast = Toast.makeText(context.getApplicationContext(),         context.getResources().getString(R.string.your_message), Toast.LENGTH_LONG); toast.show() <\/code><\/pre>\n<p>  <\/li>\n<li> \u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0438\u043b\u0438 \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0435\u0433\u0430 \u0440\u0435\u0441\u0438\u0432\u0435\u0440\u0430:\n<pre><code class=\"xml\">&lt;action android:name=&quot;android.intent.action._BOOT_COMPLETED&quot;\/&gt; &lt;action android:name=&quot;android.intent.action.ACTION_BOOT_COMPLETED&quot;\/&gt; <\/code><\/pre>\n<p>  <\/li>\n<li> \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:\n<ul>\n<li>\u00abuses-permission\u00bb \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u043f\u0440\u044f\u043c\u043e\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u00abmanifest\u00bb, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\/\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0442\u0435\u0433\u0435 \u00abreceiver\u00bb; <\/li>\n<li>\u0442\u0435\u0433 \u00abreceiver\u00bb \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u043f\u0440\u044f\u043c\u043e\u0439 \u043f\u043e\u0442\u043e\u043c\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u00abapplication\u00bb. <\/li>\n<\/ul>\n<p>  <\/li>\n<li> \u0420\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u044b \u0437\u0430\u0434\u0430\u0447, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, Startup-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u0438 \u0442.\u043f. \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 ACTION_BOOT_COMPLETED \u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0442\u044c\/\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435. \u0423\u0434\u0430\u043b\u0438\u0442\u0435 \u044d\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 \u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445.\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ab6\/646\/ef3\/ab6646ef3f40411d924d26d952664c71.png\" alt=\"image\"\/><\/p>\n<\/li>\n<li> \u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u0436\u0438\u043c Fast boot. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0440\u0435\u0436\u0438\u043c \u0438\u043b\u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u043f. 1.6.\n<\/li>\n<li> \u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0442\u044f \u0431\u044b 1 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 ACTION_BOOT_COMPLETED \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\n<\/li>\n<li> \u041d\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435: \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043b\u0438\u0448\u043d\u0438\u0435, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0432 \u0442\u0435\u0433\u0435 \u00abreceiver\u00bb, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 (\u00abuses-permission\u00bb, \u00abenabled\u00bb, \u00abexported\u00bb):\n<pre><code class=\"xml\">&lt;receiver     android:name=&quot;.BootCompletedReceiver&quot;     android:enabled=&quot;true&quot;     android:exported=&quot;true&quot; &gt;     &lt;uses-permission android:name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot; \/&gt;     &lt;intent-filter&gt;         &lt;action android:name=&quot;android.intent.action.BOOT_COMPLETED&quot; \/&gt;     &lt;\/intent-filter&gt; &lt;\/receiver&gt; <\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h4>3. \u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u0440\u0435\u0441\u0438\u0432\u0435\u0440\u0430 \u0432 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435 \u0438 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445.<\/h4>\n<p>  <\/p>\n<ol>\n<li> \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435:\n<pre><code class=\"dos\">adb shell <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c ACTION_BOOT_COMPLETED \u0432\u0441\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c, \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre><code class=\"dos\">am broadcast -a android.intent.action.BOOT_COMPLETED <\/code><\/pre>\n<p>  \u0418\u043b\u0438 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 ACTION_BOOT_COMPLETED \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435:<\/p>\n<pre><code class=\"dos\">am broadcast -a android.intent.action.BOOT_COMPLETED my.package.name <\/code><\/pre>\n<p>  <\/li>\n<li> \u0412 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0432\u0430\u0448\u0435 \u041f\u041e, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0435\u0433\u043e \u0438\u0437 \u0441\u0442\u0443\u0434\u0438\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0442\u0443\u0434\u0438\u044f \u0441\u043e\u0431\u0435\u0440\u0435\u0442 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0435\u0433\u043e. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 (\u044d\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435). \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 ACTION_BOOT_COMPLETED, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0438\u0437 AVD-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430, \u0430 \u043d\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043d\u043e\u043f\u043a\u0438 \u00abRun app\u00bb \u0432 \u0442\u0443\u043b\u0431\u0430\u0440\u0435 \u0441\u0442\u0443\u0434\u0438\u0438.\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430: \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0447\u0435\u0440\u0435\u0437 AVD<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/907\/db0\/162\/907db01623a6407097c56ed6df160495.png\" alt=\"image\"\/>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Android Monitor \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438 logcat.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430: \u043a\u0430\u043a \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438 logcat<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/808\/43d\/a6b\/80843da6b614439b91bd7e4a5b75e49e.png\" alt=\"image\"\/>  <\/div>\n<\/div>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h4>\u0418\u0442\u043e\u0433\u0438<\/h4>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;manifest xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:installLocation=&quot;internalOnly&quot;     package=&quot;com.site.yourapp&quot; &gt;          &lt;uses-permission android:name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot; \/&gt;     &lt;uses-permission android:name=&quot;android.permission.QUICKBOOT_POWERON&quot; \/&gt;      &lt;application&gt;         &lt;activity             android:name=&quot;.MainActivity&quot;             android:label=&quot;@string\/app_name&quot; &gt;             &lt;intent-filter&gt;                 &lt;action android:name=&quot;android.intent.action.MAIN&quot; \/&gt;                 &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; \/&gt;             &lt;\/intent-filter&gt;         &lt;\/activity&gt;              &lt;receiver             android:name=&quot;.BootCompletedReceiver&quot; &gt;             &lt;intent-filter&gt;                 &lt;action android:name=&quot;android.intent.action.BOOT_COMPLETED&quot; \/&gt;                 &lt;action android:name=&quot;android.intent.action.QUICKBOOT_POWERON&quot; \/&gt;                 &lt;action android:name=&quot;com.htc.intent.action.QUICKBOOT_POWERON&quot; \/&gt;             &lt;\/intent-filter&gt;         &lt;\/receiver&gt;     &lt;\/application&gt;  &lt;\/manifest&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0440\u0435\u0441\u0438\u0432\u0435\u0440\u0430, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"java\">public class BootCompletedReceiver extends BroadcastReceiver {   public BootCompletedReceiver() {   }   public void onReceive(Context context, Intent intent) {     if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {       Toast toast = Toast.makeText(context.getApplicationContext(),               context.getResources().getString(R.string.your_message), Toast.LENGTH_LONG);       toast.show();       Log.d(&quot;myapp&quot;, context.getResources().getString(R.string.your_message);       \/\/ \u0432\u0430\u0448 \u043a\u043e\u0434 \u0437\u0434\u0435\u0441\u044c     }   } } <\/code><\/pre>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u043f\u043e\u0431\u043e\u0440\u043e\u0442\u044c \u00ab\u043a\u043e\u0432\u0430\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0430\u0433\u0430\u00bb \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abACTION_BOOT_COMPLETED\u00bb.       <\/p>\n<div class=\"clear\"><\/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\/271663\/\"> http:\/\/habrahabr.ru\/post\/271663\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0430 <a href=\"http:\/\/stackoverflow.com\/search?tab=newest&amp;q=boot_completed\">stackoverflow.com<\/a> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ACTION_BOOT_COMPLETED \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u043e\u0432\u0438\u0447\u043a\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439: \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 ACTION_BOOT_COMPLETED. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u044f \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0440\u0435\u0437\u044e\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043e\u043f\u044b\u0442 \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0437 stackoverflow.com, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442. \u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0436\u0435 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u00ab\u043a\u043e\u0432\u0430\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0430\u0433\u0430\u00bb \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abACTION_BOOT_COMPLETED\u00bb?  <\/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-268979","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/268979","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=268979"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/268979\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=268979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=268979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=268979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}