Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

learning Android OS porting on different Embedded Boards

 
Mandar Khire
Ranch Hand
Posts: 569
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have started learning Android after few java projects.
I got Many boards like raspberry Pi,Banana Pi, Wandboard, Calixto, many more.(Though Not expert in Electronics.)
I have target to port android os in board, after successful porting of android os want to unit test its all possible sensors, peripherals, GPIO pins etc by simple android applications.
Find out android java app limits means
if some GPIO pin not accessible/not working as i expect then whether to use NDK or SDK or both.

For that i try to find out links/books which gives clear concepts regarding above kind of task.
If any one has some suggestion/tips/hints/etc for me then welcome.
 
Maneesh Godbole
Saloon Keeper
Posts: 11327
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is confusing for me.
What exactly do you mean by
I have target to port android os in board
 
Mandar Khire
Ranch Hand
Posts: 569
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally we programmer create Android app for Device which already has Android OS. We just use apk on that device.
I have boards like Android mobile phone without Android OS only hardware. Or Computer which has empty HDD & we have to install OS/drivers etc which we want.
So from zero i have to start.
Many forums like xda developer or raspberry pi give me hint that all boards not supports all Android versions.
If some run with x version but we cant run all apps on that due to some reasons.

I have to find out which board with which android os version works best so i can use maximum sensors, peripherals, GPIO pins etc.
Lots of books i download by net but all for how to program in some IDE.

 
Maneesh Godbole
Saloon Keeper
Posts: 11327
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem, I would go to the source of the Android OS. Then I would look up the section which talks about system requirements (hardware). The I would identify which board(s) I am considering is/are most suitable.
 
Mandar Khire
Ranch Hand
Posts: 569
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same thing i have already implemented.
But question is which book related to Android OS. What are Android OS limitations using different board.
Currently i am using Android Source Code for reference.
Because example Wandboard.org gives img of Android OS for its board. Just download & use.
But if using that image i try to access its boards some GPIO pin or sensor or peripherals & got problem, then i have to compile Android source code with Drivers & use it in that board.
If i done that thing then also i dont know whether my android apk which written in java really give me results which i wants.

So regarding this is there any book available?
Like if we want to learn how to edit/modify Linux kernel then lots of books available for kernel programming.
 
Maneesh Godbole
Saloon Keeper
Posts: 11327
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Android compatibility is free, and it's easy.
If you are building a mobile device, you can follow these steps to make sure your device is compatible with Android. For more details about the Android compatibility program in general, see the program overview.

Building a compatible device is a three-step process:

Obtain the Android software source code. This is the source code for the Android platform that you port to your hardware.
Comply with the Android Compatibility Definition Document (CDD). The CDD enumerates the software and hardware requirements of a compatible Android device.
Pass the Compatibility Test Suite (CTS). Use the CTS as an ongoing aid to compatibility during the development process.

Did you check out the CDD document mentioned above?
https://source.android.com/compatibility/index.html
 
Mandar Khire
Ranch Hand
Posts: 569
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maneesh Godbole for kind help.
I think, i cant explain properly what i want to ask in this post.
Example:-
1 Though Android website for Developer which explain lots of things very good way.
But then also lots of books for Android App Developers.
Same way is there books for People who want to learn Android Source code?

2. As Some mobile phone not has facility Auto focus in camera, but another mobile phone has that. We can see In both phone same OS version.
So if i write program which use camera & specially want to use Auto focus, then that program give me error in mobile phone which not have that facility.
If by simple programming i get that facility then no problem but if not then i have to find out way by which way i can access that auto focus facility to my program.
for that should i use NDK or NDK & SDK both means should i use C program in java program?
This example is completely imaginary.


 
Maneesh Godbole
Saloon Keeper
Posts: 11327
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mandar Khire wrote:
2. As Some mobile phone not has facility Auto focus in camera, but another mobile phone has that. We can see In both phone same OS version.
So if i write program which use camera & specially want to use Auto focus, then that program give me error in mobile phone which not have that facility.
If by simple programming i get that facility then no problem but if not then i have to find out way by which way i can access that auto focus facility to my program.

Your logic is flawed. No amount of programming is going to make your device gain some capability unless there is a hardware to support it.
 
Mandar Khire
Ranch Hand
Posts: 569
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your logic is flawed. No amount of programming is going to make your device gain some capability unless there is a hardware to support it.

Yes i know.

What about point 1?
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not come across any such comprehensive book.

