[Q] Rom porting - where to begin? - Optimus One, P500, V General

Hello XDA community!
I'm interested in rom porting / developing, but don't know where to begin, and how. I have some C, C++ and Java knowledge (cause I learned to be a software designer and developer), and got some free time, so I want to help in rom developments, if I can. (for example to get Optimus Net rom woriking on our Optimus One)
Could someone give an advice, where to begin to learn these things?
Thank you for every help! And keep up the good work, developers!

Just some suggested ports
-oxygen
-AOSP
-sense
-miui

do you want to develop or customize? these are different things.
for porting a binary compiled rom, you need most knowledge in decompiling code.
for porting real source code, you need most knowledge of C/C++ and JAVA and hardware.
for the first steps, use a ready and running rom and theme it something.
if you want to do really more and have dreams what to do - start developing on
source code - use direct source code from AOSP, CM7 or CodeAurora. Here you need to read
about how the compile process is working, if you have a working and booting rom you can modify
all the software you have or write new

Take a base ROM from another phone. First thing, delete the boot.img. That boot.img contains the kernel, which will not do good to your phone. Next, add the boot.img from your phone to this rom (use commom sense, if you are porting a vanilla rom, use an AOSP kernel, if porting sense, use HTC kernels, if you are porting other UI’s like blur, use an AOSP kernel.) Next, go into the /system folder. In here, we want to first delete the usr folder. The usr folder has hard button and keypad drivers. Replace the usr folder with the one from your phone. Next, go into the etc folder. delete the vold.fstab andapns-conf.xml and replace with the one from your phone. Next, we want to go into the lib folder. Here, we will want to replace the lights.(device name here) (and the sensors.name if it is an AOSP port) and replace with files from your phone

Related

[Q] Beginner Questions

I'm very interested in doing some ROM development, though I'm quite the beginner. I know my way around Java and can hold up against some C, and I've also done some apps. I have a few questions though before I get started.
After I run make on the AOSP, how can I test my build with the emulator and my device (Eris)?
Will using the build on my Eris work, provided there are no build problems?
How could I base a ROM I make off of an existing ROM? (For example, KaosFroyo)
What is the difference between cooking a ROM, and running make on the AOSP?
I think thats about it for now. Thanks for taking a look!
Chiggins said:
I'm very interested in doing some ROM development, though I'm quite the beginner. I know my way around Java and can hold up against some C, and I've also done some apps. I have a few questions though before I get started.
After I run make on the AOSP, how can I test my build with the emulator and my device (Eris)?
Will using the build on my Eris work, provided there are no build problems?
How could I base a ROM I make off of an existing ROM? (For example, KaosFroyo)
What is the difference between cooking a ROM, and running make on the AOSP?
I think thats about it for now. Thanks for taking a look!
Click to expand...
Click to collapse
1) I'll answer the Eris part, since I have done that more than once... You need to zip up the following:
a) /system folder from 'out/target/product/generic (or desirec if you used a vendor tree)
b) a /META-INF/com/google/android folder structure with a working update-script
c) a boot.img with an Eris kernel and appropriate init.* scripts in the ramdisk​Then sign the resulting zip. There's your base ROM. You can also just throw that into dsixda's kitchen.
2) Yes. Define 'work'. You'll need an Eris kernel, Eris specific drivers in the right place, and the correct settings in the init.* scripts and build.prop. It also helps to have a wlan.ko in /system/lib/modules that is compiled against the kernel that you are using.
3) If you take an existing Eris ROM and use it as a base, you're golden. The Eris specific stuff is already there. At that point, you can theme, add/remove apps/etc. Give credit where credit is due though. Personally, I recommend that you start with a stock ROM or AOSP, but that's me.
4) Well, I suppose it depends on who you ask... Some devs don't really like the 'cook' moniker. It sort of implies that you are just taking parts from everywhere else and making something tasty instead of coming up with something new. Compiling AOSP is not really coming up with something new, but at least you started 'from scratch'.
Even if you don't want to use a kitchen, I recommend that you download dsixda's and my Android Builder to look at the scripts. You can learn a lot by looking at those.

[Q]Cooking the framework layer

Dear experts,
like many ppl, I am new to Android Development, and would be able to cook my own rom with amazing home-made features before the end of the week... and I want it to be easy, funny, and eventually Fast....
... Indeed, I don't want all of this, so I'll try to be realistic in my incoming questions and beg for your indulgence if some things sound stupid / inexact / already documented and so on : I have performed a long search process before I decided to post here and would not ask it otherwise.
So, first, here's what I have know about android:
- Android Architecture (various layers)
- Android + java programming (beginner with both but skilled with general OOP and smartphone -iPhone- programming)
- Rom flasing process : rooting, bootloader / recovery flashing , using adb, filesystem of a ROM
- Android official source building (from git repository) and patch apply.
- Basic cooking without any source code modification: use of dsixda's kitchen with xda members' home-made roms mainly
Then, the material I am working with :
- Max OS 10.6.5
- A HTC - Tattoo : rooted, with nandroid and busybox installed (also have an available HTC - Hero)
- adb 1.0.26
- HTC Android Kitchen 0.106 - by dsixda
- Android official source from http://android.git.kernel.org/
Now, what I don't know about is advanced cooking... I read a lot about ppl wondering the same, and generally there was no basic answers (not to mention guide/tutorials).
Since I will surely be the nth to ask this, let's try to ask a specific question.
I downloaded from Android github a patch I am very interested in. This patch applies on the framework and does not impact any other layer (especially not the kernel nor the hardware related libs). After building the source, I thus get a framework.jar I would like to replace some target framework.jar with .
I was quite sure it was not very bright to do such with a custom ROM, even a quite standard FroYo-based one, since there was little chance that such a cooked-rom used a virgin framework taken as-it from android github. But I tried anyway with some of the FroYo-based roms taken from the xda list for my tattoo device. I basicely replaced the framework.jar with mine.
... and indeed, it failed : I kept getting stuck at the boot screen everytime I do such.
So.... I am trying to understand what I do wrong.
- I am quite sure I miss some signing process, but although I read many threads about such a signing about apk files, I did not manage to figure out how to do this with frameworks / jar files. Could someone bring me some light about this?
- Provided the signing is not the (only) problem here, could someone explain where / why I am wrong?
- Eventually, since I did not manage to find full source for a FroYo-based (running) cooked rom , do you know of such a source repository I could work with instead of working with android official sources (including the framework java files + compatible with HTC-tattoo / HTC-hero if possible)?
Thanks for all of you for reading until here, whatever your answers (or silence) may be.
And thanks in advance to those who may have some answers or any constructive criticism.
Roger_Rabbit
--------------------------
An old fashioned rabbit

[Q] can we make our own roms???HOW???

I Am INTERESTEd IN MAKING roms for defy...i just dunno d procedure
how to make custom.zip and update.zip which can be flash only in custom recovery???
how to edit apk files and tools needed to make it work.???
PLZZ help me out guys....seriously want to build roms for defy....
me too! i was a symbian cooker and now I would make my own rom for defy...but I don't know what tool to use
im not a developer myself but from what i understand, for our phone we can make 2 kinds of roms:
-aosp (android open source project) like cm7, miui and its variants. For this you need to know how to code, compile and debug the android os.
-roms based off stock roms like ms2 ginger etc. For this type you dont have as much flexibly as aosp roms as you dont have source code and this is more or less like cooked roms on wm or symbian.
As for guides on how to get started go over to the main android section in xda. They are a good number of guides if you search properly
http://forum.xda-developers.com/showthread.php?t=1441844
double thread...

[Q] New rom (or just launcher)?

The first thing I want to say is that my English is not really good. I hope you understand my questions.
I have an idea for a new Android rom, but I'm faced with a dilemma. I want to have as much as possible supported devices, so I also can just build a launcher apk which can be installed through Google Play. In this way all mobile devices with the minimal platform version can use it. The biggest problem is that I don't only want a replacement for the application launcher but also the notification drawer and everything else. Is it possible to replace them also? I don't think so, so I think I'll work on a custom rom.
The next problem is which base rom I would use if I really build a custom rom. It's most likely to use AOSP as base because it's clean. The question is which version of AOSP: Gingerbread, Ice Cream Sandwich, or the newest version Jelly Bean. You would probably say Jelly Bean because this is the newest version. The problem is the phone support. Gingerbread is supported on most phones. If I build ICS or JB the phones which are supported by Cyanogenmod are easy to support, because I can use their device files. The only problem is that my phone, the Samsung Galaxy Gio is not officially supported and the unofficial port is not really stable. I don't think it's a big problem to use this device files and just wait till the developer makes it more stable, but I don't know for sure.
The last thing I want to know is if it's really that simple to support multiple devices. If I read tutorials about porting existing roms to your device they all say you just have to add your device files to the source and compile it. But they never say something about the kernel. Most devices need another kernel because their hardware is different isn't it? Please explain me how this works.
I'm sorry about this hazy story, but please help me before I make wrong choices. Thanks on purpose.
Wietse
WietsedeVries said:
The biggest problem is that I don't only want a replacement for the application launcher but also the notification drawer and everything else. Is it possible to replace them also? I don't think so, so I think I'll work on a custom rom.
Click to expand...
Click to collapse
These changes you are talking about can be done. They are system changes so not supported by the android app installer.
Eg: Your notification drawer, status bar are part of SystemUI.apk. The source for this is can be found in the AOSP source code under android/frameworks/base/...
You can make your modifications, compile it into an apk and then make a flashable zip to replace the current one (or push it via a rooted adb console).
or you can compile the entire source code into a flashable zip (eg CM7,9 etc..) and use it a replacement ROM with your modifications.
This is the line between an application under the android runtime and the android runtime itself.
these files, under framework are part of the OS. so to provide a customized version of the operating itself is what people like to call ROMs.
Now ROMs (like any OS) are device dependant. Windows has the code to run in a lot of different hardware configs, but android aims to be small. It should have only the minimum required code to efficiently run itself on a device.
Thats the kernel. The kernel communicates with the hardware and so the rest of the hardware can happily talk to a working kernel and expect the hardware to function as advertised. Kernel is a simple program which goes into the RAM on system start and sits there directing the operation of the phone.
Kernel devs work on making sure the hardware and the android runtime work perfectly together. Now, in this imperfect world, not all sources are open, even though they should be. and therein the issue lies.
If you want to compile android from source and make sure it works on your phone, first you need to make sure you have the kernel with all the changes(patches) to it made by the vendor (chap who made the phone and bullied you into buying it) to get it working on your hardware.
If you dont have that, you have to do it yourself. Or wait for someone else to do it.
once you can compile android and get it working on your phone with all the itty bitty hardware working A-OK.. then you can browse through the source, make changes as per your individual requirements and compile it into a ROM.
see the changes to the OS are separate from the changes to the kernel. The kernel changes are for hardware-software interaction so they are phone SPECIFIC.
but changes to your custom android OS (ROM) can be "cherry-picked" from other ROM/gerrit/AOSP/CM/AOKP sources and put inside your own source tree to get included in your build.
so if you have all the device / kernel stuff from a working android distribution, you can take the source of another android distribution and swap the device stuff into it and see if it works.
hope this helps.
wingie6200 said:
These changes you are talking about can be done. They are system changes so not supported by the android app installer.
Eg: Your notification drawer, status bar are part of SystemUI.apk. The source for this is can be found in the AOSP source code under android/frameworks/base/...
You can make your modifications, compile it into an apk and then make a flashable zip to replace the current one (or push it via a rooted adb console).
or you can compile the entire source code into a flashable zip (eg CM7,9 etc..) and use it a replacement ROM with your modifications.
This is the line between an application under the android runtime and the android runtime itself.
these files, under framework are part of the OS. so to provide a customized version of the operating itself is what people like to call ROMs.
Now ROMs (like any OS) are device dependant. Windows has the code to run in a lot of different hardware configs, but android aims to be small. It should have only the minimum required code to efficiently run itself on a device.
Thats the kernel. The kernel communicates with the hardware and so the rest of the hardware can happily talk to a working kernel and expect the hardware to function as advertised. Kernel is a simple program which goes into the RAM on system start and sits there directing the operation of the phone.
Kernel devs work on making sure the hardware and the android runtime work perfectly together. Now, in this imperfect world, not all sources are open, even though they should be. and therein the issue lies.
If you want to compile android from source and make sure it works on your phone, first you need to make sure you have the kernel with all the changes(patches) to it made by the vendor (chap who made the phone and bullied you into buying it) to get it working on your hardware.
If you dont have that, you have to do it yourself. Or wait for someone else to do it.
once you can compile android and get it working on your phone with all the itty bitty hardware working A-OK.. then you can browse through the source, make changes as per your individual requirements and compile it into a ROM.
see the changes to the OS are separate from the changes to the kernel. The kernel changes are for hardware-software interaction so they are phone SPECIFIC.
but changes to your custom android OS (ROM) can be "cherry-picked" from other ROM/gerrit/AOSP/CM/AOKP sources and put inside your own source tree to get included in your build.
so if you have all the device / kernel stuff from a working android distribution, you can take the source of another android distribution and swap the device stuff into it and see if it works.
hope this helps.
Click to expand...
Click to collapse
Thank you very very much for your explanation! It's a pity it's impossible to hit multiple times "Thanks".
I think I'm going to make a modified SystemUI.apk but you didn't tell the application launcher is also in this file. Did you just forget this or is this stored in another file/folder? And the lock screen? And I want also to replace the boot animation if it's possible.
If I take the source files of the SystemUI.apk of AOSP ICS, does this work on every phone running ICS? Included CM, AOKP and other (smaller) custom roms? And my last question: Since SystemUI.apk a apk file is, is it possible to edit these files through Eclipse and build it in Eclipse? Or do I get errors?
//Edit:
Still another question: How much work is it to, as example, port a modified Gingerbread SystemUI.apk to ICS? (Or vice versa)
WietsedeVries said:
Thank you very very much for your explanation! It's a pity it's impossible to hit multiple times "Thanks".
I think I'm going to make a modified SystemUI.apk but you didn't tell the application launcher is also in this file. Did you just forget this or is this stored in another file/folder? And the lock screen? And I want also to replace the boot animation if it's possible.
If I take the source files of the SystemUI.apk of AOSP ICS, does this work on every phone running ICS? Included CM, AOKP and other (smaller) custom roms? And my last question: Since SystemUI.apk a apk file is, is it possible to edit these files through Eclipse and build it in Eclipse? Or do I get errors?
//Edit:
Still another question: How much work is it to, as example, port a modified Gingerbread SystemUI.apk to ICS? (Or vice versa)
Click to expand...
Click to collapse
Only way is through exchanging the png files since porting the whole .apk is impossible.
Sent from my Jelly Beaned Ace
Thanks for the answer. And do you also know the answers of the other questions?
Sent from my GT-S5660 using xda app-developers app
WietsedeVries said:
If I take the source files of the SystemUI.apk of AOSP ICS, does this work on every phone running ICS? Included CM, AOKP and other (smaller) custom roms? And my last question: Since SystemUI.apk a apk file is, is it possible to edit these files through Eclipse and build it in Eclipse? Or do I get errors?
//Edit:
Still another question: How much work is it to, as example, port a modified Gingerbread SystemUI.apk to ICS? (Or vice versa)
Click to expand...
Click to collapse
There are two roads you can go now - one is use apktool to *decompile* apk the apk file that you've taken from your phone, it doesnt convert the app to java source code but java bytecode in .smali files (like an assembly version of the source) but you will have access to the resource files (xml, images etc..) so you can replace them and create some new themes.
http://forum.xda-developers.com/showthread.php?t=1814441
http://forum.xda-developers.com/showthread.php?t=1760133
And no - a GB systemUI.apk will *NOT* work on ICS. It is very probable that any changes you make through any of these methods can brick you phone. So make sure you have CWM and a nandroid backup.
If you want to add/edit functionality within the source code of systemUI.apk, you need to learn how to compile Android from Source. i would suggest getting hold of the CyanogenMod source tree for your device and playing around with it.
Ginger bread is CM7 and ICS is CM9.
http://forum.xda-developers.com/showthread.php?t=1552090
once you have the full source tree, you'll find a folder called android/frameworks/base/core/...something../systemui/..
this will contain the javasource code for your application. Here you can edit stuff to your hearts content!
Note that this cannot be compiled standalone by eclipse. The Android build system must be used to compile this (cuz its a system app).
a nice resource i used when i was doing the same thing :laugh:
http://iserveandroid.blogspot.in/2011/01/how-to-implement-your-own-status-bar.html
cheers and have fun.

[Q] Building a custom ROM for Xperia-L from AOSP

Pardon my ignorance. Just for fun and learning, I am willing to build a custom ROM from scratch for Sony Xperia-L from Android AOSP. But, even after going through a number of tutorials, following are the issues which are yet unclear to me:
How to obtain Xperia-L specific drivers to intergrate it into my build. Please note that unlike a few tutorials has suggested, I don't want to start from CM ROMS. I want to do it from 'scratch'
I have downloaded Open source archive for build 15.3.A.1.12, 15.3.A.1.14 and 15.3.A.1.16. It contains two top level directories: kernel and platform. What are these two for? Given the size of AOSP so large, I presume this archive does NOT contain full source for Xperia-L stock ROM. Am I correct to reason that?
Without using kiddie-approach, e.g. different ROM kitchen, what is the recommended approach to for a beginner to master the art?

Categories

Resources