{"id":323812,"date":"2021-05-26T21:00:25","date_gmt":"2021-05-26T21:00:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=323812"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=323812","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f ANDROID \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/558434\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/du\/0s\/j4\/du0sj4mi0jmkgfmqvtxuxqezfms.jpeg\"><\/div>\n<p><\/a><br \/>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0412\u0430\u043c\u0438, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Android \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 HTML CSS \u0438 JS. \u041f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u043a\u043e\u0434 \u043d\u0430 Java \u0434\u043b\u044f Android \u0431\u0443\u0434\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 XAMARIN \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 Visual Studio. <br \/>  <a name=\"habracut\"><\/a><br \/>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 1 &#8212;<\/font><\/b> \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 <a href=\"https:\/\/visualstudio.microsoft.com\/ru\/downloads\/\">\u0441\u0430\u0439\u0442 <\/a>\u0438 \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Community.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hg\/mn\/qt\/hgmnqtsojhxzhc14gtbue5fdm-i.jpeg\"> <\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 2 &#8212;<\/font><\/b> \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 <u>XAMARIN<\/u>. \u041d\u043e \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cf\/iw\/vo\/cfiwvoithfcaadtjtd0gdafw1vc.png\"><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. <\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 3 &#8212;<\/font><\/b> \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Visual Studio. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442. \u0412 \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043f\u0438\u0448\u0435\u043c xamarin, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 Android, \u044f\u0437\u044b\u043a c# (\u0415\u0441\u043b\u0438 \u0436\u0435\u043b\u0430\u0435\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u044f\u0437\u044b\u043a \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0433\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c)<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ah\/j4\/fs\/ahj4fsp4qip8um4tbguffpd1etu.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 4 &#8212;<\/font><\/b> \u0414\u0430\u043b\u0435\u0435. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0438\u043c\u044f \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0433\u0434\u0435 \u0435\u0433\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u0421\u043e\u0437\u0434\u0430\u0442\u044c.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ef\/ru\/o7\/efruo7bk9d_dtlyjhka9hnmxxiu.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 5 &#8212;<\/font><\/b> \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/g2\/73\/x9\/g273x9roqc3ss9vopeizeivvc5s.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 6 &#8212;<\/font><\/b> \u0416\u043c\u0435\u043c \u043e\u043a. Visual Studio \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/es\/fk\/gq\/esfkgqbch3x7oapmpqz7mshullc.png\"><\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0441 Visual Studio \u043d\u0430\u0436\u0430\u0432 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 F5.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/q5\/6h\/hp\/q56hhp9f3rhaurbop_jx6f-vlao.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 7 &#8212;<\/font><\/b> \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Java. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043a\u043e\u0434\u0438\u0442\u044c \u043d\u0430 C#. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bq\/md\/ox\/bqmdox1ltnngnfnahhl_5t1dfu4.png\"><\/p>\n<p>  \u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a\u043e\u0434 \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c WebView \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 HTML \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 Assets.<\/p>\n<pre><code class=\"xml\">public class MainActivity : AppCompatActivity     {         WebView mWebview; \/\/\u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 HTML         protected override void OnCreate(Bundle savedInstanceState)         {             base.OnCreate(savedInstanceState);             Xamarin.Essentials.Platform.Init(this, savedInstanceState);                         mWebview = new WebView(this);             mWebview.Settings.JavaScriptEnabled = true; \/\/\u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 JS \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432             mWebview.Settings.DomStorageEnabled = true; \/\/\u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430             mWebview.Settings.BuiltInZoomControls = true; \/\/\u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043b\u044c\u0446\u0430\u043c\u0438 \u0449\u0438\u043f\u043a\u043e\u043c             mWebview.Settings.DisplayZoomControls = false; \/\/\u044d\u0442\u043e \u0437\u0430\u043f\u0440\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430             mWebview.Settings.CacheMode = CacheModes.NoCache; \/\/\u044d\u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043b\u0438\u0431\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445               mWebview.LoadUrl($&quot;file:\/\/\/android_asset\/Content\/login.html&quot;); \/\/\u044d\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 Asset\/Content             SetContentView(mWebview);          }         public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)         {             Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);              base.OnRequestPermissionsResult(requestCode, permissions, grantResults);         }     }<\/code><\/pre>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 8 &#8212;<\/font><\/b> \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043c \u043f\u0430\u043f\u043a\u0443 Content.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wu\/rj\/no\/wurjnodw1x6qs6p8sx9e8ifsr44.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 9 &#8212;<\/font><\/b> \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 Content \u0444\u0430\u0439\u043b login.html <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vr\/ov\/y1\/vrovy1-aecmwif7x3mhzqppaxqw.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 10 &#8212;<\/font><\/b> \u0414\u0430\u043b\u0435\u0435 \u0443\u0436\u0435 \u043f\u0438\u0448\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u043d\u0430\u043c HTML CSS JS. \u041c\u043e\u0436\u0435\u043c \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 F5 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/si\/7l\/qa\/si7lqacul_npj0ar0pqrzejlwne.png\"><\/p>\n<p>  \u041f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e. \u0424\u0430\u0439\u043b\u044b html \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u0422\u043e \u0435\u0441\u0442\u044c, \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f Android \u0438 iOS \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c. \u041d\u0435 \u043d\u0430\u0434\u043e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, \u043d\u0435 \u043d\u0430\u0434\u043e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u0430\u043a\u0435\u0442\u044b (\u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u044b) \u043d\u0430 iOS. \u0412\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 HTML. <\/p>\n<p>  \u0412 \u0438\u0434\u0435\u0430\u043b\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432 AppStore \u0438 Google Play.  <\/p>\n<blockquote><p><b><font color=\"#3AC1EF\">Q: <\/font><\/b>\u041d\u043e \u043a\u0430\u043a \u0431\u044b\u0442\u044c \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0441\u0430\u043c\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b? \u041f\u0443\u0448 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f? \u041a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0441\u0430\u043c\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439?<\/p><\/blockquote>\n<p>\u0412\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e! JavaScript \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Android: <\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 1 &#8212;<\/font><\/b> \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u0444\u0430\u0439\u043b MainActivity<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eg\/i8\/et\/egi8etnfketoyyqf1g8zap76tlq.png\"><\/p>\n<pre><code class=\"xml\">\/\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f javascript             mWebview.AddJavascriptInterface(new JavaScriptInterface(), &quot;interface&quot;);               \/\/<\/code><\/pre>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 2 &#8212;<\/font><\/b> \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 JavaScriptInterface \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0443\u0433\u0430\u0442\u044c\u0441\u044f Visual Studio<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vg\/yt\/dc\/vgytdc39bsrr4kxwwg7lq91hqw8.png\"><\/p>\n<pre><code class=\"xml\">  public class JavaScriptInterface : Java.Lang.Object     {         [JavascriptInterface]         [Export(&quot;alert&quot;)]  \/\/\u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0438\u0437 html \u0444\u0430\u0439\u043b\u0430 interface.alert('\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e');         public void alert(string data)         {             Toast.MakeText(Application.Context, data, ToastLength.Short).Show();\/\/\u0437\u0434\u0435\u0441\u044c \u0410\u043d\u0434\u0440\u043e\u0438\u0434 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c Toast         }     }<\/code><\/pre>\n<p>  \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 Export \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435. <\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 3 &#8212;<\/font><\/b> \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rk\/gc\/6u\/rkgc6ugvmx9klldzoerbym5etwg.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 4 &#8212;<\/font><\/b> \u0412 \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c mono<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6j\/q3\/5d\/6jq35dtjkhqnwzufh9brufy9tze.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 5 &#8212;<\/font><\/b> \u041d\u0430\u0439\u0434\u0435\u043c Export \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ej\/dq\/7n\/ejdq7nhyjbxov9jaiclvcyw1b1y.png\"><\/p>\n<p>  <b><font color=\"#3AC1EF\">\u258d\u0428\u0430\u0433 6 &#8212;<\/font><\/b> \u0416\u043c\u0435\u043c \u043e\u043a \u0438 \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u043f\u0430\u043b\u0430.<\/p>\n<p>  \u0422\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 Visual Studio \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0447\u0442\u043e \u0442\u043e.<\/p>\n<pre><code class=\"xml\">Toast.MakeText(Application.Context, data, ToastLength.Short).Show();<\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u041e\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0410\u043d\u0434\u0440\u043e\u0438\u0434\u0430. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 HTML \u0444\u0430\u0439\u043b\u0435 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0410\u043d\u0434\u0440\u043e\u0438\u0434\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0435 \u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u0438\u0435 \u0434\u0432\u0443\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u043f\u043e JavaScript \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u0441\u044e\u0434\u0430. \u0412\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e. \u0412\u0441\u0435 \u0447\u0435\u0440\u0435\u0437 HTML + JavaScript.<\/p>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b login.htm:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/th\/sn\/2e\/thsn2e0c_zztaeqx3jklwii8dkw.png\"><\/p>\n<pre><code class=\"xml\">&lt;html&gt; &lt;head&gt;     &lt;style&gt;         h1 {             color: yellowgreen;         }     &lt;\/style&gt; &lt;\/head&gt; &lt;body&gt;     &lt;h1&gt;\u041f\u0440\u0438\u0432\u0435\u0442 \u043c\u0438\u0440&lt;\/h1&gt;      &lt;button onclick=&quot;sendToAndroid();&quot;&gt;\u041d\u0430\u0436\u043c\u0438 \u043c\u0435\u043d\u044f&lt;\/button&gt;     &lt;script&gt;         function sendToAndroid() {             \/\/\u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u0438\u0437 HTML \u0444\u0430\u0439\u043b\u0430 \u043f\u043e javacsript \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443              interface.alert(&quot;\u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f&quot;);          }     &lt;\/script&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <b><font color=\"#3AC1EF\"> \u0436\u043c\u0435\u043c F5 <\/font><\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0y\/r9\/pi\/0yr9pifgmtyoj6pnt8cbh-smwp4.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 HTML \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f Toast \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  <b><font color=\"#3AC1EF\"> P.s. \u041f\u043e\u043b\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 MainActivity<\/font><\/b><\/p>\n<pre><code class=\"xml\">using Android.App; using Android.OS; using Android.Runtime; using Android.Webkit; using Android.Widget; using AndroidX.AppCompat.App; using Java.Interop;  namespace MyFirstApp {     [Activity(Label = &quot;@string\/app_name&quot;, Theme = &quot;@style\/AppTheme&quot;, MainLauncher = true)]     public class MainActivity : AppCompatActivity     {         WebView mWebview; \/\/\u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 HTML         protected override void OnCreate(Bundle savedInstanceState)         {             base.OnCreate(savedInstanceState);             Xamarin.Essentials.Platform.Init(this, savedInstanceState);              mWebview = new WebView(this);             mWebview.Settings.JavaScriptEnabled = true; \/\/\u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 JS \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432             mWebview.Settings.DomStorageEnabled = true; \/\/\u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430             mWebview.Settings.BuiltInZoomControls = true; \/\/\u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043b\u044c\u0446\u0430\u043c\u0438 \u0449\u0438\u043f\u043a\u043e\u043c             mWebview.Settings.DisplayZoomControls = false; \/\/\u044d\u0442\u043e \u0437\u0430\u043f\u0440\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u043d\u043e\u043f\u043e\u043a \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430             mWebview.Settings.CacheMode = CacheModes.NoCache; \/\/\u044d\u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043b\u0438\u0431\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445              \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f javascript             mWebview.AddJavascriptInterface(new JavaScriptInterface(), &quot;interface&quot;);                          \/\/              mWebview.LoadUrl($&quot;file:\/\/\/android_asset\/Content\/login.html&quot;); \/\/\u044d\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 Asset\/Content             SetContentView(mWebview);         }         public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)         {             Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);              base.OnRequestPermissionsResult(requestCode, permissions, grantResults);         }     }     public class JavaScriptInterface : Java.Lang.Object     {         [JavascriptInterface]         [Export(&quot;alert&quot;)]         public void alert(string data)         {             Toast.MakeText(Application.Context, data, ToastLength.Short).Show();         }     } }<\/code><\/pre>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/557204\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ty\/b7\/fd\/tyb7fdkkt98xbfhc-jlqbuybdda.jpeg\"><\/a><br \/>  <a href=\"http:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=brighttranslate&amp;utm_content=sozdaem_prilozhenie_dlya_android_bystro_i_prosto\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ou\/g5\/kh\/oug5kh6sjydt9llengsiebnp40w.png\"><\/a><\/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=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/558434\/\"> https:\/\/habr.com\/ru\/company\/ruvds\/blog\/558434\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/558434\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/du\/0s\/j4\/du0sj4mi0jmkgfmqvtxuxqezfms.jpeg\"><\/div>\n<p><\/a><br \/>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0412\u0430\u043c\u0438, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Android \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 HTML CSS \u0438 JS. \u041f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u043a\u043e\u0434 \u043d\u0430 Java \u0434\u043b\u044f Android \u0431\u0443\u0434\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 XAMARIN \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 Visual Studio.   <\/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-323812","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323812","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=323812"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323812\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}