You may be aware that android has been ported to some embedded boards, such as Beaglebone boards and Hardkernel's Odroid.
My suggestion is that you start with the source code of those ports, to get an idea of what is involved.
Once you get this idea, you'll atleast know what more to delve into for your particular board.

For Beaglebone boards I suggest the following resources (Note: TI here is Texas Instruments whose Sitara SoC's run the Beaglebone boards)
1. TI's AOSP development guide
2. TI's adaptation of AOSP kernel source code
3. Derek Molloy's excellent videos on beaglebone black internals and linux device trees
4. Understand linux device trees . There are other device tree related articles in lwn.net; do a search.

For Odroid or the other boards you have mentioned, I don't have any suggestion since I haven't investigated them very deeply, but something above should help you atleast search for somethings.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some opinions addressing your original post:
Find out android java app limits, means if some GPIO pin not accessible/not working as i expect then whether to use NDK or SDK or both.

Note that Android platform API does not expose any APIs at all for GPIO access.
- If some functionality is not available in the API and also not supported by stock AOSP - such as GPIOs - then you need to write and integrate your own software in one or more layers of the OS. Likely your own device drivers, linux daemons, etc. This is what TI would have done for beaglebone. The only exception to this is USB access, because raw USB I/O is available in the platform API.

- If functionality is not available in the API but is supported by stock AOSP via some native daemons, then you can use NDK to talk to those native daemons.

- There are some functionalities which are available in the API but don't work unless you have some special permissions and keys.
For example, LocationProvider documentation gives the impression that any custom location provider can subclass it. If I want to attach a GPS module via USB or bluetooth to my android phone, in theory, I should be able to write a subclass of LocationProvider in my app that gets location from the module via USB/bluetooth APIs. However, installing it as a location provider turns out to be impossible for normal apps because it requires a special permission that is available only to firmware developers. In such cases too, you need to build your own version of AOSP.

- For any other functionality which is available in API and does not require any special treatment, use the API because it's the most convenient way.


 
Mandar Khire
Ranch Hand
Posts: 569
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Karthik Shiraly,
As i know about Linux little bit due to using Centos5.4 for few java projects from past 2 years.
But when i start working on Embedded boards with blank sd card for OS,
then i afraid lots of things in C in kernel/driver etc.
This kind of development is first time for me.
But now i got way. If i get success then i will know 'how What When Where Why' in Android OS as well as Android Programming.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mandar Khire wrote:then i afraid lots of things in C in kernel/driver etc.This kind of development is first time for me.


If you are very new to Linux and C programming, then I suggest :
- Start with building a stock x86 linux kernel for a Virtualbox VM hosted on your desktop/laptop. Learn about terms like toolchains, make files, kconfig, etc. Learn how to include or remove device drivers.
The Linux documentation project and Linux from scratch are great resources.

- Write a couple of simple char and block device drivers. There are many good tutorials on youtube. Since you're running them in a VM, there is no chance of damaging your physical machine.

- Learn to setup cross compilation toolchains, so that builds can be done on a faster desktop/laptop instead of slower embedded board.

- Finally, check out the resources I mentioned above.

It's actually a daunting task you've undertaken, so I salute your courage. Little steps will get you there.
 
Mandar Khire
Ranch Hand
Posts: 569
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Karthik Shiraly,
I learn lots of new things in Linux.
I follow few steps before learning.
1. Download Android Image from website
2. Deploy it in new Blank unallocated SD card
3. Run it in Board.
4. Run Hello World Program in it by Android Studio by reading Android Developer Site.

After success in these steps.
I follow few more steps
1. Download Android Source code by help of git by following steps given in website
2. follow steps for Build (make command at last)
3. see the lots of files & folders in out folder. (5 files with extension .img)

Now i stuck at point of Deployment it in Blank unallocated SD card.
I read many instructions. tried lots of instructions. But no success.
I read following links
1. Create an Android 4.2.2 Image
2. How to get started with Embedded Android on the Wandboard: Building and Deploying the Bootloader, Kernel and Android Root File System

But i confuse about it. Can anybody give me hint/help regarding how to deploy output of make in Blank unallocated SD card!
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mandar Khire wrote:But i confuse about it. Can anybody give me hint/help regarding how to deploy output of make in Blank unallocated SD card!

The "2.How to get started with..." link there seems to be quite comprehensive. You'll have to be more specific about what is confusing you or what step is failing.

I don't have a wandboard, so any help from me will be based on trying to map these steps to what I did with beaglebone/odroid boards. Some things like using a serial cable aren't necessary in beaglebone, so I'm not able to judge whether's it's a critical step for wandboard.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic