Build steps to join the Android project in Unity

Source: Internet
Author: User

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 both cases involve the build step of adding an Android project to 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 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 is the red box bundle identifier*, its value must be the same as the Android project package name * * *

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 ...

Article by http://yy.china.com.cn/shnk/xb/lb/Reorganization reprint

Build steps to join the Android project in Unity

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.