Recently busy with the platform, need to access a variety of Android Platform SDK to publish. When the SDK was encountered such a situation, a bit of trouble, so record.
Some SDK access is to provide a jar package, so that the jar can be easily made into Android plugin, added to the Unity project, packaged into the APK output.
And there are some SDKs that provide a Lib project. In the documentation provided by the SDK, it is added in the Android project by adding dependencies. But for unity works, this is a bit different.
After many tests, steps are required:
1. Add the entire project catalog "Note 1" of the SDK project to the PLUGINS/ANDROID/%SDK name% directory
2. Also export the jar package and place the jar package in the Plugins/android/libs directory.
3. You can then choose how to make Android plugin, or call it directly in Unity3d.
"Note 1: The content contains: res/directory libs/directory assets/directory androidmanifest.xml. Classpath project.properties. Project Proguard-project.txt and others, depending on the situation "
Describe a strange phenomenon that was encountered during the test. In the above steps, if you skip step 2, use Unity3d to generate the APK directly (case a), and export the Eclipse Project, and then use Ecliipse to generate the APK (case b), there will be two different situations. In case a, if you invoke the interface of the SDK, you receive an ClassNotFound exception, and condition B can pass normally. By looking at the Unity Engineering/temp/stagingarea/Directory, it is assumed that unity is only processing the resource files under the PLUGINS/ANDROID/%SDK name% directory, while the Java files in the SRC directory are not processed.
How to add dependent Android engineering to the Unity3d project