Recent

Author Topic: Android vs Linux  (Read 13194 times)

djdjdjole

  • Full Member
  • ***
  • Posts: 101
Android vs Linux
« on: January 18, 2013, 08:59:59 pm »
I don't know if it is right forum or forum branch to ask such question. My field of
interest is embedded device programming (ARM, GUI), using some operating system.
Many such devices come with both Linux and Android images. This raises a question to me regarding relation between Linux and Android programming.
So what is the comparation between the two (although Android is basically Linux), which will help me outweight to one side or the other?
To make comparition "language independent", let's assume I do Linux programming, using Java (and Android also).

Regards

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android vs Linux
« Reply #1 on: January 18, 2013, 10:51:48 pm »
Linux basically is just a kernel, what sits on top of it that differs common Linux and Android. Common Linux uses native binaries for execution, has the concept of daemons, applications, etc. common to desktop computers. Android uses interpreted binaries (a.k.a. bytecodes) interpreted by its Dalvik virtual machine. It has very simple concept, and everything is regarded as application. Launchers, lock screen, keyboards, etc. are applications you can modify.

djdjdjole

  • Full Member
  • ***
  • Posts: 101
Re: Android vs Linux
« Reply #2 on: January 19, 2013, 09:40:30 am »
Thanks Leledumbo, I'm pretty aware of the facts that you quoted about Android, because I did some Android programming in Java for tablets. What I want to ask is does Linux loose battle against Android, when speaking of EMBEDDED world?
For example Android has it's Eclipse IDE (with designer), seems to me easier for GUI programming and also hardware (of embedded boards) seems to be equally accessible as in bare Linux. 
I really like Linux, however I am now in doubt if I should continue to use it for embedded or turn over to Android.

Regards

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android vs Linux
« Reply #3 on: January 19, 2013, 04:48:23 pm »
Quote
What I want to ask is does Linux loose battle against Android, when speaking of EMBEDDED world?
IMO, no. Embedded Linux is everywhere, long before Android comes. Android mostly wins on phone and tablet, but not on other hardwares. Embedded Linux is less likely to use GUI, mostly just needs to make the hardware 'alive'. And that's the power in itself: small, compact, yet powerful and not bloated. You should narrow down your term of "embedded", whether it's a phone or what. Anyway, I think the battle hasn't started yet. We'll have to wait for Ubuntu phone, and probably after that other distros will follow.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Android vs Linux
« Reply #4 on: January 19, 2013, 04:55:06 pm »
IMO: yes ;)
Disclaimer: this is more of a "devil's advocate" post, an attempt to show a different view, as I haven't even developed for embedded Linux or Android before.

Agreed with Leledumbo that plain Linux may be better for non-GUI embedded devices. However, given the huge success of Android in the market (cell phones, tablets), I think it is very likely that Android will expand to non-GUI embedded devices as well, because a lot of infrastructure, procedures, compilers etc can be standardised.

TBH, I have no idea about the current situation with native (non-Java) executables on Android but assume these will indeed play a larger role on resource-constrained non-GUI Android devices than on traditional, fatter Android devices.

Just my 2 cents - that may be completely wrong.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

djdjdjole

  • Full Member
  • ***
  • Posts: 101
Re: Android vs Linux
« Reply #5 on: January 19, 2013, 08:32:50 pm »
To be honest, I haven't use both Android and Linux on same hardware - so this lack of comparission. My first board (Mini2440), I used only from Linux, although it comes with Android image also. Android, I do only for phones/tablets. Now I have RPi, which announces Android image soon. It means that all the hardware on boards of that kind, could be powered by Android, also, and hence my question.
Agree with Leledumbo's statement of nerrowing term "embedded", but I can reformulate question -which areas in embedded world is better to use Android for (excluding phone and tablets from discussion)  and which bare Linux ?

Regards

PS One interesting matter - I recently acquired tablet that has USB host and Android provides API for it, so I can attach some USB device and communicate it (I tried and it works) without writting driver (user mode programming only). Don't you think this (and who knows what else) extends use of Android ?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android vs Linux
« Reply #6 on: January 20, 2013, 06:05:04 am »
Quote
which areas in embedded world is better to use Android for (excluding phone and tablets from discussion)  and which bare Linux ?
If the device has no UI, has limited memory and storage, I'll use bare Linux. Smart cards, robots, etc. fall into this category. Otherwise, feel free to use Android. Note that pure AOSP image requires more than 100 MB of storage and around 256 MB of RAM, so if the device has less than that, Android is not a feasible target.
Quote
Don't you think this (and who knows what else) extends use of Android ?
Yes, one of the benefits of Android is that its API provides easy hardware access. The burden of connecting the lower level access to higher level is given to the vendor, which builds the driver and customize the Android image for you.

djdjdjole

  • Full Member
  • ***
  • Posts: 101
Re: Android vs Linux
« Reply #7 on: January 20, 2013, 11:43:18 am »
Your arguments sounds quite logical with one little addition from me - memory requirements, I consider would be not so important matter for discussion, shortly (for example RPi board has 512Mb of RAM and it's price is 25E).
For the moment I will certainly follow both Android and bare Linux and see what's happening.
And one more thing - AFAIK, Ubuntu phone, you mentioned, seems to me like  something wihich will live together with Android (sharing the kernel, but when docked - than it is Ubuntu, else Android) and not something that will beat him.

Regards

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android vs Linux
« Reply #8 on: January 20, 2013, 01:17:39 pm »
Quote
And one more thing - AFAIK, Ubuntu phone, you mentioned, seems to me like  something wihich will live together with Android (sharing the kernel, but when docked - than it is Ubuntu, else Android) and not something that will beat him.
Seems so, except that everything is native, not interpreted bytecode.

djdjdjole

  • Full Member
  • ***
  • Posts: 101
Re: Android vs Linux
« Reply #9 on: January 20, 2013, 01:54:11 pm »
Just heard the news that overall sale of tablets overwhelmed those of laptops and netbooks in the world. Probably, the brute force will decide. Meaning - memory chips  and CPU power growth will almost erase the relation between interpreting (Android) and native (Linux) execution. Similiar is regarding OS image and executable size.
I am very, very sad to say how it means to me that future of embedded world  belong to Android, at least (but not necessarily in future) for GUI applications.
Linux (embedded)+ Qt/GTK building process, now seems unnecessary.
And Lazarus, which I mostly use, espetially for embedded GUI Linux, should probably adapt somehow to new winds, else desktops will be it's only field.   

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android vs Linux
« Reply #10 on: January 20, 2013, 03:08:43 pm »
Quote
And Lazarus, which I mostly use, espetially for embedded GUI Linux, should probably adapt somehow to new winds, else desktops will be it's only field.
Lazarus and Free Pascal already supports Android, some applications are already on the market. I already use it myself, both native Android and LCL Custom Drawn way.

djdjdjole

  • Full Member
  • ***
  • Posts: 101
Re: Android vs Linux
« Reply #11 on: January 20, 2013, 04:54:05 pm »
I've tried some Android coding, using Lazarus, few months ago, but many questions left unanswerd to me. For example - can I use ordinary Lazarus classes for TCP (lNet class) or RS232 (5dpo). What, about bluetooth class for Android or using some new classes - like USB Host API or FTDI adapter class. Can I show new form, the way I do in Windows/Linux instead of using Android Intents.... At that moment, it seemed to me that I must often write JNI leyer, myself, which I consider (if I am not mistaken) not to be promissing.
I think, average programmer expect to use Lazarus the way similar to programming Windows or Linux (and their embedded variants), but seems to me it is not the case with Android (although I now that Android is quite different). Of course, something may be changed since my last Lazarus/Android attempt, or it is my missunderstandings.
And please if you can point me at some links, you consider to be much informative.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android vs Linux
« Reply #12 on: January 20, 2013, 06:10:03 pm »
Quote
For example - can I use ordinary Lazarus classes for TCP (lNet class) or RS232 (5dpo). What, about bluetooth class for Android or using some new classes - like USB Host API or FTDI adapter class
I can't answer this as I haven't used them.
Quote
Can I show new form, the way I do in Windows/Linux instead of using Android Intents.... At that moment, it seemed to me that I must often write JNI leyer, myself, which I consider (if I am not mistaken) not to be promissing.
I think, average programmer expect to use Lazarus the way similar to programming Windows or Linux (and their embedded variants), but seems to me it is not the case with Android (although I now that Android is quite different). Of course, something may be changed since my last Lazarus/Android attempt, or it is my missunderstandings.
Using LCL Custom Drawn, it's no different from desktop programming with Lazarus:
http://wiki.freepascal.org/Custom_Drawn_Interface/Android

You can check $(LazarusDir)/examples/androidlcl as it shows the power of custom drawn interface, single source for both Android and desktop, except for the lpr. In my project, however, I decided to combine the lpr with ifdef, as the difference is so minimal.

djdjdjole

  • Full Member
  • ***
  • Posts: 101
Re: Android vs Linux
« Reply #13 on: January 20, 2013, 06:21:46 pm »
Thank you, I will investigate the matter, although communications are of primary interest to me. I did some in Java (WiFi and USB host), but it would be interesting of doing it in Lazarus.

Regards

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android vs Linux
« Reply #14 on: January 20, 2013, 06:44:02 pm »
By the way, there's LazDeviceAPIs for some hardware access.

 

TinyPortal © 2005-2018