Removing CA sample with NDK build
authorjnashok <jn.ashok@samsung.com>
Mon, 20 Jul 2015 05:23:52 +0000 (14:23 +0900)
committerErich Keane <erich.keane@intel.com>
Mon, 20 Jul 2015 17:34:36 +0000 (17:34 +0000)
CA sample that will build from gradle is submitted
This will build the APK directly using SCons and gradle
Hence removing earlier sample with NDK build

Change-Id: Icde256f08e7886ecfe1edcb434e7153aa69e0247
Signed-off-by: jnashok <jn.ashok@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1750
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
21 files changed:
resource/csdk/connectivity/samples/android/sample_service/AndroidManifest.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/jni/Android.mk [deleted file]
resource/csdk/connectivity/samples/android/sample_service/jni/Application.mk [deleted file]
resource/csdk/connectivity/samples/android/sample_service/jni/ResourceModel.c [deleted file]
resource/csdk/connectivity/samples/android/sample_service/jni/org_iotivity_ca_service_RMInterface.h [deleted file]
resource/csdk/connectivity/samples/android/sample_service/project.properties [deleted file]
resource/csdk/connectivity/samples/android/sample_service/res/layout/activity_main.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/res/menu/main.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/res/values-v11/styles.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/res/values-v14/styles.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/res/values-w820dp/dimens.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/res/values/dimens.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/res/values/strings.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/res/values/styles.xml [deleted file]
resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaEdrInterface.java [deleted file]
resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaIpInterface.java [deleted file]
resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaLeClientInterface.java [deleted file]
resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaLeServerInterface.java [deleted file]
resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/DLog.java [deleted file]
resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/MainActivity.java [deleted file]
resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/RMInterface.java [deleted file]

