[IOT-1032][IOT-1033][IOT-1034] Fixed for an issue with android sample application.
authorcoderhyme <jhyo.kim@samsung.com>
Thu, 24 Mar 2016 08:51:22 +0000 (01:51 -0700)
committerJungHo Kim <jhyo.kim@samsung.com>
Fri, 25 Mar 2016 00:39:29 +0000 (00:39 +0000)
It seems discovered resource is not what it should be in sample client.
It happens because method finding resource is changed.

Change-Id: Ib820319658038f7969fbd503b374c9d1933adb09
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6265
Reviewed-by: Markus Jung <markus.jung85@gmail.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/resource-encapsulation/examples/android/RESampleClientApp/app/src/main/java/org/iotivity/service/sample/client/ResourceClientActivity.java

index 54a7d46..cb1c742 100644 (file)
@@ -63,6 +63,7 @@ public class ResourceClientActivity extends Activity
     private static final int MSG_ID_ATTRIBUTE_RECEIVED  = 1;
     private static final int MSG_ID_PRINT_LOG           = 2;
 
+    private static final String RESOURCE_TYPE = "oic.r.temperature.sensor";
     private static final String ATTR_KEY_TEMPERATURE = "Temperature";
 
     private TextView mLogView;
@@ -287,7 +288,7 @@ public class ResourceClientActivity extends Activity
         if (mDiscoveryTask == null) {
             try {
                 mDiscoveryTask = RcsDiscoveryManager.getInstance()
-                        .discoverResource(RcsAddress.multicast(),
+                        .discoverResourceByType(RcsAddress.multicast(), RESOURCE_TYPE,
                                 mOnResourceDiscoveredListener);
                 mDiscoveryBtn.setText(R.string.cancel_discovery);