I am following the example for Extending UnityPlayerActivity in the official guide:
http://unity3d.com/support/documentation/Manual/Android-Plugins.html
but I got stuck at the following sentence:
“Then add classes.jar to the classpath used to compile the new Activity.”
I am a complete Java beginner so I do not understand the steps needed to do this. I am currently developing an Unity Android application on a Windows 7 PC. I am trying to extend UnityPlayerActivity to a customised one so that I can start another activity from this activity like in the example given in
http://unity3d.com/support/documentation/Manual/Android-Launch%20an%20Android%20Application%20from%20a%20Unity%20Application.html
What are the detailed steps needed to compile the newly created activity and add the classes.jar to a new .jar? Is this question even correct? I got lost after searching for answer to these steps on Google for hours. I figure maybe someone more experienced can provide an answer much faster here.
“Then add classes.jar to the classpath used to compile the new Activity.”
This sentence means that you need to add a reference to classes.jar to compile arguments when compiling your java classes. classes.jar file is located in Unity Editor subfolders. I assume you’re doing something like this to compile your activity:
javac MyActivirty.java -d .
You need to classes.jar to that:
javac MyActivirty.java -classpath /Path/To/Classes/Jar/classes.jar -d .
If you need to add extra jars to classpath, you have to separate them using “:” symbol:
javac MyActivirty.java MyOtherClass.java -classpath /Path/To/Classes/Jar/classes.jar:/AnotherPath/another.jar -d .
If you need to add Android java classes add bootclasspath argument:
javac MyActivirty.java MyOtherClass.java -bootclasspath /Path/To/AndroidSDK/android-sdk-mac_86/platforms/android-11/android.jar -classpath /Path/To/Classes/Jar/classes.jar:/AnotherPath/another.jar -d .
I hope this will get you going.