As many of you might have been aware, Unity has recently released free Android and iOS licenses for a limited amount of time. This was a massive encouragement for us to give it a try and see what we could achieve.

Many people have asked us if we would create an Android and/or an iOS version of our previous game The Cat that Got the Milk. Well, we are certainly adventuring on that path with our next game. Watch this space :)

A while back I managed to get a simple Hello World running on my Android phone using Eclipse, so I was hoping it would be quite fast to get a build using Unity. Just before I went on holidays I gave it a go and managed to get a build of one of The Button’s test level we created.

I started by researching a bit on the web and found that some people claimed that it only took them 30 mins to get a game running… that was certainly not the case for me as installing everything I needed took almost all of that time.

For our experiment I have used:

  • PC with Windows XP OS
  •  Unity 3.5 with Android
  •  HTC Desire phone

There is a Unity’s Android SDK setup page that you can follow if you are interested in building your own game on Android and Unity.

There were a couple of videos I found interesting too:

For me, there were three main steps before building:

  • Install all necessary software
    • Install the Android SDK version compatible with my Unity version (3.5)
    • Install Java SE (version 6 as later on I had problems with version 7)
  • Setup Unity
    • Build Settings: found on the File menu

      • Select the scene to be built
      • Select the Android platform
      • Tick Development Build
    • Player Settings: button found on the Build Settings panel

        • Bundle Identifier: com.YourCompanyName.YourProjectName
        • Minimum API Level I selected the oldest from the list as later on I had a few errors:

      Failure [INSTALL_FAILED_OLDER_SDK] error. (I should update my phone!)
      Install Location and Write Access were both set to external as I had some build errors such as:
      Unable to install APK!
      failed to copy ‘Package.apk’ to ‘/data/local/tmp/Package.apk’: No space left on device
      unity Failure [INSTALL_FAILED_MEDIA_UNAVAILABLE]

  • Prepare the phone
    • Clear out space on my phone!
      Due to several failure attempts to install The Button build on my phone, I decided to delete some apps and move all apps I could to my SD card. Even though my Android build was set to be installed on the SD card, the process still requires some internal memory space. This confused me a bit at first as I was only building one single test level with not much on so I couldn’t understand why I kept having “No space left on device” errors.
    • Turned on USB debugging on my phone
      • Click the Menu button
      • Selected Applications
      • Selected Development
    • Connect my phone to the computer using the USB Tethering mode (made sure my computer recognised my phone)

The last thing left to do is to simply click Build And Run from the Build Settings panel. This will create a .apk file locally that will then be copied to the phone as an .asec with the name that you have setup as the Bundle Identifier on the Player Settings panel. In my case it was com.TheButton.TheButton.asec which was copied to the .android_secure folder.

After all the steps above succeeded with no errors, The Button build was available from my apps list with the Unity logo as I hadn’t setup one yet on the Player Settings panel.

It was really exciting to see the test level running on the phone. It brought a big smile to all of us and it gaves us hope and encouragement to keep trying, to keep exploring, to keep creating.

The next challenge was to get user input to trigger different character animations. More on the next post.

Let us know if you would like me to expand any of the points I mentioned above, or if you have any useful tips and links about developing for Android/iOS.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>