Deep Android System Programming/Unterstanding - How start? - Android Software Development

Hi,
firstly, i have to say, i didn't found a correct section, but this seems to be the most properly, although i could be a noob. If my posting wasn't correct, i hope you will forgive me & move my post in the right section.
In the next months I'd like to start porting CM11 or/and Android 4.4 to my Xperia J, respectively learn how android system works. In this case i thought it would be helpful, if i learn more about Java, especially because i'm learning C# since one year in school.
Really, I'm not interested in "trivial" things things like how to program a own launcher.
(I'd never done something like that, i'm just not interested in.)
My interestings are deeper, e.g. about the implemention of GPRS (want to remove that without damaging the system), the general system settings(want also to modify something in there), the new permission manager in android 4.4, the interaction with the sim card in CM & the original android & their differences(e.g. my Sim only works in android, not in CM), their code & their connection to each other.
Which parts of Android are written in Java, C & C++? (I know the Kernel is wirtten in C, but thats all)
Can you give me some sources about this?
Have you some suggestions what i could do?
Would something like that here:
http://www.amazon.com/Embedded-Android-Porting-Extending-Customizing/dp/1449308295
be helpful?
Or would be something like that better for my project:
http://www.amazon.com/The-Linux-Programming-Interface-Handbook/dp/1593272200/
http://www.amazon.com/Building-Embedded-Linux-Systems-Yaghmour/dp/0596529686/
?
Thanks in advance.
Edit: This Guide: http://forum.xda-developers.com/showthread.php?t=2620389 is a good source, but im still wondering.

Related

where do you learn how to build custom roms?

Hi I'm just wondering where to learn how to make custom roms?
I find it very interesting but guess I don't quite understand it just yet.
I have built cupcake and tried to run it in the emulator following the steps google gives on the source code page, but it never gets past "Android" with a flashing cursor and a black background on the emulator and i've never tried to flash it to the phone as im not brave enough being i really dont know what i'm doing. I would like to use the files in JF's build so i have root and what not, maybe poke around the code a little, see how things work. I wish someone would make a beginers tutorial for for this. I know its not easy and you need to know how to program. and programing shouldn't be part of the tutorial, but just how to get all the files maybe make a small change to one or two of them and then build it and see those changes at work would be nice.
Thanx for any help!
there is no beginners guide to programming the android OS, either you can look at the source and edit to your liking or you can't. for the most part the guys that have been building the ROMs have been working with programming for a long time and know what they are doing. i am working on it, but my java is old knowlege and i don't remember much. you will need to learn java in order to play with building your own ROM
I'm not so much talking about editing the source as just take the source and build it so i can run it in the emulator. I'm not that great with linux, and i did build it, but i think i did somthing wrong because it freezes at the android screen. I know im not going to just grab the code and start changing it with no experiance. I just want to mess around and see what i can learn.

Making ROMs

