Languages

Menu
Sites
Language
Android app unable to find Gear 2 peer agent

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

Responses

1 Replies
flopo lopolus

is bluetooth on? what does your androidManifest look like?
in the FTsample app it kinda looks like:
 

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.samsung.accessory.FTSampleProvider"
    android:versionCode="1"
    android:versionName="1.0.9.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="17" />

    <uses-permission android:name="com.samsung.accessory.permission.ACCESSORY_FRAMEWORK" />
    <uses-permission android:name="com.samsung.wmanager.APP"/>
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name="com.samsung.accessory.FTSampleProvider.ui.FTSampleProviderActivity"
            android:label="FTSampleProvider"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service android:name="com.samsung.accessory.FTSampleProvider.backend.FTSampleProviderImpl" />

         <receiver android:name="com.samsung.android.sdk.accessory.RegisterUponInstallReceiver" >
            <intent-filter>
                <action android:name="android.accessory.device.action.REGISTER_AFTER_INSTALL" />
            </intent-filter>
        </receiver>
        <receiver android:name="com.samsung.android.sdk.accessory.ServiceConnectionIndicationBroadcastReceiver" >
            <intent-filter>
                <action android:name="android.accessory.service.action.ACCESSORY_SERVICE_CONNECTION_IND" />
            </intent-filter>
        </receiver>
    	
        <receiver android:name="com.samsung.android.sdk.accessoryfiletransfer.SAFileTransferIncomingRequestReceiver">
            <intent-filter>
                <action android:name="com.samsung.accessory.ftconnection" /> 
            </intent-filter>
        </receiver>

        <meta-data
            android:name="AccessoryServicesLocation"
            android:value="/res/xml/accessoryservices.xml" />
    </application>
</manifest>

you need a lot of this code in your xml if you are connecting and sending messages accross devices