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.
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.
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.
“ 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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With