Since I couldn’t find a topic on this yet, I’m starting one.
We’ve figured out how to use Unity 3 with the Android Pro license to deploy a working app to an Android device.
Now what we want to do is add some things at the Java level, in a similar way to what we do in Objective-C for our iPhone apps.
However, Unity compiles to a ‘.apk’ file. We’ve been able to unpack this to reveal several files including a ‘classes.dex’ file. But where do we go from here? We are experimenting, and I’ll post any useful results.
However, any information or support from the Unity Team or the community would be greatly appreciated. Are we, perhaps, venturing down a blind alley here?
Thanks in advance.
Same here!
I also believe that the build process for android should be similar to that of the iphone, in the sense that it should generate the project and then we could manually compile it with ant, and there could be an option in the GUI to generate directly an .apk file. Otherwise we have no idea how to customize our app on android easilly.
I think that this is vital for android app development!
After some further research my colleagues discovered this:
http://answers.unity3d.com/questions/8008/can-i-access-java-code-from-unity
It appears to be a good solution. I will post again if we can get it working.
Hi guys,
Well, after a day or so of hassle, we managed to get it working.
Here’s the procedure:
-
Do what it says here:
http://answers.unity3d.com/questions/8008?sort=oldest#sort-top
-
When it says ‘import the .dlls into Unity’ you need more or less all the .dll files in the ‘bin’ folder of IKVM. Just drag that bin folder into your Unity hierarchy and you should be good.
-
Test in editor and on device. We got our simple Hello World + Counter working on a Nexus One.
NOTE: If you’re getting errors at runtime, check your .java code. The issue may be there.
Good luck out there folks.