언어 설정

Menu
Sites
Language
Autolaunch widget on install

I've created an application which communicates between tizen and android. My widget has to start after install, in order to do this you are able to use autoLaunchAppId in the sap service xml file. However when i try to do this it will not work, the widget doesn't even start. I watched the tutorial provided by tizen but it still doesn't work , below is my sapservice.xml on android and tizen side. 

Tizen side:

<resources>
    <application name="Guard">
        <serviceProfile 
            name="guard" 
            id="/system/guard" 
            role="consumer" 
            version="2.0" 
            serviceLimit="ANY" 
            serviceTimeout="10"
            autoLaunchAppId="J1maNaJcXd.Guard">
            <supportedTransports>
                <transport type="TRANSPORT_BT"/>
                <transport type="TRANSPORT_WIFI"/>
            </supportedTransports>
            <serviceChannel
                id="104"
                dataRate="high"
                priority="low"
                reliability="enable"/>
        </serviceProfile>
    </application>
</resources>

Also here is my application id in my config source file tizen side:

<tizen:application id="J1maNaJcXd.Guard" package="J1maNaJcXd" required_version="2.2"/>

Android side:

<resources>
    <application name="GuardSmartWatch">
        <serviceProfile 
            name="guard" 
            id="/system/guard" 
            role="provider" 
            serviceImpl="nl.tizin.guard.smartwatch.SAPServiceProvider" 
            version="2.0"
            autoLaunchAppId="J1maNaJcXd.Guard"
            serviceLimit="ONE_PEERAGENT" 
            serviceTimeout="30">
            <supportedTransports>
                <transport type="TRANSPORT_WIFI"/>
                <transport type="TRANSPORT_BT"/>
            </supportedTransports>
            <serviceChannel
                id="104"
                dataRate="high"
                priority="low"
                reliability="enable" />
        </serviceProfile>
    </application>
</resources>

I was wondering if somebody knows what i am doing wrong. Another question i have is if it's possible to autolaunch a WATCH_CLOCK and set it as GearFace after install.

답변 바로가기

Responses

3 댓글
Mark as answer
daniel kim

Hi,

According to the guideline document, you need to call this API from Android side to awake your widget in Gear side. 

                protected final void requestServiceConnection(SAPeerAgent peerAgent)

               Request a Service Connection with a remote Accessory Peer Agent. Your application will be notified the request result by the onServiceConnectionResponse(SAPeerAgent, SASocket, int) callback. Ensure the availability of the Accessory Peer Agent before calling this method. This method is typically called in the onFindPeerAgentResponse(SAPeerAgent, int) callback. You should NOT use previously cached SAPeerAgent instance, as it may be no longer available for making Service Connection with.
Parameters:peerAgent - The Accessory Peer Agent with which you request Service Connection.Throws:IllegalArgumentException - Thrown if peerAgent argument passed is null or invalid.Since:2.0.19

 

And please refer to below description about auto launch.

      autoLaunchAppId: The application ID that should be invoked by incoming service connection request. If a Peer Agent requests a service connection to this service profile while it is not running, the system launchs this application. Unless this value is specified, the system never launches this application even if the Peer Agent requests a service connection.

 

I wish this will help you.

Siebert Elhorst

This is indeed the answer, i have another question regarding autolaunch. Is it possible to autolaunch the widget as gear face?

daniel kim

As Clock widget can be shown by configuring Gear setting , I guess that it's not possible to launch it manually.

Regards,