[Android] how to include your app into list in dialog which is launched when you put device on cradle or dock

I am very in trouble not to find how to solve the problem.
The problem is that I want to include my app into list in dialog.
The dialog is launched when I put device on cradle or dock.

I have searched for a very long time.
And finally I found it!

The hint page is here. I appreciate the author writing it very much.
Custom CAR DOCK application in Android

I have to use intent. And the setting is following.

AndroidManifest.xml

            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.DESK_DOCK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

This resolve point is I have to use both category.DESK_DOCK and category.DEFAULT together.
If I use only which one of those, it can’t work.

Here is the screenshot.
DeskDockTest app is my application.
The others are default app of devices.

Tags: ,

3 Responses to “[Android] how to include your app into list in dialog which is launched when you put device on cradle or dock”

  1. Giorgio says:

    This is an app developed with Flash CS 5.5?
    Where exactly do you put those intent filter parameters in ‘app-name.xml’ before publishing for Android in Flash?
    Is this line “” necesary for it to run in the dock?

    Thanks in advance for any help with this!

  2. Giorgio says:

    I’ve copied an pasted the line from your post with ‘category.LAUNCHER’ but it doesn’t show up in the post.

  3. Giorgio

    Thanks comments.
    This app is developed with Eclipse, not Flash CS 5.5 or Flash Builder.
    It is native app.

    In native app development with Eclipse, we use AndroidManifest.xml to configure settings.
    Here is all strings.

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.mydeskdock"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk android:minSdkVersion="11" />
    
        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
            <activity
                android:label="@string/app_name"
                android:name=".DeskDockTestActivity" >
                <intent-filter >
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                    <category android:name="android.intent.category.DESK_DOCK" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </activity>
        </application>
    
    </manifest>
    

    But I can find some strings in {appname}-app.xml of Flash Builder Mobile project.
    I think you have to modify these strings.

    	<!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
    	<!--<android> 
    		<manifestAdditions>
    		<![CDATA[
    			<manifest android:installLocation="auto">
    				<uses-permission android:name="android.permission.INTERNET"/>
    				<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    				<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    				<uses-configuration android:reqFiveWayNav="true"/>
    				<supports-screens android:normalScreens="true"/>
    				<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
    				<application android:enabled="true">
    					<activity android:excludeFromRecents="false">
    						<intent-filter>
    							<action android:name="android.intent.action.MAIN"/>
    							<category android:name="android.intent.category.LAUNCHER"/>
    						</intent-filter>
    					</activity>
    				</application>
    			</manifest>
    		]]>
    		</manifestAdditions> 
    	</android> -->
    	<!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
    	<android>
            <manifestAdditions><![CDATA[
    			<manifest android:installLocation="auto">
    			    <!--See the Adobe AIR documentation for more information about setting Google Android permissions-->
    			    <!--Removing the permission android.permission.INTERNET will have the side effect
    					of preventing you from debugging your application on your device-->
    			    <uses-permission android:name="android.permission.INTERNET"/>
    			    <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
    			    <!--<uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
    			    <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>-->
    			    <!--The DISABLE_KEYGUARD and WAKE_LOCK permissions should be toggled together
    					in order to access AIR's SystemIdleMode APIs-->
    			    <!--<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>-->
    			    <!--<uses-permission android:name="android.permission.WAKE_LOCK"/>-->
    			    <!--<uses-permission android:name="android.permission.CAMERA"/>-->
    			    <!--<uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
    			    <!--The ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions should be toggled
    					together in order to use AIR's NetworkInfo APIs-->
    			    <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
    			    <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
    			</manifest>
    			
    		]]></manifestAdditions>
        </android>
    

    I think if you write down below code in {appname}-app.xml, it will work.
    But I am sorry for without testing it.
    Because the cradle is owned by my client’s. I returned it before.
    I can’t test it.

    	<android>
            <manifestAdditions><![CDATA[
    			<manifest android:installLocation="auto">
    			    <uses-permission android:name="android.permission.INTERNET"/>
    				<uses-configuration android:reqFiveWayNav="true"/>
    				<supports-screens android:normalScreens="true"/>
    				<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
    				<application android:enabled="true">
    					<activity android:excludeFromRecents="false">
    						<intent-filter>
    							<action android:name="android.intent.action.MAIN"/>
    							<category android:name="android.intent.category.LAUNCHER"/>
    							<category android:name="android.intent.category.DESK_DOCK" />
    			                <category android:name="android.intent.category.DEFAULT" />
    						</intent-filter>
    					</activity>
    				</application>
    			</manifest>
    		]]></manifestAdditions>
        </android>
    

    I hope it can work correctly.