Skip to content

Commit 521c49a

Browse files
committed
still on simultaneous online / offline asap exchange
1 parent 02c9ee7 commit 521c49a

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ https://developer.android.com/studio/projects/android-library
33
*/
44

55
// choose one line either for an app or a lib
6-
//apply plugin: 'com.android.application'
7-
apply plugin: 'com.android.library'
6+
apply plugin: 'com.android.application'
7+
//apply plugin: 'com.android.library'
88

99
android {
1010
compileSdkVersion 28
1111
defaultConfig {
1212
// we produce a library by commenting out that line:
13-
// applicationId "net.sharksystem.asap.example"
13+
applicationId "net.sharksystem.asap.example"
1414
minSdkVersion 23
1515
targetSdkVersion 28
1616
versionCode 1

app/src/main/java/net/sharksystem/asap/android/Util.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static String makeValidFolderName(CharSequence rootFolder, CharSequence ownerNam
2626
// substitute special chars
2727
String folderName = Utils.url2FileName(ownerName.toString());
2828
Log.d("Util", "create asap folder for "
29-
+ ownerName + " | use folderName" + folderName);
29+
+ ownerName + " | use folderName: " + folderName);
3030

3131
return rootFolder + "/" + folderName;
3232
}

app/src/main/java/net/sharksystem/asap/android/bluetooth/BluetoothEngine.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ public static BluetoothEngine getASAPBluetoothEngine(ASAPService ASAPService,
4646
return BluetoothEngine.engine;
4747
}
4848

49-
public static BluetoothEngine getASAPBluetoothEngine() {
50-
return BluetoothEngine.engine;
51-
}
52-
5349
private BluetoothEngine(ASAPService ASAPService, Context context) {
5450
super(ASAPService, context);
5551

app/src/main/java/net/sharksystem/asap/android/service/ASAPService.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ void startBluetooth() {
184184
void stopBluetooth() {
185185
Log.d("ASAPService", "stop bluetooth");
186186

187-
BluetoothEngine asapBluetoothEngine = BluetoothEngine.getASAPBluetoothEngine();
187+
BluetoothEngine asapBluetoothEngine =
188+
BluetoothEngine.getASAPBluetoothEngine(this, this);
189+
188190
if(asapBluetoothEngine != null) {
189191
asapBluetoothEngine.stop();
190192
}
@@ -195,7 +197,9 @@ void stopBluetooth() {
195197
void startBluetoothDiscoverable() {
196198
Log.d("ASAPService", "start bluetooth discoverable");
197199

198-
BluetoothEngine asapBluetoothEngine = BluetoothEngine.getASAPBluetoothEngine();
200+
BluetoothEngine asapBluetoothEngine =
201+
BluetoothEngine.getASAPBluetoothEngine(this, this);
202+
199203
asapBluetoothEngine.startDiscoverable();
200204

201205
Log.d("ASAPService", "started bluetooth discoverable");
@@ -205,7 +209,9 @@ void startBluetoothDiscoverable() {
205209
public void startBluetoothDiscovery() {
206210
Log.d("ASAPService", "start bluetooth discovery");
207211

208-
BluetoothEngine asapBluetoothEngine = BluetoothEngine.getASAPBluetoothEngine();
212+
BluetoothEngine asapBluetoothEngine =
213+
BluetoothEngine.getASAPBluetoothEngine(this, this);
214+
209215
asapBluetoothEngine.startDiscovery();
210216

211217
Log.d("ASAPService", "started bluetooth discovery");

0 commit comments

Comments
 (0)