Closed FriederHannenheim closed 1 year ago
Could you say what you would like to see happening instead? I found that if I waited, the widget fills up.
Oh. It loads for maybe a minute and then it works. Why does it load that long? Couldn't you just use the list of hackerspaces that is shown when you open the app normally?
Hm. This looks like several issues. Can you make a list for clarity?
Can confirm that loading seems to be very slow. If someone could debug (and maybe fix) the loading behavior, that would be very welcome.
Hm. I was looking at Widget.java, line 303.
This appeared a while AFTER the widget was created. It seems that the UpdateService
is not used until it is triggered by some event.
In the AndroidManifest.xml we have this:
As well as the different receiver -> intent-filter
:
My guess is that these trigger the update service. When the widget is first created, this does not take place.
Here is the update mechanism:
I would guess that once the widget is successfully created either
https://developer.android.com/reference/android/appwidget/AppWidgetManager#summary
The most important AppWidgetProvider callback is onUpdate() because it is called wheneach App Widget is added to a host (unless you use a configuration Activity). Ifyour App Widget accepts any user interaction events, then you need to registerthe event handlers in this callback. If your App Widget doesn't create temporaryfiles or databases, or perform other work that requires clean-up, then onUpdate() may be the only callbackmethod you need to define. For example, if you want an App Widget with a buttonthat launches an Activity when clicked, you could use the followingimplementation of AppWidgetProvider:
According to this, my first guess was correct... Looking into it.
It seems to me that Widget_config calls updateAlarm and that creates the system alarm for update with a 50ms delay. This is but a rough estimation and might go wrong - it might not be updated after 50ms. That might be the problem here.
So, I had a look and I add the direct update without the redirection through the Android operating system... And it is there! Instantly....
PR in progress... #34
When adding the widget, the list of spaces needs to be loaded (in order to choose a space). Sometimes this is still slow, but there is an issue with loading of the directory that I'm currently investigating. It's probably an IPv6 issue on the directory server (which sometimes runs into a timeout, causing a 30-60 loading time).
However, the main issue was probably resolved with #34, so we can probably close this.
When I try to create a widget the app shows loading. I can tap the loading icon away but can't choose a hackerspace.