Porting from iOS to Android

Discussion in 'Game Development (Technical)' started by Christop406, Aug 5, 2015.

  1. Christop406

    Christop406 New Member

    Joined:
    Aug 4, 2015
    Messages:
    2
    Likes Received:
    0
    I have already made one game (https://itunes.apple.com/us/app/i-love-dots!/id1004696124) for iOS and I am about to start on my next. My question is, does it make more sense to program the game in a cross-platform game engine (Unity, Cocos2D, etc.), or is it easy enough/even possible to port a game after it has been created? If the latter is true, could someone maybe point me in the right direction to go about porting games to Android? Thank you!
     
  2. GaiaDreamCreation

    Indie Author

    Joined:
    Jun 8, 2008
    Messages:
    439
    Likes Received:
    26
    I don't know anything about coding for iOS or Android. However, I know that Unity is a pretty good solution for developing and exporting to many platforms. It would make sense to develop with Unity (or other cross-platform solutions) to export to Android. Furthermore, after that, you will be able to do the maintenance in your App only once. This prevents writing the code twice and having to synchronize the functionality and the bebugging. Unity is my personal choice.
     
  3. lumis

    lumis New Member

    Joined:
    Aug 4, 2015
    Messages:
    11
    Likes Received:
    0
    http://www.quora.com/Whats-the-best-way-to-port-an-iPhone-app-to-Android

    I don't know that it's easy. Currently we have a game we developed for Android, and we thought it'd be simple enough to port it to iOS. Once we started, we found out basically we'd have to purchase a Macbook and work to build it up again from the ground. That being said, you can mostly use all the same assets (might have to adjust some sizes) and you have the structure of the coding. But you still want to re-test everything as it is going to a different system.
     
  4. Bram

    Indie Author Greenlit

    Joined:
    May 1, 2010
    Messages:
    181
    Likes Received:
    2
    Porting from iOS to Android is non-trivial.
    First there is the language barrier: Objective-C versus Java/C++.

    I will assume that most of your iOS game is C or C++ code.
    This means that using Android's NDK you can port the C/C++ part of your code pretty much 1:1.
    You will still need to write a little Java too, for your Activity class.

    Next, you need to address the app-life-cycle of Android.
    When an iOS app is pushed to the background, it is no big deal: your OpenGL context and resources (VBOs, textures, etc.) will still be in memory when you are foregrounded again.

    Not so much in Android:
    When your Android app is backgrounded (interrupted by cell phone call, e.g.) you will lose ALL OpenGL resources.
    This means that your app must be able to recreate all resources from scratch upon command.
    (Not just create them at program start, like you do on iOS.)
    This is the biggest difference between iOS and Android.

    Bram
     
  5. kaufenpreis

    kaufenpreis New Member

    Joined:
    Aug 1, 2014
    Messages:
    103
    Likes Received:
    4
    If you're looking to share code between the apps, you'll first have to port the iOS's business logic to C or C++ and then use the ndk as a starting point for the Android app. If that sounds like too much trouble, it's because it is (unless your app is a game).

    In my experience, using a source code converter is a very reliable way to get buggy, slow, un-maintainable code. Don't punish yourself by pursuing this route.

    If you really want to make an Android app, there are no shortcuts; you'll have to learn Java and the Android APIs. If you just don't have the time for that, hire a contractor. If you can't do any of these things, focus on improving your iOS app.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer