{"id":175509,"date":"2013-04-04T20:09:02","date_gmt":"2013-04-04T16:09:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=175509"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=175509","title":{"rendered":"<span class=\"post_title\">\u041a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c email \u0441 Android-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Unity, \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 Java<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0427\u0430\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043e\u0441\u043b\u0430\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u043e \u0434\u0440\u0443\u0433\u0443 \u0441 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0448\u0442\u0430\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u041e\u0421. \u041f\u0440\u0438 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Android \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 \u044f\u0437\u044b\u043a\u043e\u043c Java \u043b\u0435\u0442 5 \u043d\u0430\u0437\u0430\u0434, \u0438 \u043c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043b\u0435\u0437\u0442\u044c \u0432 \u0434\u0435\u0431\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f Android-\u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f Unity, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Eclipse, \u0441\u0431\u043e\u0440\u043a\u0438 jar-\u0444\u0430\u0439\u043b\u0430, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 <i>AndroidManifest.xml<\/i> \u0438 \u0442\u0434. \u041c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 C#, \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 Java (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445). \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0412\u0430\u043c\u0438, \u043a\u0430\u043a \u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u0412\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u0435\u0442\u043e\u0434 \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 \u043b\u044e\u0431\u043e\u0433\u043e Java-\u043a\u043e\u0434\u0430.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/4db\/6e1\/9f7\/4db6e19f7198f1848447a49cfa4393ad.png\"\/><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/f7b\/7d4\/a5a\/f7b7d4a5a1a18f60a165b36fbe9dca19.png\"\/><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/h4>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u043f\u0438\u0441\u044c\u043c\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 html-\u043a\u043e\u0434\u044b, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f URI-\u0441\u0445\u0435\u043c\u043e\u0439 <b><a href=\"http:\/\/en.wikipedia.org\/wiki\/Mailto\">mailto<\/a><\/b>:  <\/p>\n<pre><code class=\"cs\">string url = string.Format(&quot;mailto:{0}?subject={1}&body={2}&quot;, to, WWW.EscapeURL(subject), WWW.EscapeURL(body)); Application.OpenURL(url); <\/code><\/pre>\n<p>  \u0422.\u0435. \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Unity <i><a href=\"http:\/\/docs.unity3d.com\/Documentation\/\/ScriptReference\/Application.OpenURL.html\">Application.OpenURL<\/a><\/i>. \u041d\u0435 \u0432\u0441\u0435 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <i><a href=\"http:\/\/docs.unity3d.com\/Documentation\/\/ScriptReference\/WWW.EscapeURL.html\">WWW.EscapeURL<\/a><\/i>.<br \/>  \u0427\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u043e, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0442.\u0434.?<\/p>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 HTML<\/h4>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b Android. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 Java-\u043a\u043e\u0434:  <\/p>\n<pre><code class=\"java\">intent = new Intent(Intent.ACTION_SEND); if (isHTML)   intent.setType(&quot;text\/html&quot;); else   intent.setType(&quot;message\/rfc822&quot;); intent.putExtra(Intent.EXTRA_SUBJECT, subject); if (isHTML)   intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body)); else   intent.putExtra(Intent.EXTRA_TEXT, body); startActivity(intent); <\/code><\/pre>\n<p>  \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0432 \u0441\u0435\u0442\u0438. \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0431\u044b\u043b\u0430 <a href=\"http:\/\/habrahabr.ru\/post\/112450\/\">\u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 Andoird<\/a>. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u043f\u043e\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0435\u0435.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u0437 Unity, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c jar-\u0444\u0430\u0439\u043b, \u0432\u044b\u0437\u0432\u0430\u0442\u044c Java-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 C#-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u0442\u0434. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e. \u041d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b Unity <i><a href=\"http:\/\/docs.unity3d.com\/Documentation\/\/ScriptReference\/AndroidJavaClass.html\">AndroidJavaClass<\/a><\/i> \u0438<i> <a href=\"http:\/\/docs.unity3d.com\/Documentation\/\/ScriptReference\/AndroidJavaObject.html\">AndroidJavaObject<\/a><\/i>. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0421 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043b\u044e\u0431\u043e\u043c\u0443 Java-\u043a\u043b\u0430\u0441\u0441\u0443 \u0438 \u043b\u044e\u0431\u043e\u043c\u0443 Java-\u043e\u0431\u044a\u0435\u043a\u0442\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Java-\u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0430, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u0438 \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u0442\u0434.<\/p>\n<p>  \u042f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b \u0435\u0433\u043e \u043d\u0430 C#, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u043a\u043b\u0430\u0441\u0441\u044b:  <\/p>\n<pre><code class=\"cs\">\/\/\/ &lt;summary&gt; \/\/\/ Sends mail using default mail application. \/\/\/ &lt;\/summary&gt; private static void SendMail(string subject, string body, bool isHTML) {   using (var intentClass = new AndroidJavaClass(&quot;android.content.Intent&quot;))   {     \/\/ intent = new Intent(Intent.ACTION_SEND);     using (var intentObject = new AndroidJavaObject(&quot;android.content.Intent&quot;, intentClass.GetStatic&lt;string&gt;(&quot;ACTION_SEND&quot;)))     {       \/\/ Setting text type       if (isHTML)         \/\/ intent.setType(&quot;text\/html&quot;);         intentObject.Call&lt;AndroidJavaObject&gt;(&quot;setType&quot;, &quot;text\/html&quot;);       else         \/\/ intent.setType(&quot;message\/rfc822&quot;);         intentObject.Call&lt;AndroidJavaObject&gt;(&quot;setType&quot;, &quot;message\/rfc822&quot;);        \/\/ intent.putExtra(Intent.EXTRA_SUBJECT, subject);       intentObject.Call&lt;AndroidJavaObject&gt;(&quot;putExtra&quot;, intentClass.GetStatic&lt;string&gt;(&quot;EXTRA_SUBJECT&quot;), subject);        \/\/ Setting body       if (isHTML)       {         \/\/ intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body));         using (var html = new AndroidJavaClass(&quot;android.text.Html&quot;))         {           var htmlBody = html.CallStatic&lt;AndroidJavaObject&gt;(&quot;fromHtml&quot;, body);           intentObject.Call&lt;AndroidJavaObject&gt;(&quot;putExtra&quot;, intentClass.GetStatic&lt;string&gt;(&quot;EXTRA_TEXT&quot;), htmlBody);         }       }       else       {         \/\/ intent.putExtra(Intent.EXTRA_TEXT, body);         intentObject.Call&lt;AndroidJavaObject&gt;(&quot;putExtra&quot;, intentClass.GetStatic&lt;string&gt;(&quot;EXTRA_TEXT&quot;), body);       }        \/\/ startActivity(intent);       using (var unity = new AndroidJavaClass(&quot;com.unity3d.player.UnityPlayer&quot;))       {         using (var currentActivity = unity.GetStatic&lt;AndroidJavaObject&gt;(&quot;currentActivity&quot;))         {           currentActivity.Call(&quot;startActivity&quot;, intentObject);         }       }     }   } } <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>intentClass<\/i> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a Java-\u043a\u043b\u0430\u0441\u0441\u0443 <i>android.content.Intent<\/i>, \u0447\u0435\u043c \u044f \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c \u0442\u0438\u043f\u0430 <i>Intent.EXTRA_TEXT<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>GetStatic<\/i>:  <\/p>\n<pre><code class=\"cs\">intentClass.GetStatic&lt;string&gt;(&quot;EXTRA_TEXT&quot;) <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>intentObject<\/i> \u2014 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 Java-\u043a\u043b\u0430\u0441\u0441\u0430 <i>android.content.Intent<\/i>. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b Java-\u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e:  <\/p>\n<pre><code class=\"cs\">var intentObject = new AndroidJavaObject(&quot;android.content.Intent&quot;, intentClass.GetStatic&lt;string&gt;(&quot;ACTION_SEND&quot;)) <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <i>AndroidJavaObject<\/i> \u2014 \u0438\u043c\u044f Java-\u043a\u043b\u0430\u0441\u0441\u0430, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0443\u0436\u0435 \u0441\u0430\u043c\u043e\u0433\u043e Java-\u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>  \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0443\u0442\u0430\u0442\u044c <i>AndroidJavaObject<\/i> c <i>AndroidJavaClass<\/i>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e. \u042d\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0445\u043e\u0436\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e (<i>AndroidJavaClass<\/i> \u0434\u0430\u0436\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 <i>AndroidJavaObject<\/i>), \u0447\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b <i>AndroidJavaClass<\/i> \u0432\u043c\u0435\u0441\u0442\u043e <i>AndroidJavaObject<\/i> \u0438 \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u044d\u0442\u043e\u0433\u043e. \u041f\u0435\u0447\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u043d\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 \u0434\u0435\u0442\u0430\u043b\u0438 \u0443\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>  \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <i>using<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u00ab\u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f\u00bb Java-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041e\u0431 \u044d\u0442\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"http:\/\/docs.unity3d.com\/Documentation\/Manual\/PluginsForAndroid.html\">Best practice when using Java plugins with Unity<\/a>.<br \/>  \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>Call<\/i>, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430:  <\/p>\n<pre><code class=\"cs\">intentObject.Call&lt;AndroidJavaObject&gt;(&quot;putExtra&quot;, intentClass.GetStatic&lt;string&gt;(&quot;EXTRA_TEXT&quot;), body); <\/code><\/pre>\n<p>  <b>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c:<\/b> \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0442\u0438\u043f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d, \u0438\u043b\u0438, \u0447\u0442\u043e \u0435\u0449\u0435 \u0445\u0443\u0436\u0435, \u0432\u044b \u043d\u0435\u0445\u043e\u0442\u044f \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0435 \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 (\u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0441\u0442\u044c), \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0438 \u043d\u0435 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 (<i>currentActivity<\/i> \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c) \u0438 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0441\u044b\u043b\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <i>intentObject<\/i>:  <\/p>\n<pre><code class=\"cs\">using (var unity = new AndroidJavaClass(&quot;com.unity3d.player.UnityPlayer&quot;)) {   using (var currentActivity = unity.GetStatic&lt;AndroidJavaObject&gt;(&quot;currentActivity&quot;))   {     currentActivity.Call(&quot;startActivity&quot;, intentObject);   } } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. <br \/>  \u041f\u043e\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0439 Java-\u043a\u043e\u0434. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u0434 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d. \u0412 \u0438\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u0439 \u043a\u043e\u0434, \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043d\u0435\u0441\u0432\u0435\u0434\u0443\u0449\u0435\u043c\u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443.<\/p>\n<p>  \u0413\u043e\u0442\u043e\u0432 \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f;)<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:  <\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/117564\/\">\u0418\u0433\u0440\u0430 \u0437\u0430 \u0434\u0432\u0430 \u0434\u043d\u044f<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/120361\/\">\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u043e-\u0440\u043e\u043b\u0438\u043a \u0438\u0433\u0440\u044b \u043c\u0430\u043b\u044b\u043c\u0438 \u0441\u0438\u043b\u0430\u043c\u0438<\/a> \u2014 \u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0410\u043b\u0435\u043a\u0441\u0435\u0435\u043c \u041b\u0443\u043d\u0438\u043d\u044b\u043c \u2014 <a href=\"http:\/\/habrahabr.ru\/users\/type_2\/\" class=\"user_link\">type_2<\/a>.<\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/122197\/\">2d \u043d\u0430 Unity3d<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/148313\/\">\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c\u0430 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u0433\u0440 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/169451\/\">\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f 2d-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432 Unity3d<\/a><\/li>\n<\/ul>\n<p>  \u0423\u0434\u0430\u0447\u0438 \u0412\u0430\u043c \u0432 \u0412\u0430\u0448\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u0445!    \t \t\t   \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\/175509\/\"> http:\/\/habrahabr.ru\/post\/175509\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0427\u0430\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043e\u0441\u043b\u0430\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u043e \u0434\u0440\u0443\u0433\u0443 \u0441 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0448\u0442\u0430\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u041e\u0421. \u041f\u0440\u0438 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Android \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 \u044f\u0437\u044b\u043a\u043e\u043c Java \u043b\u0435\u0442 5 \u043d\u0430\u0437\u0430\u0434, \u0438 \u043c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043b\u0435\u0437\u0442\u044c \u0432 \u0434\u0435\u0431\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f Android-\u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f Unity, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Eclipse, \u0441\u0431\u043e\u0440\u043a\u0438 jar-\u0444\u0430\u0439\u043b\u0430, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 <i>AndroidManifest.xml<\/i> \u0438 \u0442\u0434. \u041c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 C#, \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 Java (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445). \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0412\u0430\u043c\u0438, \u043a\u0430\u043a \u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u0412\u044b \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u0435\u0442\u043e\u0434 \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 \u043b\u044e\u0431\u043e\u0433\u043e Java-\u043a\u043e\u0434\u0430.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/4db\/6e1\/9f7\/4db6e19f7198f1848447a49cfa4393ad.png\"\/><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/f7b\/7d4\/a5a\/f7b7d4a5a1a18f60a165b36fbe9dca19.png\"\/>  <\/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-175509","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/175509","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=175509"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/175509\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=175509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=175509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=175509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}