So this is combination question/idea.
I have been reading around and it seems to me that most ROMs are made mostly just by taking existing ROMs (often taking the stock one) and editing the installed applications. This is what Kitchens do - right?
When we want to theme things we have to go through and manually edit all sorts of images, resources, compiled xml files, etc.
That all being said why don't people ever just take the source from google (android is open source) and just modify the source to their liking and compile their own ROM? Do people already do this? Wouldn't this making theming a lot easier by just replacing the files before it is all compiled together?
Why don't we just compile a version that lets you theme most things pretty easily - make large parts of the UI skinnable and then people don't have to spend so much time hacking xml files?
Again, this all may be completely wrong and I apologize for wasting your time for reading this if it is...
Just wondering if there is an easier way to do what we are doing
you should do some research on the Cyanogen mod and Android open source project (AOSP)
you're on the right track with where you're going with this, but it's already been done. most ROMs ARE in fact modified versions of 2.1 with edited image files, added applications and such and that's really all we can do, until now at least. some of our devs are working on porting ROMs based off of the Cyanogen mod, which is based off of AOSP.
someone please correct me if I'M wrong =)
I've found the following links to be really helpful:
1) http://forum.xda-developers.com/showthread.php?t=622916 - compiling Hero kernel & AOSP from source
2) http://blog.coralic.nl/2010/01/28/build-eclair-aka-android-2-1-for-hero-from-source/ - blog entry that #1 was based off of
3) http://forum.androidcentral.com/htc...how-build-your-own-kernel-package-source.html - sort of the same thing again, but it's good to read different takes on things like this
4) http://forum.xda-developers.com/showthread.php?t=633246 - very good kitchen
gnarlyc
I could be wrong, but the Google source code will be rather "generic" or all-encompassing. It will (or should) work for ALL Android hardware devices. Problem with that is that it's not optimized for a specific piece of hardware. Same logic applies with compiling your own kernel in Linux. Linux includes hardware support for thousands and thousands of pieces of hardware (and some obscure sh*t at that). Granted, it's not loaded into memory but the code is still in there. When people compile there own kernel, they only include drivers for their video card, their IDE/SATA controllers, their CPU, and so on.
When people start with an ERIS ROM or HERO ROM from HTC, I have to presume that HTC has already stripped out the non-applicable stuff. It's a much cleaner slate to start from.
gnarlyc said:
I've found the following links to be really helpful:
1) http://forum.xda-developers.com/showthread.php?t=622916 - compiling Hero kernel & AOSP from source
2) http://blog.coralic.nl/2010/01/28/build-eclair-aka-android-2-1-for-hero-from-source/ - blog entry that #1 was based off of
3) http://forum.androidcentral.com/htc...how-build-your-own-kernel-package-source.html - sort of the same thing again, but it's good to read different takes on things like this
4) http://forum.xda-developers.com/showthread.php?t=633246 - very good kitchen
gnarlyc
Click to expand...
Click to collapse
Funny you mention that, I just installed an Ubuntu VM so that I could check out the source and start playing around... see what there is to see

Beginners help with cooking please

