Unity calls Android Configuration method

Source: Internet
Author: User

method One: Publish Eclipse Android Project (tick), as IOS Publish Xcode like, in Eclipse in the Write call

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/54/50/wKioL1R-5s7QD6LDAADSoB9rjGI139.jpg "title=" 1.jpg " alt= "Wkiol1r-5s7qd6ldaadsob9rjgi139.jpg"/>

Method Two:

Operational process Configuration points:

1. new Android Project, note the package path like mine is com.zx, the other steps are done directly next

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/54/52/wKiom1R-5mGiXUlCAABT1sfoAN8434.jpg "title=" 2.jpg " alt= "Wkiom1r-5mgixulcaabt1sfoan8434.jpg"/>

2. tick Mark This project as a library

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/50/wKioL1R-5wzybiRMAAB1dJnKkhA488.jpg "title=" 3.jpg " alt= "Wkiol1r-5wzybirmaab1djnkkha488.jpg"/>

3, the new Android project to write the relevant interface method, copy bin file (only need Zx.jar),res resource Pack, Androidmainfest.xml configuration file

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/52/wKiom1R-5svTmWyeAAElVaVV6l8304.jpg "title=" 4.jpg " alt= "Wkiom1r-5svtmwyeaaelvavv6l8304.jpg"/>

4.Copy to the Plugins/android folder in the Unity project , such as, and unzip the Zx.jar package in the bin folder

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/50/wKioL1R-54_x4MhpAAAqaJpMInA911.jpg "title=" 5.jpg " alt= "Wkiol1r-54_x4mhpaaaqajpmina911.jpg"/>

5, set the release package reference Path, note the same as the Android class package

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/52/wKiom1R-5xHxGXukAABMLl3jPhU838.jpg "title=" 6.jpg " alt= "Wkiom1r-5xhxgxukaabmll3jphu838.jpg"/>

6.Unity Call Android method Reference

Java class public method 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/54/50/ Wkiol1r-56mbhi0laaagmttylpy366.jpg "title=" 7.jpg "alt=" Wkiol1r-56mbhi0laaagmttylpy366.jpg "/>

Unity calls

public void Savetophoto (string imgurl) {#if unity_editor//Current platform #elif unity_iphone//ios platform #elif unity_android       Android Platform Androidjavaclass JC = Newandroidjavaclass ("Com.unity3d.player.UnityPlayer"); Androidjavaobject Jo =JC.       Getstatic<androidjavaobject> ("currentactivity"); Jo. Call ("SaveImage", Imgurl); #endif}


Unity calls Android Configuration method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.