Removes Permission?

Thanks. It's good to hear someone else confirm a similar issue.

I had been using essentially the same app developed with a different RAD tool (B4X) for years, but when all my devices upgraded themselves to Android 11 that app stopped working. That is why I gave App Inventor a try.

The app is only for my own personal use. By using a RAD tool I had hoped to avoid all this nonsense of maintaining half a dozen files in order to compile. I find it really strange that the Notification Permission Dialog pops up, but there is no entry to enable the notification permission – leads me to believe it's an android 11 thing or, as you say, a service thing rather than a lack of permission in the manifest thing.

I will try comparing the before-and-after manifests to isolate the differences. Editing the manifest with each compile is not a solution. Since I only need to get the SSID for the currently connected network, I wish there were something much simpler than the Wi-Fi Manager extension to do this.

I am only using the currently connected SSID to not send the UDP commands to control the bulbs if I'm not connected to a specific network. I don't think it will hurt anything if I send useless UDP commands on an unknown network or I can get 90% there by comparing the connection IP for "192.168.0.". Not having the SSID is not a showstopper.

Barry.

It takes less than 1 min. You only have to add the service again (to the version with WiFi).
How often do you have to compile your app?

Here is an example:
Left: without SideBar ext. / right: with SideBar

The yellow marked line is missing and has to be added again. That's all.

I can hardly imagine that you won't find something suitable on Ulli's website.
But there you were already, as it seems.

if you find a difference in the manifest, then as it seems to be, the build process somehow removes a relevant part and this should then be fixed by the MIT App Inventor team. You then could send me your project as personal message and I will forward it to the MIT App Inventor team so they can find out, what exactly needs to be fixed.

I agree... this is only a workaround...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thanks for agreeing to look at this. I hope I've done as much of the work as possible.

I created two test versions of my APK. I appended the name of the first one with "_LS", for Location Sensor and I appended the second one with "_LS_TW" for Location Sensor + Taifun WiFi.

I've attached text versions of the manifest for both APKs:
The _LS APK: AndroidManifest_LS.txt (3.0 KB)
and the _LS_TW APK: AndroidManifes_LS_TW.txt (2.7 KB)

I used Notepad++ to do a comparison of the two text APK's. Unfortunately I don't know how to output the colored version of the comparison – I could only take screenshots:

The_LS comparison window screenshot:


The_LS_TW comparison window screenshot:

Comparing the two screenshots:
Line 4 on the _LS manifest is missing the Change_Wi-Fi_State permission – that's to be expected.
On line 20 there is a name difference in the two manifests – also to be expected.
On lines 25-29 the _LS_TW manifest is missing the service declaration – Bingo

I would be willing to bet this is the problem. Do you agree?

Thanks,
Barry.

yes exactly... as @Anke already was assuming...
somehow these lines are removed while building the project...

@UsesServices(services = {
  @ServiceElement(
	name = "com.puravidaapps.TaifunNotificationListener.TaifunNotificationListener$NotificationService", 
    label = "NotificationService", 
    permission = "android.permission.BIND_NOTIFICATION_LISTENER_SERVICE", 
    intentFilters = {
      @IntentFilterElement(actionElements = {@ActionElement(name = "android.service.notification.NotificationListenerService")
    })
  })      
})

the MIT App Inventor team will have to find out, why that happens and fix that issue...
as already mentioned

Taifun

I had already sent you a project (aia) via PM with the same problem: TaifunAlarmManager and SideBar.

It is obviously not due to the AI2 build server, but to the development environment under which the extension was compiled. Because the problem also arises with my MyFonts extension and Ulli's MediaNotification. But @Ulrich_Bien then compiled MyFonts.java in his environment and the problem no longer occurs.

Maybe @ewpatton can say more about (the reason for) this issue.
I compiled MyFonts with Evan's Extension Template. But Taifun doesn't use it, as he told me.

I have uploaded the two projects (aia files) that produce the manifests shown above. The _LS version works correctly, but the _LS_TW does not work. Upon further inspection of the text manifests we find that the notification description is missing in the_LS_TW version. The only difference between the two projects is the addition of the Taifun Wi-Fi extension to the Designer.

