• Advertisement
Sign in to follow this  

programming language for android.....

This topic is 738 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Good Day!

 

what programming language is the best choice for android games? can you please tell me the pros and cons of each language.

please i really want to learn and make my own games...

 

thanks in advance...

 

have a nice day..

 

sorry for bad grammar....

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

Well the first and most obvious choice is Java. That is the language all the dev tools from google are geared at and all hooks in with the APIs provided. The massive downside of Java being Java itself, for me it is just a painful language that has not kept pace with the world shifting around it. You might be able to use Scala as a replacement to Java but don't quote me on that. Scala is much better language choice imho

 

Given that MS have just bought up xamarin and now give it away free that might be a viable option. This allows you to use C# and target Android, iOS, Mac and Windows using mostly common code base which will open your target audience far further. C#, if you are not familiar with it, started as a poor Java clone but has grown quickly to be a powerful multi paradigm language which Java is now playing frantic catch up to and failing.

 

C++, if you want the pain. C++ if used correctly will give you more performance and control over the chosen platform at the cost of more developer responsibility. You will also be more tied to hardware as you compile for target type of CPU, this can be a bad thing in the fast moving world of mobile.

Share this post


Link to post
Share on other sites

It depends on your goals and the requirements of the game you're trying to build.  You will need to write some of it in Java, just like for iOS you need to write at least some in Objective-C.  After that if you dont care about your code being cross-platform or high performance, you can stick with Java for the entire thing.  If you need high performance or you want your engine to be used for other platforms, then you can do the initialization of the app in Java and then write the rest in C++.

Share this post


Link to post
Share on other sites

It depends on your goals and the requirements of the game you're trying to build.  You will need to write some of it in Java, just like for iOS you need to write at least some in Objective-C.  After that if you dont care about your code being cross-platform or high performance, you can stick with Java for the entire thing.  If you need high performance or you want your engine to be used for other platforms, then you can do the initialization of the app in Java and then write the rest in C++.

 

With the likes of xamarin there is actually no requirement to write any Java at all, the same with using xamarin for iOS you do not have to see a single line of objective-c :)

Share this post


Link to post
Share on other sites

As far as I can read OP didn't mention any other platform (or cross-platform), apart from Android. The options for this are

 

1. Java 

pros;  Straight forward coding, great way if you are a beginner 

          You won't have the distractions of the complexities of native development

           Straight forward coding with the popular IDE eclipse and Android studio

 

cons:   You will have performance issues for many graphically intensive coding

           Just to give you an example of a degraded performance using just Java:- Currently using only java with eclipse IDE, My GL takes a whopping 5 minutes to render (no exaggerations)

           (but I made a decision earlier on that I want to minimise the complexity of my code and rather concentrate core problems of the app, so i will have to live with that. Though I intend to refactor for better performance later on, if possible convert to native code. By then I wouldn't be distracted from the core app problems because that would be solved ) 

 

2. Java core plus native language (c/c++), you need NDK

Pros;   You get much better performance particularly for graphically intensive developments such as games, image processing and physics simulations

 

Cons; Massively Increases the complexity of your code , connecting with JNI  etc

           If you are not experienced enough debugging could be a nightmare, 

 

But all in all your decision should depend on your experience and the type of application you intend to develop

More reading http://developer.android.com/tools/sdk/ndk/index.html

                      https://en.wikipedia.org/wiki/Android_software_development

                      http://developer.android.com/ndk/guides/index.html

 

3. Xamarin (not a programming language)

As mentioned above if you want to leave open the options for cross platform development then Xamarin is the way to go

Share this post


Link to post
Share on other sites


Currently i am using only java with eclipse IDE, My GL takes a whopping 5 minutes to render (no exaggerations), AND that's a BIG con

Is this in the emulator or on a real device?

 


Your choices should be between Java and C++ (with the NDK), but these were mostly outlined above.

 

These are the main languages that are supported natively.  Java is the easiest to get into (being the default language for Androids Dalvik virtual machine) but, it is not as portable as C++.  Unfortunately the C++ debugging on Android is rubbish.

 

You can also replace Java with any other language that is capable of running on the Dalvik virtual machine.  Its a fairly exotic way to go but there are guides around that tell you how to get going.  The main replacement languages I've seen used in real world apps are Clojure, Scala and Ruby.  Could be a good choice if you are an expert in any of these languages but, difficult to find support if anything goes wrong.

 

 

There are several Engines or Frameworks available that allow you to use other languages such as Haxe, Monkey-X, HTML5 / Javascript, GML, C#,  Python, Lua to target both Android and multiple other platforms.  Good points is a lot of these engines have huge a large comunity, support forums and books / documentation available.  The downsides could be performance if you want to do something really specific and also failure to support a new feature on release.

 

 

There are also several solutions available that allow you to convert (cross - compile) Objective-C iPhone applications to Android.  These have varying degrees of success but, one of the more popular ones "Apportable" works pretty close with the cocos2d guys so that porting an iOS app that is written using the cocos2d framework is fairly painless.  Good if you already write iOS games using the cocos2D framework but, probably better just to use cocos2d-x (C++) in the first place.

 

 

I think before asking which language is the best for you there are a few other questions that you need to ask first:

Do you only intend to target Android or do you want to target multiple platforms?

 

Do you want to write everything from scratch or use an existing framework or engine?

 

What programming language(s) do you already know?

 

If you want to use an Engine or Framework then do you want to be able to do everything in the editor or code everything at a lower level?

 

 

 

 

The truth is that you can use almost any computer programming language to write Android apps. My take on it is the following:

I want to write my own high performance game engine from scratch:

Use C++.

I want to use a fully featured engine with an editor to write my games:
Use Unity (C#) or Unreal (C++).

 

I don't want write my own engine and I don't want to use all the features in Unreal or Unity.  I like to code:

Use libGdx(Java) or Monogame(C#)

Share this post


Link to post
Share on other sites

Since you are a beginner I'll cut it short: there's nothing else than Java for you.

Ok, there's C# with Xamarin and now it's MS I bet it'll be very soon far, far better than Java. The Xamarin API looks to be intersecting with the Java API at large so I would consider those fairly equivalent. The Java framework (or the Xamarin, likely) have a few quirks such as having your app window getting killed implying you basically cannot do anything taking for granted it'll complete. Those issues AFAIK are common to Java and Xamarin (which binds to the same framework basically) so get in touch with them ASAP.

 

Those issues are not there for native NDK. NDK is still a work in progress and even if you do it you need workflow to support it (build all your libs for all archs etc). I have used C++ for more than a decade now but I don't think it is productive for me to go NDK yet.

 

Look around at where you can move and figure out which one is more requested. For me, that was Java.

Share this post


Link to post
Share on other sites


With the likes of xamarin there is actually no requirement to write any Java at all, the same with using xamarin for iOS you do not have to see a single line of objective-c 

 

That is actually true for C++ too, on Android, using the NativeActivity.

 

Of course, to actually ship a quality product, you'd likely need a bit of Java/obj-c code.

So it is a good idea to understand how the interaction works, so you can extend it when needed.

 

Regardless of which language you choose to do your main development in, there will always be some Java code involved on Android, and some Obj-C code involved on iOS.

Share this post


Link to post
Share on other sites

thanks for the response....

 

actually i just started to learn android studio, and i dont know if its possible to make a games in android studio. 

 

and right now i still don't know where to start to learn how to make a games.

 

what language do i need to study.?

 

as you've said we are in fast moving technology and I can't decide if i will study native language like Obj-C and C++ because I'm worried that maybe this language will no longer exist in the next decade.

 

If i were you what language and where i will start?

 

thanks again.....

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement