Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have 2 questions:
Why did the Android founders choose Linux?
Is Linux the so called middleware in Android?
This seems to hold the answer:
http://android-dls.com/wiki/index.php?title=Android_FAQ#Q:_Why_does_Android_use_the_a_GPL_Linux_kernel.2C_but_libraries_and_user_space_apps_that_are_licensed_more_liberal_open_source.2Ffree_software_licenses.3F
Q: Why does Android use the a GPL Linux kernel, but libraries and user space apps that are licensed more liberal open source/free software licenses?
A: To put it simply - the Linux kernel has wide hardware and industry support, and keeping GPL code in the kernel as much as possible makes a pretty clear line between GPLed stuff and unencumbered stuff, but vendors are somewhat scared of the GPL, so it is avoided as much as possible outside the kernel. It seems that currently bluez is about the only userspace code in android which is GPLed. Official reasons for why to use a Linux kernel from a Google IO preso:
Great memory and process management
Permissions-based security model
Proven driver model
Support for shared libraries
Itʼs already open source!
For an unofficial explanation of why Google prefers the Apache2 license over the GPL license, please see this ArsTechnica article: http://arstechnica.com/news.ars/post/20071106-why-google-chose-the-apache-software-license-over-gplv2.html
I'm not sure it's possible to give an absolute answer, but the main reason for choosing Linux is probably that it's free and widely supported. Also, there's a very strong Linux community (thus a lot of know-how).
Linux is an operating system kernel, not middleware.
Linux is open source. Android needed to be.
Android uses a Linux kernel. Check out this video and the two others in the series describing Android in more detail: http://developer.android.com/videos/index.html#v=QBGfUs9mQYY
Linux was chosen because it's open and customizable enough to suit Android's needs.
Writing an entire OS is time-intensive and expensive.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am interested in developing kernel for android phones. I searched on internet about android kernel development and i got how to build kernel on linux machine means only how to use tools for create a custom kernel but i want to know how to write code to make android kernel. How to start with c programming and ALP. Please guide me.
Android uses Linux kernel and that is why you should get familiar with Linux first.
From you post I am guessing that you don't know much of C programming language. Before you start doing any kernel work you should be able to write an application in C because if you cannot write an application you probably will not understand a kernel.
To start leaning C there are dozens of resources everywhere, I would recommend the book "C programming language" by Brian W. Kernighan. and Denis M. Ritchie (inventor of C).
Application runs in so called "User mode" and have only access to Virtual Memory that is given to them by the kernel. If the application tries to access memory that is not in its Virtual Space the kernel sends an abort signal. This prevents the system from crashing. In kernel the is not the case because the kernel runs in "Kernel mode" and thus has access to the whole address space when you do something wrong the consequences can range from halting the system to wiping permanent storage and more.
So first learn how to write applications, maybe a native applications, try to use the functionality that is provided by the kernel by learning about "System calls". For this purpose I would recommend the books "Advanced Linux Programming" by Mark Mitchel, it is freely hosted on its website http://advancedlinuxprogramming.com/. You can find some reference here https://en.wikibooks.org/wiki/The_Linux_Kernel.
If you are comfortable with both C and the Services the Linux kernel provides. Than you can start thinking about diving into the kernel. Very popular book is "Linux kernel development" by Robert Love. Although I don't think it is very up to date It should cover the major topics related to that subject,there are probably resources out there that are more up to date.
This is a long journey and you should really think about it first, depending on what you want to do you may actually be able to do it in "User Space".
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have background about android application development and now I want to explore deeper side of the Android.
Because of Android is open source, I want to find my phone's source code, then change some values in code, and after all I can compile and flash the code into the phone and see the changes.
I know there is an android documentation here but it is not clear for me.
So, my question is how can I download the source code of my phone?
You haven't specified your device type so here are some more general ideas:
Basically it is not that simple and depends on your device. Parts of Android are open source, other parts are not. Furthermore, your Android device can have a locked bootloader which won't allow you to install your custom build firmware.
Your link shows you how to download the current Android source code using the repo tool. Usually, Android is not in a single git repo. The repo tool reads from a configuration file the different git repositories, current branches, etc. and clones them for you.
I did Android development for OMAP devices (in the past). OMAP itself is outdated but you can learn alot from the documentation: http://omapedia.org/wiki/Main_Page Furthermore, you can still buy OMAP dev boards and play around with them, build a custom image, patch things, etc.
Building a custom Android for OMAP devices works like this:
Clone Android source code
Clone Linux Kernel
Clone U-Boot bootloader
Build all three and create image files
Flash them on the device
A few words about open source: Many things ar eopen source, but not everything. E.g. GPU driver are closed source. In case of OMAP devices, you can get them precompiled. So if you want to touch something which is not open source, you run into problems.
I hope that helps you and points you a little bit into the right direction.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm planning the development of a mobile SDK in the gaming field, that should be cross platform (iOS and Android to begin with)
I know that many game engines embed lua as a scripting language, to expose certain functionality easily to the developer, however i've never since it being used as the core language that SDKs are written in.
What are the pros/cons for using lua specifically for achieving a cross-platform mobile SDK?
Pros:
Portable: builds on any platform with an ANSI C compiler.
Lua is comparably as easy as Python in terms of learning how to write code.
Embedded and extensible language that provides a straightforward interface to/from C/C++/Objective-C. It has a very clean C API.
Sufficiently fast: performs well comparing to other languages and has a JIT compiler that noticeably improves performance on many tasks.
Well documented: reference manual, book, wiki, 6-page short reference and more.
Friendly and enthusiastic community.
Clean and simple syntax suitable for beginners and accessible to non-programmers.
Integrated interpreter: just run lua from the command line.
Native support for coroutines to implement iterators and non-preemptive multi-threading.
Incremental garbage collector that has low latency, no additional memory cost, little - implementation complexity, and support for weak tables.
Simple yet powerful debug library.
Free
Cons:
Lua does not focus on 100% backward compatibility. Many newer releases of Lua break programs written in previous versions.
Limited error handling support.
Global scoping by default.
No Unicode support.
Lua supports only a few data structures, including arrays, lists and hash tables.
Limited pattern-matching support.
No POSIX functions built-in..
No class/object finalizers.
Packaging on Windows. It requires a fair amount of experience with Windows application packaging to produce an installer that provides everything your end user needs in a way that makes your use of Lua as the core language irrelevant to them.
Based on:
Lua - Good, Different, Bad and Ugly parts.
Look at Lua
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have integrated zbar code scanner in my Android-app in minutes (great library!),
nevertheless I am thinking of replacing it with another QR code reader now.
The reason is, that there is much scepticism[1][2] on the web whether
LGPL is compatible with commercial Android projects.
Can someone tell me why zbar uses LGPL but nevertheless are supporting android? (the even have a android section in their support forum...)
Is there a way to make sure my app meets the license requirements?
[1] http://source.android.com/source/licenses.html
[2] http://www.gnu.org/licenses/lgpl-java.html
Android platform project has different licensing requirements from 3rd party app developers. While it is possible to replace and reverse engineer LGPL libraries in 3rd party apps, it is not so for LGPL libraries in read-only firmware.
Key parts of Android zbar are distributed in binary .so files. As such, they are replaceable in your distributed app in terms compliant with LGPL.
For the Java adapter code (zbar.jar), make sure you're not using ProGuard or other obfuscation on it.
For reference, here's how the droidText project addresses LGPL compliance: https://code.google.com/p/droidtext/wiki/LGPLCompliance
(Standard I-am-not-a-lawyer disclaimer applies.)
TL/DR: always distribute zbar source together with the app and you are clear.
I'd say that it's not simple for a user to upgrade the library should they want to. Instead, to be safe, you should treat your program as statically linked with the library. (From a practical point of view, your program is sort of statically linked, anyway.)
If you do that, you have to distribute the source (or linkable object files) of the library. It must be the potentially tweaked source you used, not some generic download-link or so.
By the way I upvoted llato's answer too, because it got some merit, but I would not be keen on arguing that line of reasoning in front of a judge. (Not that I think zbar authors in particular would drag me there but you get the point.)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Is there a Haskell interpreter (with standard libraries) that can be installed on Android?
So that someone with an Android device can do some Haskell exercises on an Android device: write and run some example code in Haskell.
Hugs is written in C and quite portable. It should be possible to port it to Android.
Taking a note from imz, all you need is
ConnectBot or similar
A remote machine with
Vim, Emacs, or similar
runghc / ghci / hugs / yourfavoritehaskellinterpreterorcompiler
It's not as solid as a dedicated app or scripting layer would be, but honestly, for your use cases, it would provide almost exactly the same functionality as those options (if not more). And it would be just as "mobile" as a website (depends only on the uptime of the host and the connectivity of the client).
You can use tryhaskell.org from your mobile browser. It will accept any valid expression, but keep in mind that defining your own data types won't be possible.
For some negative information, all the work I've seen for GHC on Android (such as http://ipwnstudios.com/) is based on cross-compilation, rather than building GHC for android or ARM.
I just found IDEone in the Android Market, which sends your code to an online service. It works, but programming on Android isn't much fun. Btw: In case you don't want to register see BugMeNot
Surprisingly, I couldn't uncover any existing Haskell interpreter for Android.
But here are some instructions for writing your own interpreter for the Scripting Layer on Android. That's assuming you're willing to try mapping the haskell functions on top of the Java android ones (which is not a perfect solution, I know). You'll also want to refer to their scripting layer written for Scala, because that's the one that comes closest to Haskell (which is not very close I admit).
Otherwise, there shouldn't be any reason why any of those Haskell implementations couldn't be directly compiled for Android using the NDK. As long as they're written in C, they should work on Android. For C++, that's a little bit more tricky since Android doesn't have all the C++ headers.