Unity for Android is special, unity for IOS Packaging is to give the Xcode project directly to the developer, developers can continue to add new views on the basis of the project, and finally by the developer to package the creation of the IPA package, publish the program. and the unity for Android package directly generated APK package, is equal to saying that the source code developers are not visible, but unity itself is a bit limited, for the Android platform we need to learn how to call Android Java code in unity. Our goal in this chapter is to use Unity's script to open activity. First we create a generic Android project, as shown in the directory structure.
Because the project needs to use the interface provided by unity, the interface Classes.jar needs to be introduced into the current project but. The location of the interface Pack, open the finder-> application->unity-> click on the Unity icon, right mouse button Select “ Show Package Contents ”->Contents-> Playbackengines->androidplayer->bin->classes.jar. After the interface package is introduced into the project, the Java code begins.
Unitytestactivity.java
Http://www.qdmm.com/BookReader/1163793,22699652.aspx
Http://www.qdmm.com/BookReader/1163793,22719361.aspx
Http://www.qdmm.com/BookReader/1163793,65455160.aspx
Http://www.qdmm.com/BookReader/1163793,65455311.aspx
Http://www.qdmm.com/BookReader/1163793,65455315.aspx
Http://www.qdmm.com/BookReader/1163793,65455341.aspx
Http://www.qdmm.com/BookReader/1163793,65455366.aspx
Http://www.qdmm.com/BookReader/1163793,65455374.aspx
Http://www.qdmm.com/BookReader/1163793,65455420.aspx
Http://www.qdmm.com/BookReader/1163793,65455438.aspx
Http://www.qdmm.com/BookReader/1163793,65455443.aspx
Http://www.qdmm.com/BookReader/1163793,65455459.aspx
Http://www.qdmm.com/BookReader/1163793,65455463.aspx
Http://www.qdmm.com/BookReader/1163793,65455464.aspx
Http://www.qdmm.com/BookReader/1163793,65455468.aspx
Http://www.qdmm.com/BookReader/1163793,65455471.aspx
Http://www.qdmm.com/BookReader/1163793,65455475.aspx
Http://www.qdmm.com/BookReader/1163793,65455483.aspx
Http://www.qdmm.com/BookReader/1163793,65455486.aspx
Http://www.qdmm.com/BookReader/1163793,65455491.aspx
Http://www.qdmm.com/BookReader/1163793,65455494.aspx
Http://www.qdmm.com/BookReader/1163793,65455498.aspx
Package Com.xys; Import Android.content.Context; Import android.content.Intent; Import Android.os.Bundle; Import com.unity3d.player.UnityPlayerActivity; public class Unitytestactivity extends Unityplayeractivity {/** Called when the activity is first created. */ Context mcontext = null; @Override public void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);
For the Android platform we need to learn how to call Android Java code in unity.