From: Jaehong Jo Date: Wed, 10 Jun 2015 02:35:46 +0000 (+0900) Subject: Modify android sample app X-Git-Tag: 0.9.2-beta~148 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5453db4c0354909f07fdcf407003a8b3494f974a;p=contrib%2Fiotivity.git Modify android sample app Modify the address to be automatically entered for testing Change-Id: Ieaecd7e26571d1e767ef70318ec027d1c827c904 Signed-off-by: Jaehong Jo Reviewed-on: https://gerrit.iotivity.org/gerrit/1229 Tested-by: jenkins-iotivity Reviewed-by: Erich Keane --- diff --git a/resource/csdk/connectivity/samples/android/sample_service/res/values/strings.xml b/resource/csdk/connectivity/samples/android/sample_service/res/values/strings.xml index f75b6be..116cd8f 100644 --- a/resource/csdk/connectivity/samples/android/sample_service/res/values/strings.xml +++ b/resource/csdk/connectivity/samples/android/sample_service/res/values/strings.xml @@ -1,5 +1,6 @@ + CA Android Sample Find Send Response @@ -10,13 +11,17 @@ Request to All Response /a/light + coap:// + :6298 resourceUri/response Network Info Receive Received Message + "Remote Address: " Settings PayloadData PayloadData + \ No newline at end of file diff --git a/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/MainActivity.java b/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/MainActivity.java index 5cdef44..249acf9 100644 --- a/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/MainActivity.java +++ b/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/MainActivity.java @@ -778,5 +778,14 @@ public class MainActivity extends Activity { String callbackData = subject + receivedData; DLog.v(TAG, callbackData); + if (subject.equals(getString(R.string.remote_address))) { + StringBuilder sb = new StringBuilder(); + sb.append(getString(R.string.coap_prefix)).append(receivedData); + if (receivedData.contains(".")) { // IP + sb.append(getString(R.string.port_num)); + } + sb.append(getString(R.string.uri)); + mReqData_ed.setText(sb.toString()); + } } }