diff --git a/resource/csdk/connectivity/samples/android/sample_service/AndroidManifest.xml b/resource/csdk/connectivity/samples/android/sample_service/AndroidManifest.xml
deleted file mode 100644 (file)
index 4ffc3e2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="org.iotivity.ca.sample_service"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk
-        android:minSdkVersion="19"
-        android:targetSdkVersion="21" />
-
-    <application
-        android:allowBackup="true"
-        android:label="@string/app_name"
-        android:theme="@style/AppTheme" >
-        <activity
-            android:name="org.iotivity.ca.service.MainActivity"
-            android:label="@string/app_name"
-            android:windowSoftInputMode="stateHidden" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-    <uses-permission android:name="android.permission.BLUETOOTH" />
-    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
-    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
-
-</manifest>
-
diff --git a/resource/csdk/connectivity/samples/android/sample_service/jni/Android.mk b/resource/csdk/connectivity/samples/android/sample_service/jni/Android.mk
deleted file mode 100644 (file)
index 6d51eff..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-APP_PATH := $(call my-dir)
-#specify project root path here wrt make file directory
-PROJECT_ROOT_PATH      = ../../..
-
-include $(CLEAR_VARS)
-LOCAL_PATH := $(APP_PATH)
-LOCAL_MODULE := RMInterface
-LOCAL_SRC_FILES := ResourceModel.c
-LOCAL_CFLAGS = -D__WITH_DTLS__
-LOCAL_C_INCLUDES = $(PROJECT_ROOT_PATH)/api $(PROJECT_ROOT_PATH)/external/inc
-LOCAL_STATIC_LIBRARIES := CA
-LOCAL_LDLIBS := -llog
-include $(BUILD_SHARED_LIBRARY)
-
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#Build CACommon CACoap CA
-include $(CLEAR_VARS)
-PROJECT_ROOT_PATH                      = ../../..
-CA_LIB_PATH                            = $(PROJECT_ROOT_PATH)/build/android
-include $(CA_LIB_PATH)/jni/Android.mk
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
diff --git a/resource/csdk/connectivity/samples/android/sample_service/jni/Application.mk b/resource/csdk/connectivity/samples/android/sample_service/jni/Application.mk
deleted file mode 100644 (file)
index a0e5d81..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-APP_STL := gnustl_shared
-
-APP_PLATFORM = android-21
-APP_CPPFLAGS += -fexceptions
-APP_CPPFLAGS += -frtti
-APP_CFLAGS = -Wno-error=format-security
diff --git a/resource/csdk/connectivity/samples/android/sample_service/jni/ResourceModel.c b/resource/csdk/connectivity/samples/android/sample_service/jni/ResourceModel.c
deleted file mode 100644 (file)
index 21ba6b9..0000000
+++ /dev/null
@@ -1,1410 +0,0 @@
-#include <jni.h>
-#include <android/log.h>
-#include <stdio.h>
-#include <dlfcn.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "cainterface.h"
-#include "cacommon.h"
-
-#include "org_iotivity_ca_service_RMInterface.h"
-
-#define  LOG_TAG   "JNI_INTERFACE_SAMPLE"
-#define  LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
-#define  LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
-
-/**
- * @def RS_IDENTITY
- * @brief
- */
-#define IDENTITY     ("1111111111111111")
-/* @def RS_CLIENT_PSK
- * @brief
- */
-#define RS_CLIENT_PSK   ("AAAAAAAAAAAAAAAA")
-
-#define PORT_LENGTH 5
-#define SECURE_DEFAULT_PORT 5684
-#define RESOURCE_URI_LENGTH 14
-#define OPTION_INFO_LENGTH 1024
-#define NETWORK_INFO_LENGTH 1024
-
-typedef struct
-{
-    char ipAddress[CA_IPADDR_SIZE];
-    uint16_t port;
-} addressSet_t;
-
-void request_handler(const CAEndpoint_t* object, const CARequestInfo_t* requestInfo);
-void response_handler(const CAEndpoint_t* object, const CAResponseInfo_t* responseInfo);
-void error_handler(const CAEndpoint_t *object, const CAErrorInfo_t* errorInfo);
-void get_resource_uri(const char *URI, char *resourceURI, uint32_t length);
-uint32_t get_secure_information(CAPayload_t payLoad);
-CAResult_t get_network_type(uint32_t selectedNetwork);
-void callback(char *subject, char *receivedData);
-CAResult_t get_remote_address(CATransportAdapter_t transportType, const char *address);
-void parsing_coap_uri(const char* uri, addressSet_t* address, CATransportFlags_t *flags);
-
-uint16_t g_localSecurePort = SECURE_DEFAULT_PORT;
-CATransportAdapter_t g_selectedNwType = CA_ADAPTER_IP;
-static CAToken_t g_lastRequestToken = NULL;
-static uint8_t g_lastRequestTokenLength = 0;
-
-static const char COAP_PREFIX[] =  "coap://";
-static const char COAPS_PREFIX[] = "coaps://";
-static const uint16_t COAP_PREFIX_LEN = sizeof(COAP_PREFIX) - 1;
-static const uint16_t COAPS_PREFIX_LEN = sizeof(COAPS_PREFIX) - 1;
-
-static const char SECURE_INFO_DATA[]
-                                   = "{\"oc\":[{\"href\":\"%s\",\"prop\":{\"rt\":[\"core.led\"],"
-                                     "\"if\":[\"oic.if.baseline\"],\"obs\":1,\"sec\":1,\"port\":"
-                                     "%d}}]}";
-static const char NORMAL_INFO_DATA[]
-                                   = "{\"oc\":[{\"href\":\"%s\",\"prop\":{\"rt\":[\"core.led\"],"
-                                     "\"if\":[\"oic.if.baseline\"],\"obs\":1}}]}";
-
-static jobject g_responseListenerObject = NULL;
-static JavaVM *g_jvm;
-
-static CAEndpoint_t *g_clientEndpoint = NULL;
-static char *g_resourceUri = NULL;
-static CAToken_t g_clientToken = NULL;
-static uint8_t g_clientTokenLength = 0;
-
-static uint16_t g_clientMsgId = 0;
-static char *g_remoteAddress = NULL;
-
-// init
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_setNativeResponseListener(JNIEnv *env, jobject obj,
-                                                                   jobject listener)
-{
-    LOGI("setNativeResponseListener");
-    g_responseListenerObject = (*env)->NewGlobalRef(env, obj);
-}
-
-#ifdef __WITH_DTLS__
-static CADtlsPskCredsBlob_t *pskCredsBlob = NULL;
-
-void clearDtlsCredentialInfo()
-{
-    LOGI("clearDtlsCredentialInfo IN");
-    if (pskCredsBlob)
-    {
-        // Initialize sensitive data to zeroes before freeing.
-        if (NULL != pskCredsBlob->creds)
-        {
-            memset(pskCredsBlob->creds, 0, sizeof(OCDtlsPskCreds)*(pskCredsBlob->num));
-            free(pskCredsBlob->creds);
-        }
-
-        memset(pskCredsBlob, 0, sizeof(CADtlsPskCredsBlob_t));
-        free(pskCredsBlob);
-        pskCredsBlob = NULL;
-    }
-    LOGI("clearDtlsCredentialInfo OUT");
-}
-
-// Internal API. Invoked by OC stack to retrieve credentials from this module
-void CAGetDtlsPskCredentials(CADtlsPskCredsBlob_t **credInfo)
-{
-    LOGI("CAGetDtlsPskCredentials IN");
-    *credInfo = (CADtlsPskCredsBlob_t *) malloc(sizeof(CADtlsPskCredsBlob_t));
-    if (NULL == *credInfo)
-    {
-        LOGE("Failed to allocate credential blob.");
-        return;
-    }
-
-    int16_t credLen = sizeof(OCDtlsPskCreds) * (pskCredsBlob->num);
-    (*credInfo)->creds = (OCDtlsPskCreds *) malloc(credLen);
-    if (NULL == (*credInfo)->creds)
-    {
-        LOGE("Failed to allocate crentials.");
-        free(*credInfo);
-        *credInfo = NULL;
-        return;
-    }
-
-    memcpy((*credInfo)->identity, pskCredsBlob->identity, DTLS_PSK_ID_LEN);
-    (*credInfo)->num = pskCredsBlob->num;
-    memcpy((*credInfo)->creds, pskCredsBlob->creds, credLen);
-
-    LOGI("CAGetDtlsPskCredentials OUT");
-}
-
-CAResult_t SetCredentials()
-{
-    LOGI("SetCredentials IN");
-    pskCredsBlob = (CADtlsPskCredsBlob_t *)malloc(sizeof(CADtlsPskCredsBlob_t));
-    if (NULL == pskCredsBlob)
-    {
-        LOGE("Memory allocation failed!");
-        return CA_MEMORY_ALLOC_FAILED;
-    }
-    memcpy(pskCredsBlob->identity, IDENTITY, DTLS_PSK_ID_LEN);
-
-    pskCredsBlob->num = 1;
-
-    pskCredsBlob->creds = (OCDtlsPskCreds *)malloc(sizeof(OCDtlsPskCreds) *(pskCredsBlob->num));
-    if (NULL == pskCredsBlob->creds)
-    {
-        LOGE("Memory allocation failed!");
-        return CA_MEMORY_ALLOC_FAILED;
-    }
-    memcpy(pskCredsBlob->creds[0].id, IDENTITY, DTLS_PSK_ID_LEN);
-    memcpy(pskCredsBlob->creds[0].psk, RS_CLIENT_PSK, DTLS_PSK_PSK_LEN);
-
-    LOGI("SetCredentials OUT");
-    return CA_STATUS_OK;
-}
-#endif
-
-JNIEXPORT jint JNI_OnLoad(JavaVM *jvm, void *reserved)
-{
-    LOGI("JNI_OnLoad");
-
-    JNIEnv* env;
-    if (JNI_OK != (*jvm)->GetEnv(jvm, (void**) &env, JNI_VERSION_1_6))
-    {
-        return -1;
-    }
-    g_jvm = jvm; /* cache the JavaVM pointer */
-
-    CANativeJNISetJavaVM(g_jvm);
-
-    return JNI_VERSION_1_6;
-}
-
-void JNI_OnUnload(JavaVM *jvm, void *reserved)
-{
-    LOGI("JNI_OnUnload");
-
-    JNIEnv* env;
-    if (JNI_OK != (*jvm)->GetEnv(jvm, (void**) &env, JNI_VERSION_1_6))
-    {
-        return;
-    }
-    g_jvm = 0;
-    return;
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMInitialize(JNIEnv *env, jobject obj, jobject context)
-{
-    LOGI("RMInitialize");
-
-    //Currently set context for Android Platform
-    CANativeJNISetContext(env, context);
-
-    CAResult_t res = CAInitialize();
-
-    if (CA_STATUS_OK != res)
-    {
-        LOGE("Could not Initialize");
-    }
-
-#ifdef __WITH_DTLS__
-    if (CA_STATUS_OK != SetCredentials())
-    {
-        LOGE("SetCredentials failed");
-        return;
-    }
-
-    res = CARegisterDTLSCredentialsHandler(CAGetDtlsPskCredentials);
-    if(CA_STATUS_OK != res)
-    {
-        LOGE("Set credential handler fail");
-        return;
-    }
-#endif
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMTerminate(JNIEnv *env, jobject obj)
-{
-    LOGI("RMTerminate");
-    CADestroyToken(g_lastRequestToken);
-    CATerminate();
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMStartListeningServer(JNIEnv *env, jobject obj)
-{
-    LOGI("RMStartListeningServer");
-
-    if (CA_STATUS_OK != CAStartListeningServer())
-    {
-        LOGE("Could not start Listening server");
-    }
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMStartDiscoveryServer(JNIEnv *env, jobject obj)
-{
-    LOGI("RMStartDiscoveryServer");
-
-    if (CA_STATUS_OK != CAStartDiscoveryServer())
-    {
-        LOGE("Could not start discovery server");
-    }
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMRegisterHandler(JNIEnv *env, jobject obj)
-{
-    LOGI("RMRegisterHandler");
-
-    CARegisterHandler(request_handler, response_handler, error_handler);
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMSendRequest(JNIEnv *env, jobject obj, jstring uri,
-                                                       jstring payload, jint selectedNetwork,
-                                                       jint isSecured, jint msgType)
-{
-    LOGI("selectedNetwork - %d", selectedNetwork);
-    CAResult_t res = get_network_type(selectedNetwork);
-    if (CA_STATUS_OK != res)
-    {
-        return;
-    }
-
-    const char* strUri = (*env)->GetStringUTFChars(env, uri, NULL);
-    LOGI("RMSendRequest - %s", strUri);
-
-    CATransportFlags_t flags;
-    addressSet_t address = {};
-    parsing_coap_uri(strUri, &address, &flags);
-
-    //create remote endpoint
-    CAEndpoint_t* endpoint = NULL;
-    res = CACreateEndpoint(flags, g_selectedNwType, (const char*)address.ipAddress,
-                           address.port, &endpoint);
-    if (CA_STATUS_OK != res)
-    {
-        LOGE("Could not create remote end point");
-        (*env)->ReleaseStringUTFChars(env, uri, strUri);
-        return;
-    }
-
-    CAMessageType_t messageType = msgType;
-
-    // create token
-    CAToken_t token = NULL;
-    uint8_t tokenLength = CA_MAX_TOKEN_LEN;
-
-    res = CAGenerateToken(&token, tokenLength);
-    if ((CA_STATUS_OK != res) || (!token))
-    {
-        LOGE("token generate error!!");
-        // destroy remote endpoint
-        CADestroyEndpoint(endpoint);
-        (*env)->ReleaseStringUTFChars(env, uri, strUri);
-        return;
-    }
-
-    char resourceURI[RESOURCE_URI_LENGTH + 1] = { 0 };
-
-    get_resource_uri((const CAURI_t) strUri, resourceURI, RESOURCE_URI_LENGTH);
-    (*env)->ReleaseStringUTFChars(env, uri, strUri);
-
-    CAInfo_t requestData = { 0 };
-    requestData.token = token;
-    requestData.tokenLength = tokenLength;
-
-    if (1 == isSecured)
-    {
-        uint32_t length = sizeof(SECURE_INFO_DATA) + strlen(resourceURI);
-        requestData.payload = (CAPayload_t) malloc(length);
-        if (NULL == requestData.payload)
-        {
-            LOGE("Memory allocation failed!");
-            // destroy token
-            CADestroyToken(token);
-            // destroy remote endpoint
-            CADestroyEndpoint(endpoint);
-            return;
-        }
-        snprintf(requestData.payload, length, SECURE_INFO_DATA, resourceURI, g_localSecurePort);
-        requestData.payloadSize = length;
-    }
-    else
-    {
-        uint32_t length = sizeof(NORMAL_INFO_DATA) + strlen(resourceURI);
-        requestData.payload = (CAPayload_t) malloc(length);
-        if (NULL == requestData.payload)
-        {
-            LOGE("Memory allocation failed!");
-            // destroy token
-            CADestroyToken(token);
-            // destroy remote endpoint
-            CADestroyEndpoint(endpoint);
-            return;
-        }
-        snprintf(requestData.payload, length, NORMAL_INFO_DATA, resourceURI);
-        requestData.payloadSize = length;
-    }
-
-    requestData.type = messageType;
-    requestData.resourceUri = (CAURI_t) malloc(sizeof(resourceURI));
-    if (NULL == requestData.resourceUri)
-    {
-        LOGE("Memory allocation failed!");
-        // destroy token
-        CADestroyToken(token);
-        // destroy remote endpoint
-        CADestroyEndpoint(endpoint);
-        free(requestData.payload);
-        return;
-    }
-    memcpy(requestData.resourceUri, resourceURI, sizeof(resourceURI));
-
-    CARequestInfo_t requestInfo = { 0 };
-    requestInfo.method = CA_GET;
-    requestInfo.isMulticast = false;
-    requestInfo.info = requestData;
-
-    // send request
-    if (CA_STATUS_OK != CASendRequest(endpoint, &requestInfo))
-    {
-        LOGE("Could not send request");
-    }
-
-    // destroy token
-    CADestroyToken(token);
-
-    // destroy remote endpoint
-    CADestroyEndpoint(endpoint);
-
-    free(requestData.payload);
-    free(requestData.resourceUri);
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMSendReqestToAll(JNIEnv *env, jobject obj, jstring uri,
-                                                           jint selectedNetwork)
-{
-    LOGI("selectedNetwork - %d", selectedNetwork);
-    CAResult_t res = get_network_type(selectedNetwork);
-    if (CA_STATUS_OK != res)
-    {
-        return;
-    }
-
-    // create remote endpoint
-    CAEndpoint_t *endpoint = NULL;
-    res = CACreateEndpoint(CA_DEFAULT_FLAGS, g_selectedNwType, NULL, 0, &endpoint);
-
-    if (CA_STATUS_OK != res)
-    {
-        LOGE("create remote endpoint error, error code: %d", res);
-        return;
-    }
-
-    // create token
-    CAToken_t token = NULL;
-    uint8_t tokenLength = CA_MAX_TOKEN_LEN;
-
-    res = CAGenerateToken(&token, tokenLength);
-    if ((CA_STATUS_OK != res) || (!token))
-    {
-        LOGE("token generate error!!");
-        // destroy remote endpoint
-        CADestroyEndpoint(endpoint);
-        return;
-    }
-
-    LOGI("generated token %s", token);
-
-    CAInfo_t requestData = { 0 };
-    requestData.token = token;
-    requestData.tokenLength = tokenLength;
-    requestData.payload = (CAPayload_t) "TempJsonPayload";
-    requestData.payloadSize = strlen((const char *) requestData.payload);
-    requestData.type = CA_MSG_NONCONFIRM;
-
-    const char* strUri = (*env)->GetStringUTFChars(env, uri, NULL);
-    LOGI("resourceUri - %s", strUri);
-    requestData.resourceUri = (CAURI_t)strUri;
-
-    uint8_t optionNum = 2;
-    CAHeaderOption_t *headerOpt = (CAHeaderOption_t*) calloc(1,
-                                                             sizeof(CAHeaderOption_t) * optionNum);
-    if (NULL == headerOpt)
-    {
-        LOGE("Memory allocation failed");
-        // destroy remote endpoint
-        CADestroyEndpoint(endpoint);
-        return;
-    }
-
-    char* FirstOptionData = "Hello";
-    headerOpt[0].optionID = 3000;
-    memcpy(headerOpt[0].optionData, FirstOptionData, strlen(FirstOptionData));
-    headerOpt[0].optionLength = (uint16_t) strlen(FirstOptionData);
-
-    char* SecondOptionData2 = "World";
-    headerOpt[1].optionID = 3001;
-    memcpy(headerOpt[1].optionData, SecondOptionData2, strlen(SecondOptionData2));
-    headerOpt[1].optionLength = (uint16_t) strlen(SecondOptionData2);
-
-    requestData.numOptions = optionNum;
-    requestData.options = headerOpt;
-
-    CARequestInfo_t requestInfo = { 0 };
-    requestInfo.method = CA_GET;
-    requestInfo.isMulticast = true;
-    requestInfo.info = requestData;
-
-    // send request to all
-    res = CASendRequest(endpoint, &requestInfo);
-    if (CA_STATUS_OK != res)
-    {
-        LOGE("Could not send request to all");
-        //destroy token
-        CADestroyToken(token);
-    }
-    else
-    {
-        CADestroyToken(g_lastRequestToken);
-        g_lastRequestToken = token;
-        g_lastRequestTokenLength = tokenLength;
-    }
-
-    //ReleaseStringUTFChars for strUri
-    (*env)->ReleaseStringUTFChars(env, uri, strUri);
-
-    free(headerOpt);
-
-    // destroy remote endpoint
-    CADestroyEndpoint(endpoint);
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMSendResponse(JNIEnv *env, jobject obj,
-                                                        jint selectedNetwork,
-                                                        jint isSecured, jint msgType,
-                                                        jint responseValue)
-{
-    LOGI("RMSendResponse");
-
-    LOGI("selectedNetwork - %d", selectedNetwork);
-
-    CAResult_t res = get_network_type(selectedNetwork);
-    if (CA_STATUS_OK != res)
-    {
-        LOGE("Not supported network type");
-        return;
-    }
-
-    if (NULL == g_clientEndpoint)
-    {
-        LOGE("No Request received");
-        return;
-    }
-
-    CAMessageType_t messageType = msgType;
-
-    CAInfo_t responseData = { 0 };
-    responseData.type = messageType;
-    responseData.messageId = g_clientMsgId;
-    responseData.resourceUri = (CAURI_t)g_resourceUri;
-
-    CAResponseInfo_t responseInfo = { 0 };
-
-    if (msgType != CA_MSG_RESET)
-    {
-        responseData.token = g_clientToken;
-        responseData.tokenLength = g_clientTokenLength;
-        responseInfo.result = responseValue;
-
-        if (1 == isSecured)
-        {
-            uint32_t length = strlen(SECURE_INFO_DATA) + strlen(g_resourceUri) + 1;
-            responseData.payload = (CAPayload_t) malloc(length);
-            sprintf(responseData.payload, SECURE_INFO_DATA, g_resourceUri,
-                    g_localSecurePort);
-            responseData.payloadSize = length;
-        }
-        else
-        {
-            uint32_t length = strlen(NORMAL_INFO_DATA) + strlen(g_resourceUri) + 1;
-            responseData.payload = (CAPayload_t) malloc(length);
-            sprintf(responseData.payload, NORMAL_INFO_DATA, g_resourceUri);
-            responseData.payloadSize = length;
-        }
-    }
-    //msgType is RESET
-    else
-    {
-        responseInfo.result = CA_EMPTY;
-    }
-
-    responseInfo.info = responseData;
-
-    // send response
-    res = CASendResponse(g_clientEndpoint, &responseInfo);
-    if (CA_STATUS_OK != res)
-    {
-        LOGE("Could not send response");
-    }
-
-    // destroy token
-    CADestroyToken(g_clientToken);
-    g_clientToken = NULL;
-    g_clientTokenLength = 0;
-
-    // destroy remote endpoint
-    CADestroyEndpoint(g_clientEndpoint);
-    g_clientEndpoint = NULL;
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMSendNotification(JNIEnv *env, jobject obj, jstring uri,
-                                                            jstring payload, jint selectedNetwork,
-                                                            jint isSecured, jint msgType,
-                                                            jint responseValue)
-{
-    LOGI("selectedNetwork - %d", selectedNetwork);
-
-    CAResult_t res = get_network_type(selectedNetwork);
-    if (CA_STATUS_OK != res)
-    {
-        LOGE("Not supported network type");
-        return;
-    }
-
-    const char* strUri = (*env)->GetStringUTFChars(env, uri, NULL);
-    LOGI("RMSendNotification - %s", strUri);
-
-    CATransportFlags_t flags;
-    addressSet_t address = {};
-    parsing_coap_uri(strUri, &address, &flags);
-
-    //create remote endpoint
-    CAEndpoint_t* endpoint = NULL;
-    if (CA_STATUS_OK != CACreateEndpoint(flags, g_selectedNwType,
-                                         (const char*)address.ipAddress,
-                                         address.port, &endpoint))
-    {
-        //ReleaseStringUTFChars for strUri
-        (*env)->ReleaseStringUTFChars(env, uri, strUri);
-        LOGE("Could not create remote end point");
-        return;
-    }
-
-    char resourceURI[RESOURCE_URI_LENGTH + 1] = { 0 };
-    get_resource_uri(strUri, resourceURI, RESOURCE_URI_LENGTH);
-
-    //ReleaseStringUTFChars for strUri
-    (*env)->ReleaseStringUTFChars(env, uri, strUri);
-
-    CAMessageType_t messageType = msgType;
-
-    // create token
-    CAToken_t token = NULL;
-    uint8_t tokenLength = CA_MAX_TOKEN_LEN;
-
-    res = CAGenerateToken(&token, tokenLength);
-    if ((CA_STATUS_OK != res) || (!token))
-    {
-        LOGE("token generate error!");
-        CADestroyEndpoint(endpoint);
-        return;
-    }
-
-    CAInfo_t responseData = { 0 };
-    responseData.token = token;
-    responseData.tokenLength = tokenLength;
-    responseData.resourceUri = (CAURI_t) malloc(sizeof(resourceURI));
-    if (NULL == responseData.resourceUri)
-    {
-        LOGE("Memory allocation failed!");
-        // destroy token
-        CADestroyToken(token);
-        // destroy remote endpoint
-        CADestroyEndpoint(endpoint);
-        return;
-    }
-    memcpy(responseData.resourceUri, resourceURI, sizeof(resourceURI));
-
-    if (1 == isSecured)
-    {
-        uint32_t length = sizeof(SECURE_INFO_DATA) + strlen(resourceURI);
-        responseData.payload = (CAPayload_t) malloc(length);
-        if (NULL == responseData.payload)
-        {
-            LOGE("Memory allocation failed!");
-            // destroy token
-            CADestroyToken(token);
-            // destroy remote endpoint
-            CADestroyEndpoint(endpoint);
-
-            free(responseData.resourceUri);
-            return;
-        }
-        snprintf(responseData.payload, length, SECURE_INFO_DATA, resourceURI, g_localSecurePort);
-    }
-    else
-    {
-        uint32_t length = sizeof(NORMAL_INFO_DATA) + strlen(resourceURI);
-        responseData.payload = (CAPayload_t) malloc(length);
-        if (NULL == responseData.payload)
-        {
-            LOGE("Memory allocation failed!");
-            // destroy token
-            CADestroyToken(token);
-            // destroy remote endpoint
-            CADestroyEndpoint(endpoint);
-
-            free(responseData.resourceUri);
-            return;
-        }
-        snprintf(responseData.payload, length, NORMAL_INFO_DATA, resourceURI);
-    }
-
-    responseData.type = messageType;
-
-    CAResponseInfo_t responseInfo = { 0 };
-    responseInfo.result = responseValue;
-    responseInfo.info = responseData;
-
-    // send notification
-    if (CA_STATUS_OK != CASendNotification(endpoint, &responseInfo))
-    {
-        LOGE("Could not send notification");
-    }
-
-    LOGI("Send Notification");
-
-    // destroy token
-    CADestroyToken(token);
-
-    // destroy remote endpoint
-    CADestroyEndpoint(endpoint);
-
-    free(responseData.payload);
-    free(responseData.resourceUri);
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMSelectNetwork(JNIEnv *env, jobject obj,
-                                                         jint networkType)
-{
-    LOGI("RMSelectNetwork Type : %d", networkType);
-
-    if (CA_STATUS_OK != CASelectNetwork(networkType))
-    {
-        LOGE("Could not select network");
-    }
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMUnSelectNetwork(JNIEnv *env, jobject obj,
-                                                           jint networkType)
-{
-    LOGI("RMUnSelectNetwork Type : %d", networkType);
-
-    if (CA_STATUS_OK != CAUnSelectNetwork(networkType))
-    {
-        LOGE("Could not unselect network");
-    }
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMGetNetworkInfomation(JNIEnv *env, jobject obj)
-{
-    LOGI("RMGetNetworkInfomation");
-
-    CAEndpoint_t *tempInfo = NULL;
-    uint32_t tempSize = 0;
-
-    CAResult_t res = CAGetNetworkInformation(&tempInfo, &tempSize);
-    if (CA_STATUS_OK != res)
-    {
-        LOGE("Could not start get network information");
-        free(tempInfo);
-        return;
-    }
-
-    LOGI("################## Network Information #######################");
-    callback("######## Network Information", "#######");
-    LOGI("Network info total size is %d", tempSize);
-
-    uint32_t index;
-    for (index = 0; index < tempSize; index++)
-    {
-        res = get_remote_address(tempInfo[index].adapter, tempInfo[index].addr);
-        if (CA_STATUS_OK != res)
-        {
-            free(tempInfo);
-            return;
-        }
-        if (NULL != g_responseListenerObject)
-        {
-            char networkInfo[NETWORK_INFO_LENGTH];
-            LOGI("Type: %d", tempInfo[index].adapter);
-            sprintf(networkInfo, "%d",tempInfo[index].adapter);
-            callback("Type :", networkInfo);
-            if (CA_ADAPTER_IP == tempInfo[index].adapter)
-            {
-                LOGI("Port: %d", tempInfo[index].port);
-                sprintf(networkInfo, "%d",tempInfo[index].port);
-                callback("Port: ", networkInfo);
-            }
-            LOGI("Secured: %d", (tempInfo[index].flags & CA_SECURE));
-            LOGI("Address: %s", g_remoteAddress);
-            callback("Address: ", g_remoteAddress);
-            free(g_remoteAddress);
-        }
-        if (tempInfo[index].flags & CA_SECURE)
-        {
-            g_localSecurePort = tempInfo[index].port;
-        }
-    }
-
-    // free
-    free(tempInfo);
-
-    LOGI("##############################################################");
-}
-
-JNIEXPORT void JNICALL
-Java_org_iotivity_ca_service_RMInterface_RMHandleRequestResponse(JNIEnv *env, jobject obj)
-{
-    LOGI("RMHandleRequestResponse");
-
-    if (CA_STATUS_OK != CAHandleRequestResponse())
-    {
-        LOGE("Could not handle request and response");
-    }
-}
-
-void request_handler(const CAEndpoint_t* object, const CARequestInfo_t* requestInfo)
-{
-
-    if (!object)
-    {
-        LOGE("Remote endpoint is NULL!");
-        return;
-    }
-
-    if (!requestInfo)
-    {
-        LOGE("Request info is NULL!");
-        return;
-    }
-
-    if ((NULL != g_lastRequestToken) && (NULL != requestInfo->info.token) &&
-            (strncmp(g_lastRequestToken, requestInfo->info.token,
-                     requestInfo->info.tokenLength) == 0))
-    {
-        LOGI("token is same. received request of it's own. skip.. ");
-        return;
-    }
-
-    CAResult_t res = get_remote_address(object->adapter, object->addr);
-    if (CA_STATUS_OK != res)
-    {
-        return;
-    }
-
-    LOGI("##########received request from remote device #############");
-    LOGI("Remote Address: %s", g_remoteAddress);
-    LOGI("Uri: %s", requestInfo->info.resourceUri);
-    LOGI("Data: %s", requestInfo->info.payload);
-    LOGI("Token: %s", requestInfo->info.token);
-    LOGI("Code: %d", requestInfo->method);
-    LOGI("MessageType: %d", requestInfo->info.type);
-
-    if (NULL != g_responseListenerObject)
-    {
-        callback("received request from remote device", "#######");
-        char *cloneUri = NULL;
-        uint32_t len = 0;
-
-        if (NULL != requestInfo->info.resourceUri)
-        {
-            len = strlen(requestInfo->info.resourceUri);
-            cloneUri = (char *)malloc(sizeof(char) * (len + 1));
-
-            if (NULL == cloneUri)
-            {
-                LOGE("cloneUri Out of memory");
-                free(g_remoteAddress);
-                return;
-            }
-
-            memcpy(cloneUri, requestInfo->info.resourceUri, len + 1);
-            callback("Uri: ", cloneUri);
-        }
-
-        len = strlen(g_remoteAddress);
-        char *cloneRemoteAddress = (char *) malloc(sizeof(char) * (len + 1));
-
-        if (NULL == cloneRemoteAddress)
-        {
-            LOGE("cloneRemoteAddress Out of memory");
-            free(g_remoteAddress);
-            free(cloneUri);
-            return;
-        }
-
-        memcpy(cloneRemoteAddress, g_remoteAddress, len + 1);
-
-        callback("Remote Address: ", cloneRemoteAddress);
-        free(cloneRemoteAddress);
-        free(g_remoteAddress);
-
-        //clone g_clientEndpoint
-        g_clientEndpoint = (CAEndpoint_t *) malloc(sizeof(CAEndpoint_t));
-        if (NULL == g_clientEndpoint)
-        {
-            LOGE("g_clientEndpoint Out of memory");
-            free(cloneUri);
-            return;
-        }
-        memcpy(g_clientEndpoint, object, sizeof(CAEndpoint_t));
-
-        if (NULL != cloneUri)
-        {
-            len = strlen(cloneUri);
-            g_resourceUri = (char *) malloc(sizeof(char) * (len + 1));
-            if (NULL == g_resourceUri)
-            {
-                LOGE("g_clientEndpoint->resourceUri Out of memory");
-                free(g_clientEndpoint);
-                free(cloneUri);
-                return;
-            }
-            memcpy(g_resourceUri, cloneUri, len + 1);
-            free(cloneUri);
-        }
-        //clone g_clientToken
-        len = requestInfo->info.tokenLength;
-
-        g_clientToken = (char *) malloc(sizeof(char) * len);
-        if (NULL == g_clientToken)
-        {
-            LOGE("g_clientToken Out of memory");
-            free(g_clientEndpoint);
-            return;
-        }
-
-        if (NULL != requestInfo->info.token)
-        {
-            memcpy(g_clientToken, requestInfo->info.token, len);
-            g_clientTokenLength = len;
-
-        }
-
-        //clone g_clientMsgId
-        g_clientMsgId = requestInfo->info.messageId;
-
-        if (NULL != requestInfo->info.payload)
-        {
-            len = strlen(requestInfo->info.payload);
-            char *clonePayload = (char *) malloc(sizeof(char) * (len + 1));
-
-            if (NULL == clonePayload)
-            {
-                LOGE("clonePayload Out of memory");
-                free(g_clientEndpoint);
-                return;
-            }
-
-            memcpy(clonePayload, requestInfo->info.payload, len + 1);
-
-            callback("Data: ", clonePayload);
-            free(clonePayload);
-        }
-    }
-
-    if (requestInfo->info.options)
-    {
-        uint32_t len = requestInfo->info.numOptions;
-        uint32_t i;
-
-        LOGI("Option count: %d", requestInfo->info.numOptions);
-
-        for (i = 0; i < len; i++)
-        {
-            LOGI("Option %d", i + 1);
-            LOGI("ID : %d", requestInfo->info.options[i].optionID);
-            LOGI("Data[%d]: %s", requestInfo->info.options[i].optionLength,
-                 requestInfo->info.options[i].optionData);
-
-            if (NULL != g_responseListenerObject)
-            {
-                char optionInfo[OPTION_INFO_LENGTH] = { 0, };
-                sprintf(optionInfo, "Num[%d] - ID : %d, Option Length : %d", i + 1,
-                        requestInfo->info.options[i].optionID,
-                        requestInfo->info.options[i].optionLength);
-
-                callback("Option info: ", optionInfo);
-
-                size_t optionDataLen = strlen(requestInfo->info.options[i].optionData);
-                char *cloneOptionData = (char *) malloc(sizeof(char) * (optionDataLen + 1));
-                if (NULL == cloneOptionData)
-                {
-                    LOGE("cloneOptionData Out of memory");
-                    free(g_clientEndpoint);
-                    return;
-                }
-
-                memcpy(cloneOptionData, requestInfo->info.options[i].optionData,
-                       optionDataLen + 1);
-
-                callback("Option Data: ", cloneOptionData);
-                free(cloneOptionData);
-            }
-        }
-    }
-    LOGI("############################################################");
-
-    //Check if this has secure communication information
-    if (requestInfo->info.payload && CA_ADAPTER_IP == object->adapter)
-    {
-        uint32_t securePort = get_secure_information(requestInfo->info.payload);
-        if (0 < securePort) //Set the remote endpoint secure details and send response
-        {
-            LOGI("This is secure resource...");
-
-            CAEndpoint_t *endpoint = NULL;
-            if (CA_STATUS_OK != CACreateEndpoint(CA_SECURE,
-                        object->adapter, object->addr, securePort, &endpoint))
-            {
-                LOGE("Failed to create duplicate of remote endpoint!");
-                return;
-            }
-            object = endpoint;
-        }
-    }
-}
-
-void response_handler(const CAEndpoint_t* object, const CAResponseInfo_t* responseInfo)
-{
-
-    CAResult_t res = get_remote_address(object->adapter, object->addr);
-    if (CA_STATUS_OK != res)
-    {
-        return;
-    }
-
-    LOGI("##########Received response from remote device #############");
-    LOGI("Uri: %s", responseInfo->info.resourceUri);
-    LOGI("Remote Address: %s", g_remoteAddress);
-    LOGI("response result: %d", responseInfo->result);
-    LOGI("Data: %s", responseInfo->info.payload);
-    LOGI("Token: %s", responseInfo->info.token);
-    LOGI("MessageType: %d", responseInfo->info.type);
-
-    if (NULL != g_responseListenerObject)
-    {
-        uint32_t len = 0;
-
-        if (NULL != responseInfo->info.resourceUri)
-        {
-            len = strlen(responseInfo->info.resourceUri);
-            char *cloneUri = (char *) malloc(sizeof(char) * (len + 1));
-
-            if (NULL == cloneUri)
-            {
-                LOGE("cloneUri Out of memory");
-                free(g_remoteAddress);
-                return;
-            }
-
-            memcpy(cloneUri, responseInfo->info.resourceUri, len + 1);
-
-            callback("Uri: ", cloneUri);
-            free(cloneUri);
-        }
-
-        len = strlen(g_remoteAddress);
-        char *cloneRemoteAddress = (char *) malloc(sizeof(char) * (len + 1));
-
-        if (NULL == cloneRemoteAddress)
-        {
-            LOGE("cloneRemoteAddress Out of memory");
-            free(g_remoteAddress);
-            return;
-        }
-
-        memcpy(cloneRemoteAddress, g_remoteAddress, len + 1);
-
-        callback("Remote Address: ", cloneRemoteAddress);
-        free(cloneRemoteAddress);
-        free(g_remoteAddress);
-
-        if (NULL != responseInfo->info.payload)
-        {
-            len = strlen(responseInfo->info.payload);
-            char *clonePayload = (char *) malloc(sizeof(char) * (len + 1));
-
-            if (NULL == clonePayload)
-            {
-                LOGE("clonePayload Out of memory");
-                return;
-            }
-
-            memcpy(clonePayload, responseInfo->info.payload, len + 1);
-
-            callback("Data: ", clonePayload);
-            free(clonePayload);
-        }
-    }
-
-    if (responseInfo->info.options)
-    {
-        uint32_t len = responseInfo->info.numOptions;
-        uint32_t i;
-        for (i = 0; i < len; i++)
-        {
-            LOGI("Option %d", i + 1);
-            LOGI("ID : %d", responseInfo->info.options[i].optionID);
-            LOGI("Data[%d]: %s", responseInfo->info.options[i].optionLength,
-                 responseInfo->info.options[i].optionData);
-
-            if (NULL != g_responseListenerObject)
-            {
-                char optionInfo[OPTION_INFO_LENGTH] = { 0, };
-                sprintf(optionInfo, "Num[%d] - ID : %d, Option Length : %d", i + 1,
-                        responseInfo->info.options[i].optionID,
-                        responseInfo->info.options[i].optionLength);
-
-                callback("Option info: ", optionInfo);
-
-                size_t optionDataLen = strlen(responseInfo->info.options[i].optionData);
-                char *cloneOptionData = (char *) malloc(sizeof(char) * (optionDataLen + 1));
-                if (NULL == cloneOptionData)
-                {
-                    LOGE("cloneOptionData Out of memory");
-                    return;
-                }
-                memcpy(cloneOptionData, responseInfo->info.options[i].optionData,
-                       optionDataLen + 1);
-                callback("Option Data: ", cloneOptionData);
-                free(cloneOptionData);
-            }
-        }
-    }
-    LOGI("############################################################");
-
-    //Check if this has secure communication information
-    if (responseInfo->info.payload && CA_ADAPTER_IP == object->adapter)
-    {
-        uint32_t securePort = get_secure_information(responseInfo->info.payload);
-        if (0 < securePort) //Set the remote endpoint secure details and send response
-        {
-            LOGI("This is secure resource...");
-        }
-    }
-}
-
-void error_handler(const CAEndpoint_t *rep, const CAErrorInfo_t* errorInfo)
-{
-    printf("+++++++++++++++++++++++++++++++++++ErrorInfo+++++++++++++++++++++++++++++++++++");
-
-    if(errorInfo)
-    {
-        const CAInfo_t *info = &errorInfo->info;
-        LOGI("Error Handler, ErrorInfo :");
-        LOGI("Error Handler result    : %d", errorInfo->result);
-        LOGI("Error Handler token     : %s", info->token);
-        LOGI("Error Handler messageId : %d", (uint16_t) info->messageId);
-        LOGI("Error Handler resourceUri : %s", info->resourceUri);
-        LOGI("Error Handler type      : %d", info->type);
-        LOGI("Error Handler payload   : %s", info->payload);
-
-        if(CA_ADAPTER_NOT_ENABLED == errorInfo->result)
-        {
-            LOGE("CA_ADAPTER_NOT_ENABLED, enable the adapter");
-        }
-        else if(CA_SEND_FAILED == errorInfo->result)
-        {
-            LOGE("CA_SEND_FAILED, unable to send the message, check parameters");
-        }
-        else if(CA_MEMORY_ALLOC_FAILED == errorInfo->result)
-        {
-            LOGE("CA_MEMORY_ALLOC_FAILED, insufficient memory");
-        }
-        else if(CA_SOCKET_OPERATION_FAILED == errorInfo->result)
-        {
-            LOGE("CA_SOCKET_OPERATION_FAILED, socket operation failed");
-        }
-        else if(CA_STATUS_FAILED == errorInfo->result)
-        {
-            LOGE("CA_STATUS_FAILED, message could not be delivered, internal error");
-        }
-    }
-    LOGI("++++++++++++++++++++++++++++++++End of ErrorInfo++++++++++++++++++++++++++++++++");
-
-    return;
-}
-
-void get_resource_uri(const char *URI, char *resourceURI, uint32_t length)
-{
-    const char *startPos = URI;
-    const char *temp = strstr(URI, "://");
-    if (NULL != temp)
-    {
-        startPos = strchr(temp + 3, '/');
-        if (!startPos)
-        {
-            LOGE("Resource URI is missing");
-            return;
-        }
-    }
-
-    const char *endPos = strchr(startPos, '?');
-    if (!endPos)
-    {
-        endPos = URI + strlen(URI);
-    }
-    --endPos;
-
-    if (endPos - startPos <= length)
-    {
-        memcpy(resourceURI, startPos + 1, endPos - startPos);
-    }
-
-    LOGI("URI: %s, ResourceURI: %s", URI, resourceURI);
-}
-
-uint32_t get_secure_information(CAPayload_t payLoad)
-{
-    LOGI("entering get_secure_information");
-
-    if (!payLoad)
-    {
-        LOGE("Payload is NULL");
-        return -1;
-    }
-
-    const char *subString = NULL;
-    if (NULL == (subString = strstr(payLoad, "\"sec\":1")))
-    {
-        LOGE("This is not secure resource");
-        return -1;
-    }
-
-    if (NULL == (subString = strstr(payLoad, "\"port\":")))
-    {
-        LOGE("This secure resource does not have port information");
-        return -1;
-    }
-
-    const char *startPos = strstr(subString, ":");
-    if (!startPos)
-    {
-        LOGE("Parsing failed !");
-        return -1;
-    }
-
-    const char *endPos = strstr(startPos, "}");
-    if (!endPos)
-    {
-        LOGE("Parsing failed !");
-        return -1;
-    }
-
-    char portStr[6] = { 0 };
-    memcpy(portStr, startPos + 1, (endPos - 1) - startPos);
-
-    LOGI("secured port is: %s", portStr);
-    return atoi(portStr);
-}
-
-CAResult_t get_network_type(uint32_t selectedNetwork)
-{
-
-    uint32_t number = selectedNetwork;
-
-    if (!(number & 0xf))
-    {
-        return CA_NOT_SUPPORTED;
-    }
-    if (number & CA_ADAPTER_IP)
-    {
-        g_selectedNwType = CA_ADAPTER_IP;
-        return CA_STATUS_OK;
-    }
-    if (number & CA_ADAPTER_RFCOMM_BTEDR)
-    {
-        g_selectedNwType = CA_ADAPTER_RFCOMM_BTEDR;
-        return CA_STATUS_OK;
-    }
-    if (number & CA_ADAPTER_GATT_BTLE)
-    {
-        g_selectedNwType = CA_ADAPTER_GATT_BTLE;
-        return CA_STATUS_OK;
-    }
-
-    return CA_NOT_SUPPORTED;
-}
-
-void callback(char *subject, char *receivedData)
-{
-    JNIEnv* env = NULL;
-    uint32_t status = (*g_jvm)->GetEnv(g_jvm, (void **) &env, JNI_VERSION_1_6);
-    uint32_t res = (*g_jvm)->AttachCurrentThread(g_jvm, &env, NULL);
-
-    jclass cls = (*env)->GetObjectClass(env, g_responseListenerObject);
-    jmethodID mid = (*env)->GetMethodID(env, cls, "OnResponseReceived",
-                                        "(Ljava/lang/String;Ljava/lang/String;)V");
-
-    jstring jsubject = (*env)->NewStringUTF(env, (char*) subject);
-    jstring jreceivedData = (*env)->NewStringUTF(env, (char*) receivedData);
-    (*env)->CallVoidMethod(env, g_responseListenerObject, mid, jsubject, jreceivedData);
-
-}
-
-CAResult_t get_remote_address(CATransportAdapter_t transportType, const char *address)
-{
-    uint32_t len = strlen(address);
-
-    g_remoteAddress = (char *)malloc(sizeof (char) * (len + 1));
-    if (NULL == g_remoteAddress)
-    {
-        LOGE("g_remoteAddress Out of memory");
-        return CA_MEMORY_ALLOC_FAILED;
-    }
-
-    memcpy(g_remoteAddress, address, len + 1);
-
-    return CA_STATUS_OK;
-}
-
-
-void parsing_coap_uri(const char* uri, addressSet_t* address, CATransportFlags_t *flags)
-{
-    if (NULL == uri || NULL == address)
-    {
-        LOGE("parameter is null");
-        return;
-    }
-
-    // parse uri
-    // #1. check prefix
-    uint8_t startIndex = 0;
-    if (strncmp(COAPS_PREFIX, uri, COAPS_PREFIX_LEN) == 0)
-    {
-        LOGI("uri has '%s' prefix", COAPS_PREFIX);
-        startIndex = COAPS_PREFIX_LEN;
-        *flags = CA_SECURE;
-    }
-    else if (strncmp(COAP_PREFIX, uri, COAP_PREFIX_LEN) == 0)
-    {
-        LOGI("uri has '%s' prefix", COAP_PREFIX);
-        startIndex = COAP_PREFIX_LEN;
-        *flags = CA_DEFAULT_FLAGS;
-    }
-
-    // #2. copy uri for parse
-    int32_t len = strlen(uri) - startIndex;
-
-    if (len <= 0)
-    {
-        LOGE("uri length is 0!");
-        return;
-    }
-
-    char *cloneUri = (char *) calloc(len + 1, sizeof(char));
-    if (NULL == cloneUri)
-    {
-        LOGE("Out of memory");
-        return;
-    }
-
-    memcpy(cloneUri, &uri[startIndex], sizeof(char) * len);
-    cloneUri[len] = '\0';
-
-    char *pAddress = cloneUri;
-    char *pResourceUri = NULL;
-
-    int32_t i = 0;
-    for (i = 0; i < len; i++)
-    {
-        if (cloneUri[i] == '/')
-        {
-            // separate
-            cloneUri[i] = 0;
-            pResourceUri = &cloneUri[i + 1];
-            break;
-        }
-    }
-    LOGI("pAddress : %s", pAddress);
-
-    int res = get_address_set(pAddress, address);
-    if (res == -1)
-    {
-        LOGE("address parse error");
-
-        free(cloneUri);
-        return;
-    }
-    return;
-}
-
-int get_address_set(const char *pAddress, addressSet_t* outAddress)
-{
-    if (NULL == pAddress || NULL == outAddress)
-    {
-        LOGE("parameter is null");
-        return -1;
-    }
-
-    int32_t len = strlen(pAddress);
-    int32_t isIp = 0;
-    int32_t ipLen = 0;
-
-    int32_t i = 0;
-    for (i = 0; i < len; i++)
-    {
-        if (pAddress[i] == '.')
-        {
-            isIp = 1;
-        }
-
-        // found port number start index
-        if (isIp && pAddress[i] == ':')
-        {
-            ipLen = i;
-            break;
-        }
-    }
-
-    if (isIp)
-    {
-        if(ipLen && ipLen < sizeof(outAddress->ipAddress))
-        {
-            strncpy(outAddress->ipAddress, pAddress, ipLen);
-            outAddress->ipAddress[ipLen] = '\0';
-        }
-        else if (!ipLen && len < sizeof(outAddress->ipAddress))
-        {
-            strncpy(outAddress->ipAddress, pAddress, len);
-            outAddress->ipAddress[len] = '\0';
-        }
-        else
-        {
-            LOGE("IP Address too long: %d", ipLen==0 ? len : ipLen);
-            return -1;
-        }
-
-        if (ipLen > 0)
-        {
-            outAddress->port = atoi(pAddress + ipLen + 1);
-        }
-    }
-    else
-    {
-        strncpy(outAddress->ipAddress, pAddress, len);
-        outAddress->ipAddress[len] = '\0';
-    }
-
-    return isIp;
-}
diff --git a/resource/csdk/connectivity/samples/android/sample_service/jni/org_iotivity_ca_service_RMInterface.h b/resource/csdk/connectivity/samples/android/sample_service/jni/org_iotivity_ca_service_RMInterface.h
deleted file mode 100644 (file)
index 6f60059..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#include <jni.h>
-/* Header for class org_iotivity_ca_service_RMInterface */
-
-#ifndef _Included_org_iotivity_ca_service_RMInterface
-#define _Included_org_iotivity_ca_service_RMInterface
-#ifdef __cplusplus
-extern "C" {
-#endif
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_setNativeResponseListener
-  (JNIEnv *, jobject, jobject);
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMInitialize
- * Signature: (Landroid/content/Context;)V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMInitialize
-  (JNIEnv *, jobject, jobject);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMTerminate
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMTerminate
-  (JNIEnv *, jobject);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMStartListeningServer
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMStartListeningServer
-  (JNIEnv *, jobject);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMStartDiscoveryServer
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMStartDiscoveryServer
-  (JNIEnv *, jobject);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMRegisterHandler
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMRegisterHandler
-  (JNIEnv *, jobject);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMSendRequest
- * Signature: (Ljava/lang/String;Ljava/lang/String;III)V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMSendRequest
-  (JNIEnv *, jobject, jstring, jstring, jint, jint, jint);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMSendReqestToAll
- * Signature: (Ljava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMSendReqestToAll
-  (JNIEnv *, jobject, jstring, jint);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMSendResponse
- * Signature: (IIII)V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMSendResponse
-  (JNIEnv *, jobject, jint, jint, jint, jint);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMSendNotification
- * Signature: (Ljava/lang/String;Ljava/lang/String;IIII)V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMSendNotification
-  (JNIEnv *, jobject, jstring, jstring, jint, jint, jint, jint);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMSelectNetwork
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMSelectNetwork
-  (JNIEnv *, jobject, jint);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMUnSelectNetwork
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMUnSelectNetwork
-  (JNIEnv *, jobject, jint);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMGetNetworkInfomation
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMGetNetworkInfomation
-  (JNIEnv *, jobject);
-
-/*
- * Class:     org_iotivity_ca_service_RMInterface
- * Method:    RMHandleRequestResponse
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_iotivity_ca_service_RMInterface_RMHandleRequestResponse
-  (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/resource/csdk/connectivity/samples/android/sample_service/project.properties b/resource/csdk/connectivity/samples/android/sample_service/project.properties
deleted file mode 100644 (file)
index 6e18427..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-21
diff --git a/resource/csdk/connectivity/samples/android/sample_service/res/layout/activity_main.xml b/resource/csdk/connectivity/samples/android/sample_service/res/layout/activity_main.xml
deleted file mode 100644 (file)
index 05c2bf9..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin"
-    tools:context="org.iotivity.ca.service.MainActivity" >
-
-    <RelativeLayout
-        android:id="@+id/sample_service_layout"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentTop="true"
-        android:background="#cccccc" >
-
-        <LinearLayout
-            android:id="@+id/layout_mode"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_alignParentTop="true"
-            android:orientation="horizontal" >
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-
-            <TextView
-                android:id="@+id/tv_mode"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content" />
-        </LinearLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_network"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_mode"
-            android:orientation="horizontal" >
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-
-            <TextView
-                android:id="@+id/tv_network"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_Response_Noti_title"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_mode" >
-
-            <TextView
-                android:id="@+id/tv_Response_Noti"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:text="[Send Response / Send Notification]"
-                />
-
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_notify"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_Response_Noti_title" >
-
-            <EditText
-                android:id="@+id/et_notification"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:text="@string/notification" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_request_setting_for_server"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_notify" >
-
-            <Button
-                android:id="@+id/btn_Request_setting_for_server"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:text="@string/request_setting" />
-
-            <Button
-                android:id="@+id/btn_notify"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_toRightOf="@id/btn_Request_setting_for_server"
-                android:text="@string/notify" />
-
-            <Button
-                android:id="@+id/btn_sendresponse"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_toRightOf="@id/btn_notify"
-                android:text="@string/sendresponse" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_request_title"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_mode" >
-
-            <TextView
-                android:id="@+id/tv_request"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:text="[Send Request]" />
-
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_request"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_request_title" >
-
-            <EditText
-                android:id="@+id/et_req_data"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:text="@string/req_data" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_request_setting_for_client"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_request" >
-
-            <Button
-                android:id="@+id/btn_Request_setting_for_client"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:text="@string/request_setting" />
-
-            <Button
-                android:id="@+id/btn_Request"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_toRightOf="@id/btn_Request_setting_for_client"
-                android:text="@string/request" />
-
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_request_to_all_title"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_request_setting_for_client" >
-
-            <TextView
-                android:id="@+id/tv_request_to_all"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content" 
-                android:text="[Send Request to All]"
-                />
-
-         </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_request_to_all"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_request_to_all_title" >
-
-            <EditText
-                android:id="@+id/et_req_to_all_data"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:layout_centerVertical="true"
-                android:text="@string/uri" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_request_to_all_setting_for_client"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_request_to_all" >
-
-            <Button
-                android:id="@+id/btn_request_to_all_setting_for_client"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:text="@string/request_setting" />
-
-            <Button
-                android:id="@+id/btn_request_to_all"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_toRightOf="@id/btn_request_to_all_setting_for_client"
-                android:text="@string/request_to_all" />
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_handle_title"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_request_to_all_setting_for_client" >
-
-            <TextView
-                android:id="@+id/tv_handle"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:text="[Handle Reqeust,Response data / Get NetworkInfo]"/>
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/layout_receive"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/layout_handle_title" >
-
-            <Button
-                android:id="@+id/btn_receive"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:text="@string/receive" />
-
-            <Button
-                android:id="@+id/btn_get_network_info"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_toRightOf="@id/btn_receive"
-                android:text="@string/get_network_info" />
-
-        </RelativeLayout>
-    </RelativeLayout>
-
-    <ScrollView
-        android:id="@+id/sv_result_scoll"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        android:layout_below="@id/sample_service_layout"
-        android:layout_marginTop="10pt" >
-
-        <TextView
-            android:id="@+id/tv_result"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content" />
-    </ScrollView>
-
-</RelativeLayout>
\ No newline at end of file
diff --git a/resource/csdk/connectivity/samples/android/sample_service/res/menu/main.xml b/resource/csdk/connectivity/samples/android/sample_service/res/menu/main.xml
deleted file mode 100644 (file)
index e0d03f4..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    tools:context="org.iotivity.ca.sample_service.MainActivity" >
-
-    <item
-        android:id="@+id/action_settings"
-        android:orderInCategory="100"
-        android:showAsAction="never"
-        android:title="@string/action_settings"/>
-
-</menu>
-
diff --git a/resource/csdk/connectivity/samples/android/sample_service/res/values-v11/styles.xml b/resource/csdk/connectivity/samples/android/sample_service/res/values-v11/styles.xml
deleted file mode 100644 (file)
index 3df0c14..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<resources>
-
-    <!--
-        Base application theme for API 11+. This theme completely replaces
-        AppBaseTheme from res/values/styles.xml on API 11+ devices.
-    -->
-    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
-        <!-- API 11 theme customizations can go here. -->
-    </style>
-
-</resources>
-
diff --git a/resource/csdk/connectivity/samples/android/sample_service/res/values-v14/styles.xml b/resource/csdk/connectivity/samples/android/sample_service/res/values-v14/styles.xml
deleted file mode 100644 (file)
index 13d7045..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<resources>
-
-    <!--
-        Base application theme for API 14+. This theme completely replaces
-        AppBaseTheme from BOTH res/values/styles.xml and
-        res/values-v11/styles.xml on API 14+ devices.
-    -->
-    <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
-        <!-- API 14 theme customizations can go here. -->
-    </style>
-
-</resources>
-
diff --git a/resource/csdk/connectivity/samples/android/sample_service/res/values-w820dp/dimens.xml b/resource/csdk/connectivity/samples/android/sample_service/res/values-w820dp/dimens.xml
deleted file mode 100644 (file)
index efaa062..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<resources>
-
-    <!--
-         Example customization of dimensions originally defined in res/values/dimens.xml
-         (such as screen margins) for screens with more than 820dp of available width. This
-         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
-    -->
-    <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
-
diff --git a/resource/csdk/connectivity/samples/android/sample_service/res/values/dimens.xml b/resource/csdk/connectivity/samples/android/sample_service/res/values/dimens.xml
deleted file mode 100644 (file)
index 6ed10f5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<resources>
-
-    <!-- Default screen margins, per the Android Design guidelines. -->
-    <dimen name="activity_horizontal_margin">16dp</dimen>
-    <dimen name="activity_vertical_margin">16dp</dimen>
-
-</resources>
-
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
deleted file mode 100644 (file)
index d365f1e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string name="app_name">CA Android Sample</string>
-    <string name="sendresponse">Response</string>
-    <string name="notify">Notification</string>
-    <string name="request_setting">Setting</string>
-    <string name="request">Request</string>
-    <string name="request_to_all">Request to All</string>
-    <string name="response">Response</string>
-    <string name="uri">/a/light</string>
-    <string name="coap_prefix">coap://</string>
-    <string name="port_num">:6298</string>
-    <string name="notification"></string>
-    <string name="req_data"></string>
-    <string name="resp_data">resourceUri/response</string>
-    <string name="get_network_info">Network Info</string>
-    <string name="receive">Receive</string>
-    <string name="received">Received Message</string>
-    <string name="remote_address">"Remote Address: "</string>
-    <string name="action_settings">Settings</string>
-</resources>
\ No newline at end of file
diff --git a/resource/csdk/connectivity/samples/android/sample_service/res/values/styles.xml b/resource/csdk/connectivity/samples/android/sample_service/res/values/styles.xml
deleted file mode 100644 (file)
index d77df4e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<resources>
-
-    <!--
-        Base application theme, dependent on API level. This theme is replaced
-        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-    -->
-    <style name="AppBaseTheme" parent="android:Theme.Light">
-        <!--
-            Theme customizations available in newer API levels can go in
-            res/values-vXX/styles.xml, while customizations related to
-            backward-compatibility can go here.
-        -->
-    </style>
-
-    <!-- Application theme. -->
-    <style name="AppTheme" parent="AppBaseTheme">
-        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
-    </style>
-
-</resources>
-
diff --git a/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaEdrInterface.java b/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaEdrInterface.java
deleted file mode 100644 (file)
index 1e4d47c..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/******************************************************************
- *
- * Copyright 2014 Samsung Electronics All Rights Reserved.
- *
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-package org.iotivity.ca;
-
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-
-public class CaEdrInterface {
-
-    private CaEdrInterface(Context context) {
-
-        registerIntentFilter(context);
-    }
-
-    private static IntentFilter registerIntentFilter(Context context) {
-        IntentFilter filter = new IntentFilter();
-        filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
-        filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
-        context.registerReceiver(mReceiver, filter);
-        return filter;
-    }
-
-    // Network Monitor
-    private native static void caEdrStateChangedCallback(int state);
-
-    private native static void caEdrBondStateChangedCallback(String addr);
-
-    private static final BroadcastReceiver mReceiver = new BroadcastReceiver() {
-
-        @Override
-        public void onReceive(Context context, Intent intent) {
-
-            String action = intent.getAction();
-
-            if (action != null && action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
-
-                int state =
-                        intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR);
-
-                // STATE_ON:12, STATE_OFF:10
-                if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_OFF)
-                {
-                    caEdrStateChangedCallback(state);
-                }
-            }
-
-            if (action != null && action.equals(BluetoothDevice.ACTION_BOND_STATE_CHANGED)) {
-
-                int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE,
-                                                   BluetoothDevice.ERROR);
-
-                if (bondState == BluetoothDevice.BOND_NONE) {
-                    if ((intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE,
-                                            BluetoothDevice.ERROR)
-                                                == BluetoothDevice.BOND_BONDED)) {
-                        BluetoothDevice device
-                            = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
-
-                        caEdrBondStateChangedCallback(device.getAddress());
-                    }
-                }
-            }
-        }
-    };
-}
diff --git a/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaIpInterface.java b/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaIpInterface.java
deleted file mode 100644 (file)
index 901520b..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/******************************************************************\r
- *\r
- * Copyright 2014 Samsung Electronics All Rights Reserved.\r
- *\r
- *\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- ******************************************************************/\r
-\r
-package org.iotivity.ca;\r
-\r
-import android.content.BroadcastReceiver;\r
-import android.content.Context;\r
-import android.content.Intent;\r
-import android.content.IntentFilter;\r
-import android.net.ConnectivityManager;\r
-import android.net.NetworkInfo;\r
-import android.net.wifi.WifiManager;\r
-\r
-public class CaIpInterface {\r
-    private static Context mContext;\r
-\r
-    private CaIpInterface(Context context) {\r
-        mContext = context;\r
-        registerIpStateReceiver();\r
-    }\r
-\r
-    private void registerIpStateReceiver() {\r
-        IntentFilter intentFilter = new IntentFilter();\r
-        intentFilter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);\r
-        intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);\r
-\r
-        mContext.registerReceiver(mReceiver, intentFilter);\r
-    }\r
-\r
-    private static BroadcastReceiver mReceiver = new BroadcastReceiver() {\r
-        @Override\r
-        public void onReceive(Context context, Intent intent) {\r
-            if (intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE,\r
-                WifiManager.WIFI_STATE_UNKNOWN) == WifiManager.WIFI_STATE_DISABLED) {\r
-                caIpStateDisabled();\r
-            } else if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {\r
-                ConnectivityManager manager = (ConnectivityManager)\r
-                        mContext.getSystemService(Context.CONNECTIVITY_SERVICE);\r
-                NetworkInfo nwInfo = manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\r
-\r
-                if(nwInfo.isConnected()) {\r
-                    caIpStateEnabled();\r
-                }\r
-            }\r
-        }\r
-    };\r
-\r
-    private native static void caIpStateEnabled();\r
-\r
-    private native static void caIpStateDisabled();\r
-}
\ No newline at end of file
diff --git a/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaLeClientInterface.java b/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaLeClientInterface.java
deleted file mode 100644 (file)
index 891cb40..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-/******************************************************************
- *
- * Copyright 2014 Samsung Electronics All Rights Reserved.
- *
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-package org.iotivity.ca;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothGatt;
-import android.bluetooth.BluetoothGattCallback;
-import android.bluetooth.BluetoothGattCharacteristic;
-import android.bluetooth.BluetoothGattDescriptor;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.util.Log;
-
-public class CaLeClientInterface {
-
-    private static String SERVICE_UUID = "ADE3D529-C784-4F63-A987-EB69F70EE816";
-    private static String TAG          = "Sample_Service : CaLeClientInterface";
-
-    private CaLeClientInterface(Context context) {
-
-        caLeRegisterLeScanCallback(mLeScanCallback);
-        caLeRegisterGattCallback(mGattCallback);
-
-        registerIntentFilter(context);
-    }
-
-    public static void getLeScanCallback() {
-        caLeRegisterLeScanCallback(mLeScanCallback);
-    }
-
-    public static void getLeGattCallback() {
-        caLeRegisterGattCallback(mGattCallback);
-    }
-
-    private static IntentFilter registerIntentFilter(Context context) {
-        IntentFilter filter = new IntentFilter();
-        filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
-        filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
-        context.registerReceiver(mReceiver, filter);
-        return filter;
-    }
-
-    private native static void caLeRegisterLeScanCallback(BluetoothAdapter.LeScanCallback callback);
-
-    private native static void caLeRegisterGattCallback(BluetoothGattCallback callback);
-
-    // BluetoothAdapter.LeScanCallback
-    private native static void caLeScanCallback(BluetoothDevice device,
-                                                int rssi, byte[] scanRecord);
-
-    // BluetoothGattCallback
-    private native static void caLeGattConnectionStateChangeCallback(
-            BluetoothGatt gatt, int status, int newState);
-
-    private native static void caLeGattServicesDiscoveredCallback(BluetoothGatt gatt, int status);
-
-    private native static void caLeGattCharacteristicReadCallback(
-            BluetoothGatt gatt, BluetoothGattCharacteristic characteristic,
-            byte[] data, int status);
-
-    private native static void caLeGattCharacteristicWriteCallback(
-            BluetoothGatt gatt, BluetoothGattCharacteristic characteristic,
-            byte[] data, int status);
-
-    private native static void caLeGattCharacteristicChangedCallback(
-            BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, byte[] data);
-
-    private native static void caLeGattDescriptorReadCallback(BluetoothGatt gatt,
-                                                             BluetoothGattDescriptor descriptor,
-                                                             int status);
-
-    private native static void caLeGattDescriptorWriteCallback(BluetoothGatt gatt,
-                                                              BluetoothGattDescriptor descriptor,
-                                                              int status);
-
-    private native static void caLeGattReliableWriteCompletedCallback(BluetoothGatt gatt,
-                                                                     int status);
-
-    private native static void caLeGattReadRemoteRssiCallback(BluetoothGatt gatt, int rssi,
-                                                             int status);
-
-    // Network Monitor
-    private native static void caLeStateChangedCallback(int state);
-
-    // bond state
-    private native static void caLeBondStateChangedCallback(String address);
-
-    // Callback
-    private static BluetoothAdapter.LeScanCallback mLeScanCallback =
-                   new BluetoothAdapter.LeScanCallback() {
-
-        @Override
-        public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
-
-            try {
-                List<UUID> uuids = getUuids(scanRecord);
-                for (UUID uuid : uuids) {
-                    Log.d(TAG, "UUID : " + uuid.toString());
-                    if(uuid.toString().contains(SERVICE_UUID.toLowerCase())) {
-                        Log.d(TAG, "we found that has the Device");
-                        caLeScanCallback(device, rssi, scanRecord);
-                    }
-                }
-            } catch(UnsatisfiedLinkError e) {
-
-            }
-        }
-    };
-
-    private static List<UUID> getUuids(final byte[] scanRecord) {
-        List<UUID> uuids = new ArrayList<UUID>();
-
-        int offset = 0;
-        while (offset < (scanRecord.length - 2)) {
-            int len = scanRecord[offset++];
-            if (len == 0)
-                break;
-
-            int type = scanRecord[offset++];
-
-            switch (type) {
-            case 0x02:
-            case 0x03:
-                while (len > 1) {
-                    int uuid16 = scanRecord[offset++];
-                    uuid16 += (scanRecord[offset++] << 8);
-                    len -= 2;
-                    uuids.add(UUID.fromString(String.format(
-                            "%08x-0000-1000-8000-00805f9b34fb", uuid16)));
-                }
-                break;
-            case 0x06:
-            case 0x07:
-                while (len >= 16) {
-                    try {
-                        ByteBuffer buffer = ByteBuffer.wrap(scanRecord, offset++, 16).
-                                                            order(ByteOrder.LITTLE_ENDIAN);
-                        long mostSigBits = buffer.getLong();
-                        long leastSigBits = buffer.getLong();
-                        uuids.add(new UUID(leastSigBits, mostSigBits));
-                    } catch (IndexOutOfBoundsException e) {
-                        Log.e(TAG, e.toString());
-                        continue;
-                    } finally {
-                        offset += 15;
-                        len -= 16;
-                    }
-                }
-                break;
-            default:
-                offset += (len - 1);
-                break;
-            }
-        }
-        return uuids;
-    }
-
-    private static final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
-
-        @Override
-        public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
-            super.onConnectionStateChange(gatt, status, newState);
-
-            caLeGattConnectionStateChangeCallback(gatt, status, newState);
-        }
-
-        @Override
-        public void onServicesDiscovered(BluetoothGatt gatt, int status) {
-            super.onServicesDiscovered(gatt, status);
-
-            caLeGattServicesDiscoveredCallback(gatt, status);
-        }
-
-        @Override
-        public void onCharacteristicRead(BluetoothGatt gatt,
-                BluetoothGattCharacteristic characteristic, int status) {
-            super.onCharacteristicRead(gatt, characteristic, status);
-
-            caLeGattCharacteristicReadCallback(gatt, characteristic,
-                                               characteristic.getValue(), status);
-        }
-
-        @Override
-        public void onCharacteristicWrite(BluetoothGatt gatt,
-                BluetoothGattCharacteristic characteristic, int status) {
-            super.onCharacteristicWrite(gatt, characteristic, status);
-
-            caLeGattCharacteristicWriteCallback(gatt, characteristic,
-                                                characteristic.getValue(), status);
-        }
-
-        @Override
-        public void onCharacteristicChanged(BluetoothGatt gatt,
-                BluetoothGattCharacteristic characteristic) {
-            super.onCharacteristicChanged(gatt, characteristic);
-
-            caLeGattCharacteristicChangedCallback(gatt, characteristic,
-                                                  characteristic.getValue());
-        }
-
-        @Override
-        public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor,
-                int status) {
-            super.onDescriptorRead(gatt, descriptor, status);
-
-            caLeGattDescriptorReadCallback(gatt, descriptor, status);
-        }
-
-        @Override
-        public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor,
-                int status) {
-            super.onDescriptorWrite(gatt, descriptor, status);
-
-            caLeGattDescriptorWriteCallback(gatt, descriptor, status);
-        }
-
-        @Override
-        public void onReliableWriteCompleted(BluetoothGatt gatt, int status) {
-            super.onReliableWriteCompleted(gatt, status);
-
-            caLeGattReliableWriteCompletedCallback(gatt, status);
-        }
-
-        @Override
-        public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {
-            super.onReadRemoteRssi(gatt, rssi, status);
-
-            caLeGattReadRemoteRssiCallback(gatt, rssi, status);
-        }
-    };
-
-    private static final BroadcastReceiver mReceiver = new BroadcastReceiver() {
-
-        @Override
-        public void onReceive(Context context, Intent intent) {
-
-            String action = intent.getAction();
-
-            if (action != null && action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
-
-                int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE,
-                                               BluetoothAdapter.ERROR);
-
-                if (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_OFF)
-                {
-                    caLeStateChangedCallback(state);
-                }
-            }
-
-            if (action != null && action.equals(BluetoothDevice.ACTION_BOND_STATE_CHANGED)) {
-
-                int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE,
-                                                   BluetoothDevice.ERROR);
-
-                if (bondState == BluetoothDevice.BOND_NONE) {
-                    if ((intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE,
-                            BluetoothDevice.ERROR) == BluetoothDevice.BOND_BONDED)) {
-                            BluetoothDevice device = intent
-                                .getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
-
-                        caLeBondStateChangedCallback(device.getAddress());
-                    }
-                }
-            }
-        }
-    };
-}
-
diff --git a/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaLeServerInterface.java b/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/CaLeServerInterface.java
deleted file mode 100644 (file)
index 75f447b..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/******************************************************************
- *
- * Copyright 2014 Samsung Electronics All Rights Reserved.
- *
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-package org.iotivity.ca;
-
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothGattCharacteristic;
-import android.bluetooth.BluetoothGattDescriptor;
-import android.bluetooth.BluetoothGattServerCallback;
-import android.bluetooth.BluetoothGattService;
-import android.bluetooth.le.AdvertiseCallback;
-import android.bluetooth.le.AdvertiseSettings;
-
-public class CaLeServerInterface {
-
-    private CaLeServerInterface() {
-
-        caLeRegisterGattServerCallback(mGattServerCallback);
-        caLeRegisterBluetoothLeAdvertiseCallback(mAdvertiseCallback);
-    }
-
-    public static void getLeGattServerCallback() {
-        caLeRegisterGattServerCallback(mGattServerCallback);
-    }
-
-    public static void getBluetoothLeAdvertiseCallback() {
-        caLeRegisterBluetoothLeAdvertiseCallback(mAdvertiseCallback);
-    }
-
-    private native static void caLeRegisterGattServerCallback(BluetoothGattServerCallback callback);
-
-    private native static void caLeRegisterBluetoothLeAdvertiseCallback(AdvertiseCallback callback);
-
-    // BluetoothGattServerCallback
-    private native static void caLeGattServerConnectionStateChangeCallback(
-            BluetoothDevice device, int status, int newState);
-
-    private native static void caLeGattServerServiceAddedCallback(int status,
-                                                                  BluetoothGattService service);
-
-    private native static void caLeGattServerCharacteristicReadRequestCallback(
-            BluetoothDevice device,
-            int requestId, int offset, BluetoothGattCharacteristic characteristic, byte[] data);
-
-    private native static void caLeGattServerCharacteristicWriteRequestCallback(
-            BluetoothDevice device, int requestId,
-            BluetoothGattCharacteristic characteristic, byte[] data, boolean preparedWrite,
-            boolean responseNeeded, int offset, byte[] value);
-
-    private native static void caLeGattServerDescriptorReadRequestCallback(
-            BluetoothDevice device, int requestId, int offset, BluetoothGattDescriptor descriptor);
-
-    public native static void caLeGattServerDescriptorWriteRequestCallback(
-            BluetoothDevice device, int requestId, BluetoothGattDescriptor descriptor,
-            boolean preparedWrite, boolean responseNeeded, int offset, byte[] value);
-
-    private native static void caLeGattServerExecuteWriteCallback(BluetoothDevice device,
-                                                                 int requestId, boolean execute);
-
-    private native static void caLeGattServerNotificationSentCallback(BluetoothDevice device,
-                                                                     int status);
-
-    // AdvertiseCallback
-    private native static void caLeAdvertiseStartSuccessCallback(
-            AdvertiseSettings settingsInEffect);
-
-    private native static void caLeAdvertiseStartFailureCallback(int errorCode);
-
-    private static final BluetoothGattServerCallback mGattServerCallback =
-                         new BluetoothGattServerCallback() {
-
-        @Override
-        public void onConnectionStateChange(BluetoothDevice device, int status,
-                int newState) {
-            super.onConnectionStateChange(device, status, newState);
-
-            caLeGattServerConnectionStateChangeCallback(device, status, newState);
-        }
-
-        @Override
-        public void onServiceAdded(int status, BluetoothGattService service) {
-            super.onServiceAdded(status, service);
-
-            caLeGattServerServiceAddedCallback(status, service);
-        }
-
-        @Override
-        public void onCharacteristicReadRequest(
-                BluetoothDevice device, int requestId, int offset,
-                BluetoothGattCharacteristic characteristic) {
-            super.onCharacteristicReadRequest(device, requestId, offset, characteristic);
-
-            caLeGattServerCharacteristicReadRequestCallback(device, requestId, offset,
-                                                            characteristic,
-                                                            characteristic.getValue());
-        }
-
-        @Override
-        public void onCharacteristicWriteRequest(
-                BluetoothDevice device, int requestId, BluetoothGattCharacteristic characteristic,
-                boolean preparedWrite, boolean responseNeeded, int offset, byte[] value) {
-            super.onCharacteristicWriteRequest(device, requestId, characteristic,
-                    preparedWrite, responseNeeded, offset, value);
-
-            caLeGattServerCharacteristicWriteRequestCallback(device, requestId, characteristic,
-                                                             value, preparedWrite, responseNeeded,
-                                                             offset, value);
-        }
-
-        @Override
-        public void onDescriptorReadRequest(
-                BluetoothDevice device,
-                int requestId, int offset, BluetoothGattDescriptor descriptor) {
-            super.onDescriptorReadRequest(device, requestId, offset, descriptor);
-
-            caLeGattServerDescriptorReadRequestCallback(device, requestId, offset, descriptor);
-        }
-
-        @Override
-        public void onDescriptorWriteRequest(
-                BluetoothDevice device, int requestId, BluetoothGattDescriptor descriptor,
-                boolean preparedWrite, boolean responseNeeded, int offset,
-                byte[] value) {
-            super.onDescriptorWriteRequest(device, requestId, descriptor, preparedWrite,
-                                           responseNeeded, offset, value);
-
-            caLeGattServerDescriptorWriteRequestCallback(device, requestId, descriptor,
-                                                         preparedWrite, responseNeeded, offset,
-                                                         value);
-        }
-
-        @Override
-        public void onExecuteWrite(BluetoothDevice device, int requestId, boolean execute) {
-            super.onExecuteWrite(device, requestId, execute);
-
-            caLeGattServerExecuteWriteCallback(device, requestId, execute);
-        }
-
-        @Override
-        public void onNotificationSent(BluetoothDevice device, int status) {
-            super.onNotificationSent(device, status);
-
-            caLeGattServerNotificationSentCallback(device, status);
-        }
-    };
-
-    private static final AdvertiseCallback mAdvertiseCallback = new AdvertiseCallback() {
-
-        @Override
-        public void onStartSuccess(AdvertiseSettings settingsInEffect) {
-            super.onStartSuccess(settingsInEffect);
-
-            caLeAdvertiseStartSuccessCallback(settingsInEffect);
-        }
-
-        @Override
-        public void onStartFailure(int errorCode) {
-            super.onStartFailure(errorCode);
-
-            caLeAdvertiseStartFailureCallback(errorCode);
-        }
-    };
-}
diff --git a/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/DLog.java b/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/DLog.java
deleted file mode 100644 (file)
index 9fe8422..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-
-package org.iotivity.ca.service;
-
-import android.os.Handler;
-import android.widget.TextView;
-
-public final class DLog {
-
-    private final static String MAIN_TAG = "Sample_Service : DLog";
-
-    private static TextView mLogView = null;
-
-    private static Handler mHandler = null;
-
-    public static void setTextView(Handler handler, TextView logView) {
-        mHandler = handler;
-        mLogView = logView;
-    }
-
-    private static void addLogText(final String msg) {
-
-        mHandler.post(new Runnable() {
-
-            @Override
-            public void run() {
-
-                if (mLogView == null)
-                    return;
-
-                StringBuilder builder = new StringBuilder(mLogView.getText());
-                // add front
-                builder.append(msg + "\n");
-
-                mLogView.setText(builder.toString());
-            }
-
-        });
-
-    }
-
-    public static final void v(String className, String msg) {
-        android.util.Log.v(MAIN_TAG, className + "." + msg);
-
-        if (mLogView != null) {
-            addLogText(msg);
-        }
-    }
-
-    public static final void d(String className, String msg) {
-        android.util.Log.d(MAIN_TAG, className + "." + msg);
-
-        if (mLogView != null) {
-            addLogText(msg);
-        }
-    }
-
-    public static final void i(String className, String msg) {
-        android.util.Log.i(MAIN_TAG, className + "." + msg);
-
-        if (mLogView != null) {
-            addLogText(msg);
-        }
-    }
-
-    public static final void w(String className, String msg) {
-        android.util.Log.w(MAIN_TAG, className + "." + msg);
-
-        if (mLogView != null) {
-            addLogText(msg);
-        }
-    }
-
-    public static final void w(String className, String msg, Exception ex) {
-        android.util.Log.w(MAIN_TAG, className + "." + msg + ":" + ex.getMessage());
-
-        if (mLogView != null) {
-            addLogText(msg);
-        }
-    }
-
-    public static final void w(String className, String msg, Error e) {
-        android.util.Log.w(MAIN_TAG, className + "." + msg + ":" + e.getMessage());
-
-        if (mLogView != null) {
-            addLogText(msg);
-        }
-    }
-
-}
-
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
deleted file mode 100644 (file)
index 97d37e9..0000000
+++ /dev/null
@@ -1,713 +0,0 @@
-package org.iotivity.ca.service;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.os.Bundle;
-import android.os.Handler;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-
-import org.iotivity.ca.sample_service.R;
-
-public class MainActivity extends Activity {
-
-    static RMInterface RM = new RMInterface();
-
-    private final static String TAG = "Sample_Service : MainActivity";
-
-    private final CharSequence[] mNetworkCheckBoxItems = { Network.IP.name(),
-            Network.LE.name(), Network.EDR.name()};
-
-    private final CharSequence[] mDTLSCheckBoxItems = { DTLS.UNSECURED.name(),
-            DTLS.SECURED.name() };
-
-    private final CharSequence[] mMsgTyleCheckBoxItems = { MsgType.CON.name(),
-            MsgType.NON.name(), MsgType.ACK.name(), MsgType.RESET.name() };
-
-    private final CharSequence[] mResponseResultCheckBoxItems = {
-            ResponseResult.CA_SUCCESS.name(), ResponseResult.CA_CREATED.name(),
-            ResponseResult.CA_DELETED.name(), ResponseResult.CA_VALID.name(),
-            ResponseResult.CA_CHANGED.name(), ResponseResult.CA_CONTENT.name(),
-            ResponseResult.CA_EMPTY.name(), ResponseResult.CA_BAD_REQ.name(),
-            ResponseResult.CA_BAD_OPT.name(), ResponseResult.CA_NOT_FOUND.name(),
-            ResponseResult.CA_INTERNAL_SERVER_ERROR.name(),
-            ResponseResult.CA_RETRANSMIT_TIMEOUT.name() };
-
-    private enum Mode {
-        SERVER, CLIENT, BOTH, UNKNOWN
-    };
-
-    private enum Network {
-        IP, LE, EDR
-    };
-
-    private enum DTLS {
-        UNSECURED, SECURED
-    };
-
-    private enum MsgType {
-        CON, NON, ACK, RESET
-    };
-
-    private enum ResponseResult {
-        CA_SUCCESS, CA_CREATED, CA_DELETED, CA_VALID, CA_CHANGED, CA_CONTENT, CA_EMPTY,
-        CA_BAD_REQ, CA_BAD_OPT, CA_NOT_FOUND, CA_INTERNAL_SERVER_ERROR, CA_RETRANSMIT_TIMEOUT
-    }
-
-    private boolean mCheckedItems[] = {
-            false, false, false, false
-    };
-
-    private int mSelectedItems[] = { 0, 0, 0 };
-
-    private int mUnSelectedItems[] = { 0, 0, 0 };
-
-    private Mode mCurrentMode = Mode.UNKNOWN;
-
-    private RelativeLayout mSendNotificationLayout = null;
-
-    private RelativeLayout mSendRequestLayout = null;
-
-    private RelativeLayout mSendRequestToAllLayout = null;
-
-    private RelativeLayout mSendRequestSettingLayout = null;
-
-    private RelativeLayout mSendRequestToAllSettingLayout = null;
-
-    private RelativeLayout mSendResponseNotiSettingLayout = null;
-
-    private RelativeLayout mReceiveLayout = null;
-
-    private RelativeLayout mRequestTitleLayout = null;
-
-    private RelativeLayout mRequestToAllTitleLayout = null;
-
-    private RelativeLayout mResponseNotificationTitleLayout = null;
-
-    private RelativeLayout mHandleTitleLayout = null;
-
-    private TextView mMode_tv = null;
-
-    private TextView mNetwork_tv = null;
-
-    private EditText mNotification_ed = null;
-
-    private EditText mReqData_ed = null;
-
-    private EditText mReqToAllData_ed = null;
-
-    private Button mNotify_btn = null;
-
-    private Button mReqeust_btn = null;
-
-    private Button mReqeust_setting_btn = null;
-
-    private Button mReqeustToAll_btn = null;
-
-    private Button mReqeustToAll_setting_btn = null;
-
-    private Button mResponse_Notify_setting_btn = null;
-
-    private Button mResponse_btn = null;
-
-    private Button mGetNetworkInfo_btn = null;
-
-    private Button mRecv_btn = null;
-
-    private Handler mLogHandler = null;
-
-    /**
-     * Defined ConnectivityType in cacommon.c
-     *
-     * CA_IP = (1 << 0) CA_LE = (1 << 2) CA_EDR = (1 << 3)
-     */
-    private int CA_IP = (1 << 0);
-    private int CA_LE = (1 << 1);
-    private int CA_EDR = (1 << 2);
-    private int isSecured = 0;
-    private int msgType = 1;
-    private int responseValue = 0;
-    private int selectedNetworkType = -1;
-    private int selectedMsgType = 1;
-    private int selectedMsgSecured = 0;
-    private int selectedResponseValue = 0;
-    int selectedNetwork = -1;
-    int interestedNetwork = 0;
-    int uninterestedNetwork = 0;
-    private boolean isSendResponseSetting = false;
-    private boolean isSendRequestToAllSetting = false;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_main);
-
-        RM.setResponseListener(this);
-
-        mLogHandler = new Handler();
-        TextView logView = (TextView) findViewById(R.id.tv_result);
-        DLog.setTextView(mLogHandler, logView);
-
-        // Initialize UI
-        // common
-        mReceiveLayout = (RelativeLayout) findViewById(R.id.layout_receive);
-
-        // client
-        mSendRequestLayout = (RelativeLayout) findViewById(R.id.layout_request);
-        mSendRequestToAllLayout = (RelativeLayout) findViewById(R.id.layout_request_to_all);
-        mSendRequestSettingLayout = (RelativeLayout)
-                findViewById(R.id.layout_request_setting_for_client);
-        mSendRequestToAllSettingLayout = (RelativeLayout)
-                findViewById(R.id.layout_request_to_all_setting_for_client);
-        mRequestTitleLayout = (RelativeLayout) findViewById(R.id.layout_request_title);
-        mRequestToAllTitleLayout = (RelativeLayout) findViewById(R.id.layout_request_to_all_title);
-        mHandleTitleLayout = (RelativeLayout) findViewById(R.id.layout_handle_title);
-
-        // server
-        mSendNotificationLayout = (RelativeLayout) findViewById(R.id.layout_notify);
-        mSendResponseNotiSettingLayout = (RelativeLayout)
-                findViewById(R.id.layout_request_setting_for_server);
-        mResponseNotificationTitleLayout = (RelativeLayout)
-                findViewById(R.id.layout_Response_Noti_title);
-
-        mMode_tv = (TextView) findViewById(R.id.tv_mode);
-        mNetwork_tv = (TextView) findViewById(R.id.tv_network);
-
-        mNotification_ed = (EditText) findViewById(R.id.et_notification);
-        mReqData_ed = (EditText) findViewById(R.id.et_req_data);
-        mReqToAllData_ed = (EditText) findViewById(R.id.et_req_to_all_data);
-
-        mResponse_btn = (Button) findViewById(R.id.btn_sendresponse);
-        mNotify_btn = (Button) findViewById(R.id.btn_notify);
-        mReqeust_btn = (Button) findViewById(R.id.btn_Request);
-        mReqeust_setting_btn = (Button) findViewById(R.id.btn_Request_setting_for_client);
-        mReqeustToAll_btn = (Button) findViewById(R.id.btn_request_to_all);
-        mReqeustToAll_setting_btn = (Button)
-                findViewById(R.id.btn_request_to_all_setting_for_client);
-        mResponse_Notify_setting_btn = (Button) findViewById(R.id.btn_Request_setting_for_server);
-        mGetNetworkInfo_btn = (Button) findViewById(R.id.btn_get_network_info);
-        mRecv_btn = (Button) findViewById(R.id.btn_receive);
-
-        mResponse_btn.setOnClickListener(mSendResponseHandler);
-        mNotify_btn.setOnClickListener(mNotifyHandler);
-        mReqeust_btn.setOnClickListener(mSendRequestHandler);
-        mReqeust_setting_btn.setOnClickListener(mSendRequestSettingHandler);
-        mReqeustToAll_btn.setOnClickListener(mSendRequestToAllHandler);
-        mReqeustToAll_setting_btn.setOnClickListener(mSendRequestToAllSettingHandler);
-        mResponse_Notify_setting_btn
-                .setOnClickListener(mSendResponseNotiSettingHandler);
-        mRecv_btn.setOnClickListener(mResponseHandler);
-        mGetNetworkInfo_btn.setOnClickListener(mGetNetworkInfoHandler);
-
-        showSelectModeView();
-
-        // Initialize Connectivity Abstraction
-        RM.RMInitialize(getApplicationContext());
-
-        // set handler
-        RM.RMRegisterHandler();
-    }
-
-    private void showSelectModeView() {
-
-        mSendNotificationLayout.setVisibility(View.INVISIBLE);
-        mSendRequestLayout.setVisibility(View.INVISIBLE);
-        mSendRequestToAllLayout.setVisibility(View.INVISIBLE);
-        mSendRequestSettingLayout.setVisibility(View.INVISIBLE);
-        mSendRequestToAllSettingLayout.setVisibility(View.INVISIBLE);
-        mReceiveLayout.setVisibility(View.INVISIBLE);
-        mRequestTitleLayout.setVisibility(View.INVISIBLE);
-        mRequestToAllTitleLayout.setVisibility(View.INVISIBLE);
-        mHandleTitleLayout.setVisibility(View.INVISIBLE);
-        mResponseNotificationTitleLayout.setVisibility(View.INVISIBLE);
-        mSendResponseNotiSettingLayout.setVisibility(View.INVISIBLE);
-
-        mMode_tv.setText("Select Mode (Server or Client)");
-        Log.i(TAG, "Select Mode (Server or Client)");
-    }
-
-    private void showNetworkView() {
-
-        mNetwork_tv.setText("Select Network Type");
-        Log.i(TAG, "Select Network Type");
-    }
-
-    private void showModeView() {
-
-        if (mCurrentMode == Mode.SERVER) {
-
-            mSendNotificationLayout.setVisibility(View.VISIBLE);
-            mSendRequestLayout.setVisibility(View.INVISIBLE);
-            mSendRequestToAllLayout.setVisibility(View.VISIBLE);
-            mSendRequestSettingLayout.setVisibility(View.INVISIBLE);
-            mSendRequestToAllSettingLayout.setVisibility(View.VISIBLE);
-            mReceiveLayout.setVisibility(View.VISIBLE);
-
-            mRequestTitleLayout.setVisibility(View.INVISIBLE);
-            mRequestToAllTitleLayout.setVisibility(View.VISIBLE);
-            mHandleTitleLayout.setVisibility(View.VISIBLE);
-
-            mResponseNotificationTitleLayout.setVisibility(View.VISIBLE);
-            mSendResponseNotiSettingLayout.setVisibility(View.VISIBLE);
-
-            mNetwork_tv.setText("");
-
-        } else if (mCurrentMode == Mode.CLIENT) {
-
-            mSendNotificationLayout.setVisibility(View.INVISIBLE);
-            mSendRequestLayout.setVisibility(View.VISIBLE);
-            mSendRequestToAllLayout.setVisibility(View.VISIBLE);
-            mSendRequestSettingLayout.setVisibility(View.VISIBLE);
-            mSendRequestToAllSettingLayout.setVisibility(View.VISIBLE);
-            mReceiveLayout.setVisibility(View.VISIBLE);
-
-            mRequestTitleLayout.setVisibility(View.VISIBLE);
-            mRequestToAllTitleLayout.setVisibility(View.VISIBLE);
-            mHandleTitleLayout.setVisibility(View.VISIBLE);
-
-            mResponseNotificationTitleLayout.setVisibility(View.INVISIBLE);
-            mSendResponseNotiSettingLayout.setVisibility(View.INVISIBLE);
-
-            mNetwork_tv.setText("");
-        }
-    }
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-
-        // Terminate Connectivity Abstraction
-        RM.RMTerminate();
-        android.os.Process.killProcess(android.os.Process.myPid());
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-
-        menu.add(0, 1, Menu.NONE, "Start Server");
-        menu.add(0, 2, Menu.NONE, "Start Client");
-        menu.add(0, 3, Menu.NONE, "Select Network");
-
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-
-        switch (item.getItemId()) {
-
-        case 1:
-
-            RM.RMStartListeningServer();
-
-            if (interestedNetwork == 0) {
-                mCurrentMode = Mode.SERVER;
-                mMode_tv.setText("MODE: " + mCurrentMode.toString());
-                Log.i(TAG, "MODE: " + mCurrentMode.toString());
-                showNetworkView();
-
-            } else {
-                mCurrentMode = Mode.SERVER;
-                mMode_tv.setText("MODE: " + mCurrentMode.toString());
-                Log.i(TAG, "MODE: " + mCurrentMode.toString());
-                showModeView();
-            }
-
-            break;
-
-        case 2:
-
-            RM.RMStartDiscoveryServer();
-
-            if (interestedNetwork == 0) {
-                mCurrentMode = Mode.CLIENT;
-                mMode_tv.setText("MODE: " + mCurrentMode.toString());
-                Log.i(TAG, "MODE: " + mCurrentMode.toString());
-                showNetworkView();
-
-            } else {
-                mCurrentMode = Mode.CLIENT;
-                mMode_tv.setText("MODE: " + mCurrentMode.toString());
-                Log.i(TAG, "MODE: " + mCurrentMode.toString());
-                showModeView();
-            }
-
-            break;
-
-        case 3:
-
-            checkInterestedNetwork("Select Network");
-
-            break;
-        }
-
-        return super.onOptionsItemSelected(item);
-    }
-
-    private OnClickListener mSendResponseHandler = new OnClickListener() {
-
-        @Override
-        public void onClick(View v) {
-
-            DLog.v(TAG, "SendResponse click");
-            if ( selectedNetwork != -1) {
-                RM.RMSendResponse(selectedNetwork, isSecured, msgType, responseValue);
-            }
-            else {
-                DLog.v(TAG, "Please Select Network Type");
-            }
-        }
-    };
-
-    private OnClickListener mNotifyHandler = new OnClickListener() {
-
-        @Override
-        public void onClick(View v) {
-
-            DLog.v(TAG, "SendNotification click");
-            if ( selectedNetwork != -1) {
-                RM.RMSendNotification(mNotification_ed.getText().toString(),
-                    null, selectedNetwork, isSecured, msgType, responseValue);
-            }
-            else {
-                DLog.v(TAG, "Please Select Network Type");
-            }
-        }
-    };
-
-    private OnClickListener mSendRequestHandler = new OnClickListener() {
-
-        @Override
-        public void onClick(View v) {
-
-            DLog.v(TAG, "SendRequest click");
-            if ( selectedNetwork != -1) {
-                RM.RMSendRequest(mReqData_ed.getText().toString(), null,
-                    selectedNetwork, isSecured, msgType);
-            }
-            else {
-                DLog.v(TAG, "Please Select Network Type");
-            }
-        }
-    };
-
-    private OnClickListener mSendRequestSettingHandler = new OnClickListener() {
-
-        @Override
-        public void onClick(View v) {
-            checkSendNetworkType("Select Send Network Type");
-        }
-    };
-
-    private OnClickListener mSendRequestToAllHandler = new OnClickListener() {
-
-        @Override
-        public void onClick(View v) {
-
-            DLog.v(TAG, "SendRequestToAll click");
-            if ( selectedNetwork != -1) {
-                RM.RMSendReqestToAll(mReqToAllData_ed.getText().toString(), selectedNetwork);
-            }
-            else {
-                DLog.v(TAG, "Please Select Network Type");
-            }
-        }
-    };
-
-    private OnClickListener mSendRequestToAllSettingHandler = new OnClickListener() {
-
-        @Override
-        public void onClick(View v) {
-            isSendRequestToAllSetting = true;
-            checkSendNetworkType("Select Send Network Type");
-        }
-    };
-
-    private OnClickListener mSendResponseNotiSettingHandler = new OnClickListener() {
-
-        @Override
-        public void onClick(View v) {
-            isSendResponseSetting = true;
-            checkSendNetworkType("Select Send Network Type");
-        }
-    };
-
-    private OnClickListener mGetNetworkInfoHandler = new OnClickListener() {
-        @Override
-        public void onClick(View v) {
-
-            RM.RMGetNetworkInfomation();
-        }
-    };
-
-    private OnClickListener mResponseHandler = new OnClickListener() {
-
-        @Override
-        public void onClick(View v) {
-
-            RM.RMHandleRequestResponse();
-        }
-    };
-
-    private void checkInterestedNetwork(String title) {
-
-        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
-        builder.setTitle(title)
-                .setMultiChoiceItems(mNetworkCheckBoxItems, mCheckedItems,
-                        new DialogInterface.OnMultiChoiceClickListener() {
-
-                            @Override
-                            public void onClick(DialogInterface dialog,
-                                    int which, boolean isChecked) {
-
-                                if (isChecked) {
-
-                                    mSelectedItems[which] = 1;
-                                    mUnSelectedItems[which] = 0;
-
-                                } else if (mSelectedItems[which] == 1) {
-
-                                    mSelectedItems[which] = 0;
-                                    mUnSelectedItems[which] = 1;
-                                }
-                            }
-                        })
-                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-
-                        interestedNetwork = 0;
-
-                        for (int i = 0; i < mSelectedItems.length; i++) {
-                            if (mSelectedItems[i] == 1) {
-                                interestedNetwork |= (1 << i);
-                            }
-                        }
-                        if(0 != interestedNetwork)
-                            RM.RMSelectNetwork(interestedNetwork);
-
-                        uninterestedNetwork = 0;
-
-                        for (int i = 0; i < mUnSelectedItems.length; i++) {
-                            if (mUnSelectedItems[i] == 1) {
-                                uninterestedNetwork |= (1 << i);
-                            }
-                        }
-                        if(0 != uninterestedNetwork)
-                            RM.RMUnSelectNetwork(uninterestedNetwork);
-
-                    }
-                }).show();
-    }
-
-    private void checkMsgSecured(String title) {
-
-        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
-
-        builder.setTitle(title)
-                .setSingleChoiceItems(mDTLSCheckBoxItems, selectedMsgSecured,
-                        new DialogInterface.OnClickListener() {
-
-                            @Override
-                            public void onClick(DialogInterface dialog,
-                                    int which) {
-                                selectedMsgSecured = which;
-                            }
-                        })
-                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-
-                        if (selectedMsgSecured == DTLS.SECURED.ordinal()) {
-                            isSecured = 1;
-                            DLog.v(TAG, "Send secured message");
-
-                        } else if (selectedMsgSecured == DTLS.UNSECURED.ordinal()) {
-                            isSecured = 0;
-                            DLog.v(TAG, "Send unsecured message");
-                        }
-                        checkMsgType("Select Msg Type");
-                    }
-
-                }).show();
-    }
-
-    private void checkMsgType(String title) {
-
-        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
-        builder.setTitle(title)
-                .setSingleChoiceItems(mMsgTyleCheckBoxItems, selectedMsgType,
-                        new DialogInterface.OnClickListener() {
-
-                            @Override
-                            public void onClick(DialogInterface dialog,
-                                    int which) {
-                                selectedMsgType = which;
-                            }
-                        })
-                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-
-                        if (selectedMsgType == MsgType.CON.ordinal()) {
-                            msgType = 0;
-                            DLog.v(TAG, "Message Type is CON");
-
-                        } else if (selectedMsgType == MsgType.NON.ordinal()) {
-                            msgType = 1;
-                            DLog.v(TAG, "Message Type is NON");
-                        } else if (selectedMsgType == MsgType.ACK.ordinal()) {
-                            msgType = 2;
-                            DLog.v(TAG, "Message Type is ACK");
-                        } else if (selectedMsgType == MsgType.RESET.ordinal()) {
-                            msgType = 3;
-                            DLog.v(TAG, "Message Type is RESET");
-                            }
-
-                        if (isSendResponseSetting == true && msgType != 3) {
-                            checkResponseResult("Select Value of Response Result");
-                            isSendResponseSetting = false;
-                        }
-                    }
-                }).show();
-    }
-
-    private void checkResponseResult(String title) {
-
-        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
-        builder.setTitle(title)
-                .setSingleChoiceItems(mResponseResultCheckBoxItems, selectedResponseValue,
-                        new DialogInterface.OnClickListener() {
-
-                            @Override
-                            public void onClick(DialogInterface dialog,
-                                    int which) {
-                                selectedResponseValue = which;
-                            }
-                        })
-                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-
-                        if (selectedResponseValue == ResponseResult.CA_SUCCESS.ordinal()) {
-                            responseValue = 200;
-                            DLog.v(TAG, "Response Value is CA_SUCCESS");
-                        } else if (selectedResponseValue == ResponseResult.CA_CREATED
-                                .ordinal()) {
-                            responseValue = 201;
-                            DLog.v(TAG, "Response Value is CA_CREATED");
-                        } else if (selectedResponseValue == ResponseResult.CA_DELETED
-                                .ordinal()) {
-                            responseValue = 202;
-                            DLog.v(TAG, "Response Value is CA_DELETED");
-                        } else if (selectedResponseValue == ResponseResult.CA_VALID
-                                .ordinal()) {
-                            responseValue = 203;
-                            DLog.v(TAG, "Response Value is CA_VALID");
-                        } else if (selectedResponseValue == ResponseResult.CA_CHANGED
-                                .ordinal()) {
-                            responseValue = 204;
-                            DLog.v(TAG, "Response Value is CA_CHANGED");
-                        } else if (selectedResponseValue == ResponseResult.CA_CONTENT
-                                .ordinal()) {
-                            responseValue = 205;
-                            DLog.v(TAG, "Response Value is CA_CONTENT");
-                        } else if (selectedResponseValue == ResponseResult.CA_EMPTY
-                                .ordinal()) {
-                            responseValue = 0;
-                            DLog.v(TAG, "Response Value is CA_EMPTY");
-                        } else if (selectedResponseValue == ResponseResult.CA_BAD_REQ
-                                .ordinal()) {
-                            responseValue = 400;
-                            DLog.v(TAG, "Response Value is CA_BAD_REQ");
-                        } else if (selectedResponseValue == ResponseResult.CA_BAD_OPT
-                                .ordinal()) {
-                            responseValue = 402;
-                            DLog.v(TAG, "Response Value is CA_BAD_OPT");
-                        } else if (selectedResponseValue == ResponseResult.CA_NOT_FOUND
-                                .ordinal()) {
-                            responseValue = 404;
-                            DLog.v(TAG, "Response Value is CA_NOT_FOUND");
-                        } else if (selectedResponseValue ==
-                                ResponseResult.CA_INTERNAL_SERVER_ERROR
-                                .ordinal()) {
-                            responseValue = 500;
-                            DLog.v(TAG, "Response Value is CA_INTERNAL_SERVER_ERROR");
-                        } else if (selectedResponseValue == ResponseResult.CA_RETRANSMIT_TIMEOUT
-                                .ordinal()) {
-                            responseValue = 504;
-                            DLog.v(TAG, "Response Value is CA_RETRANSMIT_TIMEOUT");
-                        }
-                    }
-                }).show();
-    }
-
-    private void checkSendNetworkType(String title) {
-        selectedNetworkType = -1;
-        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
-
-        builder.setTitle(title)
-                .setSingleChoiceItems(mNetworkCheckBoxItems, -1,
-                        new DialogInterface.OnClickListener() {
-
-                            @Override
-                            public void onClick(DialogInterface dialog,
-                                    int which) {
-                                selectedNetworkType = which;
-                            }
-                        })
-                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
-
-                    @Override
-                    public void onClick(DialogInterface dialog, int which) {
-
-                        if (selectedNetworkType == Network.IP.ordinal()) {
-                            selectedNetwork = CA_IP;
-                            DLog.v(TAG, "Selected Network is CA_IP");
-                        } else if (selectedNetworkType == Network.LE.ordinal()) {
-                            selectedNetwork = CA_LE;
-                            DLog.v(TAG, "Selected Network is LE");
-                        } else if (selectedNetworkType == Network.EDR.ordinal()) {
-                            selectedNetwork = CA_EDR;
-                            DLog.v(TAG, "Selected Network is EDR");
-                        } else {
-                            DLog.v(TAG, "Selected Network is NULL");
-                            selectedNetwork = -1;
-                        }
-
-                        if (isSendRequestToAllSetting != true) {
-                            checkMsgSecured("Select DTLS Type");
-                        }
-                        isSendRequestToAllSetting = false;
-                    }
-                }).show();
-    }
-
-    public void OnResponseReceived(String subject, String receivedData) {
-        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());
-            mNotification_ed.setText(sb.toString());
-        }
-    }
-}
diff --git a/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/RMInterface.java b/resource/csdk/connectivity/samples/android/sample_service/src/org/iotivity/ca/service/RMInterface.java
deleted file mode 100644 (file)
index 0c9db02..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.iotivity.ca.service;
-
-import android.content.Context;
-
-public class RMInterface {
-
-    static {
-        // Load RI JNI interface
-        System.loadLibrary("RMInterface");
-    }
-
-    private org.iotivity.ca.service.MainActivity mResponseListener = null;
-
-    public native void setNativeResponseListener(Object listener);
-
-    public native void RMInitialize(Context context);
-
-    public native void RMTerminate();
-
-    public native void RMStartListeningServer();
-
-    public native void RMStartDiscoveryServer();
-
-    public native void RMRegisterHandler();
-
-    public native void RMFindResource(String uri);
-
-    public native void RMSendRequest(String uri, String payload,
-            int selectedNetwork, int isSecured, int msgType);
-
-    public native void RMSendReqestToAll(String uri, int selectedNetwork);
-
-    public native void RMSendResponse(int selectedNetwork, int isSecured,
-            int msgType, int responseValue);
-
-    public native void RMAdvertiseResource(String advertiseResource);
-
-    public native void RMSendNotification(String uri, String payload,
-            int selectedNetwork, int isSecured, int msgType, int responseValue);
-
-    public native void RMSelectNetwork(int interestedNetwork);
-
-    public native void RMUnSelectNetwork(int uninterestedNetwork);
-
-    public native void RMGetNetworkInfomation();
-
-    public native void RMHandleRequestResponse();
-
-    public void setResponseListener(org.iotivity.ca.service.MainActivity listener) {
-        mResponseListener = listener;
-        setNativeResponseListener(this);
-    }
-
-    private void OnResponseReceived(String subject, String receivedData) {
-        if (null != mResponseListener) {
-            mResponseListener.OnResponseReceived(subject, receivedData);
-        }
-    }
-
-}