Set Default Intents via MDZ

Version 1

    In android there are times when trying to play a video or open a map address, or any other action task,  android OS shows you the list of applications that you can use to open that intent (In general term , android asks you to choose an application you want to do that task with , like opening a video link with default video player or a downloaded video player app). When there are many such applications that can handle an intent , DEFAULT_INTENT_UPDATE action lets you to set one activity as the default one to handle that intent.


    The default intent handler for any intent can be set via MDZ by constructing an MDZ package that contains a default_intents.xml file for the DEFAULT_INTENT_UPDATE action.  A sample management folder structure that can be built into an MDZ for this purpose is attached to this document (AttractScreen_mgmt.zip).  You can find this attachment at the bottom of this document.  Use this sample as a reference for the structure of the directory that needs to be passed into the Management Package Builder tool as described on this page.

     

    In the example below , Home App (Main activity of the home app) is selected as default activity to handle the intent "concierge.intent.action.SHOW_ATTRACT_SCREEN".

    While creating a new default intents file , put the complete ComponentName of the desired app for the tag "activity name" , and the intent tag would be the intent that you would want to handle . Do not forget to include all the categories as listed on the Android Manifest file for that intent action.


    The contents of the sample default_intents.xml file is shown below.

     

    <?xml version="1.0" ?>

    <activities>

        <activity name="com.motorola.asds.isign.home/.Home" >

           <intent>

                <action name="concierge.intent.action.SHOW_ATTRACT_SCREEN" />

                <cat name="android.intent.category.DEFAULT" />

           </intent>

      </activity>

    </activities>