Porting Firefox OS to Android device - android

I would like to port Firefox OS to my device (that is not supported by Mozilla but it has Android 4.2). I've read from net that some of the drivers haven't been developed yet, but if FFOS uses the kernel from Android, then it can load the drivers from my Android ROM, right?
From this point, my real question is: if I build my FFOS ROM correctly, would I still have some bugs from hardware/drivers?
Thank you!

Leakspin, I'll try to give you some context on whether it's doable, and what has been done yet.
if FFOS uses the kernel from Android, then it can load the drivers from my Android ROM, right?
Yes and No. There is much more than that. As you can see, Firefox is built putting together several pieces, such as Gonk(what you were referring to "android kernel", Gecko (our application runtime), and finally Gaia (user interface). Take a look at the Stack. For more info, please follow the architecture blog post at MDN.
Has it been ported yet to any Android devices?
Yes, but it's not a simple process and there is no guarantee that it will work on all android devices. Here, have a look at the list of devices and which tools you will need to perform such operation.
There is also a porting tutorial you might want to follow.
f I build my FFOS ROM correctly, would I still have some bugs from hardware/drivers?
Unfortunately, very likely that you will do.
I tried my best to style this answer, but the stupid stackoverflow limited the amount of links and images I'm able to post. Sorry for that.
Links:
How to port Firefox OS
Pre-requisites.

Related

How to modifiy the system apps running on my phone

I want to modify the system apps running on my specific phone. I am stumped about some important steps on how to do that - see my questions further below.
N.B.: I am not interested in deploying these modifications to other phones. Instead I want to play with the original code and improve it. Hence "create your own system app" is no sufficient answer.
Background
I am just starting to get into Android development (have sufficient Java knowledge, though). There are plenty of great tutorials out there (e.g. here and here) but they all seem to cover user application development. I'm more interested in getting (a little) "closer to the metal". Unfortunately I am unable to find good sources teaching how to do that.
Example
As an example let's say I want to modify how the built-in brightness control works (e.g. changing the minimum) or want to add features to the call screen (e.g. "Send SMS instead" when the line is busy).
Specific Questions
I obviously need these things to get started...
Sources
The sources for (parts of?) the OS running on my phone. This is the part that confuses me the most. Can I just download the official sources or is it likely that my vendor made modifications?
In my specific scenario (I use a Fairphone), could those modifications be contained in any of these sources:
some core apps deployed by the vendor
the image binaries (some way down the page)
sources for the Linux kernel and some other libraries
Tools
I really hope to stay in Java-land. But either case I need a development (I hope to use Android Studio or Eclipse ADT) and a debugging environment (I hope the Android Virtual Devices suffice).
Is it a valid assumption that I can use those tools for system apps or are they usually implemented in C?
Process
Assuming I can download the official sources and get started with, e.g. Android Studio. As opposed to developing a user app, do I have to do anything special to emulate the modified system app on AVD?
I'm asking because I assume that AVD already runs an unmodified version of that very app.
I am just starting to get into Android development (have sufficient Java knowledge, though). ... I'm more interested in getting (a little) "closer to the metal".
You can of course follow your own bliss, but you may find it pretty frustrating to learn Android development by hacking on the OS itself. You'll find yourself doing a lot of OS debugging and working with harder-to-use tools than normal.
Example
As an example let's say I want to modify how the built-in brightness control works (e.g. changing the minimum)
I realize this is just an example, but this could be a tough one, because there are a lot of things that contribute to brightness control -- there's the app with the UI that sets it, but that talks to the framework and ultimately the driver for the hardware that actually deals with brightness curves for the display, in coordination with the ambient light sensor.
or want to add features to the call screen (e.g. "Send SMS instead" when the line is busy).
There's a dialer app, but implementing a feature like that will be...difficult, provided it's even feasible. I don't know offhand whether that sort of call state is available to the API.
Specific Questions
I obviously need these things to get started...
Sources
The sources for (parts of?) the OS running on my phone. This is the part that confuses me the most. Can I just download the official sources or is it likely that my vendor made modifications?
If you're replacing system apps, you'll need to run an OS signed with debug keys; you don't have access to the signing keys for the installed system apps on a retail build of the OS that would enable you to replace them. That will mean either getting a debug-keys installation or building it yourself from source, and flashing it to your phone. I would most strongly discourage you from using your daily phone for this sort of work -- you don't want it to be bricked when you need to receive an important call.
If you're not running a Nexus phone, then yes, your vendor has made modifications. The system apps are probably modified, and you almost certainly won't have access to the closed source of those apps. Also, there will be closed-source device drivers that are essential to the operation of the OS that you won't have access to. If you're trying to get AOSP Android up and running on such a device, as an individual hacker it's at best very, very difficult. If you're willing to use something like CyanogenMod, you could look to see if (and to what extent) they support your hardware.
If you are running a Nexus phone, then it's a goal of the AOSP project to try to have the OS bootable on select Nexus devices, though you won't necessarily enjoy the fullest functionality of the retail OS build, depending on the state of drivers -- even Nexus phones can have closed-source drivers and bits that make life more, um, exciting for building with AOSP.
In my specific scenario (I use a Fairphone), could those modifications be contained in any of these sources:
some core apps deployed by the vendor
Almost certainly
the image binaries (some way down the page)
Not sure what you mean by that
sources for the Linux kernel and some other libraries
It's unlikely there are significant modifications to the kernel itself, though vendors sometimes do...interesting...things with system configuration. I already mentioned device drivers. Vendors also have custom implementations/modifications of some framework APIs.
Tools
Vendor-specific tools are rare.
I really hope to stay in Java-land. But either case I need a development (I hope to use Android Studio or Eclipse ADT) and a debugging environment (I hope the Android Virtual Devices suffice).
Much of what you want to do can probably be implemented in Java, though it depends on how close you're getting to the hardware which can be difficult to know.
Is it a valid assumption that I can use those tools for system apps or are they usually implemented in C?
The "system apps" are implemented in Java, but again, you sort of have to know where the dividing line is.
Process
Assuming I can download the official sources and get started with, e.g. Android Studio. As opposed to developing a user app, do I have to do anything special to emulate the modified system app on AVD?
That's actually different, because you're dealing with an emulator system image instead of a phone image. The emulator system images are completely open source, and you can build them from AOSP.
I'm asking because I assume that AVD already runs an unmodified version of that very app.
That's correct.
To come back to my initial point, if you read between the lines of what I'm saying, I won't tell you it's impossible, but the difficulty ranges from freakin' tough on the easy end to spend-years-of-your-life on the hard end. If you really want to proceed, your best bet may be to buy the phone that's best supported by CyanogenMod and work that angle; there's a more active developer community there to help you. I know you're more excited about trying to customize the OS than you are in making a user-space app, but you'll experience less frustration with the latter than the former.

How to port Android kitkat on Panda board?

I want to learn Android BSP porting.For that I want to port Android kitkat on TI's Panda board.I have already done the Linux porting on panda board.Please suggest the starting point for the same.
I have tried similar thing on Exynos5250 development board with partial success. With partial I mean, the system is up, shell is accessible, all partitions are mounted. But display is not up. So I may guide you a little bit. I may describe what I did for this.
First of all take two source codes.
1) AOSP to which you want to port your Pandaboard.
2) Take any working Andoroid source, it may be ICS or JB or even KK.
Now, You need to port your HARDWARE BOARD to KITKAT SOURCE(1)
So, get KK aosp and build it once for any device already available in source. Follow,
https://source.android.com/source/building.html
Now follow this link in XDA forum.
http://forum.xda-developers.com/chef-central/android/guide-android-rom-development-t2814763
This describes things if you are starting from scratch.
Or if your machine is already set for building AOSP with proper tools refer specifically
http://forum.xda-developers.com/chef-central/android/guide-android-rom-development-t2814763#9
This shows what to change and where to change. Just note that you may not have cm.mk file as that is specifically for cyanogenmod.
There are few useful links in my bookmark bar that you may refer when the code is building(It takes hours, believe me)
http://wiki.cyanogenmod.org/w/Doc:_porting_intro
http://elinux.org/Android_Device
http://forum.xda-developers.com/showthread.php?t=2620389
http://www.kandroid.org/ndk/docs/ANDROID-MK.html
Android device configuration for AOSP
You may use the JB kernel for a while to boot it up as I did, but it will break some features in Kitkat android.
Also, I while building you may face a lot of errors. You need to deal with them on your own.
Also if you successfully port it, don't forget to share the process you followed.
I hope this will provide a good start for the process. Good Luck.

Modify and boot linux kernel on mobile device

During my education I have been developing Android iOS apps and websites for almost 18 months. Now, as my final year project, I am working on Linux source code with the goal to boot it on a mobile device – like Android. I have it successfully as a Debian package following tutorials on the Internet. I am currently using Ubuntu.
I have a strategy but not sure if I am on the right track. It is as follows:
A:
Download Linux source code. Remove extra drivers, compile and
install it on currently running Ubuntu and use it.
Customize the code further and boot it as my own distribution. For
that I'm following LFS.
Specify a particular target mobile, modify the code for it, write
drivers if I need any, not sure which one (that's why I'm here :) ),
and boot the kernel on it.
I do not know whether my strategy is right or not. I'll really appreciate if someone can tell me:
B:
Am I on the right track? If not, what might be the right one?
Do I need to specify a mobile and customize the kernel code for that
one?
Other than drivers, what else do I need to change in the kernel?
Last but not the least when I boot the kernel on a mobile device; am I going to have any
interface or terminal there?
Sorry if my question doesn't make sense. I am a student and still trying to figure things out. I would be very thankful if someone could give me hints on what subjects to search for on the Internet.
Update: What I want is to confirm whether my strategy is correct or not. If not, then please just name the steps I should follow.
It is not unusual that the drivers for the SoC and devices around it are closed source.
As far as I know, the drivers for the Exynos SoC (the stuff Samsung uses in many of their devices) is (partly) closed source.
So generally speaking you have to write drivers for everything and everyone.
Especially the actual radio connection is tricky as there are no devices which need proprietary
firmware blobs (although the rest of the drivers may be open source).
Another problem is the boot loader on many devices, which does not easily let you install
custom kernels (hash sum stored in the boot loader, unwilling to boot if kernel hash does not
match).
So, assuming you are developing for a device that is already supported by android, I personally
would start with the corresponding device tree for your device and start modifying that.
You can a lot of device trees on CyanogenMod's github page.
Benefits:
You can start off with a working state
If something breaks you know it was you
Alternatively, you can peek at other projects like Ubuntu Touch.
They are able to utilize existing android kernels by using Hybris.
If you want to have a distribution based on Debian/Ubuntu I would recommend
trying Ubuntu Touch and modifying that.

