Android app unable to find Gear 2 peer agent

Android app unable to find Gear 2 peer agent

BY 24 Jun 2014 Web Application Development

Hi all, I am cross-posting this from Samsung Gear forums. My Gear 2 is registered with the Gear Manager on my Android device. When I open my Android app (called Prixapp), it successfully installs the widget (called PrixappGearWidget) on the Gear 2 side. However, it gives the following popup: “Prixapp is not installed on your mobile device. To use PrixappGearWidget on your Gear, download Prixapp to your mobile device. You will be taken to the download screen.” Confused as to why I’m getting this because the install has just completed on the Android side and the widget is newly showing up on the Gear. Furthermore, when I call findPeerAgents() from my Android app, it is returning  FINDPEER_DEVICE_NOT_CONNECTED. Not sure what problem would allow the two devices to read each other but then cause findPeerAgents() to fail. Everything looks right to me in my accessoryservices.xml on both sides: I’ve copied all xml below:

accessoryservices.xml – Android side

<resources>
    <application name="Prixapp" >
        <serviceProfile
            id="/system/Prixapp"
            name="Prixapp"
            role="provider"
            serviceImpl="prixapp.prixapp.medications.GearProviderService"
            version="1.0"
            serviceLimit="ANY"
        serviceTimeout="10">
            <supportedTransports>
                <transport type="TRANSPORT_BT" />
            </supportedTransports>
            <serviceChannel
                id="104"
                dataRate="low"
                priority="low"
                reliability= "enable"/>   
    </serviceProfile>
    </application>
</resources>

accessoryservices.xml – Tizen side

<resources>
    <application name="PrixappGearWidget" >
        <serviceProfile
            id="/system/Prixapp"
            name="Prixapp"
            role="consumer"
            version="2.0">
            <supportedTransports>
                <transport type="TRANSPORT_BT" />
            </supportedTransports>
            <serviceChannel
                id="104"
                dataRate="low"
                priority="low"
                reliability="enable" >
            </serviceChannel>
        </serviceProfile>
    </application>
</resources>

config.xml – Tizen side

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/PrixappGearWidget" version="1.0.0" viewmodes="maximized">
    <tizen:application id="VbsgE6bms2.PrixappGearWidget" package="VbsgE6bms2" required_version="1.0"/>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <icon src="icon.png"/>
    <tizen:metadata key="AccessoryServicesLocation" value="res/xml/accessoryservices.xml"/>
    <tizen:privilege name="http://developer.samsung.com/privilege/accessoryprotocol"/>
    <name>PrixappGearWidget</name>
</widget>

What could be causing the call to findPeerAgents() to fail? Any input greatly appreciated. Thanks

Written by