Sign in to follow this  
Michael Charbbie Fuentes

programming language for android.....

Recommended Posts

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


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

Everything has a learning curve. Some learning curves are sharper, more difficult to learn, than others.

 

Learning a programming language is hard.

Learning to make games is hard, even if you already know a programming language.

Learning to program on mobile devices is hard, even if you know how to program on a PC already.

 

My recommendation is that you simplify.

 

Learn to program on your main computer first.  Write programs on your computer for your computer.  Start with "Hello, World!" then guess-the-number, then perhaps a simple non-graphical tic-tac-toe. 

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?

 

Real device

 

thanks for the response....

 

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

 

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

 

3.  what language do i need to study.?

 

4.  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.

 

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

 

thanks again.....

 

1. Android studio is an IDE, you will still need an Engine if you want to start coding games fast. Gamemaker, Unity and Unreal4 are the most popular ones you could start with

 

2. If you choose Unity, good beginners tutorial comes with it

 

3. If you choose Unity then you need to learn C#

 

4. You can't live with that kind of philosophy otherwise you will end up not learning anything. Most languages improve on functionality with time, but the basics will be the same. No learning is a waste. C++ has been around for 30 years and still going strong. If you learn Object-C it will never be a waste

 

5. Depends on your decisions. If you want to start gradually as frob suggests, then start with C# (or Java) on desktop with basic coding and gradually increase the complexity. You could do some googling, there are many good tutorials online

 On the other hand if you want to jump straight in to making games you can start with either Unity or Gamemaker. But you still need to learn C# if you choose C#

 

If you feel overloaded with information, You could ask yourself: whats my target? how much time have I got for learning? do I want to be a good programmer or do I just want to make games quick? If its the first, follow frob's advice until you are good enough to start making games with Unity. If you decide on the latter you could choose Gamemaker as it has the least steep learning curve

Share this post


Link to post
Share on other sites

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.

Actually your thinking is backwards.
C++ has possibly been around longer than you have been alive (as for me it is only 1 year younger) and will be here long after you are dead.
If you are planning on programming in 10 years, you should be focusing on C++, as it is the only language guaranteed to be here a decade from now.

 

 

L. Spiro

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.....

 

Of all the languages used in games now the one that will almost certainly be around in 10 years is C++.  It's the most widely used language in games, it's been around now for decades, and it generally offers the best combination of flexibility and performance.  It's also supported on every single platform there is.  If you can only learn one language for games, this is it.

 

But you're a beginner, so this is a different question and we'd need to know more about you and what you plan to do to tell you what language you should tackle first.  Honestly if you're just starting and want to learn to make games, the last platform I'd recommend is Android.  Working on Android is generally a pain in the a** and suitable mostly to masochists.  I'd suggest you start making games on your PC of choice (Windows, Mac, Linux), or if you really want to do something on mobile I'd recommend iOS. 

Share this post


Link to post
Share on other sites

 

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.

Actually your thinking is backwards.
C++ has possibly been around longer than you have been alive (as for me it is only 1 year younger) and will be here long after you are dead.
If you are planning on programming in 10 years, you should be focusing on C++, as it is the only language guaranteed to be here a decade from now.

 

 

L. Spiro

 

 

Just because C++ has been around for a long time doesn't guarantee that it will be around forever.   Just about every survey I can find shows that C++ usage has been declining for years.
I don't want to start another language holy war as I am a C++ coder myself and well aware of its merits and well aware that the language will most likely be around in 10 years time but, it is already getting harder to find C++ development jobs outside of a few niche fields.

Share this post


Link to post
Share on other sites

 

Just because C++ has been around for a long time doesn't guarantee that it will be around forever.   Just about every survey I can find shows that C++ usage has been declining for years.

Other languages are almost always written in C or C++. So whilst C++ popularity may be declining (which it honestly isn't), it doesn't mean the technology is going away... ever.

 

Yes, it may not be cool. I remember the day when people told me that C and C++ was already obsoleted by Java 1.5... Haha did I have the last laugh ;)

 

The fact that C and C++ both have hundreds of compilers available to them whereas languages such as Java and C# have only a few does speak very highly for how critical C and C++ is for software development and how much they are "the" standard technology that all others are based upon.

 

For a beginner, it may not be relevant but for any technology have a look at its dependencies, such as what the runtime requires, what the compiler requires etc... This will almost always be C or C++ but also gives you a good idea of the lifespan of the language.

Edited by Karsten_

Share this post


