<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.iotivity.sample_service"
+ package="org.iotivity.sample_service"
android:versionCode="1"
android:versionName="1.0" >
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
- android:name="com.iotivity.service.MainActivity"
+ android:name="org.iotivity.service.MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
#include "cainterface.h"
#include "cacommon.h"
-#include "com_iotivity_service_RMInterface.h"
+#include "org_iotivity_service_RMInterface.h"
#define LOG_TAG "JNI_INTERFACE_SAMPLE"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
static CAToken_t g_clientToken;
static uint8_t g_clientTokenLength = NULL;
// init
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_setNativeResponseListener
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_setNativeResponseListener
(JNIEnv *env, jobject obj, jobject listener){
LOGI("setNativeResponseListener");
g_responseListenerObject = (*env)->NewGlobalRef(env, obj);
}
#endif
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMInitialize
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMInitialize
(JNIEnv *env, jobject obj, jobject context)
{
LOGI("RMInitialize");
}
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMTerminate(JNIEnv *env, jobject obj)
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMTerminate(JNIEnv *env, jobject obj)
{
LOGI("RMTerminate");
CATerminate();
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMStartListeningServer(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMStartListeningServer(JNIEnv *env,
jobject obj)
{
LOGI("RMStartListeningServer");
}
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMStartDiscoveryServer(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMStartDiscoveryServer(JNIEnv *env,
jobject obj)
{
LOGI("RMStartDiscoveryServer");
}
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMRegisterHandler(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMRegisterHandler(JNIEnv *env,
jobject obj)
{
LOGI("RMRegisterHandler");
CARegisterHandler(request_handler, response_handler);
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMFindResource(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMFindResource(JNIEnv *env,
jobject obj, jstring uri)
{
const char* strUri = (*env)->GetStringUTFChars(env, uri, NULL);
}
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMSendRequest(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendRequest(JNIEnv *env,
jobject obj, jstring uri, jstring payload, jint selectedNetwork, jint isSecured,
jint msgType)
{
CADestroyRemoteEndpoint(endpoint);
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMSendResponse(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendResponse(JNIEnv *env,
jobject obj, jstring uri, jstring payload, jint selectedNetwork, jint isSecured)
{
LOGI("RMSendResponse");
CADestroyRemoteEndpoint(endpoint);
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMAdvertiseResource(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMAdvertiseResource(JNIEnv *env,
jobject obj, jstring uri, jint selectedNetwork)
{
LOGI("RMAdvertiseResource");
free(headerOpt);
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMSendNotification(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendNotification(JNIEnv *env,
jobject obj, jstring uri, jstring payload, jint selectedNetwork, jint isSecured)
{
const char* strUri = (*env)->GetStringUTFChars(env, uri, NULL);
CADestroyRemoteEndpoint(endpoint);
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMSelectNetwork(JNIEnv *env, jobject obj,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSelectNetwork(JNIEnv *env, jobject obj,
jint networkType)
{
LOGI("RMSelectNetwork Type : %d", networkType);
}
}
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMHandleRequestResponse(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMHandleRequestResponse(JNIEnv *env,
jobject obj)
{
LOGI("RMHandleRequestResponse");
+++ /dev/null
-#include <jni.h>
-/* Header for class com_iotivity_service_RMInterface */
-
-#ifndef _Included_com_iotivity_service_RMInterface
-#define _Included_com_iotivity_service_RMInterface
-#ifdef __cplusplus
-extern "C" {
-#endif
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_setNativeResponseListener
- (JNIEnv *, jobject, jobject);
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMInitialize
- * Signature: (Landroid/content/Context;)V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMInitialize
- (JNIEnv *, jobject, jobject);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMTerminate
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMTerminate
- (JNIEnv *, jobject);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMStartListeningServer
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMStartListeningServer
- (JNIEnv *, jobject);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMStartDiscoveryServer
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMStartDiscoveryServer
- (JNIEnv *, jobject);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMRegisterHandler
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMRegisterHandler
- (JNIEnv *, jobject);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMFindResource
- * Signature: (Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMFindResource
- (JNIEnv *, jobject, jstring);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMSendRequest
- * Signature: (Ljava/lang/String;III)V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMSendRequest
- (JNIEnv *, jobject, jstring, jstring, jint, jint, jint);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMSendResponse
- * Signature: (Ljava/lang/String;III)V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMSendResponse
- (JNIEnv *, jobject, jstring, jstring, jint, jint);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMAdvertiseResource
- * Signature: (Ljava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMAdvertiseResource
- (JNIEnv *, jobject, jstring, jint);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMSendNotification
- * Signature: (Ljava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMSendNotification
- (JNIEnv *, jobject, jstring, jstring, jint, jint);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMSelectNetwork
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMSelectNetwork
- (JNIEnv *, jobject, jint);
-
-/*
- * Class: com_iotivity_service_RMInterface
- * Method: RMHandleRequestResponse
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_iotivity_service_RMInterface_RMHandleRequestResponse
- (JNIEnv *, jobject);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
--- /dev/null
+#include <jni.h>
+/* Header for class org_iotivity_service_RMInterface */
+
+#ifndef _Included_org_iotivity_service_RMInterface
+#define _Included_org_iotivity_service_RMInterface
+#ifdef __cplusplus
+extern "C" {
+#endif
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_setNativeResponseListener
+ (JNIEnv *, jobject, jobject);
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMInitialize
+ * Signature: (Landroid/content/Context;)V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMInitialize
+ (JNIEnv *, jobject, jobject);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMTerminate
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMTerminate
+ (JNIEnv *, jobject);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMStartListeningServer
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMStartListeningServer
+ (JNIEnv *, jobject);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMStartDiscoveryServer
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMStartDiscoveryServer
+ (JNIEnv *, jobject);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMRegisterHandler
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMRegisterHandler
+ (JNIEnv *, jobject);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMFindResource
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMFindResource
+ (JNIEnv *, jobject, jstring);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMSendRequest
+ * Signature: (Ljava/lang/String;III)V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendRequest
+ (JNIEnv *, jobject, jstring, jstring, jint, jint, jint);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMSendResponse
+ * Signature: (Ljava/lang/String;III)V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendResponse
+ (JNIEnv *, jobject, jstring, jstring, jint, jint);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMAdvertiseResource
+ * Signature: (Ljava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMAdvertiseResource
+ (JNIEnv *, jobject, jstring, jint);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMSendNotification
+ * Signature: (Ljava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendNotification
+ (JNIEnv *, jobject, jstring, jstring, jint, jint);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMSelectNetwork
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSelectNetwork
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: org_iotivity_service_RMInterface
+ * Method: RMHandleRequestResponse
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMHandleRequestResponse
+ (JNIEnv *, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.iotivity.service.MainActivity" >
+ tools:context="org.iotivity.service.MainActivity" >
<RelativeLayout
android:id="@+id/sample_service_layout"
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
- tools:context="com.iotivity.sample_service.MainActivity" >
+ tools:context="org.iotivity.sample_service.MainActivity" >
<item
android:id="@+id/action_settings"
-package com.iotivity.jar;
+package org.iotivity.jar;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
-package com.iotivity.jar;
+package org.iotivity.jar;
import android.content.BroadcastReceiver;
import android.content.Context;
-package com.iotivity.service;
+package org.iotivity.service;
import android.os.Handler;
import android.widget.TextView;
-package com.iotivity.service;
+package org.iotivity.service;
import java.util.ArrayList;
import android.widget.RelativeLayout;
import android.widget.TextView;
-import com.iotivity.sample_service.R;
+import org.iotivity.sample_service.R;
public class MainActivity extends Activity {
-package com.iotivity.service;
+package org.iotivity.service;
import android.content.Context;
System.loadLibrary("CAInterface");
}
- private com.iotivity.service.MainActivity mResponseListener = null;
+ private org.iotivity.service.MainActivity mResponseListener = null;
public native void setNativeResponseListener(Object listener);
public native void RMHandleRequestResponse();
- public void setResponseListener(com.iotivity.service.MainActivity listener) {
+ public void setResponseListener(org.iotivity.service.MainActivity listener) {
mResponseListener = listener;
setNativeResponseListener(this);
}