Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a good grasp in C++ and C and have also experience developing AAA game using C++. Now, I'm shamelessly thinking to dive into mobile game development either in iOS or Android. Unfortunately, I don't know objective-C and java and neither have courage to learn it. So, As above mentioned reason, Is there any possibility to do mobile development in C++ without using any single statement of JAVA and Objective-C ?

share|improve this question

5 Answers 5

Some objective C has to be written for iPhone apps. That being said, you can write a pretty thin layer of obj-c and then do all you game code in C or C++.

On android look up the NDK. I don't have any experience with it, but it promises to be a native sdk so you should be able to write most things in C or C++.

That being said, you're artificially limiting yourself with the language barrier. On iOS, if you want to do anything with the OS layer (like GameCenter, their social platform), or use any kind of middleware, you'd probably be faced with an objective C API.

I can kind of understand the sentiment. C++ in particular is a huge language. But obj-c isn't a big. It's a bolt on to C (so the fundamentals should be familiar) with a few extra things added on top. It isn't nearly as complex or deep as C++.

share|improve this answer
2  
Please keep in mind that using Android NDK means to leave the advantages of "write once deploy everywhere" since you have to compile your code for multiple platforms perhaps incurring in multiple build problems. NDK is meant to be used to call C function from java code, not to write whole application (while it is still possible). –  FxIII Aug 8 '11 at 7:44
1  
I also think Google have explicitly stated that NDK is not to be used for a full game implementation. Besides, the java syntax is nearly identical to C++ and should take a few days to get the hang of. If you want to make money you should probably focus on iOS games though. –  Nailer Aug 8 '11 at 8:09
    
What do you say about Unity3D, if i learn C# –  James Bern Aug 8 '11 at 8:46
1  
Starting with Android 2.3, Google added native activity which lets you write a full app in 100% c++ (mainly for games). –  5ound Aug 8 '11 at 14:08
    
I would recommend Unity3D, especially if you want to deploy to multiple platforms. C# isn't that difficult to learn if you already know C++, and their forum content is top notch with tons of sample code (although most code is in JavaScript). –  Doug.McFarlane Aug 8 '11 at 23:58

I've been writing a game for quite a while in c++ for Android. I have to touch the java code once every few weeks, but for the most part I modified one of the sample apps that comes with the NDK and have written c++ otherwise. I've had to do a bit of JNI work as well, which is never fun. However, I have many years of java experience, so having to write java or JNI doesn't particularly slow me down.

My game runs just as well on my linux box as it does on my test devices. The linux version is pure C++ and the trouble I went through to make this work pays for itself every time I make an iterative change to my game.

My project has 836 lines of java code, 331 lines of hideous jni C code and about 40k lines of C++ code.

share|improve this answer
    
Do you use a build system that can build for each target in an automated fashion? I've been using CMake for allowing cross-platform builds, and was wondering if I could integrate it with ndk-build. –  Martin Foot Aug 11 '11 at 7:05
    
I've seen other NDK projects use CMake. –  stephelton Sep 29 '12 at 16:39

There is also Marmalade which allows you to use c++ to create mobile applications for a broad range of devices such as iPhone, Android, Win Mobile, Bada, and some more.

share|improve this answer

I'm using cocos2d-x for a while, it's a game engine based on c++. (it actually a c++ port of cocos2d-iphone). using this engine you can easily run and test your codes on windows and then compile the same code for iphone/android export.

share|improve this answer
    
also now includes bada and some people have used it on top of Marmalade –  Andy Dent Jan 13 '12 at 7:09

If you really want just C++, Marmalade might be good for you

But for full capabilities you have to use at least some objective-C (or java, but i'm talking about "full capabilities"). But with a thin layer of objective-C you could do so much, so I reccomend you look in to iOS development with Xcode.


If you have a mac look at Xcode, if not, try corona with lua instead.

There are many ways to max your C++ code to be run on the iPhone. A free program on the mac app store could help increase C++ use in Objective-C based products:

It's called objective-C++ Preprocessor Headers

This allows you to do even more with C++ rather than Objective-C.

iOS programming:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.