This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this dependency is to provide android-things compatibility in your app's gradle file | |
provided 'com.google.android.things:androidthings:0.4-devpreview' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--this line is for android-things compatibility--> | |
<uses-library android:name="com.google.android.things"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bridgefy.start(new MessageListener() { | |
@Override | |
public void onMessageReceived(Message message) { | |
super.onMessageReceived(message); | |
//We have received a message from another peer | |
} | |
}, new StateListener() { | |
@Override | |
public void onDeviceConnected(Device device, Session session) { | |
super.onDeviceConnected(device, session); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isThingsDevice(Context context) { | |
final PackageManager pm = context.getPackageManager(); | |
return pm.hasSystemFeature("android.hardware.type.embedded"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UUID.fromString("0000" + longUuid.toString().substring(4, 8) + "-0000-1000-8000-00805f9b34fb"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="material_red50">#ffffebee</color> | |
<color name="material_red100">#ffffcdd2</color> | |
<color name="material_red200">#ffef9a9a</color> | |
<color name="material_red300">#ffe57373</color> | |
<color name="material_red400">#ffef5350</color> | |
<color name="material_red500">#fff44336</color> | |
<color name="material_red600">#ffe53935</color> | |
<color name="material_red700">#ffd32f2f</color> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps to solve the dex limit error on android apps: | |
Make sure you have the v21 support library | |
compile "com.android.support:appcompat-v7:21.0.0" | |
Add the multidex support jar to your project libraries. This jar is located in your SDK folder on the following path: | |
extras/android/support/multidex/library/libs/android-support-multidex.jar |