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 For example, the Java method:
>How to create a compressed tar.gz file from a folder or file in Linux? tar czf new-tar-file-name.tar.gz file-or-folder-to-archive Here is the command explanation: tar - the tar command. c - create new archive. z - compress the archive using gzip. f - use archive file. new-tar-file-name.tar.gz - the name of the tar.gz to create. file-or-folder-to-archive - the name of the folder we want to archive. >How to create a compressed tar.gz file from multiple files and folders in Linux? tar -czf new-tar-file-name.tar.gz file1 file2 folder1 folder2 >How to extract a compressed tar.gz file in Linux? tar -xzf tar-file-name.tar.gz Here is the command explanation: tar - the tar command. x - extract the archive. z - uncompress the archive using gzip. f - use archive file. tar-file-name.tar.gz - the name of the tar.gz to create. The tar command will extract all the files/folders in the archive to the current directory. >How to extract a compress
Awesome!
ReplyDeleteit is working good!