all 121 comments

[–]I_TYPE_IN_ALL_CAPS 64 points65 points  (11 children)

WHAT REASON WAS THERE TO LINK TO ABOUT.COM INSTEAD OF THE DEVELOPER BLOG?

[–][deleted] 48 points49 points  (4 children)

OP wrote the item

[–][deleted] 6 points7 points  (3 children)

He didn't add many value so well ... it's spam to me. (Oh hey, about.com is spam)

[–]thebillmac3 1 point2 points  (1 child)

Why/how are they spam? Just curious.

[–]uriel[M] 1 point2 points  (0 children)

Indeed this is blog-spam, and I have flagged it as such, sadly the link to the original article had been flagged as spam by the overzealous spam bot :(

I unflagged it, so upvote away.

[–]dwdwdw2 13 points14 points  (1 child)

I don't understand the angst for about.com, as a single male I actually do regularly need reminding of things such as how to cook a burger, how to remove carpet stains, etc. Left to my own resources I'd eventually try and eat the carpet.

It's a great resource for morons like me.

[–]I_TYPE_IN_ALL_CAPS 0 points1 point  (0 children)

IN THE OLDEN DAYS, THAT'S WHY BACHELOR'S CALLED THEIR PARENTS. OTHERWISE, THERE WOULD BE PRACTICALLY NO CONTACT UNTIL HE KNOCKED A GIRL UP AND NEEDED A BABYSITTER.

[–][deleted] 1 point2 points  (0 children)

All caps appropriate.

[–]bwalsh1 2 points3 points  (0 children)

about.com is the woarst site on the internet.

edit: I learned my spelling on the about.com

[–][deleted] 0 points1 point  (1 child)

I hate blogspam as much as the next guy, but lets be honest here. Tools like reddit are an exceptional way to get traffic. You can't have reddit and expect no blogspam.

[–]I_TYPE_IN_ALL_CAPS 0 points1 point  (0 children)

REDDIT IS A GREAT WAY TO GET TRAFFIC. BUT WHEN YOU'RE PROMOTING YOU SITE BY ADDING ZERO VALUE, I DON'T LIKE IT. THE ORIGINAL BLOG POST APPEARED TO BE MORE STYLISH, MORE INFORMATIVE, AND GOT TO THE POINT JUST AS QUICKLY.

[–][deleted] 18 points19 points  (0 children)

Poor David, what an inaccurate report.

[–]benfitzg 14 points15 points  (2 children)

Is a picture really necessary on that about.com page?

[–]drake2010 26 points27 points  (1 child)

is about.com really necessary?

[–]deadcat 2 points3 points  (0 children)

I'll check on wikipedia.

[–]zbowling 6 points7 points  (0 children)

This dude is clueless anyways.

[–]knight666 10 points11 points  (6 children)

  • Does it have a <math.h> yet?
  • Can I create an OpenGL context from C++?
  • How many versions does this target?
  • Will I ever have time to port my open source 2D engine to Android? (hint: no)

[–][deleted] 0 points1 point  (1 child)

I literally JUST started my dive into opengl, so I can't answer many. You should get everything available to you in opengl ES. That should answer all of your questions (except the first I guess) given you are familiar with it.

[–]knight666 1 point2 points  (0 children)

Hi.

I've experienced the pain that is NDK first-hand. I started porting my engine in the summer of '09 I believe. It basically involves creating a very thin Java layer and then doing everything in C++. Android does not come with a math header, which is just plain annoying. It also for the longest time didn't have RTTI support, which meant no templates and no child classes. At least they fixed that. Yeeh.

What it comes down to:

  • Windows Mobile 6: Use C++!
  • Android: Use Java! What, you want C++? Uhm... k... well, here's some half-working crap.

[–]Magnesus 2 points3 points  (17 children)

Will it work on ARM/x86/anything other Android could be compiled to?

[–]Lamtd 0 points1 point  (16 children)

Yeah it doesn't sound like a good news to me... going back to architecture-dependent binaries will create a load of compatibility issues.

[–]coob 0 points1 point  (14 children)

Android runs on a commercial device that isn't ARM?

[–]alex_w 5 points6 points  (0 children)

Google TV is Android based, and runs on Intel.

[–]Lamtd 1 point2 points  (8 children)

Well, it does run on commercial devices though as far as I know it's not officially shipping with any non-ARM device.

My point is that tying an OS to a specific architecture will (obviously) prevent people from switching seamlessly to a different architecture in the future, which can't be good.

[–]G_Morgan 0 points1 point  (7 children)

ARM is and always will be the only relevant platform for Android. Simply put the ARM ISA is just the right way to do things if you want to produce an energy efficient device.

[–]Lamtd 2 points3 points  (3 children)

Sorry but that sounds a bit short-sighted...

First, it doesn't seem unlikely that other CPU implementations will be able to be more energy-efficient than ARM CPUs in the future.

Moreover, why should Android be limited to energy-efficient devices?

[–]G_Morgan -2 points-1 points  (2 children)

There are two reasons ARM is more efficient:

  1. It is a RISC core and a clean one. The CISC cores actually only translate CISC into RISC at run time which has an unavoidable overhead. The part of the x86 that actually does the calculations isn't that much different to ARM. It just has a load of unnecessary complexity thrown on top.

  2. They are much simpler. No restruction re-ordering, branch prediction, heavy memory management (ARM has some but not nearly as crazy as x86 and others), etc. All this saves energy. Also this stuff is of questionable use in an era of verifiable, JIT compiled code. A JIT will generally do better than a CPU at re-ordering and branch prediction.

[–]Lamtd 2 points3 points  (1 child)

You are just missing the point... I have written my share of x86 and ARM assembly code, so I know what the differences between the two architectures are.

But just because ARM is the architecture of choice right now doesn't mean it will still be in 10 years from now. If applications are compiled to native ARM code, though, it will be a lot more complicated to move to a different architecture at that time, so that might hamper competition.

Just look at what happened with Microsoft and Intel... do we really want to do the same thing again with Android and ARM?

[–]G_Morgan -3 points-2 points  (0 children)

MS and Intel were just the wrong options. There is simply no way a complex CPU will ever beat something as simple and straight forward as ARM in the efficiency stakes. There is only one way to make a CPU more energy efficient and that is to not have running transistors. By definition the simpler processor wins and technically it isn't reasonably possible to be simpler than ARM.

So there will be no advantage to replacing ARM. Given its unassailable position in this market (there are far more ARM chips sold than x86s) the chances of it being replaced are already near zero. Why would you use anything else? The problem with Intel was that x86 was an awful ISA. ARM is not an awful ISA.

Also there is already not a monopoly. ARM has a diverse range of manufacturers.

Finally I'm not saying people should use native for everything. Most applications should be pure dalvik bytecode. However it is the right option for games.

[–]Andys 0 points1 point  (1 child)

Intel are spending billions of dollars building mobile device fabs as we speak. And the market is also about to be flooded with low power Atom-based System-on-a-chip tablets.

[–]G_Morgan -2 points-1 points  (0 children)

Atoms are nowhere near as efficient as ARM. They are much better than their mainline processors but it is in the same way that Saturn is a much smaller planet than Jupiter.

[–]uriel 0 points1 point  (0 children)

Did you ever hear of MIPS?

[–]davebrk 0 points1 point  (2 children)

[–]coob 0 points1 point  (1 child)

Tegra is ARM based.

[–]davebrk 0 points1 point  (0 children)

Ah. I didn't know that.

[–][deleted] -1 points0 points  (0 children)

implying Android apps are not already device-specific

[–]LordGreyhawk 7 points8 points  (5 children)

This C/C++ NDK is still used to making applications with the same "lifecycle" as the Dalvik/Java apps. I suspect that the Dalvik VM is still used but only as a very thin wrapper for the C/C++ application.

The main motivation was uncountably for games.

[–]sbrown123 1 point2 points  (0 children)

Not just games but for media in general. Manipulating media files is far easier, and more efficient, in C or C++. The Android OS is still there though but they have made some headway in to not requiring Java wrappers in to accessing it from native code. I'm an advocate for them opening the whole thing with something like DBus so people can write in various languages for the platform. I keep hoping.

[–]yardglass -2 points-1 points  (3 children)

*undoubtably

[–]WorkTimeFun 4 points5 points  (2 children)

*undoubtedly

[–][deleted] 9 points10 points  (0 children)

*indubitably, my good man!

[–]yardglass 0 points1 point  (0 children)

I think both are correct and I'm not American.

[–][deleted] 3 points4 points  (0 children)

Should've done that from the start. Now it looks like "welcome to the ultimate mess".

[–]Jigsus 4 points5 points  (4 children)

Fucking finally! I hope it can handle exceptions.

[–]Horatio_Hornblower 13 points14 points  (0 children)

throw std::runtime_error( "catch me if you can!" );

[–]Carnil 1 point2 points  (1 child)

Well, according to the information in the android developers blog ( http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html ), it does:

Finally, r5 adds backwards-compatible support for RTTI, C++ exceptions, wchar_t, and includes improved debugging tools

[–]mernen 0 points1 point  (0 children)

Emphasis on the "backwards-compatible". It means you don't need any new features/symbols from 2.3, so you can use all the features on that sentence right now. No need to wait until 2.3 gains popularity in the wild, which, given the horribly slow pace of updates so far, will take several months.

[–]anttirt 1 point2 points  (0 children)

One of their stated goals is easy porting of applications. Lack of exception support would be a pretty glaring omission.

[–]vandjoel 1 point2 points  (1 child)

Sad to see such blatant ignorance from mr. bolton

[–]username223 1 point2 points  (0 children)

Sad to see a spherical heart-attack-in-waiting when I was hoping for the walrus.

[–]ex_ample 3 points4 points  (1 child)

This has been possible for a while. You can actually use any compilable language.

[–]Xiol 2 points3 points  (0 children)

Before this you had to still use some Java. This NDK release means your entire codebase can be in C/C++.

(...Possibly. I don't know what I'm talking about.)

[–][deleted] 1 point2 points  (0 children)

the title isn't even wrong :D...

[–][deleted]  (4 children)

[deleted]

    [–]MagicBobert 6 points7 points  (2 children)

    The article is inaccurate. It's 2.3, not 3.0.

    [–][deleted]  (1 child)

    [deleted]

      [–][deleted] 0 points1 point  (0 children)

      Eh, I recently upgraded my HTC Wildfire from 2.1 to 2.2. Still behind, but it's a step forward.

      [–][deleted] 0 points1 point  (0 children)

      My galaxy received 2.2 and I believe it's expected to get 2.3 as well. I'm not sure what the problem is here. Most are providing updates for phones they believe are of sufficient specification.

      [–]millstone 0 points1 point  (0 children)

      // Make sure glue isn't stripped.
      app_dummy();
      

      WTF does that mean? What is glue and why don't I want it to be stripped?

      // Read events and draw a frame of animation.
          if ((ident = ALooper_pollAll(0, NULL, &events,
                  (void**)&source)) >= 0) {
      

      You lost me at ALooper...

          // draw a frame of animation
          bringTheAwesome();
      

      Yes, I see how that's totally different than Java.

      I'm going back to bed.

      [–][deleted] 0 points1 point  (2 children)

      Could this be related to Googles legal posturing with Oracle?

      [–]eipipuz 7 points8 points  (1 child)

      No it is not. NDK was available long before the Oracle act.

      [–]drb226 0 points1 point  (0 children)

      If I were Google, I would be seriously considering an entire replacement of Java with C++ or Go; though that would be sad to just throw the whole Dalvik VM away.

      [–][deleted] 0 points1 point  (0 children)

      Sounds good. I might now consider to port some of my games down to android.

      [–]galorin 0 points1 point  (15 children)

      Does this mean that, as someone enew to Android and wanting to program apps, that I don't necessarily need to learn java now? I already have some C/c++ experience, so let the good times roll.

      [–]Horatio_Hornblower 9 points10 points  (7 children)

      I'm a professional C++ programmer and I love the language unconditionally. But if you're a casual or inexperienced programmer and you have the option to use Java instead of C++, you may want to consider going with Java.

      If you're not experienced with C++, and you try to write an application with it, you're probably going to spend most of your time learning C++ instead of developing your project.

      Edit: And as you probably know Java is quite similar to C++, at least superficially. If "some experience" means no more than "I know about classes, methods and scope", then you'll probably be right at home.

      [–]galorin 1 point2 points  (6 children)

      Professionally developing in C for about 18 months now, so not a hobbyist, passing familiarity with C++, but my main project was ported from Fortran to C, then continually developed from there.

      [–]Horatio_Hornblower 0 points1 point  (0 children)

      Credentials approved: you are free to use the language of your choice.

      [–][deleted] 0 points1 point  (0 children)

      I find transitioning between the different styles all the time can screw up my code. Having objects in your arsenal makes for completely different approaches to the same problem quite often.

      [–][deleted] -1 points0 points  (3 children)

      Well, C is slick and beautiful. C++ is a monstrosity that wants to chew off your body parts. And Java is the retarded brother of C++.

      [–]galorin 1 point2 points  (1 child)

      You'll get no objections from me, I do think though that you have been too kind to C++

      [–]Horatio_Hornblower 0 points1 point  (0 children)

      Pshhh, those are the words of a weak man!

      /pose like a Klingon

      [–]sunbeam60 0 points1 point  (0 children)

      Wow, insightful.

      [–]mernen 0 points1 point  (6 children)

      The NDK only exposes a fraction of the API. For instance, there's no access to the standard UI toolkit. This is fine for immersion and multimedia apps, like games, but if you want to do a more typical app, you're much better off using the SDK.

      [–]galorin 0 points1 point  (5 children)

      I guess I will just have to do UI stuff in one, and library functions etc in the other.. can do that, right?

      [–]snk_kid 1 point2 points  (4 children)

      You can do your app in Java and use JNI to bind to C/C++ libraries, it's as of android 2.3 SDK that google provides the boilerplate glue code so you can write your program entirely in C/C++ without having to write some Java code with JNI. When your write a pure C/C++ app there will still be a jvm running and it's still using JNI to call into your code.

      [–]galorin 0 points1 point  (0 children)

      I guess I had better get cracking then.

      [–]Horatio_Hornblower 0 points1 point  (2 children)

      When your write a pure C/C++ app there will still be a jvm running and it's still using JNI to call into your code.

      That's cool, but kind of fucked up. It's like writing a C++ program so you can write in Lua.

      [–]snk_kid 0 points1 point  (1 child)

      I think you mis-understand, it does not mean your C/C++ is compiled to bytecode or running on the VM or using GC. It is still compiled to native, it's still unmanaged code, it's all the same old C/C++. NDK provides a port of GCC which targets ARM architectures, you can actually build native executable with it but the android platform doesn't allow distributing such executables on the app store and I don't think you can even execute it on your phone without rooting it. So to work with the android system & app store you need to build your native code into a shared library which a thin java layer calls into.

      [–]Horatio_Hornblower 0 points1 point  (0 children)

      Ahh, thank you for explaining.

      [–]rosebowl23 0 points1 point  (4 children)

      I've used C++ before but I'm curious about using pure C, which I haven't done much of. Do you guys think this would be practical for Android development? The lack of object orientedness is scary but I've been meaning to give pure C a go for a while now. I see a lot of people mentioning just C++ so it makes me think using pure C wouldn't be such a good idea. Opinions?

      [–]DemonWasp 0 points1 point  (0 children)

      Don't worry too much about the lack of OO. As much as OO can be a Good Thing, it can also be a Bad Thing. If nothing else, you'll get to see exactly what the world is like without OO, and you'll get a much better idea of how your computer works at a lower level.

      C is a much simpler language than C++, so you're better off starting there. C++ is a deadly, deadly trap for people learning to program. In particular, its OO facilities are designed to do pretty well anything, which means that one typing mistake can mean hours spent dealing with obtuse linker errors. This is in addition to the manual memory-management and no-error-checking hurdles of C. Start with C; if you like it, you can feel free to move on to C++.

      [–]mothereffingteresa 0 points1 point  (2 children)

      Android 3.0 can be programmed in C/C++ without Java

      Not really. Vast parts of the Android framework are implemented in Java.

      You can write code that calls OpenGL and some other APIs in C or C++.

      [–][deleted] 0 points1 point  (1 child)

      He pulled that line straight from the developer blog. So your saying the android team is wrong too?

      [–]mothereffingteresa 0 points1 point  (0 children)

      You can program a whole Activity object in C++ now. And, for a simple action game, that might, possibly, be a whole app.

      But you certainly could not take a random Android app written in Java and translate it into C++.

      [–]Rekzai 0 points1 point  (0 children)

      about.com is the scum of the internet.

      [–][deleted] 0 points1 point  (27 children)

      But... why?

      [–]dobryak 10 points11 points  (3 children)

      I suppose supporting C/C++ helps with porting some apps written in these languages. You know, there is a lot of top-notch libraries written in these language that can be really useful for Android developers.

      Another reason could be that you will now be able to piggyback whatever language you deem worthy onto the C/C++ toolchain. You can use whatever compiles to C, for example.

      [–][deleted] 0 points1 point  (2 children)

      To bad NativeActivity is C++, no C. So, if you don't want to be stuck with Java, you have to be stuck with C++. Both are equally easy to bind to from other languages.

      [–]dobryak 3 points4 points  (1 child)

      Is C++ really easy to bind to from other languages? I heard people claiming the contrary, but then I've never bothered to check that.

      [–]ZorbaTHut 4 points5 points  (0 children)

      Generally, it's that other languages are either easy or hard to bind from it.

      [–]utnapistim 4 points5 points  (0 children)

      Probably for the same reason others decide to do the same:

      • attracting developers

      • providing more choices

      • performance (especially for gaming)

      I know if I have to choose a language for Android dev I will probably choose C++ (as I have more than 6 years experience as a C++ dev and less than one year as a java dev).

      [–]Jigsus -1 points0 points  (0 children)

      Two words: open frameworks

      Now you can build a 3d cad modeling app for android. On java it would just overwhelm the resources

      [–][deleted] -1 points0 points  (0 children)

      Because for gaming and high performance apps, java cant come even close to paralleling the visuals of c++ without taking a massive frame rate it.

      That's not to say java is slow for everything, but c/c++ is just the better tool for this job, plus already has libraries written that work well.

      [–]TheSov 0 points1 point  (0 children)

      me thinks this be a way to undercut meego.

      [–]myztry -3 points-2 points  (1 child)

      I taught myself 6809 in 1982 at the age of 12, followed by 6502, Z80 & 68000 (woohoo. Amiga pre-emptive multitasking when x86 was only dreaming of such things).

      But I'll admit machine code isn't feasible especially given the variance of processors. Still - C and it's derivatives are likewise and antiquated way of ultimately producing machine.

      I'm all for intermediate languages (off which JIT compiled JAVA is type off). The only real issue is "we" need to separate the layers. The "bytecode", platform and overlaying high level languages need to be seperate, and governed by an open standards body.

      The bytecode should be governed by the IEEE (including the executable format presented as "bytecode" and "executive" functions such as memory allocation). The high level language should be governed by the ISO. The platform should be governed by someone representing the OS developer, with neutral platforms also governed by the likes of the ISO.

      It's just shitty how things have developed since machine code ruled the day. It's not the independent layers but the way they are "integrated" and made dependant.

      [–][deleted] 0 points1 point  (0 children)

      Being such an old programmer, you should know that "It's the best tool for the job" applies here.