The following example uses the Android Bluetooth APIs to construct a simple peer-to-peer messaging system that works between two paired Bluetooth devices. Unfortunately the Android emulator can’t currently be used to test Bluetooth functionality. In order to test this application you will need to have two physical devices. 1. Start by creating a new BluetoothTexting project featuring a BluetoothTexting Activity. Modify the manifest to include BLUETOOTH and BLUETOOTH_ADMIN permissions. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.paad.chapter13_bluetoothtexting" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".BluetoothTexting" android:label="@string/app_name"> <in...
JNI Types and Data Structures Table 3-1 Primitive Types and Native Equivalents Java Type Native Type Description boolean jboolean unsigned 8 bits byte jbyte signed 8 bits char jchar unsigned 16 bits short jshort signed 16 bits int jint signed 32 bits long jlong signed 64 bits float jfloat 32 bits double jdouble 64 bits void void N/A Type Signatures The JNI uses the Java VM’s representation of type signatures. Table 3-2 shows these type signatures. Table 3-2 Java VM Type Signatures Type Signature Java Type Z boolean B byte C char S short I int J long F float D double L fully-qualified-class ; fully-qualified-class [ type type[] ( arg-types ) ret-type method type...
Awesome!
ReplyDeleteit is working good!