These days are time to study under Android SDK Automation packaging. By the way, brush up on unity and Android interaction mechanism.
One, Unity and Android message delivery mechanism
Example:
Export Android Project
In order to test, we have to fill in the package name can be exported on the line
After Eclipse import, add a function called by u3d code to the activity that starts at the beginning.
1 Public void becalledfromunity (String Arg) 2 {3 unityplayer.unitysendmessage ("SDK " " becalledfromandroid " , ARG); 4 }
Ok
Message communication's done.
Second, configure the ANT environment
Step:
Download Ant uncompress The downloaded file into a directory.
Set Environmental variables Java_home to your JAVA environment,
Ant_home to the directory you uncompressed Ant to, and Add${ant_home}/bin (Unix) or%ant_home%/bin (Windows) to your PATH.
Check Installation:
You can check the basic installation with opening a new shell and typing ant. You should get a message like this
Buildfile:build.xml does not exist!
Build failed
So Ant works. This message is there because your need to write a individual buildfile for your project. With a ant-versionyou should get an output like
Apache Ant (TM) version 1.9.2 compiled on July 8 2013
Third, with Android Project
Reference: Http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html (at the moment I'm using a bit of 1.9.4)
If you already has a project that you're d like to add the Ant build script to and then there are a easy command line tool for you can use.
Open up a command prompt and navigate to the base directory of your project.
From there, use the command:
Android Update Project--path.
(PS:
ADD Path If Fail
%android_sdk%\platform-tools
%android_sdk%\tools
)
Here are an example of successful output:
Where ant.properties is manually added, in order to automate the packaging of signatures
Open up a command prompt and navigate to the base directory of your project.
From there, use the command:
Ant Release
= Packaging Success
Currently we have built a release version of the signature apk, next I'll talk about customizing the build.xml process
One of the Unity Android && Ant automate Build