Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cda5b01
Add xltDevice moudle, setup SDK structure
sunbaoshi1975 Nov 18, 2016
99d739f
clean
sunbaoshi1975 Nov 18, 2016
1edd84d
support multiple cloud device instances
sunbaoshi1975 Nov 24, 2016
6b4e793
add STATE_TOGGLE value
sunbaoshi1975 Dec 1, 2016
f938412
Implement event handler lists in xltDevice class
sunbaoshi1975 Dec 2, 2016
3ce2241
show more information on Glance activity
sunbaoshi1975 Dec 3, 2016
4d3654c
Event Broadcast demo
sunbaoshi1975 Dec 8, 2016
94db83e
Add BLEAdapter class
sunbaoshi1975 Dec 12, 2016
ca954e5
SDK BLE package
sunbaoshi1975 Dec 12, 2016
456eac8
BLE bridge disconnect
sunbaoshi1975 Dec 12, 2016
c693725
PowerSwitch supports toggle parameter
sunbaoshi1975 Dec 13, 2016
885e7eb
select bridge according to priority
sunbaoshi1975 Dec 17, 2016
b68c791
SDK supports multi-node under a device(controller)
sunbaoshi1975 Mar 18, 2017
5f15457
display ALS sensor data
sunbaoshi1975 Mar 19, 2017
3d03688
BLE connection
sunbaoshi1975 Mar 21, 2017
340b6c7
cloud SDK & private cloud
sunbaoshi1975 Mar 24, 2017
1abcefb
update SDK by following Xlight SmartController API V1.5
sunbaoshi1975 Apr 30, 2017
e378b6e
update status icon of device list to indicate offline, light-off and …
sunbaoshi1975 May 8, 2017
15b1623
SDK: add Disconnect() interface
sunbaoshi1975 May 12, 2017
91c48d6
SDK: BLE bridge, sysConfig, sysControl & sysWiFiSetup interfaces
sunbaoshi1975 May 30, 2017
769294e
fix bugs and add settings & WiFi setup fragments
sunbaoshi1975 Jun 2, 2017
d5337cb
rename package
sunbaoshi1975 Jun 7, 2017
9bc3a63
use special effect instead of timer for dance mode
sunbaoshi1975 Jul 20, 2017
a2b4b1d
SDK: add relay key API & Events
sunbaoshi1975 Dec 18, 2017
c907dc9
add, update & delect node from device list
sunbaoshi1975 Dec 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
.DS_Store
/build
/captures
<<<<<<< HEAD
<<<<<<< HEAD
app/src/main/java/ca/xlight/demoapp/SDK/CloudAccount.java
=======
>>>>>>> parent of 99d739f... clean
=======
>>>>>>> parent of 99d739f... clean
7 changes: 7 additions & 0 deletions .idea/dictionaries/sunboss.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 1 addition & 14 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/build
/src/main/java/com/umarbhutta/xlightcompanion/particle/CloudAccount.java
/src/main/java/ca/xlight/demoapp/SDK/CloudAccount.java
35 changes: 24 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.umarbhutta.xlightcompanion"
applicationId "ca.xlight.demoapp"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
targetSdkVersion 25
versionCode 2
versionName "2.0"
}
buildTypes {
release {
Expand All @@ -27,13 +27,26 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:support-fragment:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.github.clans:fab:1.6.4'
compile 'com.yanzhenjie:recyclerview-swipe:1.1.3'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'io.particle:cloudsdk:0.3.4'

// BY DEFAULT, BUILD APP AGAINST THE LOCAL SDK SOURCE
// (i.e.: make modifications to the SDK source in the local repo show up in this app
// just by rebuilding)
compile project(':cloudsdk')
//
// **OR**
//
// comment out the above, and
// UNCOMMENT THE FOLLOWING TO USE A PUBLISHED VERSION OF THE SDK:
//compile 'io.particle:cloudsdk:0.3.4'

compile 'io.particle:devicesetup:0.3.6'
compile 'me.priyesh:chroma:1.0.2'
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.umarbhutta.xlightcompanion;
package ca.xlight.demoapp;

import android.app.Application;
import android.test.ApplicationTestCase;
Expand Down
26 changes: 23 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.umarbhutta.xlightcompanion">
package="ca.xlight.demoapp">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="false" />

<application
android:allowBackup="true"
Expand All @@ -24,10 +30,24 @@
</activity>
<activity
android:name=".schedule.AddScheduleActivity"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait" />
<activity
android:name=".scenario.AddScenarioActivity"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait" />

<receiver
android:name=".Tools.DataReceiver"
android:enabled="true"
android:exported="true" />
<receiver
android:name=".Tools.StatusReceiver"
android:enabled="true"
android:exported="true" />

<activity
android:name=".glance.AddNewDevice"
android:label="@string/title_activity_add_new_device"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package ca.xlight.demoapp.SDK.BLE;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;

import java.util.Set;

/**
* Created by sunboss on 2017-03-21.
*/

public class BLEAdapterDelegate implements BLEAdapterWrapper {

private final BluetoothAdapter adapter;

public BLEAdapterDelegate(BluetoothAdapter adapter) {
assert adapter != null;
this.adapter = adapter;
}

@Override
public Set<BluetoothDevice> getBondedDevices() {
return adapter.getBondedDevices();
}

@Override
public void cancelDiscovery() {
adapter.cancelDiscovery();
}

@Override
public boolean isDiscovering() {
return adapter.isDiscovering();
}

@Override
public void startDiscovery() {
adapter.startDiscovery();
}

@Override
public boolean isEnabled() {
return adapter.isEnabled();
}
}
18 changes: 18 additions & 0 deletions app/src/main/java/ca/xlight/demoapp/SDK/BLE/BLEAdapterFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ca.xlight.demoapp.SDK.BLE;

import android.bluetooth.BluetoothAdapter;

/**
* Created by sunboss on 2017-03-21.
*/

public class BLEAdapterFactory {
private BLEAdapterFactory() {
// utility class
}

public static BLEAdapterWrapper getBluetoothAdapterWrapper() {
BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
return defaultAdapter != null ? new BLEAdapterDelegate(defaultAdapter) : new NullBLEWrapper();
}
}
22 changes: 22 additions & 0 deletions app/src/main/java/ca/xlight/demoapp/SDK/BLE/BLEAdapterWrapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package ca.xlight.demoapp.SDK.BLE;

import android.bluetooth.BluetoothDevice;

import java.util.Set;

/**
* Created by sunboss on 2017-03-21.
*/

public interface BLEAdapterWrapper {

Set<BluetoothDevice> getBondedDevices();

void cancelDiscovery();

boolean isDiscovering();

void startDiscovery();

boolean isEnabled();
}
Loading