Hi, MFile.SaveFile block within NotificationReceived Block is not updating file for every new notification.
===================================================================================
Hi, MFile.SaveFile block within NotificationReceived Block is not updating file for every new notification.
===================================================================================
Your blocks work, if
From the documentation App Inventor Extensions: Notification Listener | Pura Vida Apps
Event indicating that a notification has been received.
If your app is up and running, new notifications can be received via this event.
If you want to have it working in the background, you additionally need itoo...
See again Notification Listener (powered by itoox-wrapper) and Itoo
Taifun
I kept the app open, it is creating the text file successfully first time. But, after that it is not updating the file with empty text (or with some text) for each new notification. I shall share the .ab file.
From your blocks I only can see empty text... the second time empty text overwrites empty text so in the end nothing happened
Prepare a reasonable example and keep your app open all the time without any other app editing the file...
Tsifun
I tested with other texts as well after the app successfully created the file. It didn't update. I shall share the app here in one minute.
Hi this is the app
csvDataBase2.aia (1.6 MB)
The app has to function like this;
At first, it has to create a text file.
Then, for each new notification, the app must modify/overwrite the text file with some predictable texts like Apple or empty text or etc.
Once mit ai2 app modified the text file, the Tasker (For testing purpose we can put some new text manually in the text file.) will update the same file with new text. NOTE: Tasker code is set in such way that it has to run whenever the text file got modified.
Mit ai2 app will read the text file continuously to detect the changes that will be done by the Tasker and once detected, the new text data will be updated in a global variable and the Label of the app.
ISSUE THAT I FACE:
Mit ai2 app is not updating the text file after once it created the text file.
Updated with Block Images:
If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...
which means in your case post a screenshot of your relevant blocks...
To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
There you go
I do not know how many times I already told you
Which means, you have to use SAF or in case you do not plan to publish your app you can
Taifun
I do not want to publish this app. This app will be used only on my phone so I don't need to publish. This app is kept open. Up & Running means keeping the App open, right?
Yes
Taifun
So, since I do not want to publish the app, can I skip SAF? If so, why the problem persists, ie, not able to delete or overwrite the text file that was successfully created by the same app after installation (not created using companion).
When I tried only this much, everything worked as expected. Let me try more ...
Again, I am facing a small issue. Now, the text file is successfully getting updated by mit ai2 app with empty data. So, since the file is getting modified, Tasker is also updating the same text file with keyword/some ID.
Now, MIT ai2 app has to parse that data and put it in a global variable and a label. This is not working as expected. But, If I close and open the app again, the label is showing that parsed data from the text file ie, keyword/some ID. But, I want to make that happen without closing and reopening the app.
How can I do that?
How can I solve this issue? I think, part of the code/blocks is not looping successfully so only it may be giving output only when I close and reopen the code. Help me to solve this ...
MY EXPECTATIONS:
My expectation is that these two blocks will loop each other until the global variable will get updated with new keyword. But, facing the above said issue, so the looping may not be working... Give me clarity and guide me to solve this.
How can I trigger Screen.Initialize block multiple times?
When I added this additional block 'open another screen' everything is working as expected. Anyhow, I have to crosscheck everything later.