[Q] How Does the Android OS Work? - Droid Incredible Q&A, Help & Troubleshooting

Disclaimer: I am only a flasher. I do, however, contribute to the forums, donate to devs and also use the paid version of good apps.
My question is: How does Android work on our phones?
You have hardware (HTC Incredible); you have a carrier (Verizon, in my case); you have an OS (Android, obviously); you have a radio; you have a ROM; you have a kernel; you have themes, you have skins and you have apps. How do all these pieces interact? Just curious.

This is a really good question that should be answered in laymen's terms. I'm surprised it hasn't been answered yet.

I also thought it would have been answered by now. However, I think the developers (who would be the best folks to answer this question) are busy working with the Gingerbread source code to build new ROMs for us.
This is what I have figured out so far but I'm not sure if my analysis is correct:
After selecting your hardware and carrier, the OS is the most important element. Most of us are currently on Froyo (2.2). I have seen some screen shots showing the OS version to be "2.2.1" but I am not sure why. Google (I think) has released the source code for Gingerbread (2.3) and the developers ("devs") are hard at work producing new ROMs as I post this.
I gather that it is best to stay away from trying out different radios ("basebands"). Most of us are using 2.15.00.07.28.
I think the ROM takes the OS and re-works the user interface by adding, removing and changing the various screens and "features" of the OS. For example: the ROM can be written to take out the stock music player and substitute a music player that the ROM developer prefers. I think this is called "baking in an app". I believe the ROM developer can also create an overall "look and feel" that can be quite different from the stock OS. For instance, the ROM can be "colored" in black and red (rather than the stock green) and the stock font can be changed to something the developer prefers. In other words, the ROM is what you see and use on a daily basis.
Now this is where things get a little fuzzy: the kernel. I think this is kind of a behind the scenes element that governs the performance of a ROM. It greatly affects things like battery life, time to charge the battery and the "speed" of the phone. The kernel is where the phone can be "over-clocked" and "under-volted" should you want to do those things. I gather that once you select a ROM, you can try different kernels without changing what the various screens look like on the phone. I believe this is the way most people do it (pick a ROM and try different kernels with it). I don't think the other way really works (pick a kernel and try different ROMs with the kernel).
Next comes themes and skins which really only affect what you see on the various screens without do anything about battery life or the speed of the phone. I haven't played with these much.
Finally, I forgot to put WALLPAPER on the list in the original post. I believe this only appears as a background image on the home screens.
If any reader sees errors in my layman's analysis, please, by all means jump in and correct me. Per my disclaimer in Post #1, I am just an ordinary user and this analysis could be flawed or incorrect in whole or in part.

Everytime I try to answer a question like this, I get too complex about it and leave more questions than answers. Then someone comes along and says "It's like Windows or Linux or MacOS on a PC", and that's that. Well they're right. Those OS's tell the PC's that they are PC's and essentially all OS's do the same things.
Here's my simplified new list:
1) Hardware on phone :: meaningless without OS
-- (android OS - or any other OS)
2) Linux kernel understands hardware like touchscreen, radios, I/O (drivers/modules). Of course it also understands how to schedule processes and all those "kernel tasks".
3) Libraries provide APIs (Application programming interface) to userspace code (like APPS).
4) Userspace (apps, scripts, libraries) provide user control over the phone.
--
Together they work in harmony (we hope) to make the phone realize it is a phone and allow us to use it as such. (well, a smartphone, so many things other than a phone).
Here's a simple example: You touch the phone icon which is in userspace, and it brings up the userspace phone app. As soon (or before) as you touch some buttons, dial a number, it is using the API to the driver in the kernel that actually understands the phone hardware/radio. Also userspace controls GUI which is also requiring API to some form of OPENGL API that is requiring device drivers that get the touchscreen/LCD display. and so on.
--- Hashi
PS: I realize there are a thousand things wrong with this representation, but hey, it's a start. Feel free to fix it up if you're inclined.

Related

