Android Manifest

As part of creating your SmartWatch 2 app, you’ll need to update the Android Manifest with intent filters. How you update your Android Manifest also depends on the Smart Extension APIs that you plan to use.

How to update the Android Manifest

  1. Add the following permission:
    <uses-permission android:name = com.sonyericsson.extras.liveware.aef.EXTENSION_PERMISSION"/>
    
  2. Define the service for the app:
    <service android:name = ".SampleExtensionService"/>
    

    This service starts the app and runs during the lifetime of the app.

  3. Declare an app receiver:
    <receiver android:name = ".ExtensionReceiver”>
    

Inside this receiver, you must declare which intents to filter for. You will always need to include the “Generic app intents.” See below for a code snippet for generic app intents.  Other intents are specific to the type of app you are writing, so if you are writing an app that uses Control API, you should include both Generic and Control API intents, for example. Below are code snippets for these intents.

Generic app intents

<action android:name="com.sonyericsson.extras.liveware.aef.registration.EXTENSION_REGISTER_REQUEST"/>
<action android:name="com.sonyericsson.extras.liveware.aef.registration.ACCESSORY_CONNECTION"/>
<action android:name="android.intent.action.LOCALE_CHANGED"/>

Intents for Notification API

<action android:name="com.sonyericsson.extras.liveware.aef.notification.VIEW_EVENT_DETAIL"/>
<action android:name="com.sonyericsson.extras.liveware.aef.notification.REFRESH_REQUEST"/>

Intents for Control API

<action android:name="com.sonyericsson.extras.aef.control.START"/>
<action android:name="com.sonyericsson.extras.aef.control.STOP"/>
<action android:name="com.sonyericsson.extras.aef.control.PAUSE"/>
<action android:name="com.sonyericsson.extras.aef.control.RESUME"/>
<action android:name="com.sonyericsson.extras.aef.control.ERROR"/>
<action android:name="com.sonyericsson.extras.aef.control.KEY_EVENT"/>
<action android:name="com.sonyericsson.extras.aef.control.TOUCH_EVENT/">
<action android:name="com.sonyericsson.extras.aef.control.SWIPE_EVENT"/>
<action android:name="com.sonyericsson.extras.aef.control.OBJECT_CLICK_EVENT"/>
<action android:name="com.sonyericsson.extras.aef.control.MENU_ITEM_SELECTED"/>