From 33e4450bfd59eb7900de6379ac5c822dfa9ca6c1 Mon Sep 17 00:00:00 2001 From: thsc42 Date: Wed, 20 Jan 2021 11:02:22 +0100 Subject: [PATCH] 0.4.0 --- app/build.gradle | 6 +-- .../asap/android/apps/ASAPAndroidPeer.java | 47 +------------------ .../android/example/ASAPExampleActivity.java | 1 + 3 files changed, 5 insertions(+), 49 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 447fe59..76d03c7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,14 +3,14 @@ https://developer.android.com/studio/projects/android-library */ // choose one line either for an app or a lib -apply plugin: 'com.android.application' -//apply plugin: 'com.android.library' +//apply plugin: 'com.android.application' +apply plugin: 'com.android.library' android { compileSdkVersion 29 defaultConfig { // we produce a library by commenting out that line: - applicationId "net.sharksystem.asap.example" + //applicationId "net.sharksystem.asap.example" minSdkVersion 23 targetSdkVersion 29 versionCode 1 diff --git a/app/src/main/java/net/sharksystem/asap/android/apps/ASAPAndroidPeer.java b/app/src/main/java/net/sharksystem/asap/android/apps/ASAPAndroidPeer.java index f732e6a..659deb6 100644 --- a/app/src/main/java/net/sharksystem/asap/android/apps/ASAPAndroidPeer.java +++ b/app/src/main/java/net/sharksystem/asap/android/apps/ASAPAndroidPeer.java @@ -557,54 +557,9 @@ public void removeASAPMessageReceivedListener( // other listeners beside chunk received // /////////////////////////////////////////////////////////////////////////////////////////////// - /* - public void chunkReceived(String format, String sender, String uri, String foldername, int era) { - Log.d(this.getLogStart(), "got chunkReceived message: " - + format + " | "+ sender + " | " + uri + " | " + foldername + " | " + era); - - // inform uri changed listener - if any - Collection uriListeners = - this.uriContentChangedListener.get(format); - - Log.d(this.getLogStart(), "going to inform uri changed listener about it: " - + uriListeners); - - if(uriListeners != null) { - for(ASAPUriContentChangedListener uriListener : uriListeners) { - uriListener.asapUriContentChanged(uri); - } - } - - // inform message listeners - if any - Collection messageListeners = - this.messageReceivedListener.get(format); - - Log.d(this.getLogStart(), "going to inform message listener about it: " - + messageListeners); - - if(messageListeners != null) { - ASAPMessages asapMessages = Helper.getMessagesByChunkReceivedInfos( - format, sender, uri, foldername, era); - - if(asapMessages == null) { - Log.e(this.getLogStart(), "cannot create message - failure - give up"); - return; - } - - for(ASAPMessageReceivedListener messageListener : messageListeners) { - try { - messageListener.asapMessagesReceived(asapMessages); - } catch (IOException e) { - Log.e(this.getLogStart(), "calling messageReceivedListener: " - + e.getLocalizedMessage()); - } - } - } - } - */ - /////// uri changed listener - under construction - not yet support with ASAPPeer and not yet documented in web page + // TODO - replace or move to ASAPPeer in the Java project private Map> uriContentChangedListener = new HashMap<>(); diff --git a/app/src/main/java/net/sharksystem/asap/android/example/ASAPExampleActivity.java b/app/src/main/java/net/sharksystem/asap/android/example/ASAPExampleActivity.java index 9661ca9..c9a0327 100644 --- a/app/src/main/java/net/sharksystem/asap/android/example/ASAPExampleActivity.java +++ b/app/src/main/java/net/sharksystem/asap/android/example/ASAPExampleActivity.java @@ -8,6 +8,7 @@ import android.widget.Toast; import net.sharksystem.asap.ASAPException; +import net.sharksystem.asap.ASAPPeer; import net.sharksystem.asap.android.R; // TODO do not work with internal classes in any example!! import net.sharksystem.asap.android.apps.ASAPActivity;