thedamfr / android-bleeventadapter Goto Github PK
View Code? Open in Web Editor NEWAn Event-Based Adapter to connect your Android Device via Bluetooth Low Energy aka. Bluetooth Smart. Welcome to the Internet Of Things !
License: Apache License 2.0
An Event-Based Adapter to connect your Android Device via Bluetooth Low Energy aka. Bluetooth Smart. Welcome to the Internet Of Things !
License: Apache License 2.0
should to fix BleEventAdapter at line 37.
public void connectDevice(Context context, BluetoothDevice device) {
context.stopService(new Intent(context, GattService.class));
}
First of all thanks for your contribution.
I am trying to use your code in order to discover a TI CC2541 keyfob BLE device with a samsung galaxy S4 running android 4.3 but it just never stops. my code is attached below can you tell me what I am doing wrong?
package com.keyfob;
import com.squareup.otto.Subscribe;
import com.thedamfr.android.BleEventAdapter.BleEventAdapter;
import com.thedamfr.android.BleEventAdapter.BleEventBus;
import com.thedamfr.android.BleEventAdapter.events.DiscoveredDevicesEvent;
import com.thedamfr.android.BleEventAdapter.events.ScanningEvent;
import android.os.Bundle;
import android.app.Activity;
import android.bluetooth.BluetoothDevice;
import android.view.Menu;
import android.view.View;
public class MainActivity extends Activity {
// Class variables
BluetoothDevice device;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
BleEventAdapter.getInstance().startScanning(this);
}
@Override
protected void onResume() {
super.onResume();
BleEventBus.getInstance().register(this);
BleEventAdapter.getInstance().startScanning(this);
}
public void ActivateAlert(View v) {
}
@Override
protected void onPause() {
super.onPause();
BleEventBus.getInstance().unregister(this);
}
@Subscribe
public void onDiscoveredDevice(DiscoveredDevicesEvent event) {
device = event.getDevice();
}
}
Thank you so much for making this lib.
Do you have updated plan relating to the multiple device connection?
If you do not have an update plan, I have a plan to make it myself.
Do you have any idea how to implement?
Or do you have beta version source code? or any reference document or source for this?
If you have any references please share to me.
And I will share with you all sources.
Hi, thanks for making this lib, it works pretty well. I am wondering if you have any updates of this lib for supporting multiple device connection.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.