4 Replies - 1158 Views - Last Post: 10 October 2014 - 12:25 PM

#1 john5220  Icon User is offline

  • D.I.C Head

Reputation: -9
  • View blog
  • Posts: 118
  • Joined: 06-November 13

So what if Android was all in C++ would a phone perform faster?

Posted 10 October 2014 - 11:19 AM

I keep hearing people say Android is slower than ios because of Java. "The screen swipe lag" is what they mostly talk about

And that if it was in C++ and everything was built in C++ as opposed to java it would run much faster.

So wait what about those high end games on Android? are they developed and coded in Java? what would happen if it was coded in C++. Say X game on the store right now gives 50FPS on Nexus 4. Would it give more FPS if it was made in C++?

What was google's reason for using Java as the primary language?

This post has been edited by john5220: 10 October 2014 - 11:20 AM


Is This A Good Question/Topic? 0
  • +

Replies To: So what if Android was all in C++ would a phone perform faster?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13566
  • View blog
  • Posts: 54,122
  • Joined: 12-June 08

Re: So what if Android was all in C++ would a phone perform faster?

Posted 10 October 2014 - 11:31 AM

Quote

Say X game on the store right now gives 50FPS on Nexus 4. Would it give more FPS if it was made in C++?

Yes? No? Maybe? That would depend on a whole mess of unknowns.


Quote

What was google's reason for using Java as the primary language?

Searching "why is android in java" gives up a ton of information.
http://www.zdnet.com...ory-lesson/9499
https://programmers....sen-for-android
https://stackoverflo...ndroid-use-java
Was This Post Helpful? 0
  • +
  • -

#3 john5220  Icon User is offline

  • D.I.C Head

Reputation: -9
  • View blog
  • Posts: 118
  • Joined: 06-November 13

Re: So what if Android was all in C++ would a phone perform faster?

Posted 10 October 2014 - 11:41 AM

^ thanks from your links I found this post below. The user says the speed difference is not an issue as its so small that if you were to consider it an issue you would be coding in low level language in the first place. I think this sums it all up



Some points:

Java is a known language, developers know it and don't have to learn it

it's harder to shoot yourself with Java than with C/C++ code since it has no pointer arithmetic

it runs in a VM, so no need to recompile it for every phone out there and easy to secure

large number of development tools for Java (see point 1)

several mobile phones already used Java ME, so Java was known in the industry

the speed difference is not an issue for most applications; if it was you should code in low-level language
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12186
  • View blog
  • Posts: 45,250
  • Joined: 27-December 08

Re: So what if Android was all in C++ would a phone perform faster?

Posted 10 October 2014 - 11:52 AM

Moved to Corner Cubicle.

john5220- Please try and find the appropriate forums for threads. On topic, technical questions do not belong in the lounge. Please stop posting such threads in the lounge.
Was This Post Helpful? 0
  • +
  • -

#5 depricated  Icon User is offline

  • Nero


Reputation: 2332
  • View blog
  • Posts: 6,014
  • Joined: 13-September 08

Re: So what if Android was all in C++ would a phone perform faster?

Posted 10 October 2014 - 12:25 PM

basically the notion hinges on the difference between Compiled and Translated languages. Java is JIT (Just-In-Time) Compiled language (aka translated), meaning that it's compiled at runtime - while C++ is a fully compiled language, meaning at runtime it's already fully built.

In the mid-90s this was relevant. However, in 2014 the added overhead of JIT is a bit of a joke. Our computers are so much faster now than they were then, and even in the 90s the difference between a java application and a fully compiled c++ application was not overly noticeable. I didn't write in java at that time, but I did use java applications that had to build every time I ran them. The difference in speed wasn't enough to deter me from using them, or other people. Java has stuck around for a reason, and if it were appreciably slower than another language it would lose out.

C# is JIT, too.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1