Page 109

Android Programming Cookbook

101 / 143

</activity> <activity android:name=".androidBluetoothExample.DeviceListActivity" android:configChanges="orientation|keyboardHidden" android:label="@string/select_device" /> </application> </manifest>



We should add the AppCompat V7 support support library as well as RecyclerView V7 support support library the in our project. We can add them as dependencies to our application via build.gradle file. build.gradle apply plugin: ’’ android { compileSdkVersion 24 buildToolsVersion "24.0.0" defaultConfig { applicationId "com.javacodegeeks" minSdkVersion 14 targetSdkVersion 24 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(’proguard-android.txt’), ’proguard-rules. ←pro’ } } } dependencies { compile fileTree(dir: ’libs’, include: [’*.jar’]) testCompile ’junit:junit:4.12’ compile ’’ compile ’’ }


Build, compile and run

Tip This example should run simultaneously on two different Android devices, in order for the Bluetooth chat to connect and run. When we build, compile and run our project, the main BluetoothChat should look like this:


This is Yahya Christian School Magazine

Read more
Read more
Similar to
Popular now
Just for you