@@ -82,7 +82,7 @@ else if(view == findViewById(R.id.startDiscoverableAndDiscovery)) {
8282 }
8383
8484 ///////////////////////////////////////////////////////////////////////////////////////////
85- // asap message receiver example implementation //
85+ // asap message send/ receiver example implementation //
8686 ///////////////////////////////////////////////////////////////////////////////////////////
8787
8888 @ Override
@@ -96,6 +96,20 @@ public void asapMessagesReceived(ASAPMessages messages) {
9696 Toast .makeText (this , sb .toString (), Toast .LENGTH_LONG ).show ();
9797 }
9898
99+
100+ private void addMessage () throws IOException , ASAPException {
101+ // indirect - prefered way - send via ASAPService
102+ Log .d (this .getLogStart (), "ask asap service to deliver a message" );
103+ this .sendASAPMessage (APPNAME , URI , null , BYTE_MESSAGE );
104+
105+ /*
106+ // direct approach - write into local file system
107+ this.checkStorage();
108+ Log.d(this.getLogStart(), "add message to storage: " + MESSAGE);
109+ this.asapStorage.add(URI, MESSAGE);
110+ */
111+ }
112+
99113 ///////////////////////////////////////////////////////////////////////////////////////////
100114 // helps debugging //
101115 ///////////////////////////////////////////////////////////////////////////////////////////
@@ -236,17 +250,4 @@ private void checkStorage() throws IOException, ASAPException {
236250 this .setupCleanASAPStorage ();
237251 }
238252 }
239-
240- private void addMessage () throws IOException , ASAPException {
241- // indirect - prefered way - send via ASAPService
242- Log .d (this .getLogStart (), "ask asap service to deliver a message" );
243- this .sendASAPMessage (APPNAME , URI , null , BYTE_MESSAGE );
244-
245- /*
246- // direct approach - write into local file system
247- this.checkStorage();
248- Log.d(this.getLogStart(), "add message to storage: " + MESSAGE);
249- this.asapStorage.add(URI, MESSAGE);
250- */
251- }
252253}
0 commit comments