The beaglebone black supports Android. Why do not understand Android architecture with it!
The above figure shows the diagram of Android Architecture obtained from here
Following are the different layers in the Android stack:
- Linux Kernel Layer
- Native Libraries Layer
- Android Runtime
- Application Framework Layer
- Applications layer
Linux Kernel Layer
At the bottom of the Android stack is the Linux kernel.
Android uses Linux for its device drivers, memory management, process management, and networking.
Here you can create your own driver according to board or Soc specification.
int beagle_Set_Led(int LedNum, int Value) { /*Implement low level interaction with hardware*/ }
Native Libraries Layer
The next level up contains the Android native libraries.
The Android includes a set of C/C++ libraries used by the various components of the Android system in order to enable the device to handle different types of data and each one is specific for a particular hardware.
If you want to integrate system peripherals through kernel modifications (see Linux Kernel layer above), you need to create your own JNI (Java Native interface) library :
JNIEXPORT void JNICALL Java_com_example_led_drv_drvjava_setled1 (JNIEnv *env, jobject obj) { /*Implement Native Method Here*/ }
Android Runtime
The Android runtime layer includes a set of core Java libraries as well. Android application programmers build their apps using the Java programming language. It also includes the Dalvik Virtual Machine. –
Application Framework Layer
The most important component of the framework is the Activity Manager, which manages the life cycle of applications and a common “back-stack” for user navigation.
Applications layer
The applications are at the topmost layer of the Android stack. An average user of the Android device would mostly interact with this layer
Once you have created your JNI library, you need to create a JAVA package like that :
package com.example.led.drv; public class drvjava{ public native int setled1(); static { system.loadlibrary("your_jni_library"); } }
As a result, you can manage Beaglebone Black user LED from a Java application with a system compound by:
- Android JellyBean
- Linux kernel 3.8
- Linux devices modules
- JNI interface
- JAVA package
- JAVA app