Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make an embedded Android OS with just one app?

Tags:

I would like to make my own embedded system built on Android (ARM) just using devices distributed with Android but without their launcher.

OR

I want to start Android with my application launched on top and refuse to close it and shutdown Android from my app.

like image 228
xdonko Avatar asked Jul 03 '12 14:07

xdonko


People also ask

Can I use Android as operating system?

Android is a mobile operating system based on a modified version of the Linux kernel and other open source software, designed primarily for touchscreen mobile devices such as smartphones and tablets.

What is Android embedded system?

An embedded system with WiFi can serve web pages to, and allow interface with, ANY smart device or tablet (not just one running the Android OS). Using a web interface to configure or control an embedded device is a simple method of adding an advanced user interface to an embedded product.

Is Android embedded Linux?

“ By this definition, Android is not embedded Linux because it's “more of a platform play,” he said. Google custom-built Android as a mobile operating system that comes with its own ecosystem, separate from the classic Linux ecosystem. Its user interface is optimized for touch screen devices.


1 Answers

Essentially you're trying to have a custom build of the AOSP where the "Home" is your application. If you look into /packages/apps/Launcher2 you'll find the code for the default Home screen.

If you look at the AndroidManifest.xml file in there, you'll see something like this:

     <activity         android:name="com.android.launcher2.Launcher"         android:launchMode="singleTask"         android:clearTaskOnLaunch="true"         android:stateNotNeeded="true"         android:theme="@style/Theme"         android:screenOrientation="nosensor"         android:windowSoftInputMode="stateUnspecified|adjustPan">         <intent-filter>             <action android:name="android.intent.action.MAIN" />             <category android:name="android.intent.category.HOME" />             <category android:name="android.intent.category.DEFAULT" />             <category android:name="android.intent.category.MONKEY"/>         </intent-filter>     </activity> 

Essentialy, this says that this Activity reacts to the

android.intent.category.HOME intent.

When the system finishes booting (the ActivityManager more specifically), sends that intent. So, if you want your app to start instead of the Launcher, just create yourself an app with a similar intent filter and remove the default Launcher2 (take it out of the list in build/target/product/generic.mk and put yours instead). Also make sure the relevant .mk file has something like this:

LOCAL_OVERRIDES_PACKAGES := Home 

So long as your app doesn't provide a way for the user to launch other apps using icons (like the Launcher does), no other app will be started; unless of course something sends an Activity-starting intent from some other path than the one controlled by your app - say by using the "am" command on the target's Android shell.

like image 107
Karim Yaghmour Avatar answered Sep 28 '22 02:09

Karim Yaghmour