Porting Android on various other mobiles

I am new to the development as well as the prg world. I want to learn android and want to make applications for it. So one possible way is to buy a new android phone to test it live and not on emulator. But I have two spare phones, Nokia N70 and Motorola MotoRokr E6. So I was willing to port the OS on those machines. As a result I wanted to know is that possible then what all do i need for that considering both Software and Hardware Aspects.
ThankYou in Advance...
Its possible however I would strongly recommend against it.
While android is open source and nominally can be run on any system you choose, in reality you would have to start worrying about keyboard incompatibility, drivers for any integrated peripherals your phone has, lacking buttons that are standard to all android phones etc.
Getting android running well on one of these phones would be a large project in its own right. I certainly wouldn't recommend testing your android apps on it as a first port of call as the problems you uncover are as likely to be with your android port as with your app.
Neither phone has anywhere near sufficient memory.
You need 96-128 mb, preferably more like 256 mb of ram.
Something that was already linux-based would be simplest as you would start by adding the android kernel modifications. Alternatively, something that is a winmo cousin to a vendor's existing android phone and has basically comparable hardware so you can hopefully recycle drivers or leverage an existing porting effort.
But if you need to aquire a phone anyway, get one that already runs android.

What exactly is a ROM?

I began studying android and became curious what is a ROM. There are many pages that offer to download ROMs but what it is exactly from a developer's point of view is not quite clear.
So what is it?
Thanks!
ROM in this context is a nickname for the operating system software that gets installed into the Read Only Memory (ROM) area of the phone.
Check out this page for a more thorough description.
In the Android world, a ROM is a modified version of the Android OS that can be run on a rooted phone. There are generally 3 types of ROMs: one that emulates an upcoming release of Android, one that adds more features not seen in Android OS, and one that focuses on speed and stability.
You can find more information on Android ROMs here.
ROM is nothing but the Android OS. We use Stock ROM in our device which comes by default by the company we cannot modify the stock ROM but we can modify Custom ROM which gives easy modifications of the OS with various tweks you can fine more information here

Categories

Resources