Hi all,
so I am new to the world of Windows Mobile - use to be a Symbian fan and then got the HTC Touch Diamond recently due to my Nokia dieing of old age.
I want to learn how to cook ROMs so I can customize what I want as I want. I tried sending Da_G a PM as he seems to be quite knowledable about cooking - although he seems to be MIA (his last post was a long time ago) and I have not gotten a reply yet.
So now onto some questions which are probably stupid, but I do not know the answers to.
So I have an HTC Touch Diamond which originally comes with Windows Mobile 6.1, I am using osKitchen as it seems really popular and it looks easy enough to use. I followed the guide which is here but it does not give me the complete info I want.
So in order to cook a ROM you first need to have an original ROM (so in my case an original ROM for the HTC Touch Diamond off the HTC site?)... I got that(RUU_Diamond_HTC_WWE-AFK_2.03.421.2_Radio_Signed_Diamond_52.51.25.26_1.09.25.23_Ship.exe)
Then you open it up with osKitchen, it extracts it blah blah blah.
I then get a popup about a new ROM has been imported and it asks me if I want to automatically configure the project to use the ROM. I click yes.
Then it says the device profile currently selected uses a pre 6.5 kernel, module allocation space will be extremely limited. Do I want to auto enable module to file conversion for a list of files? Now I read somewhere that if you are using pre 6.5 kernel you want files, if you are using the 6.5 kernel you want modules? I am not sure what to click here as I want to upgrade to windows mobile 6.5 ...
So do I enable the conversion or not?
Then it pops up with the project settings, under SYS Packages I can see all of the phones services. OEM packages, I am not too sure what that is... One thing which is worrying is that there is a red circle with an X in it infront of OEM Drivers... If I hover over it, it says there are issues detected in the OEMdriers. They all seem to be errors detected in the registry and the registery key path entry is invalid due to 2 adjacent backslahes? So is this normal? What do I do?
Also there is a block "RecMod" under OEM Packages. What does that do and what is it used for?
EXT Packages, over here we have all of the applications which will be preinstalled when you flash the ROM? I know how to add .cab packages to it and it seems simple enough. Once again there is a RecMod with a tick box?
ROM Tweaking I have not really bothered with yet, would first like to learn the basics. Anything I should know about in ROM Tweaking?
Now back to SYS Packages. This is where you update/port/upgrade ? to newer windows mobile versions? Now I think if you are changing between window mobile major build versions or what ever you want to call it (like from 6.1 to 6.5) kernel changes perhaps? You call it porting? Anyways, so now I want to change to the latest build in WM6.5 .
I took a look at this thread: http://forum.xda-developers.com/showthread.php?t=650783
Now it seems like the first 3 digits indicate something, what exactly I am not too sure. Perhaps someone could explain?
There is HTC HTC which is made by HTC I think and possibly meant for HTC?
Then there is COM 2 and LG. Now since I have an HTC do I have to use the HTC one or not? Also it seems some have newer / higher WM builds? So why are there these many different builds and what difference does it make as to what they are? Also what are the COM 2, 3 and 5 ?
Anyways, I downloaded the HTC one. Now I want to port / upgrade to it. It is WM6.5 now as well. So I click Import, then goto Import a new WM build. Select the appropriate build dump, then click on start importing. It will import it and then what? Is there anything else I need to do?
I am assuming go back to Project Settings and under SYS build change it to the newer one which I have just imported? Although is this really all I need to do? Will I now have a proper functioning cooked ROM running WM6.5 with the new build?
Thanks
If you're cooking a 6.5 rom, and you have a 6.5 native kernel (there should be one out there, unless you're using a cdma diamond), then DO NOT RECMOD (convert to files). If you have to use a 6.1 kernel, then you have to recmod a lot of modules. Look around, there are threads with native kernels for many older devices. I'm not going to dig up a link, I'll let you find it. Just get the Diamond native kernel and use it.
If you have a cdma diamond, then I believe that people use the cdma raphael native kernel, but supposedly it's buggy.
OEM Drivers has an .rgu that usually has a few mistakes in it; that's probably the error you're getting. I wouldn't worry about it, but the kitchen may tell you which line the error appears in, and you can fix it.
As far as rom tweaking goes, all you need to know is that manila sucks, and Sense is blight on humanity. Good luck and have fun.
Real Beginners Stuff Please.
PsyCLown89 said:
Hi all,
so I am new to the world of Windows Mobile......
I want to learn how to cook ROMs so I can customize what I want as I want.....
So now onto some questions which are probably stupid, but I do not know the answers to......
...... I followed the guide which is here but it does not give me the complete info I want.....
..... What do I do?
..... What does that do and what is it used for?
..... would first like to learn the basics......
..... so now I want to change to the latest build in WM6.5 .
..... do I have to use the HTC one or not? Also it seems some have newer / higher WM builds? So why are there these many different builds and what difference does it make as to what they are? Also what are the COM 2, 3 and 5 ?
.....and then what? Is there anything else I need to do?
.....Thanks
Click to expand...
Click to collapse
Hi,
So many questions
I too am new to the world of Windows Mobile, and have learnt how to flash different ROMs sussessfully.
I have spent my time reading hundreds of threads about flashing, and having a go - the tutorials and threads have been great source of knowledge.
Now I want to start cooking a ROM and things are different..... I have read thousands of posts and tutorials and watched videos, but I haven't found a real Noobs method of: starting, choosing a kitchen, finding a ROM, importing the new bits, and making the changes. It all goes wrong right from the very start.
Choose a kitchen, and then what ? (exact steps, not just "find a ROM you like, then..", etc. etc.)
None of the threads I have read seem to be able to give the nitty gritty to start, they all skip over it.
I have a Kaiser, and am in a similar position to you, there isn't a native 6.5 kernel for the Kaiser, so how do I make a 6.5 build in a kitchen, when I don't have a 6.5 build to start off ?
Please can someone give a REAL NOOBS guide to starting off.
Thanks & Regards,
It all comes down to the basics. If you do not know what a kitchen actually does, then there probably is no point in cooking to start of with.
Kitchens available today make a lot of things heaps easier than they were several years ago.
Try starting with this thread.... it is not for your device, but you get to learn the basics and actually understand what happens in the background.
http://forum.xda-developers.com/showthread.php?t=335631
Cooking is not just clicking around with your mouse.
pkoper said:
.... If you do not know what a kitchen actually does, then there probably is no point in cooking to start of with.
..... Cooking is not just clicking around with your mouse.
Click to expand...
Click to collapse
This may be new to me, but it also was to EVERY cook there is, or has been at sometime. We all learn something new at some time, and all I was asking for is a little starter to get me going. I realaise it isn't a point and click exercise, otherwise I would have made a ROM by now, and not asked for help. I didn't write the software for the kitchen, so I don't know how it works.
http://forum.xda-developers.com/showthread.php?t=335631
Click to expand...
Click to collapse
Thanks for that, I hadn't seen that one, but unfortunately, it also doesn't give the procedure for starting with a WM6.1 ROM and adding/changing files to end up with a WM6.5 Native Kernel.
Please, give me a break.
Fish-Man said:
I have a Kaiser, and am in a similar position to you, there isn't a native 6.5 kernel for the Kaiser, so how do I make a 6.5 build in a kitchen, when I don't have a 6.5 build to start off ?
Click to expand...
Click to collapse
Using search you would have found the native kernel:
http://forum.xda-developers.com/showthread.php?t=619663
Fish-Man said:
Thanks for that, I hadn't seen that one, but unfortunately, it also doesn't give the procedure for starting with a WM6.1 ROM and adding/changing files to end up with a WM6.5 Native Kernel.
Click to expand...
Click to collapse
Thats exactly what I meant. Do you know what the kernel actualy is?
pkoper said:
Using search you would have found the native kernel:
http://forum.xda-developers.com/showthread.php?t=619663
Click to expand...
Click to collapse
Thanks, but I already have them. They are "files" not a "stock build" that the cooks tell you to start with. Again, do I need to start with a "stock build" of WM6.1, or can I use those WM6.5 "files" instead, if so, what am I missing from the "stock build" that I need to continue ?
Thats exactly what I meant. Do you know what the kernel actualy is?
Click to expand...
Click to collapse
Yes, It's a piece of code, usually written in assembly language (for speed of execution), that sits between the hardware devices and the system drivers and programs, to translate what the programs want, to what the hardware can understand, and deliver the results from the hardware, back to the programs.
It is the core of the Operating System, and is the first thing that is loaded into memory when the system boots, and stays there until you turn off the device (unlike other programs that are loaded, and unloaded as needed). It is loaded into a seperate and protected area of memory, where it executes processes, handles interrupts, memory management, process management, file management and I/O management.
The User, cannot interract directly with the kernel (or hardware), but has to go via a seperate program (usually containing a GUI), that can send it's requests to the kernel for processing. After the kernel has processed the programs requests, the kernel gives the information to the program, which then outputs it to the User.
Is that enough of an explanation ? Sorry I had to simplify it, but there are a lot of other noobs here that may have gained some knowledge from that, so rather than blow thier minds with acronyms and babble, I thought it best to explain it simply.
Now, are there any more questions you want me to answer, before telling me what I need to know, to understand the first few steps in cooking a ROM ?
Regards,
Fish-Man said:
Hi,
So many questions
I too am new to the world of Windows Mobile, and have learnt how to flash different ROMs sussessfully.
I have spent my time reading hundreds of threads about flashing, and having a go - the tutorials and threads have been great source of knowledge.
Now I want to start cooking a ROM and things are different..... I have read thousands of posts and tutorials and watched videos, but I haven't found a real Noobs method of: starting, choosing a kitchen, finding a ROM, importing the new bits, and making the changes. It all goes wrong right from the very start.
Choose a kitchen, and then what ? (exact steps, not just "find a ROM you like, then..", etc. etc.)
None of the threads I have read seem to be able to give the nitty gritty to start, they all skip over it.
I have a Kaiser, and am in a similar position to you, there isn't a native 6.5 kernel for the Kaiser, so how do I make a 6.5 build in a kitchen, when I don't have a 6.5 build to start off ?
Please can someone give a REAL NOOBS guide to starting off.
Thanks & Regards,
Click to expand...
Click to collapse
I don't think what you're looking for exist, persay. There are several kitchens out there to choose from. The only thing that helped me when starting out was frequenting the thread of the kitchen that I was using. It's in the kitchen's thread that you'll find all the nitty gritty answers you're looking for and other people that are in the same boat as you, and more experienced users of the same kitchen who would probably be more apt at answering questions about specific kitchen.
Fish-Man said:
Thanks, but I already have them. They are "files" not a "stock build" that the cooks tell you to start with. Again, do I need to start with a "stock build" of WM6.1, or can I use those WM6.5 "files" instead, if so, what am I missing from the "stock build" that I need to continue ?
Yes, It's a piece of code, usually written in assembly language (for speed of execution), that sits between the hardware devices and the system drivers and programs, to translate what the programs want, to what the hardware can understand, and deliver the results from the hardware, back to the programs.
It is the core of the Operating System, and is the first thing that is loaded into memory when the system boots, and stays there until you turn off the device (unlike other programs that are loaded, and unloaded as needed). It is loaded into a seperate and protected area of memory, where it executes processes, handles interrupts, memory management, process management, file management and I/O management.
The User, cannot interract directly with the kernel (or hardware), but has to go via a seperate program (usually containing a GUI), that can send it's requests to the kernel for processing. After the kernel has processed the programs requests, the kernel gives the information to the program, which then outputs it to the User.
Is that enough of an explanation ? Sorry I had to simplify it, but there are a lot of other noobs here that may have gained some knowledge from that, so rather than blow thier minds with acronyms and babble, I thought it best to explain it simply.
Now, are there any more questions you want me to answer, before telling me what I need to know, to understand the first few steps in cooking a ROM ?
Regards,
Click to expand...
Click to collapse
Nice quick knowledge drop on kernel. It sounds to me like you already have a better grasp on things then some!
Fish-Man said:
Thanks, but I already have them. They are "files" not a "stock build" that the cooks tell you to start with. Again, do I need to start with a "stock build" of WM6.1, or can I use those WM6.5 "files" instead, if so, what am I missing from the "stock build" that I need to continue ?
Click to expand...
Click to collapse
Thats because there is no stock 6.5 for the Kaiser. Not sure what "those WM6.5 files" are, but you do need the drivers for your device. Any leaked build will not contain those.
Dumping a stock rom will give you insight as to what is actually in the rom. When you then download one of the leaked builds you can you will recognize the files and hence see what needs replacing in order to upgrade.
Now, are there any more questions you want me to answer, before telling me what I need to know, to understand the first few steps in cooking a ROM ?
Regards,
Click to expand...
Click to collapse
What kitchen are you using? As there are obviously slight differences as to what is where.
I would just get a ready kitchen and study it.
http://forum.xda-developers.com/showthread.php?t=517957
for your reference maybe you should read this....
http://forum.xda-developers.com/showthread.php?t=901712
i had made the tutorial how to cook ROM, step by step. it has different device and different OS but worth to read.....
i don't have enough capability to Cook but i try to....
also in this http://forum.xda-developers.com/forumdisplay.php?f=385
some of members also made tutorial as well.......
i hope it can help.

