Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:htw-happening/AndroidApp
Browse files Browse the repository at this point in the history
  • Loading branch information
cutoffthetop committed Feb 9, 2017
2 parents 5ca4fb7 + dc69fa5 commit 7f3a014
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import android.widget.ListView;
import android.widget.Toast;

import com.happening.poc_happening.MainActivity;
import com.happening.poc_happening.MyApp;
import com.happening.poc_happening.R;
import com.happening.poc_happening.adapter.ChatEntriesAdapter;
import com.happening.poc_happening.datastore.DBHelper;
Expand Down Expand Up @@ -42,10 +44,15 @@ public static ChatFragment getInstance() {

public ChatFragment() {
bluetoothLayer = Layer.getInstance();
bluetoothLayer.setAutoConnect(true);
bluetoothLayer.createGattServer();
bluetoothLayer.startAdvertising();
bluetoothLayer.startScan();
if (!bluetoothLayer.isAdvertisingSupported()) {
//ay caramba - this isnt good
Toast.makeText(MyApp.getAppContext(), "Advertising not supported!", Toast.LENGTH_LONG).show();
} else {
bluetoothLayer.setAutoConnect(true);
bluetoothLayer.createGattServer();
bluetoothLayer.startAdvertising();
bluetoothLayer.startScan();
}
}

@Override
Expand Down

0 comments on commit 7f3a014

Please sign in to comment.