Link to post
Share on other sites

 Just about every survey I can find shows that C++ usage has been declining for years.

 

 

Do you have any references to those surveys?

I'm interested to know if they compare it in absolute or relative numbers.

 

With so many "new" languages and frameworks being invented for many reasons, I don't doubt C++ is declining as a percentage of total development done.

But at the same time, programming in general is increasing a lot, so I also suspect the number of C++ projects in absolute numbers are actually increasing, and not decreasing.

 

And as others have said, C++ is still the language in existance today that is most likely to be around in 10, 20 and possibly 100 years (unless AI programmers have taken over by then, but even then, they'll probably still maintain a few C++ projects..)

Edited by Olof Hedman

Share this post


Link to post
Share on other sites


Learn to program on your main computer first. Write programs on your computer for your computer. Start with "Hello, World!" then guess-the-number, then perhaps a simple non-graphical tic-tac-toe.

 

good day...

 

sir actually i already create guess the number game in android studio, i study the logic then i code it from scratch and its working fine.

 

but now i want to learn to make simple basic game like, snake, tetris, and some 2d games.

 

but i dont know if i can make it in android studio.

Share this post


Link to post
Share on other sites


But you're a beginner, so this is a different question and we'd need to know more about you and what you plan to do to tell you what language you should tackle first.

 

 

Good Day!

 

Sir Actually i know some basic syntax of C++, and java also. and right now I'm studying java.

 

My target is games for android devices. I watch video in youtube that using libGdx, you can create games in multiple platform.

Share this post


Link to post
Share on other sites


Do you have any references to those surveys?

 

http://www.tiobe.com/tiobe_index/

http://www.itjobswatch.co.uk/jobs/uk/c++.do?

 

http://pypl.github.io/PYPL.html

 

http://lang-index.sourceforge.net

 

Github does show a slight improvement:
https://github.com/blog/2047-language-trends-on-github

 

 

 


And as others have said, C++ is still the language in existance today that is most likely to be around in 10, 20 and possibly 100 years (unless AI programmers have taken over by then, but even then, they'll probably still maintain a few C++ projects..)

 

I'm not really arguing that C++ won't still be around just that the demand for C++ programmers won't be very high.   Fortran, Cobol and Assembly are still around and have been around for longer than C++ but, the demand for developers using these languages is very small.

Share this post


Link to post
Share on other sites

 

Do you have any references to those surveys?

 

http://www.tiobe.com/tiobe_index/

http://www.itjobswatch.co.uk/jobs/uk/c++.do?

 

http://pypl.github.io/PYPL.html

 

http://lang-index.sourceforge.net

 

Github does show a slight improvement:
https://github.com/blog/2047-language-trends-on-github

 

And as others have said, C++ is still the language in existance today that is most likely to be around in 10, 20 and possibly 100 years (unless AI programmers have taken over by then, but even then, they'll probably still maintain a few C++ projects..)

 

I'm not really arguing that C++ won't still be around just that the demand for C++ programmers won't be very high.   Fortran, Cobol and Assembly are still around and have been around for longer than C++ but, the demand for developers using these languages is very small.

 

We have to differentiate a bit between the general programming world and game development.  I'd have to really look into the links you posted, but my guess is their results are heavily biased for general or web development for various reasons.  In that case it's not surprising that as new technologies develop and hardware gets faster, that C++ would go down in market share.  This is kind of expected.  The interesting thing about C++ is that as other languages like Fortran decrease in popularity (i.e. in science) C++ can come in to fill that role whereas other new languages cant.  No one in science is changing their computational codebases from Fortran to Java, but they ARE chancing from Fortran to C++.

 

In games even though new languages like C#, Obj-C, and Java have risen and taken some share from C/C++, I just dont see how any of them have any significant chance of taking over from C/C++ as the primary language for writing games.  That's why I'd confidently put money on C++ over any other language to still be around however many numbers of decades we're talking about... where other languages are more likely to come and go.  The reason is that no other language (IMO) has the ability to do so many things, and do them well, as C++.   Also, C++ has constantly been improving and evolving which means it can preserve its core advantages while adopting new languages advantages over time.

 

This all reminds me of a talk by Scott Meyers called "Why C++ sails when the Vasa sank":

 

https://www.youtube.com/watch?v=ltCgzYcpFUI

Edited by 0r0d

Share this post


Link to post
Share on other sites

C++ is used in many roles.  For systems level work, it is still the preferred language for games.  

 

For game code other languages are frequently used, such as Lua, or C#.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this