One comment mentions differences in the build environment. I'm using the latest updated public versions of Chrome on a Windows 10 machine. I haven't made any changes to the default settings of the App Inventor IDE. I originally signed up with App Inventor years ago (don't know how many), but only used it for a few hours until several days ago to develop this app.

[example projects containing paid extension removed by Taifun]

There is nothing proprietary about these projects – in fact they were developed mostly using freely available examples from Taifun and Ulli.

In case anybody is interested in what I'm doing: this app flashes LED Wi-Fi addressable light bulbs when an Android phone receives certain notifications; for example a phone call, text message, Skype call… I am deaf so unless I'm sitting next to my phone, of course I don't hear it ring, and I may not feel it vibrate. The bulbs I use are LifX LED Wi-Fi addressable bulbs (in the US I buy ones that cost about $10 each). LifX has a public LAN API that allows you to send UDP commands over the network to have the bulbs do things. Deriving the UDP commands leads to a string of bytes (developing the strings is another story. You have to follow the LifX documentation). You need to use the public (available in Google Play) LifX app to add the bulbs to your network. You can look at your router DHCP table to find the IP address assigned to the bulbs.

Barry.

:question:
I don't understand the context of your statement to my statement (if there is one at all).

OOh… I just reread your comment more carefully and I now understand you're talking about the environment the extension was compiled under. As Rosanne Rosanna-Danna would say: "Never mind". :grin:

By development environment I thought you were referring to the browser I was using and the operating system I'm working from. Were you referring to something different?

Since AI2 is hosted online, I don't believe I have control of anything other than which browser I use and which operating system I'm working under. The device I use should not matter since the manifest is created before I install to my device. I think I read that AI2 targets android versions above 4 or so. My device runs Android 11, but again that should not matter because the manifest is created and app compiled before it knows the version of Android on my device.

Barry.

As you can easily see, my post is addressed at Taifun and Evan.
There is nothing you can do to solve / fix the problem.

I removed the uploaded projects from your thread...
as mentioned earlier, you should have sent them by PM...
see also my terms and conditions for paid extensions...

@ewpatton might want to take a look...

I'm using the default development environment

Taifun

Are you talking about the standard MIT environment from github? Is there maybe any other?

Thanks, which is the same as I use. I thought there was another one.

I will put it on the list. I'm not sure though how quickly we will be able to turn this around.

Edit: I've confirmed the behavior locally.
Edit 2: I believe I have a fix for the issue.

Thanks. I am hoping it will not be too hard to isolate the culprit. I uploaded two projects. The first compiles and includes the service definition within the manifest. The second is identical to the first except that it adds the Wi-Fi extension, doesn't use it all, just adds it. When it compiles it leaves the service definition out of the manifest. Hopefully it will be not much work to find out why this happens.

On another note, this is a problem faced by all Android app developers. Android is going nuts trying to conserve battery. It ends a process, even service, after a while. My app with the notification service might run for a couple hours or the better part of a day before Android kills it and it stops notifying me. If I rerun the app, the service restarts, and notifications work again.

Is there a way to instruct Android to not kill a service or process? It seems to be getting worse as Android progresses up in versions, 8, 9, 10, 11, … I know services have been abused in the past, but just tell the user he is wasting battery and been with it.

This isn't something that App Inventor has control over. You're welcome to complain to Google, but I'd wouldn't waste the energy...

I've submitted a potential fix here

We will aim to get it into the next release.

I received a hint via email from Ulli (@Ulrich_Bien) regarding the problem and how he solved it:
https://ullisroboterseite.de/android-ai2-faq.html?topic=extension

Summary

Only the position of the source files is a bit out of date. The suggested directory

"~\appinventor-sources\appinventor\components\src\com\google\appinventor\components\runtime"

should NOT be used! Instead, it is better to set up your own source structure that corresponds to the Java package nomenclature. Like the Google sources, this structure starts in the folder

"~\appinventor-sources\appinventor\components\src".

For me it looks like this:

Directory structure

I didn't test (compile) it myself with it. But as I said, he compiled my MyFonts.java extension and the problem no longer occurs (along with his new MediaNotification).