Reprint Please indicate this article from Big Corn's blog (http://blog.csdn.net/a396901990 ), thank you for your support!
Brief introduction:
Some projects need to include unity features in Android, such as embedded Unity3d view in Android Apps (3D models)
Some projects need to include Android features in unity, such as 3D Voice weather ball (source sharing)--Create rotatable 3D balls
Since features and code in Android can only be used as a unity plugin, the APK file will need to be run after Unity makes the final build.
so regardless of the above two cases are involved in the build steps to join the Android project in Unity:
Steps:
1. Make sure that the Android engineering code is correct, and then build it in eclipse so that all classes generate a. class file.
2. Make all. class files into Jar packages
For example, my current project directory is: C:\Users\95\Documents\GitHub\3D_Sphere\3DVoiceWeather. the compiled. class files are in the \bin\classes of the project directory.
open cmd in the CD to this directory: CD C:\Users\95\Documents\GitHub\3D_Sphere\3DVoiceWeather\bin\classes
Execute command: JAR-CVF Class.jar *
Without an accident, a Class.jar is generated in the current directory, such as:
3. Put Android project into unity
Create a Plugins folder in Unity, create an Android folder under Plugins (cannot be written incorrectly, cannot be modified).
Copy the Res folder in Android Project , Libs folder (if available) and Androidmanifest.xml file to plugins-android:
Under plugins-android , create a bin folder and copy the previously generated class.jar into it (the name is arbitrary).
4. In the Set build parameter
1. Click menu
2.file
3.Build Settings
4. Select Android and click Add Current to join the scene
5. Click on the player Settings:
Press set build parameters, including company name, product name, icon, and so on. It's all written in a casual way,
*** The main thing is in the red box. Bundle identifier* , its value must be the same as the package name of the Android project * * *
5.Bulid
After setting the parameters, you can click the Build button to make the last build operation.
If this is the first time, the build process will require you to set up the Android SDK, do not panic, find the SDK directory is selected.
Waiting to finish ...
Unity join Android Project Build step