This article takes unity3d access to 91sdk as an example.
My development environment: Mac system, Eclipse, unity4.0
Development Process:
1. Prepare the class. jar file that unity provides for interaction with Android.
My operation procedure is: Application-> untity folder-> unity-> right-click: show Package content-> contents folder-> playbackengines folder-> androidplayer folder-> bin folder-> class. jar [Directory:/applications/Unity. APP/contents/playbackengines/androidplayer/bin.
2. create an android project and set the class. copy jar to the libs folder of the project and copy the ndcomplatform of 91sdk. jar is also copied to the libs folder, mainactivity extends unityplayeractivity, And the android SDK method to be called is written. Androidmanifest. XML is configured according to 91sdk requirements. The res file of 91sdk is not required in the android project.
3. Right-click the project and choose run as-> Android Application. Go to the project directory-> bin folder-> classes folder-> copy and paste all the files in it to a directory that is easy to find, such as jaru3d.
4. Open the terminal and enter the uaru3d folder. Enter jar-CVF myclass. jar * and press Enter. The jaru3d folder contains myclass. jar, which is used for backup.
5. open unity3d4.0, create a new unity project, create a folder plugins under the assets folder, create an android folder in the plugins folder, create a bin folder and a libs folder in the android folder, and set the myclass. copy jar to the bin folder and copy the ndcomplatform of 91sdk. copy jar to the libs folder, copy all the res folders of 91sdk to the android folder, and copy androidmanifest of the android project. copy XML to the andorid folder, and copy the resources in the android project to the corresponding folder in the res folder of the Unity project.
In the assets folder, create a unity file to call Android, and drag the file to main camera.
6. Pack unity as the APK installation package to test the demo effect. Note: In the playersettings configuration, bundle identifier must be the same as the package of the android project.
7. Success. See the successful results.
Android project: u3dandroid.zip (3.77
MB)
Unity3d4.0 project: u3dprj.zip (2.92
MB)
UNTIYDEMO-APK package: u3ddemo.apk.zip (9.68
MB)
Http://blog.csdn.net/smlisi2/article/details/8782619