[REQ] Calling for support for Dedicated iTouch-like Android build for HD2

Just telling you guys the story first.
I have this spare HD2 lying around after getting the Sensation which also has a severely cracked screen (LCD working, and screen protector on top to prevent injured fingers when using ). A thought occurred to me: Why not build Android to function like an iTouch? I.e: Remove anything related to the SIM card/ remove everything that involves making calls, SMS, etc but retain the functionality of Android apps etc(As I will be using DATA SIM). Most importantly, I want it to be fully optimised for those (I believe that the phone/sms functions running in the background would affect the full potential for the HD2 running music, video, and other apps). I do know how to flash ROMS, and customise downloaded ROMS (e.g: Slipstreaming apps I want, remove some apps I don't want, customise build.prop, etc) and also some programming (a bit of obj-C, a bit of C#, and lots of VB.NET). However, I do not know how to build Android from scratch. Hence I would appreciate if:
-I can get devs to assist me in building Android from source code and customise it so it fits my expectations
-I can get support for this project as I plan to release my work to the public when its done
I will give credit to those who helped. Thanks.
Reserved for future use.
Reserved again.
arikyeo said:
Just telling you guys the story first.
I have this spare HD2 lying around after getting the Sensation which also has a severely cracked screen (LCD working, and screen protector on top to prevent injured fingers when using ). A thought occurred to me: Why not build Android to function like an iTouch? I.e: Remove anything related to the SIM card/ remove everything that involves making calls, SMS, etc but retain the functionality of Android apps etc(As I will be using DATA SIM). Most importantly, I want it to be fully optimised for those (I believe that the phone/sms functions running in the background would affect the full potential for the HD2 running music, video, and other apps). I do know how to flash ROMS, and customise downloaded ROMS (e.g: Slipstreaming apps I want, remove some apps I don't want, customise build.prop, etc) and also some programming (a bit of obj-C, a bit of C#, and lots of VB.NET). However, I do not know how to build Android from scratch. Hence I would appreciate if:
-I can get devs to assist me in building Android from source code and customise it so it fits my expectations
-I can get support for this project as I plan to release my work to the public when its done
I will give credit to those who helped. Thanks.
Click to expand...
Click to collapse
arikyeo said:
Reserved again.
Click to expand...
Click to collapse
arikyeo said:
Reserved for future use.
Click to expand...
Click to collapse
Sir, i seriously doubt your state of mental stability.
And as for your request, the best you can do is use in Airplane mode and switch on wireless. Works for me when i don't want to waste my battery.
Just so that you know, the Qualcomm processors have 2 ARM CPUs on the die, 1 for Radio(Wireless/bluetooth/GSM etc) and 1 for the General purpose/Logic etc... I don't think GSM functions and the phone app running in the background would even mean or translate into anything near a burden or even something which would affect the performace for the CPU in your HD2.
you're pretty much dead-end on this one mate.
android is built ground-up for use in mobile phones. look at those cheap shenzen tablets..they all have no network icon in top bar, and com.android.phone must be running. removing this will only result not working phone as these also include core services-market access etc
only hope you have for doing what you want is to somehow get honeycomb workin' on qsd8250 and tiny fingers to interact with it.
imho best bet would be to just install CM or MIUI, and hide phone etc from launcher.
refer to post above for "very exact explanation" of everything you are trying to do

New to the Android World!!

Hi All,
I am relatively new to the whole Android world and love my phone. There are a few complaints that I do have about the phone, but I'm sure that's just being nit picky.
I am currently running LiquidSmooth 1.3 (I believe 1.35 is only available for LTE and not GSM? Someone please feel free to correct me if I'm wrong.) I recently flashed the Trinity Kernel to see if I could get battery life on my phone.
Love the calibration that has been done to it! Here are a few things that I was hoping you could help me out with.
1.)Sometimes when I hop off of WiFi and go back to my mobile carrier, my reception bars grey out, but I can still text message and make calls. However, I cannot access the internet unless I restart / reboot the phone.
2.) What is the difference between a restart and a reboot?
3.) What is the difference between AOSP and AOKP? I read that one is more Google related, while one is a 'Kang Project'.
and finally,
3.) What is the difference in Governors??? Yes obviously experimentation is key, but I would like some advice to know all these terms to help me understand what some of you pros are posting.
Yes I feel foolish for asking these questions, but then I feel like it's essential to understand some of these terms more clearly. I'm making the transition between BB, iPhone. Any help is greatly appreciated!
liquidsmooth has cdma and gsm versions.
1. that may be ROM or kernel related problem. wifi is controlled by the kernel.
2. restart and reboot are same thing.
3. aokp is a rom name compiled off AOSP source.
3. search goes a long way, http://forum.xda-developers.com/showthread.php?t=843406
AOSP (Andriod Open Source Project) is the build of android maintained by google and that all andriod OS phones are based off of. Phone manufactures will use AOSP source code to build their particular rom for their particular phone.
AOKP (Andriod Open Kang Project) is the title of a rom for ICS compatible phones that is a play on words referencing AOSP. 'Kang' is slang for stolen software or source code. In the case of free software, it often means using software from others without giving the creator credit. However, despite the name, Team Kang often does give credit to other developers.
There is no difference between a restart in a reboot. reboot is the more specific term meaning the restart of an operating system. Restart is a general term for doing something over (dictionary definition).
Govenors manage the way the cpu switches between min and max frequency. Often under load, a govenor will scale up cpu cycles to get the task done quickly.

