Page 109

Android Programming Cookbook

101 / 143

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

5.9

build.gradle

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: ’com.android.application’ 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 ’com.android.support:appcompat-v7:24.1.1’ compile ’com.android.support:recyclerview-v7:24.1.1’ }

5.10

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:

SKY MAGZ  

This is Yahya Christian School Magazine

Read more
Read more
Similar to
Popular now
Just for you