[Q] Android ROM Development Help

To answer the question that everyone is thinking as they click on this thread... Yes, I am a noob.
Anyway, I downloaded the Android Kitchen and installed it on a Linux Ubuntu Virtual Machine on my Macbook using VMWare Fusion and i watched a video from theunlockr, but all it really let me do was add in apps, change the rom name and give it a few features but no visual customizations... If i posted a link of the "My ROM" no one would be able to tell a difference in the rom i planned on starting from.
Let me know if there is a different way to create that is actually making ROMs or customizing the ROM in it's entirety instead of small unnoticeable features, let me know if I'm just doing something wrong in my Android Kitchen and let me know if theres an easy way to develop ROMs on Mac without Virtual Machines. (The last one isn't a big worry because linux is very lightweight and runs fine on my computer but please help me on the other two questions)
Thanks in advance,
AdamFerg

Most Customs for G800F

, lets be honest: are ****.
Unstable, Buggy and **** like that.
And instead of just complaining about the devs* I want to know the following:
If I want to contribute on the code what do I need to learn? Since a while I'm teaching myself Java and Python via Solo Learn. What would I need to learn to contribute to the Android OS Code itself NOT APPS!!
It will take me months, years I am aware of that. But I'm just tired of only trying different Custom ROMS, only to see that most of them aren't a real alternative of the Stock Roms, without having the possibility to do something about it.
So feed me with some input. What are good sites to learn that?
Happy for your feedback!
*Because damn I know that the Devs are doing an amazing job!
Google is a good start.. that search engine can point you in the right direction ?
Ghost1607 said:
And instead of just complaining about the devs* I want to know the following:
If I want to contribute on the code what do I need to learn? Since a while I'm teaching myself Java and Python via Solo Learn. What would I need to learn to contribute to the Android OS Code itself NOT APPS!!
It will take me months, years I am aware of that. But I'm just tired of only trying different Custom ROMS, only to see that most of them aren't a real alternative of the Stock Roms, without having the possibility to do something about it.
So feed me with some input. What are good sites to learn that?
Click to expand...
Click to collapse
It really depends on what you want to do with Android. The upper layers are in Java. The lower layers are in C++ or C. If you want to adjust the stock libs you might have to understand ARM assembler code. Also a basic knowledge of microcontrollers and linux kernel does help (especially if it comes to the graphic and camera subsystems).
There is almost no documentation for Android (the code is the documentation) and the subsystems change from version to version. The best way (and probably only one) to learn Android is hands on. Just try to fix the most annoying bug you encounter. Try to understand how the source-code works. Check how the Java, C++ layers, kernel and the stock libs interact with each other.
Also try to understand the adb logcat output.
Also try to understand the G800F device tree. A first step is also to compile the source yourself.
hennymcc said:
It really depends on what you want to do with Android. The upper layers are in Java. The lower layers are in C++ or C. If you want to adjust the stock libs you might have to understand ARM assembler code. Also a basic knowledge of microcontrollers and linux kernel does help (especially if it comes to the graphic and camera subsystems).
There is almost no documentation for Android (the code is the documentation) and the subsystems change from version to version. The best way (and probably only one) to learn Android is hands on. Just try to fix the most annoying bug you encounter. Try to understand how the source-code works. Check how the Java, C++ layers, kernel and the stock libs interact with each other.
Also try to understand the adb logcat output.
Also try to understand the G800F device tree. A first step is also to compile the source yourself.
Click to expand...
Click to collapse
Thank you for the reply I appreciate it!
TWRP
hennymcc said:
It really depends on what you want to do with Android. The upper layers are in Java. The lower layers are in C++ or C. If you want to adjust the stock libs you might have to understand ARM assembler code. Also a basic knowledge of microcontrollers and linux kernel does help (especially if it comes to the graphic and camera subsystems).
There is almost no documentation for Android (the code is the documentation) and the subsystems change from version to version. The best way (and probably only one) to learn Android is hands on. Just try to fix the most annoying bug you encounter. Try to understand how the source-code works. Check how the Java, C++ layers, kernel and the stock libs interact with each other.
Also try to understand the adb logcat output.
Also try to understand the G800F device tree. A first step is also to compile the source yourself.
Click to expand...
Click to collapse
Dear hennymcc,
it is about your TWRP for G800F.
Everthing is ok, till it comes to a restore of a TWRP backup.
After the restore the S5 Mini is in a bootloop.
I have tried it with the version August 2015 and March 2016.
Is there any solution?
Thank you.

Categories

Resources