1) Read .csv file from phone, 2) Seach for a keyword 'Apple4321' 3) If keyword found, then look for the nearest word if it is 'send' 4) If the word 'send' is found do some action like 'play music'

"To find out the answer yourself, check the documentation and see how it is done in the example project

No

Taifun

1 Like

In Android 11, it is directing me to another page 'Notification Access'. Since I am trying Companion, my app is not in the list also.

Do it feature is working.

My Android phone not allowed me to install the app as well, then I changed the play settings to install it.

from the Q&A section App Inventor Extensions: Notification Listener | Pura Vida Apps

Q1 : Is it possible for make the extension working in debug mode? I have problems in developing my app, because I have to compile the code each time to get a good code.
A : Unfortunately it is not possible to test extensions, which use a service like the notification listener extension in the companion app. This is a technical restriction of the companion app.
But for easier developing of your app, just modify the example project and add a button to export the TinyDB into a file. You could use the Get all TinyDB Extension by Juan Antonio to backup TinyDB as Text or JSON format. Let the example project run for a while until you collected several notifications and then export TinyDB. Then in your app you like to develop import the stored TinyDB and work with the previously stored notifications.

Taifun

1 Like

Android 11 phone is not allowing to install the app. It is saying something like the app may access personal infromation. To install the app then I changed the play security settings.

When I tested the above block in companion app using do it feature, the global variable produced the expected result. But, when i tried the app after installing it, it is not recognizing the new notifications & running the blocks.

The data in text file is not getting updated. It is getting updated on companian app when I checked using Do it Feature. but not working after installation.

Why do you need 2 MFile components?
And what is the purpose to ask, if the file is empty? And if it is not empty, you do exactly the sane and store an empty text in the file... does not make much sense for me...

Your example will only work if your app is up and running and no other ptocess edited the file
We already talked about that...

The extension will not work in the companion app

Taifun

1 Like

In companion app, it didnt work but in laptop while testing with DO IT feature it gave the result by updating the global variable.(When I opened and check the textfile, it is getting updated). BUT THE ISSUE IS THAT APP IS NOT WORKING AFTER INSTALLATION.

Actually, The purpose of the block is to modify the file once when new notification is recieved. Tasker event is set in such a way that the code will run whenever there is file modifications. So, once the file modification is done then Tasker will update the textfile with new onesignalid/keyword according to the Uniqueness of notofication ie, each notification will have some keyword to make it unique.

So, mitai2 app has to 1) Modify File first & 2)After file modification, Tasker will update the text file with another onesignalID/keyword, NOW mit ai2 app has to Parse/read that onesignalID/keyword from the text file.

How can I do it only by using MFile1? Why the app is not responding to new notification if it is installed as .apk?

WHILE TESTING USING DO IT FEATURE, ONLY GLOBAL VARIABLE IS UPDATING ITSELF WITH NEW VALUES BUT LABEL IS NOT WORKING.

I think, it is working when I added these 2 blocks. But, if I include these 2 blocks, it is putting the app in an endless loop (looped using clock3). I want to run these 2 blocks only once/twice additionally after each new Notification is received.

Text File is empty:
-- If text file = empty then go to Clock3 endlessly. Clock3 will read the text file to check if any value got updated or still it is empty.

Text File is not empty:
-- If text file is not empty then parse/read the value first and then make it empty. This time go to clock3 only one or two times (don't go endlessly) after that skip clock 3. Do, this for each new notification, ie, going to clock3 only one or two more times and then skip/stop.

This is working only in Companion and not working after installation.

As you said yourself

if we use a file file:///storage/emulated/0/Download/1.txt in companion then we must delete it before using it in app after installation.

Taifun

1 Like

Hi, MFile.SaveFile block within NotificationReceived Block is not updating file for every new notification.

===================================================================================
Capture

Your blocks work, if

  1. a notification is received while your app is up and running and
  2. the text file is owned by your app

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

1 Like

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;

  1. At first, it has to create a text file.

  2. Then, for each new notification, the app must modify/overwrite the text file with some predictable texts like Apple or empty text or etc.

  3. 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.

  4. 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 icon24 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

1 Like

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?