I am new to unity and have created a basic Pong game (.exe file) for desktop. I want to convert it to android based game (.apk file).
Essentially most of code should remain the same but now I want to add touch screen inputs instead of key board inputs. Also wanted to know about the apk generation process in Unity. I have earlier created Java based games and this is my first game in Unity.
Any pointers on how to achieve this would be really helpful.
First of all for conversion you need to change platform from Desktop version to android.
Go To File → Build Settings → select android from list and hit switch platform button.
Most important thing is that you’ve to give unity a path of your android sdk . For that Go to Edit → preferences → External Tools–> and browse to your sdk forlder.
For touches I want to go through the doc here.
Hope it helps
You will need to download the sdk zip file on androids site (search android sdk download and it should be first one) and the sdk will require Java JDK and you will most likely have to install that. Second; if you coded in c# it won’t work, it needs to be in java unless you do some outside work. Third; the touch controls will work on mouse clicks with java on android at least, as in when the mouse is clicked down it registers it as a touch when using the app on the android so if you used any OnMouseDown functions then it will work just fine. Other than that you should be fine.
(edit) If you do need the JDK (if you do not have it but have SDK it will tell you, you need it in an error report while exporting) heres the link: JavaSE Upgrade
the Windows 86 is the 32 bit version.
And don’t install Eclipse like it tells you too in the SDK installation guide unless you need to make an app that isn’t a game, it isn’t necessary for .apk export.
Change the platform to Android in the player settings in edit, then change resolution in the game screen to WVGA Portrait 480 x 800 and that should give you a screen size that is pretty close to every android phone size.