{"id":196546,"date":"2013-10-07T13:16:03","date_gmt":"2013-10-07T09:16:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=196546"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=196546","title":{"rendered":"<span class=\"post_title\">\u0413\u043e\u0442\u043e\u0432\u0438\u043c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u0437\u043e\u043e\u043f\u0430\u0440\u043a \u0432\u0435\u0440\u0441\u0438\u0439 Android<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f \u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0437\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043a\u0438 \u0434\u043b\u044f Android. \u041d\u043e \u043d\u0438 \u043f\u043e\u0434 Android, \u043d\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0430 Java \u043c\u043d\u0435 \u0440\u0430\u043d\u0435\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c. \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u0440\u043e\u0434\u0435 phonegap \u0438 \u043f\u0440\u043e\u0447\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u0418 \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0434 \u0432\u0435\u0440\u0441\u0438\u0438 2.2 \u2014 4.3 (SDK 8 \u2014 18).<\/p>\n<p>  \u041e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u043a\u0440\u0443\u0442\u0430\u0441\u0430\u0445 Android \u0438 \u043a\u043e\u0441\u0442\u044b\u043b\u044f\u0445 \u043f\u043e\u0434 \u043d\u0438\u0445 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u044d\u0442\u043e \u0432\u0441\u0435 \u0443\u0432\u0438\u0434\u0435\u0432\u0448\u0435\u0433\u043e, \u044f \u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b\u0448\u043b\u043e \u0431\u0435\u0437 HelloWorld, \u00abOMG! Java\u00bb, \u0438 \u0442.\u043f.<\/p>\n<p>  <a href=\"#orientation\">\u041f\u043e\u0432\u043e\u0440\u043e\u0442 \u044d\u043a\u0440\u0430\u043d\u0430\/\u0441\u043c\u0435\u043d\u0430 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a><br \/>  <a href=\"#network_unreachable\">Network unreachable<\/a><br \/>  <a href=\"#loadSmth\">\u0413\u0440\u0443\u0437\u0438\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/a><br \/>  <a href=\"#j2js_workaround\">\u041c\u043e\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 Java \u0438 JavaScript<\/a><\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0412\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e \u0441\u0443\u0442\u0438 \u043e\u0434\u0438\u043d WebView, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b (assets), \u0438 \u0434\u043e\u043f \u043e\u0431\u0432\u044f\u0437\u043a\u0430 \u043a \u043d\u0435\u043c\u0443 \u043d\u0430 Java. \u0427\u0442\u043e JS \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0430\u043c \u2014 \u0434\u0435\u0440\u0433\u0430\u0435\u0442 \u043f\u043e \u043c\u043e\u0441\u0442\u0443 Java&lt;=&gt;JS \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\/\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u044f\u0432\u0443. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u00ab\u0432\u0442\u0438\u0445\u0443\u044e\u00bb \u043f\u043e\u0445\u0438\u043c\u0438\u0447\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<p>  <a name=\"orientation\"><\/a><\/p>\n<h4>\u041f\u043e\u0432\u043e\u0440\u043e\u0442 \u044d\u043a\u0440\u0430\u043d\u0430<\/h4>\n<p>  \u0412 Android \u0441\u043c\u0435\u043d\u0430 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a <i>\u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e<\/i> Activity (UI). \u0414\u043b\u044f WebView \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f input \u043f\u043e\u043b\u0435\u0439, \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 JS \u0438 \u0442.\u043f.<br \/>  \u0412 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043c\u0430\u0441\u0441\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 SDK. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u043f\u043e\u0434 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 SDK \u0432\u044b\u0448\u0435\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<p>  \u0412 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u043e\u0439 \u043d\u0430\u043c activity \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 android:configChanges \u00abscreenSize|orientation\u00bb. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0430, \u0438\u043d\u0430\u0447\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u0433\u0434\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<br \/>  \u0412 layout&#8217;\u0435 \u041d\u0415 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c WebView \u0432\u043e\u043e\u0431\u0449\u0435. \u0412 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0443:  <\/p>\n<pre><code class=\"xml\">    &lt;FrameLayout android:id=&quot;@+id\/webViewPlaceholder&quot;         ...     \/&gt; <\/code><\/pre>\n<p>  \u041d\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u2014 \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043d\u0438\u043c \ud83d\ude42<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0430\u0448\u0435\u0439 Activity:  <\/p>\n<pre><code class=\"java\">protected FrameLayout webViewPlaceholder; \/\/ \u0442\u0430 \u0441\u0430\u043c\u0430\u044f \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430 protected WebView webView; \/\/ \u0432\u043e\u0442 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0438 \u043d\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);     initUI(); }  protected void initUI() {     webViewPlaceholder = ((FrameLayout)findViewById(R.id.webViewPlaceholder));      if (webView == null) {         webView = new WebView(this);         webView.loadUrl(&quot;file:\/\/\/android_asset\/index.html&quot;);     }     webViewPlaceholder.addView(webView); }  @Override public void onConfigurationChanged(Configuration newConfig) {     if (webView != null) {         webViewPlaceholder.removeView(webView); \/\/ \u043f\u0435\u0440\u0435\u0434 \u0441\u043c\u0435\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0432\u044b\u0434\u0435\u0440\u0433\u0438\u0432\u0430\u0435\u043c WebView \u0438\u0437 UI     }     super.onConfigurationChanged(newConfig);     setContentView(R.layout.activity_main);     initUI(); \/\/ \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c WebView \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 UI }  @Override protected void onSaveInstanceState(Bundle outState) {     super.onSaveInstanceState(outState);     webView.saveState(outState); }  @Override protected void onRestoreInstanceState(Bundle savedInstanceState) {     super.onRestoreInstanceState(savedInstanceState);     webView.restoreState(savedInstanceState); } <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u0435?<br \/>  \u041f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u0438 \u0441\u043c\u0435\u043d\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u00ab\u0432\u044b\u0434\u0435\u0440\u0433\u0438\u0432\u0430\u0435\u043c\u00bb WebView \u0438\u0437 UI. \u0417\u0430\u043e\u0434\u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 WebView, \u0442.\u043a. activity \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u044d\u043a\u0440\u0430\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u044b\/\u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0438\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 activity \u0432 \u043d\u0430\u0448\u0435\u0439 \u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435.<br \/>  \u041a \u0441\u043b\u043e\u0432\u0443, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (\u0442\u0435\u0445 \u0436\u0435 input&#8217;\u043e\u0432), \u0442\u043e \u0438\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c id. \u0418\u043d\u0430\u0447\u0435 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>  <a name=\"network_unreachable\"><\/a><\/p>\n<h4>Network unreachable<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0432 WebView \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u043e \u0441\u0432\u043e\u0438\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u0442\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u044c\u044e \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 (\u0430\u0432\u0438\u0430-\u0440\u0435\u0436\u0438\u043c, \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d wifi&#8230;) \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0441\u044c\u043c\u0430 \u0437\u0430\u0431\u0430\u0432\u043d\u043e. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u043b\u043e\u0432\u0438\u043c WebViewClient.onReceivedError \u0438 \u0440\u0443\u0433\u0430\u0435\u043c\u0441\u044f. \u0410 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u0432\u044b\u0437\u043e\u0432 WebViewClient.onPageFinished, \u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0443 \u043d\u0430\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0430\u0441\u044c. \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0440\u0430\u043d\u044c\u0448\u0435, \u043d\u043e \u043d\u0430 4.3 (sdk 18) onReceivedError \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0443\u0441\u0442\u044f 2 <i>\u043c\u0438\u043d\u0443\u0442\u044b<\/i> \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041a\u0430\u043a\u0438\u0445 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432 \u043d\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0438 \u043c\u0435\u043d\u044f\u0442\u044c\u2026 onPageStarted \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0435, \u0442\u0438\u0448\u0438\u043d\u0430 \u043d\u0430 2 \u043c\u0438\u043d\u0443\u0442\u044b\u2026<br \/>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435? \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441, \u0430 \u0438\u0437 \u043d\u0435\u0433\u043e \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<br \/>  <i>\u0415\u0441\u043b\u0438 \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e \u2014 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445, \u043c\u043e\u0436\u0435\u0442 \u0435\u0449\u0435 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/i><\/p>\n<p>  <a name=\"loadSmth\"><\/a><\/p>\n<h4>\u0413\u0440\u0443\u0437\u0438\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h4>\n<p>  \u0412 WebView \u0431\u0435\u0437 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0435\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u043b\u0438\u0431\u043e \u0441\u0442\u0440\u043e\u043a\u0443 loadData(&quot;&#8230;&quot;), \u043b\u0438\u0431\u043e \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 loadUrl(\u00abfile:\/\/\/&#8230;\u00bb). \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 loadData \u043f\u0440\u043e\u044f\u0432\u0438\u043b \u0441\u0435\u0431\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u0441 \u043a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0435\u0439 UTF-8. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e loadData \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u0441\u0442\u0440\u043e\u043a\u0438, \u0432 Android \u043e\u0442 4.1+ (\u0432 4.0 \u0435\u0449\u0435, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043c\u043d\u044e, \u043d\u0435 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u043b\u043e\u0441\u044c) \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u044f\u0432\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u0431\u0430\u0439\u0442\u043d\u043e\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435. \u0418 \u043d\u0438 meta charset=utf-8, \u043d\u0438 webView.getSettings().setDefaultTextEncodingName(\u00abutf-8\u00bb) \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043d\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438.<br \/>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435? \u0413\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0447\u0435\u0440\u0435\u0437 loadUrl.<\/p>\n<p>  <a name=\"j2js_workaround\"><\/a><\/p>\n<h4>\u041c\u043e\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 Java \u0438 JavaScript<\/h4>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u2014 \u044d\u0442\u043e <s>\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435\u043f\u043e\u0434\u044a\u0435\u043c\u043d\u0430\u044f<\/s> \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430. \u0412\u0430\u0436\u043d\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 JS \u043a\u043e\u0434\u0430 \u0441 Java, \u043f\u0440\u0438\u0447\u0435\u043c \u043f\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u0435 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u043d.<br \/>  \u0418 \u0432\u043e\u0442 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0435\u0439\u0448\u0430\u044f \u0432\u0435\u0449\u044c \u2014 addJavascriptInterface (\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043e\u0444\u0444 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438):  <\/p>\n<pre><code class=\"java\">class JsObject {     @JavascriptInterface     public String toString() { return &quot;injectedObject&quot;; } } webView.addJavascriptInterface(new JsObject(), &quot;injectedObject&quot;); webView.loadData(&quot;&quot;, &quot;text\/html&quot;, null); webView.loadUrl(&quot;javascript:alert(injectedObject.toString())&quot;); <\/code><\/pre>\n<p>  \u0417\u0430\u0434\u0430\u0435\u043c \u00ab\u043c\u043e\u0441\u0442\u00bb \u0438 \u0435\u0433\u043e \u0438\u043c\u044f \u0434\u043b\u044f JS \u0438 \u0432\u0441\u0451, \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f. \u0412\u044b\u0437\u043e\u0432 loadData \u0431\u0435\u0437 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f (injectedObject \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432 JS) \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e \u0445\u043e\u0442\u044c \u0447\u0442\u043e-\u0442\u043e (\u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0438 \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443).<br \/>  \u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u0437 JS \u0432 Java \u0442\u0430\u043a \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438 \u0442\u0438\u043f\u043e\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<br \/>  \u041f\u0438\u0448\u0435\u043c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u0445 \u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445: 4.3 \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, 4.2 \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442,\u2026 2.3 \u2014 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043a\u043e\u0440\u043a\u0443 (\u0432\u044b\u043b\u0435\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u041e\u0421)\u2026 \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435, \u0427\u0422\u041e?\u2026 2.2 \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0421\u043d\u043e\u0432\u0430 2.3 \u2014 \u0432 \u043a\u043e\u0440\u043a\u0443.<br \/>  \u041f\u0430\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a injectedObject.toString (\u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u0432\u044b\u0437\u043e\u0432\u0430). \u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a injectedObject \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e.<br \/>  \u041f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u00abcallJNIMethod&lt;&gt;\u00bb \u0432 backtrace \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0443\u0433\u0430 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f\u2026<br \/>  \u0413\u0443\u0433\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0447\u0435\u0441 SO \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u0430\u0441\u0441\u043e\u0432\u0430\u044f \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u043b\u0438\u0437\u043a\u043e\u0439 \u043a 100% \u043d\u0430 \u0432\u0441\u0435\u0439 \u043b\u0438\u043d\u0435\u0439\u043a\u0435 2.3.* (sdk 9 \u2014 10). \u0412\u0440\u043e\u0434\u0435 \u0434\u0430\u0436\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430 2.2 (sdk 8), \u043d\u043e \u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u0440\u0443 \u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443. \u041f\u0440\u0438\u0447\u0435\u043c \u043a\u0430\u043a \u043d\u0430 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u0445, \u0442\u0430\u043a \u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b WebView \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 JS \u0434\u0432\u0438\u0436\u043a\u0430 \u043d\u0435 V8.<br \/>  \u041a\u0440\u0438\u043a\u0438 \u043c\u0430\u0441\u0441 \u0438 \u043f\u0440\u043e\u0441\u044c\u0431\u044b \u0432 Google \u043f\u043e\u0447\u0438\u043d\u0438\u0442\u044c \u0431\u0430\u0433\u0443 \u043d\u0430\u0447\u0430\u043b\u0438\u0441\u044c \u0432 2010, \u043d\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u043b\u0438.<\/p>\n<p>  \u0417\u0430 \u044d\u0442\u0438 \u0433\u043e\u0434\u044b \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u0431\u0445\u043e\u0434\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, workaround&#8217;\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043f\u043e\u0434 2.3.*. \u041d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0443\u0433\u0430\u043b\u0430\u0441\u044c \u0438 \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0434 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438, \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b:<\/p>\n<p>  1. \u0412\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u044f\u043c\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a Java \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c, \u043e\u0431\u0440\u0430\u0437\u043d\u043e, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"javascript\">    window.location = 'http:\/\/OurMegaPrefix:MethodName:Param0:Param1'; <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432 Java \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437  <\/p>\n<pre><code class=\"java\">webView.setWebViewClient(new WebViewClient() {     @Override     public boolean shouldOverrideUrlLoading(WebView view, String url) {         if (!url.startsWith(&quot;OurMegaPrefix&quot;)) {             return false;         }          \/\/ \u043d\u0430\u0448\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430: \u043f\u0430\u0440\u0441\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443, \u0432\u044b\u0434\u0435\u043b\u044f\u044f \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c     }      \/\/ \u043e\u0434\u0438\u043d \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:     public void onPageFinished(WebView view, String url) {         super.onPageFinished(view, url);          if (javascriptInterfaceBroken) {             String handleGingerbreadStupidity =                 &quot;javascript:function openQuestion(id) { window.location='http:\/\/jshandler:openQuestion:'+id; }; &quot;                 + &quot;javascript: function handler() { this.openQuestion=openQuestion; }; &quot;                 + &quot;javascript: var jshandler = new handler();&quot;;             webView.loadUrl(handleGingerbreadStupidity);         }     }  });  if (!javascriptInterfaceBroken) {     webView.addJavascriptInterface(new JsObject(), &quot;jshandler&quot;); } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 onPageFinished \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c inject \u043a\u043e\u0434\u0430 \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u0440\u043e\u043a\u0441\u0438-\u043e\u0431\u044a\u0435\u043a\u0442\u0430.<br \/>  \u041a\u0440\u043e\u043c\u0435 \u043e\u0442\u043a\u0440\u043e\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u0441\u0442\u044b\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0449\u0435 \u0438 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u043c\u044f callback \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u2026 \u041d\u043e \u043c\u044b \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043f\u043e\u0439\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  2. \u0414\u0440\u0443\u0433\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 javascript \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e (\u0434\u043b\u044f js) \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f: prompt(). \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0435\u0433\u043e \u043f\u043e\u0439\u043c\u0430\u0442\u044c \ud83d\ude42  <\/p>\n<pre><code class=\"javascript\">var res = prompt('OurMegaPrefix:meth:param0:param1'); <\/code><\/pre>\n<p>  \u0412 res \u043a\u0430\u043a-\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0436\u0435 \u0438\u0437 Java \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430. \u0418 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.  <\/p>\n<pre><code class=\"java\">webView.setWebChromeClient(new WebChromeClient() {     @Override     public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {         String prefix = JSAPI.class.getSimpleName();          if (!message.startsWith(prefix)) {             return super.onJsPrompt(view, url, message, defaultValue, result);         }          \/\/ \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430          return true; \/\/ \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c prompt \u0434\u0438\u0430\u043b\u043e\u0433 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e     } }); <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c JSAPI \u2014 \u0438\u043c\u044f \u043f\u0440\u043e\u043a\u0441\u0438-\u043a\u043b\u0430\u0441\u0441\u0430 (\u0432\u044b\u0448\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u043b\u0441\u044f \u00abJsObject\u00bb).<br \/>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c) \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0443 JSAPI.  <\/p>\n<pre><code class=\"java\">var jsapi = new JSAPI(); <\/code><\/pre>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u043e \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044e \u0432 Java, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043b\u0438 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"java\">Method method = JSAPI.class.getMethod(methodName, new Class[] {String.class}); <\/code><\/pre>\n<p>  \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u043e\u0434\u043d\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c.<br \/>  \u0418\u043b\u0438 \u0442\u0430\u043a \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e \u0438\u043c\u0435\u043d\u0438:  <\/p>\n<pre><code class=\"java\">Method method = null; for (Method meth : JSAPI.class.getMethods()) {     if (meth.getName().equals(methodName)) {         method = meth;         break;     } } <\/code><\/pre>\n<p>  \u041f\u043e\u0442\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 (\u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430):  <\/p>\n<pre><code class=\"java\">method.invoke(jsapi, parameter); <\/code><\/pre>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u043e\u0431\u0445\u043e\u0434 addJavascriptInterface. \u041d\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0443 \u0441\u0432\u043e\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043d\u0430 \u0432\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u0434\u0435\u043b\u043e\u043c.<br \/>  <i>\u042f \u0441\u0430\u043c backend&#8217;\u0449\u0438\u043a (php, python, bash, C \u0438 \u0442.\u043f.) \u0438 \u043c\u043e\u0439 JS \u043d\u0435 \u0442\u0430\u043a \u043a\u0440\u0443\u0442, \u0447\u0442\u043e\u0431\u044b \u0437\u0430 \u043d\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u0442\u044b\u0434\u043d\u043e. \u041f\u0440\u0438\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430 \ud83d\ude42<\/i><\/p>\n<p>  \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0447\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c json:  <\/p>\n<ul>\n<li>\u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 js \u0447\u0435\u0440\u0435\u0437 JSON.stringify \u0438 JSON.parse;<\/li>\n<li>\u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 java \u0447\u0435\u0440\u0435\u0437 JSONObject \u0438 JSONArray.<\/li>\n<\/ul>\n<p>  \u0418 \u043f\u043e DOMContentLoaded:  <\/p>\n<pre><code class=\"javascript\">if (typeof JSAPI == 'object') {     return; }  (function(){     var JSAPI = function() {         function bridge(func) {             var args = Array.prototype.slice.call(arguments.callee.caller.arguments, 0);             var res = prompt('JSAPI.'+func, JSON.stringify(args));             try {                 res = JSON.parse(res);                 res = (res && res.result) ? res.result : null;             }             catch (e) {                 res = null;             }             return res;         }          this.getUserAccounts = function() { \/\/ \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043c\u0435\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u0430             return bridge('getUserAccounts');         }     };      window['JSAPI'] = new JSAPI(); })(window); <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 JSAPI \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d (addJavascriptInterface \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0441\u044f) \u2014 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443.<br \/>  \u0421\u0443\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u2014 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0432\u044b\u0437\u043e\u0432 prompt(&#8216;JSAPI.getUserAccounts&#8217;, &#8216;[]&#8217;), \u0433\u0434\u0435 \u0432\u0442\u043e\u0440\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0438\u0434\u0435\u0442 json \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432\u044b\u0437\u043e\u0432\u0430.<br \/>  \u0410 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 prompt \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u044c {result: \u041e\u0422\u0412\u0415\u0422}.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 Android SDK \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434:  <\/p>\n<pre><code class=\"javascript\">var res = JSAPI.getUserAccounts(); \/\/ \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 json \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c: console.log(JSON.parse(res)[0]); <\/code><\/pre>\n<p>  \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 Java:  <\/p>\n<pre><code class=\"java\">webView.setWebChromeClient(new WebChromeClient() {     @Override     public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {         \/\/ \u0432\u044b\u0437\u043e\u0432 \u0438\u0434\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 prompt(message='JSAPI.method', defaultValue='params')          String prefix = JSAPI.class.getSimpleName()+&quot;.&quot;;          if (!message.startsWith(prefix)) {             return super.onJsPrompt(view, url, message, defaultValue, result);         }          String meth_name = message.substring(prefix.length());          String json_result = null;          try {             \/\/ \u043f\u0430\u0440\u0441\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 json \u043c\u0430\u0441\u0441\u0438\u0432\u0430             JSONArray params = new JSONArray(defaultValue);             int len = params.length();             Object []paramValues = new Object[len];             for (int i=0; i&lt;len; ++i) {                 paramValues[i] = params.opt(i);             }              \/\/ \u0438\u0449\u0435\u043c \u043c\u0435\u0442\u043e\u0434, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438             Method method = null;             for (Method meth : JSAPI.class.getMethods()) {                 if (meth.getName().equals(meth_name)) {                     method = meth;                     break;                 }             }              if (null == method) {                 throw new NoSuchMethodException();             }              \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0436\u0443 \u0432 &quot;{\\&quot;result\\&quot;:\u0420\u0415\u0417\u0423\u041b\u042c\u0422\u0410\u0422}&quot;             JSONObject res = new JSONObject();             res.put(&quot;result&quot;, method.invoke(new JSAPI(), paramValues));             json_result = res.toString();         }         catch (Exception e) {             if (   !(e instanceof JSONException)                 && !(e instanceof NoSuchMethodException)             ) {                 Log.e(TAG, &quot;Ooops:&quot;+e.getMessage()); \/\/ \u0435\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u0435\u043c\u0441\u044f \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0443\u0442 &quot;wrong number of arguments&quot;             }         }          result.confirm(json_result);         return true;     } }); <\/code><\/pre>\n<p>  \u0418 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0430\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430:  <\/p>\n<pre><code class=\"java\">class JSAPI {     @JavascriptInterface     public String getUserAccounts()     {         JSONArray json = new JSONArray();          String emailPattern = Patterns.EMAIL_ADDRESS.pattern();         AccountManager am = AccountManager.get(getApplicationContext());         if (am != null) {             for (Account ac : am.getAccounts()) {                 if (!ac.name.matches(emailPattern)) {                     continue;                 }                  JSONArray item = new JSONArray();                 item.put(ac.type);                 item.put(ac.name);                 json.put(item);             }         }          return json.toString();     } } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0438\u0445 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u043d \u043a\u0430\u043a String, \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<br \/>  \u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @JavascriptInterface \u043d\u0443\u0436\u043d\u0430\u044f \u0434\u043b\u044f \u0441\u0432\u0435\u0436\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 SDK. \u0412 \u0441\u0442\u0430\u0440\u044b\u0445 \u0438 \u0431\u0435\u0437 \u043d\u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0435\u0449\u0435 \u0445\u043e\u0447\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u00ab\u043f\u043e\u043b\u043e\u043c\u0430\u043d\u043d\u044b\u0439 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u00bb \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u0434, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 Build.VERSION.RELEASE == \u00ab2.3\u00bb. \u041f\u043b\u043e\u0445\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043b\u0443\u0447\u0448\u0435 \u0443\u0436 \u0447\u0435\u0440\u0435\u0437 Build.VERSION.RELEASE.startsWith(\u00ab2.3\u00bb). \u0410 \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435, \u0438\u043c\u0445\u043e, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u0441\u0438\u044e SDK: (Build.VERSION.SDK_INT == 9) || (Build.VERSION.SDK_INT == 10).<\/p>\n<p>  \u0416\u0435\u043b\u0430\u044e\u0449\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0435\u0449\u0435 \u0438 \u0441\u0431\u043e\u0440\u043a\u0443 JS (\u043d\u0430 V8, \u043f\u043e\u0432\u0442\u043e\u0440\u044e\u0441\u044c, \u0431\u0430\u0433 \u043d\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f) \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0433\u0443\u043b\u0438\u0442\u044c, \u0442\u0430\u043c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>  \u0418 \u0435\u0449\u0435 \u043d\u0430 \u0437\u0430\u043a\u0443\u0441\u043a\u0443 \u0432\u044b\u0437\u043e\u0432, \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b Java: \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e, \u0438\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 callback.  <\/p>\n<pre><code class=\"java\">public void callJS(String jsCode) {     final String jsCode2 = &quot;javascript:&quot;+jsCode;     runOnUiThread(new Runnable() {         @Override         public void run() {             webView.loadUrl(jsCode2);         }     }); }  jsapi.callJS(&quot;alert('Hello, Habr!');&quot;); <\/code><\/pre>\n<p>  \u0418\u0437\u0432\u0440\u0430\u0442 \u0441 jsCode2 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 jsCode \u0432\u043d\u0443\u0442\u0440\u044c Runnable. \u041a\u0430\u043a \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b. \u0415\u0449\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<br \/>  runOnUiThread \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 callJS \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 UI \u043f\u043e\u0442\u043e\u043a\u0435 (\u043f\u043e\u0447\u0442\u0438 \u043d\u0430\u0432\u0435\u0440\u044f\u043a\u0430 \u0442\u0430\u043a \u0438 \u0431\u0443\u0434\u0435\u0442).<br \/>  \u041d\u043e \ud83d\ude42 \u0412 2.2 \u0443 \u043c\u0435\u043d\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u043e \u0438 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e. \u0412 \u0441\u0442\u0430\u0440\u0448\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 <s>\u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438<\/s> \u0441\u0442\u0430\u043b\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u0435\u0435.<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0435 Java \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \ud83d\ude42 \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438\u043b\u0438, \u0432\u0434\u0440\u0443\u0433, \u0434\u0430\u0436\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<p>  P.S. Android Studio \u043d\u0430 \u0434\u043d\u044f\u0445 \u0434\u043e\u0440\u043e\u0441\u043b\u0430 \u0434\u043e 0.2.11, \u0438 \u0435\u0439 \u0443\u0436\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u044f JetBrains. \u041d\u0435 \u0431\u0435\u0437 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0438\u0437\u044a\u044f\u043d\u043e\u0432, \u043d\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/196546\/\"> http:\/\/habrahabr.ru\/post\/196546\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f \u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0437\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043a\u0438 \u0434\u043b\u044f Android. \u041d\u043e \u043d\u0438 \u043f\u043e\u0434 Android, \u043d\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0430 Java \u043c\u043d\u0435 \u0440\u0430\u043d\u0435\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c. \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u0440\u043e\u0434\u0435 phonegap \u0438 \u043f\u0440\u043e\u0447\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u0418 \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0434 \u0432\u0435\u0440\u0441\u0438\u0438 2.2 \u2014 4.3 (SDK 8 \u2014 18).<\/p>\n<p>  \u041e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u043a\u0440\u0443\u0442\u0430\u0441\u0430\u0445 Android \u0438 \u043a\u043e\u0441\u0442\u044b\u043b\u044f\u0445 \u043f\u043e\u0434 \u043d\u0438\u0445 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u044d\u0442\u043e \u0432\u0441\u0435 \u0443\u0432\u0438\u0434\u0435\u0432\u0448\u0435\u0433\u043e, \u044f \u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b\u0448\u043b\u043e \u0431\u0435\u0437 HelloWorld, \u00abOMG! Java\u00bb, \u0438 \u0442.\u043f.<\/p>\n<p>  <a href=\"#orientation\">\u041f\u043e\u0432\u043e\u0440\u043e\u0442 \u044d\u043a\u0440\u0430\u043d\u0430\/\u0441\u043c\u0435\u043d\u0430 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a><br \/>  <a href=\"#network_unreachable\">Network unreachable<\/a><br \/>  <a href=\"#loadSmth\">\u0413\u0440\u0443\u0437\u0438\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/a><br \/>  <a href=\"#j2js_workaround\">\u041c\u043e\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 Java \u0438 JavaScript<\/a><\/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-196546","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/196546","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=196546"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/196546\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=196546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=196546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=196546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}