News for hackers. Stuff that matters.
Re:Android is a screwed, hard-coded, non-portable abomination. by ryandvm on Thursday November 05, 2009 @08:43PM (#925254)
What the hell was that? Ah, gnumonks.org, makes sense. I was wondering who in their right mind would be flipping out because a mobile-freaking-phone didn't have 20 years of GNU userspace laying around. What until they find out it's not running X11...
Re:Android is a screwed, hard-coded, non-portable abomination. by jonknee on Thursday November 05, 2009 @07:52PM (#925175)
A mobile phone OS that expects to be running on a mobile phone. Those bastards.
Re:Android is a screwed, hard-coded, non-portable abomination. by thismat on Friday November 06, 2009 @11:37AM (#926299)
That's it, I'm throwing away my G1...this whole time I thought it was a server.
Re:Android is a screwed, hard-coded, non-portable abomination. by eli on Thursday November 05, 2009 @07:25PM (#925147)
Doesn't seem like a big deal to me, but then I'm not a Linux guy.

And J2ME is portable and that's truly an abomination.

Re:Android is a screwed, hard-coded, non-portable abomination. by rbranson on Thursday November 05, 2009 @07:36PM (#925157)
Agreed, I was hoping to read something of substance but what I ended up reading was very hyperbolic.
Re:Android is a screwed, hard-coded, non-portable abomination. by gvb on Thursday November 05, 2009 @08:51PM (#925266)
I disagree, there is a lot of substance to the presentation.

My summary: Google hacked the snot out of linux to produce android.[1] The result is still nominally linux, but much of what a developer expects when you say "linux" is no longer there.

As a result of the hacking (including the lack of X11), it is going to be difficult (possibly to the point of being unrealistic) to port "standard" linux programs to android.

Trivia: Nokia's n770/n800/n810/n900 runs pretty vanilla linux and X11 with Hildon[2] (Maemo) layered on top for the user interface (on-screen keyboard, etc.). It still takes some effort to port a "standard" linux program to Nokia/Maemo, even though it is pretty straightforward. As a result, the number of available packages is nowhere near what you can get via Debian/Ubuntu.

[1] I image they did it to skinny up the memory footprint and speed it up (for some definition of "speed").

[2] It didn't help that Nokia kept the Hildon user interface layer closed source for several years.

Re:Android is a screwed, hard-coded, non-portable abomination. by hvs on Friday November 06, 2009 @06:21AM (#925823)
The guys at Google are not stupid. They are actually some of the smartest guys I've ever met (I haven't met anyone on the Android team, though). Most of them also have fairly extensive experience with Linux. To make the implied assertion that they just threw everything out and hard-coded the system because they are stupid is asinine. I'm guessing that they were aiming for squeezing as much performance out of the system as possible. Considering how abysmally slow many of the smart phones are, I can't blame them. Purity as the highest ideal in software engineering is for academics. In the real world, performance is much more important goal.

And the idea of using X11 on a smart phone is laughable. Please, let's not continue to perpetuate that monstrosity on any more platforms.

Re:Android is a screwed, hard-coded, non-portable abomination. by tptacek on Thursday November 05, 2009 @07:49PM (#925170)

  for (char *p = strchr(tmpfn, ' '); p && *p; p = strchr(tmpfn, ' ')) 
    *p = '_'; 
OW MY BRAIN.
Re:Android is a screwed, hard-coded, non-portable abomination. by rntz on Thursday November 05, 2009 @08:02PM (#925186)
That's fairly redundant.

    char *p;
    while (p = strchr(tmpfn, ' '))
        *p = '_';
Re:Android is a screwed, hard-coded, non-portable abomination. by tptacek on Friday November 06, 2009 @12:34AM (#925506)
I love that the O(n^2 / 2) algorithm for this problem is modded 4x the O(n) one.
Re:Android is a screwed, hard-coded, non-portable abomination. by jongraehl on Friday November 06, 2009 @02:10AM (#925623)
If you meant to be O(n), you should have used p=strchr(p,' ') for the next-iteration part of your for loop.
Re:Android is a screwed, hard-coded, non-portable abomination. by tptacek on Friday November 06, 2009 @02:16AM (#925627)
I didn't write that code, Google did. I wonder if the person who wrote it can figure out how many golf balls fit in a school bus?
Re:Android is a screwed, hard-coded, non-portable abomination. by tptacek on Thursday November 05, 2009 @08:20PM (#925214)
OW MY BRAIN.

  char *cp = NULL;
  for(cp = tmpfn; cp && *cp; cp++)
    if(isspace(*cp))
      *cp = '_';
Re:Android is a screwed, hard-coded, non-portable abomination. by jagjit on Thursday November 05, 2009 @09:57PM (#925339)
char cp = tmpfn; for(; cp; cp++) if(cp == ' ') cp = '_';

my brain too

Re:Android is a screwed, hard-coded, non-portable abomination. by ComputerGuru on Thursday November 05, 2009 @07:53PM (#925177)
You're replacing all spaces in a string with underscores, until you reach the end of a string or there are no spaces left...

Cool. But what does this have to do with the article? (I apologize if I'm missing something, it is 3am afterall)

Re:Android is a screwed, hard-coded, non-portable abomination. by sofal on Thursday November 05, 2009 @08:03PM (#925187)
What's the purpose of the "&& *p"? Would strchr ever return a pointer to a null terminator?
Re:Android is a screwed, hard-coded, non-portable abomination. by oipuyjhg on Thursday November 05, 2009 @08:14PM (#925205)
Yes if you pass it a pointer to a null string
Re:Android is a screwed, hard-coded, non-portable abomination. by tptacek on Thursday November 05, 2009 @08:30PM (#925232)
NULL is how strchr tells you the character you're looking for isn't present. (Yes, the *p check is also superfluous).

Kids these days.

Re:Android is a screwed, hard-coded, non-portable abomination. by jonknee on Thursday November 05, 2009 @07:59PM (#925182)
It was in the presentation.
Re:Android is a screwed, hard-coded, non-portable abomination. by tptacek on Thursday November 05, 2009 @08:21PM (#925215)
What's wrong with that code, Computer Guru? =)
Re:Android is a screwed, hard-coded, non-portable abomination. by apgwoz on Thursday November 05, 2009 @11:49PM (#925447)
Yes. Linux is a kernel, and you don't have to use a traditional GNU userland with it.

Maybe I'm missing something, as I'm not too familiar with android, but I thought that android apps were compiled to Dalvik, which is Java based? I fail to see how any traditional userland software would work anyway...

Re:Android is a screwed, hard-coded, non-portable abomination. by vetinari on Friday November 06, 2009 @07:58AM (#925893)
Not only that, Android applications respond to event like "you are about to be killed, please serialize your state" or "please restore your state", something that "classic" linux applications do not support.

Android is not typical linux - it is not supposed to run on devices with gigabytes of fast memory running off AC outlet. When your memory bandwith is two orders of magnite lower, you have 128MB of it (on G1, 64MB of memory is used by the radio) and you are on battery, putting GNU system there would be not very smart - if you want something usable and with battery life longer than few hours, that is.

Re:Android is a screwed, hard-coded, non-portable abomination. by joezydeco on Friday November 06, 2009 @12:47PM (#926478)
The Android project uses Linux as a hardware abstraction layer, that's all.

It was never meant to be a full Linux distribution. Most of the things that the presenter picks on (lack of SysV IPC, prelinked libraries, hand-optimized custom libc) were meant in the interest of performance, not portability.

Re:Android is a screwed, hard-coded, non-portable abomination. by fhub on Thursday November 05, 2009 @09:35PM (#925317)
For those that are interested in Linux on mobile phones, Nokia's Maemo 5 mobile platform offers a more traditional GNU/Linux environment. It even allows the enduser to gain root access using "sudo gainroot".
Re:Android is a screwed, hard-coded, non-portable abomination. by blasdel on Thursday November 05, 2009 @09:09PM (#925284)
Just because Android has a hacked Linux kernel underneath doesn't make it anything but a quasi-JVM-based Sidekick, written by exactly the same people.