As an Android game developer, what should I keep in mind while developing my game if I ever wanted to cross-platform the game to the iPhone? Any strategies, tips, etc. on porting to both of these mobile platforms?
|
|
Write it in C/C++ -- this is the biggest thing you can do. Both platforms support C and C++, though in different ways. On Android, you'll be using the NDK. On the iPhone, it can be compiled along with the Objective-C code. You'll need to invest some time building the scaffolding around your C/C++ code for each platform. You should be able to be fairly generic in this area, since it's really just connecting up the OS specific functionality into your game code. Don't skimp in this area unless you're only planning to do one cross-platform project or that you don't mind re-inventing the wheel for every project you do. Use OpenGL ES -- both platforms have OpenGL ES support. Take advantage of it. This will minimize the amount of code that you need to re-write. You will still have some differences on each platform, but overall most of your code will work on both. Avoid platform/language specific APIs -- this should go without saying, but it's easy to be sucked into using the Java collection classes while you are working in Java. Of course, if you followed the first rule above, you won't be doing much in Java. Same goes from the opposite way -- as nice as the Foundation classes are in iOS, if you want to port to another platform, avoid them. As you can see, there is a lot of things to worry about by going cross-platform. If you are a small indie developer, it may not even be worth your time. You will have to evaluate if you really want to blaze your own trail so that you can target multiple platforms. It may be worth taking advantage of what each platform has to offer in order to have a faster development cycle. Good Luck! |
|||||
|
|
That will be a largely painful process going from Java > Objective-C. Data Driven High and Tight Contract Work Use a Multi-Platform Engine Conversion /shudder/ Tool |
||||
|
|
|
If you're thinking of porting to the iPhone and your game is still in development, then switch to C++ if you haven't already. It will make your code significantly more portable when the time comes. |
|||
|
|
|
Going to add my two cents to this thread - consider writing your game in a cross platform language like many of the others have said here... but consider C#! It's a powerful language that is managed and provides a lot of great features that C++ doesn't that can assist in game development - and a great library known as MonoGame exists for it which is akin to XNA which runs on all sorts of platforms. As of Version 3.0, at the time of this writing, it's possible to write full fledged games and port to all mobile platforms with ease. |
|||
|
|