- Home /
Unity to Android?
Hey everyone!
I'm trying to convert my unity project game into an android application, which I can post on the google play store for people to download. I read alot and people told me to just download android sdk, and follow various steps until i can save my project as a .sdk. My question:
So all i have to do is save my unity project as .sdk? Like I'm confused on how android apps work with Unity. A unity project game contains over 2000 files, how do i go about making this entire unity game made in c#, to an android app, which uses java? Do i just upload the .sdk to the play store? Can some one give me clear instructions please? Will the whole package with 2000 files get converted into .sdk??
Answer by DoTA_KAMIKADzE · Jun 05, 2015 at 02:46 PM
1) Read THIS.
2) Setup Android SDK correctly.
3) Read and change build setting described there.
4) Make some changes to your project if there are platform dependent codes, etc. THIS might be handy for you.
5) Make sure you've selected Android platform in build settings => press build => save as Something.apk.
6) That's it, upload your apk wherever you want to whichever store, just install on android device or do whatever else you want with it.
Answer by screenname_taken · Jun 05, 2015 at 02:50 PM
Unity is a game engine with multiple build options. You just go in build settings and select your build platform and it just... exports it in that. The way Unity works is that it has a player engine for each platform and it uses the scenes and assets you give it to make a game/app. And you don't convert it to SDK. SDK is the software files you'll download so that unity will read and be able to convert it to that platform. The android end file is an APK. You download the SDK manager from google, run it, select your build tools to download, download the Java JDK and then tell Unity where you've installed both. Unity can now export to Android.
Of course you may need to make some changes to your scene if you want to handle touch events and you did not use Unity's UI but instead used the old GUI system. (That easily handles touch and mouse clicks.)
$$anonymous$$ so the unity scrips are writtein in c#. How would i go about converting all those scripts into java, which is what android reads? Do they get converted automatically?
$$anonymous$$k, so your literally saying that I download a sdk manager from google, and and in my project, just build as android? ( assu$$anonymous$$g i have the java jdk). Unity will automatically do everything else, including touch functions on the android phone
The touch part depends on how you made your controls. If you hardcoded mouse buttons or keyboard buttons then you'll run into trouble. But if ins$$anonymous$$d you used the GUI system that was introduced in Unity 4.6, where you just put functions on button actions, then it will work with touch ok as that is handled through the Event System.
@DoTA_$$anonymous$$A$$anonymous$$I$$anonymous$$ADzE linked some stuff that just describe what you should be checking.
I'm currently working on following this tutorial, and changing it based on my likings : https://unity3d.com/learn/tutorials/projects/space-shooter
The scripts are based on buttonclicks with keyboard. So how would i go about changing those scripts to touch screen. And ye i'm still reading the java plugins that dota posted.
Your answer
Follow this Question
Related Questions
OnApplicaitonFocus(false) called only after game returns to foreground 0 Answers
Wake lock for android 2 Answers
how to send text from html page to unity android app? 0 Answers
App does not start on Android and force close 2 Answers
Develop for two platforms simultaneously? (or at least reducing the conversion time) 0 Answers