[ANSWER] -_/*~Kernel~*\_-

There are many explanations that people will tell you to the answer to the "what is a kernel?" Like this great one from Omnicide
Spoiler
Omnicide said:
The best way i seen it put was, think of the kernel as the engine and the rom as the body of the car. The body of the car (rom) just makes the car look nice and user friendly. Now when we talk about the engine (kernel) simply put red lining the engine will get you to go fast but burn gas. Keeping the rev down low will make you run slower but saving lots of gas. Thats just one way to look at it, rpms being the cpu.
Click to expand...
Click to collapse
or this great one from androidcentral.com
Spoiler
What is a kernel? If you spend any time reading Android forums, blogs, how-to posts or online discussion you'll soon hear people talking about the kernel. A kernel isn't something unique to Android -- iOS and MacOS have one, Windows has one, BlackBerry's QNX has one, in fact all high level operating systems have one. The one we're interested in is Linux, as it's the one Android uses. Let's try to break down what it is and what it does.
Android devices use the Linux kernel, but it's not the exact same kernel other Linux-based operating systems use. There's a lot of Android specific code built in, and Google's Android kernel maintainers have their work cut out for them. OEMs have to contribute as well, because they need to develop hardware drivers for the parts they're using for the kernel version they're using. This is why it takes a while for independent Android developers and hackers to port new versions to older devices and get everything working. Drivers written to work with the Gingerbread kernel on a phone won't necessarily work with the Ice Cream Sandwich kernel. And that's important, because one of the kernel's main functions is to control the hardware. It's a whole lot of source code, with more options while building it than you can imagine, but in the end it's just the intermediary between the hardware and the software.
When software needs the hardware to do anything, it sends a request to the kernel. And when we say anything, we mean anything. From the brightness of the screen, to the volume level, to initiating a call through the radio, even what's drawn on the display is ultimately controlled by the kernel. For example --when you tap the search button on your phone, you tell the software to open the search application. What happens is that you touched a certain point on the digitizer, which tells the software that you've touched the screen at those coordinates. The software knows that when that particular spot is touched, the search dialog is supposed to open. The kernel is what tells the digitizer to look (or listen, events are "listened" for) for touches, helps figure out where you touched, and tells the system you touched it. In turn, when the system receives a touch event at a specific point from the kernel (through the driver) it knows what to draw on your screen. Both the hardware and the software communicate both ways with the kernel, and that's how your phone knows when to do something. Input from one side is sent as output to the other, whether it's you playing Angry Birds, or connecting to your car's Bluetooth.
It sounds complicated, and it is. But it's also pretty standard computer logic -- there's an action of some sort generated for every event. Without the kernel to accept and send information, developers would have to write code for every single event for every single piece of hardware in your device. With the kernel, all they have to do is communicate with it through the Android system API's, and hardware developers only have to make the device hardware communicate with the kernel. The good thing is that you don't need to know exactly how or why the kernel does what it does, just understanding that it's the go-between from software to hardware gives you a pretty good grasp of what's happening under the glass. Sort of gives a whole new outlook towards those fellows who stay up all night to work on kernels for your phone, doesn't it?
. You probably didn't get it at all, so let me tell you what a kernel is in about 17 words. A kernel is "what makes the phone work, and connects the hardware (camera, storage, etc.) And the software (the Rom)."
I don't want to be thanked for this, thank omnicide, and androidcentral.com for the great explanations.
~~~~~~~~~~~~~~~~~~~~~
Samsung galaxy s2
Rom: Jedi knight 6
kernel: Jedi kernel 2
~~~~~~~~~~~~~~~~~~~~~
And you thought celebrities weren't smart! =P
Kernel can correlate to brains function in the human body meaning the manager of the perishing body.
Or the manager of the resources available.
Or the manager of the body.
Sent from my SAMSUNG-SGH-T989 using xda premium
I flashed JB Jedi 2 which came packed with a rom while it works great I wonder what will happen if I want to switch back to a different Rom will it be compatible with the kernel it installed?
All roms install their own default kernel each time you flash them.
They are usually chosen by the rom's Dev for good reasons (usually stability) .
It's up to you if you then choose to replace the included kernel with one of your own choosing.
At that point you should think twice about posting glitches you encounter on the ROM developer's forum because you have now changed a fundamental component of his work which is not of his choosing. It would be kind of rude to clutter his thread with problems that may be caused by the replacement kernel.
Feel free to push the envelope, just make a backup first then post problems to the kernel's thread.
Ohh ok I really didnt know that as some roms I have downloaded are 90mb some are like 330mb does that mean they are all compressed in different ways?
davcohen said:
Ohh ok I really didnt know that as some roms I have downloaded are 90mb some are like 330mb does that mean they are all compressed in different ways?
Click to expand...
Click to collapse
No. Some ROMSs gave more data or bloat. Slim ROMs, are well, slim. Leaks, like, Jedi jelly, tend to be pretty big, due to all the bloat they have.
LoopDoGG79 said:
No. Some ROMSs gave more data or bloat. Slim ROMs, are well, slim. Leaks, like, Jedi jelly, tend to be pretty big, due to all the bloat they have.
Click to expand...
Click to collapse
Bloat = the stuff, APKs in this case, someone decided are not necessary.

[Q] Why is ROM-cooking so hard?

Hi!
I have great respect for the people that give us our great ROMs, and i KNOW that that is hard - but my question is: why exactly is it that hard?
This is just a question out of curiosity, because I would really like to understand the unerlying problems that cause all the other issues.
I was under the impression that the Android stack runs on top of the Linux kernel.
Usually, the Linux kernel is the Hardware Abstraction Layer, and apps and ROM, in theory, should be kind of hardware agnostic?
e.g. the Bluetooth Issue on our Captivate Glides: I would guess that Android communicates, through some API, with the kernel's BT stack/driver. There must be some (open or closed source) driver available (worst case: some .so module ripped out of an official ROM, maybe?). So why does the headset profile not work? Did the APIs change? Are custom ROMs forced to use another version of the driver?
It also happens to this 50$ chinese tablet i have here: some ROM screw up the touchscreen, some break audio, and so forth. Why can't there be some way of installing a generic ROM, and then side-loading the OEM's drivers?
Thank you again to all ROM developers! This is NO WAY a complaint. Just pure curiosity!
I may be out of my league when trying to describe this, but the processor in our phones is somewhat different to the processor in the bulk of other phones. This is where majority of the issues came from in porting ICS to the glide before ATT released it. Even after the first official ICS update, the modders here were the ones who fixed the keyboard lights... I changed up to JB because the GPS wasn't locking quick enough and PACROM had all the quick toggles and the speed/gps lock I needed.
Sure the kernel is the underlying part that pulls it all together, even still there is all the drivers that need to work with it. If there isn't a bluetooth/wifi/HW Video driver for the version of the kernel, then it gets really tricky and now its coding for a piece of software to speak with the hardware ..... We have things that partially work, but not fully ...as with everything computers, in theory things that "should" work, don't always... I'm an IT tech.. I run into weird **** all the time that "should" work ... takes time, but with persistence and the right skillset, majority of the time a resolution can always be found.

Note II AT&T Rom choice - Advice

Hello all,
I may get teased a little bit for this one - but I am a bit of a traditionalist. Even as an IT guy, I tend to shy away from custom, enhanced or otherwise modified ISOs of windows. Not because I am afraid of them... I just like the "stock" look. I would like to stick to the same thing on my phone.
I am still running the stock version of my ATT firmware, 4.x.x. I like it just fine, and it suits my needs for the most part - (Other than the ATT bloatware that crashes constantly for several minutes upon reboot)
However, my device is beginning to slow down and I find myself using Chrome more and more because the older stock browser does not seem to want to render some sites very well. I expect it is only a matter of time before I start running into "sorry, you cannot run this app" type of issues.
So on to my questions....
1. Will upgrading to 6.x or 7.x improve the performance on my device?
2. If so, I see there are a ton of apps to choose from. Is there one specifically that is "less modified" or at least enables some sort of "gotta-have-it" functionality?
3. Can you elaborate on why you chose to move from the stock rom? I understand there are alot of "testers" on this forum who like to play with things. However, my phone is used heavily for work purposes. Simplicity and Stability remain key drivers for me.
Changing to a custom ROM may improve some areas of performance while decreasing in others such as battery life, camera, and stability.
By apps, I assume you mean roms. I can't make any recommendations as I have not had a note 2 for a few years but I have found that custom ROMs based off a stock rom are pretty stable. I always like to start with a very bare-bones ROM and add functionality via apps as needed.
I have moved to custom ROMs in the past when apps won't run on the phone's stock rom.
I've run my note 2 on DN3 for a number of years. You can still find a link to the thread in this forum and you will need to root your n2.
Not hard. 1 advantage is you can remove the bloat and it's still a rom that runs well on our device since it was built for our device in it's prime.
If you have any questions send a PM. Happy to help.
wisem2540 said:
Hello all,
I may get teased a little bit for this one - but I am a bit of a traditionalist. Even as an IT guy, I tend to shy away from custom, enhanced or otherwise modified ISOs of windows. Not because I am afraid of them... I just like the "stock" look. I would like to stick to the same thing on my phone.
I am still running the stock version of my ATT firmware, 4.x.x. I like it just fine, and it suits my needs for the most part - (Other than the ATT bloatware that crashes constantly for several minutes upon reboot)
However, my device is beginning to slow down and I find myself using Chrome more and more because the older stock browser does not seem to want to render some sites very well. I expect it is only a matter of time before I start running into "sorry, you cannot run this app" type of issues.
So on to my questions....
1. Will upgrading to 6.x or 7.x improve the performance on my device?
2. If so, I see there are a ton of apps to choose from. Is there one specifically that is "less modified" or at least enables some sort of "gotta-have-it" functionality?
3. Can you elaborate on why you chose to move from the stock rom? I understand there are alot of "testers" on this forum who like to play with things. However, my phone is used heavily for work purposes. Simplicity and Stability remain key drivers for me.
Click to expand...
Click to collapse

Categories

Resources