-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
264a774
commit c827151
Showing
239 changed files
with
27,232 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# Bluefruit_LE_Connect_Android_V2 | ||
Bluefruit LE Connect Android source code (V2) | ||
|
||
Android app for use with Bluefruit Bluetooth LE modules and dev boards from Adafruit. | ||
|
||
|
||
## App Versions | ||
|
||
- Master branch is for version 3.x of the app (Android) | ||
|
||
- The source code for previous unsupported versions is available at [Bluefruit_LE_Connect_Android](https://github.com/adafruit/Bluefruit_LE_Connect_Android). | ||
|
||
|
||
## Supported Hardware | ||
|
||
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! | ||
|
||
This application works with the following Bluefruit LE devices from Adafruit: | ||
|
||
- [Bluefruit LE Friend](https://www.adafruit.com/product/2267) | ||
- [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479) | ||
- [Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633) | ||
- [Bluefruit LE Shield](https://www.adafruit.com/products/2746) | ||
- [Bluefruit LE Micro](https://www.adafruit.com/product/2661) (Retired) | ||
- [Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829) | ||
- [Feather M0 Bluefruit LE](https://www.adafruit.com/products/2995) | ||
|
||
## License | ||
|
||
Unless otherwise specified, all files produced by Adafruit are covered by an [MIT license](https://github.com/adafruit/Bluefruit_LE_Connect_Android/blob/master/license.txt). | ||
|
||
Files produced by Nordic Semiconductors are covered by their own license terms, as detailed in the file headers and appropriate folders. Please carefully review the license requirements before using this source code in your own application. | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 27 | ||
buildToolsVersion "27.0.3" | ||
defaultConfig { | ||
applicationId "com.adafruit.bluefruit.le.connect" | ||
minSdkVersion 19 | ||
targetSdkVersion 27 | ||
versionCode 19 | ||
versionName "3.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
vectorDrawables.useSupportLibrary = true | ||
resValue "string", "app_name", "Bluefruit" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
aaptOptions { | ||
noCompress "zip" | ||
} | ||
|
||
buildTypes { | ||
beta { | ||
initWith debug | ||
|
||
applicationIdSuffix ".beta" | ||
resValue "string", "app_name", "Bluefruit Beta" | ||
} | ||
|
||
release { | ||
minifyEnabled true | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.2' | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
|
||
// Support library | ||
implementation 'com.android.support:support-v4:27.1.1' | ||
implementation 'com.android.support:appcompat-v7:27.1.1' | ||
implementation 'com.android.support:design:27.1.1' | ||
implementation 'com.android.support:support-vector-drawable:27.1.1' | ||
implementation 'com.android.support:recyclerview-v7:27.1.1' | ||
implementation 'com.android.support:percent:27.1.1' | ||
implementation 'com.android.support:cardview-v7:27.1.1' | ||
|
||
// Google Play Services | ||
implementation 'com.google.android.gms:play-services-base:15.0.1' | ||
implementation 'com.google.android.gms:play-services-location:15.0.1' | ||
implementation 'com.google.android.gms:play-services-vision:15.0.2' | ||
implementation 'com.google.android.gms:play-services-auth:15.0.1' // To enable ssl to download files on Android 4.4 | ||
|
||
// Nordic | ||
implementation 'no.nordicsemi.android.support.v18:scanner:1.1.0' | ||
implementation 'no.nordicsemi.android:dfu:1.6.1' | ||
|
||
// Architecture Components | ||
implementation 'android.arch.lifecycle:extensions:1.1.1' | ||
// compile "android.arch.lifecycle:compiler:1.0.0-rc1" | ||
implementation 'android.arch.lifecycle:common-java8:1.1.1' | ||
|
||
// Mqtt | ||
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0' | ||
implementation(group: 'org.eclipse.paho', name: 'org.eclipse.paho.android.service', version: '1.1.1') { | ||
exclude module: 'support-v4' | ||
} | ||
|
||
// Charts | ||
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3' | ||
|
||
// Color Picker | ||
implementation 'com.larswerkman:HoloColorPicker:1.5' | ||
|
||
// LeakCanary | ||
betaImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4' | ||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4' | ||
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' | ||
|
||
// | ||
testImplementation 'junit:junit:4.12' | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/antonio/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile | ||
|
||
# Remove logs on release builds | ||
-assumenosideeffects class android.util.Log { | ||
public static boolean isLoggable(java.lang.String, int); | ||
public static int v(...); | ||
public static int i(...); | ||
public static int w(...); | ||
public static int d(...); | ||
public static int e(...); | ||
} | ||
|
||
# Nordic DFU library | ||
-keep class no.nordicsemi.android.dfu.** { *; } | ||
|
||
# Paho library logger | ||
-keep class org.eclipse.paho.client.mqttv3.logging.JSR47Logger { | ||
*; | ||
} | ||
|
||
# Avoid warnings for old code in Paho 1.0.2 on Android Studio 2 | ||
-keep class org.eclipse.paho.client.mqttv3.persist.** { *; } | ||
-dontwarn org.eclipse.paho.client.mqttv3.persist.** | ||
-keepattributes Exceptions, Signature, InnerClasses |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.adafruit.bluefruit.le.connect"> | ||
|
||
<uses-feature | ||
android:name="android.hardware.bluetooth_le" | ||
android:required="true" /> | ||
|
||
<!-- Bluetooth Permissions --> | ||
<uses-permission android:name="android.permission.BLUETOOTH" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- Scanning: Needed for bluetooth scanning --> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- Controller: Client must have ACCESS_FINE_LOCATION permission to request PRIORITY_HIGH_ACCURACY location --> | ||
|
||
<!-- Downloads Permissions --> | ||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
<!-- Barcode reading --> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
|
||
<!-- App --> | ||
<application | ||
android:name=".BluefruitApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<service android:name=".dfu.DfuService" /> | ||
|
||
<!-- Mqtt Service --> | ||
<service android:name="org.eclipse.paho.android.service.MqttService" /> | ||
|
||
<activity | ||
android:name=".app.SplashActivity" | ||
android:label="@string/app_name" | ||
android:theme="@style/SplashTheme"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
|
||
<intent-filter> | ||
<action android:name="android.intent.action.VIEW" /> | ||
|
||
<category android:name="android.intent.category.DEFAULT" /> | ||
<category android:name="android.intent.category.BROWSABLE" /> | ||
|
||
<data | ||
android:host="bluefruit" | ||
android:scheme="app" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".app.MainActivity" | ||
android:label="@string/app_name" | ||
android:launchMode="singleTop" /> | ||
|
||
<!-- DFU Notification --> | ||
<activity android:name=".dfu.NotificationActivity" /> | ||
|
||
</application> | ||
</manifest> |
Oops, something went wrong.