Ionic: Widgets

Hi there,

as far as I know there is no official way to create a widget with Ionic.
I need a widget that has no more functionality than displaying some status values from my app.

Shouldn’t it be possible to create a native widget, using Android Studio or something, send a completely composed Html including the values via intent, let the widget receive and display it?
I have never worked with intents, is it possible to create one without any needed interaction with the user and restrict it to only work between my widget and my app?

In case the described communication is possible shouldn’t it then also be possible to create a widget with some more functionality like reacting to a click and send a message to the app triggering an action? Like using a RPC?

Or are these thoughts complete nonsense?

1 Like

Hi Llarian,

I have been trying to add a widget for a few days now.
What I’ve done so far is , import the platforms/android folder in Android studio and create a widget.
What I haven’t been able to do so far is access some variable values from my Ionic code, which I think is in the ‘main.js’ of the ‘assets/www/’ folder.

Have you found a way yet? If so, please do share.

Hello Viray,

no, so far no change, I haven’t had time to look into it again.
What you are describing is another way than the one I thought of.

Mine was about two apps:
A: the ionic app,
B: the widget, created with something able to create a widget

and let A send a message to B with something like ‘hello world’ and let B display the content of the message.
When I’d put the message to send in some pretty html, B would show somethingh good looking (assuming I had any design skills).
My way of communicating would be the intent, but since I have so far no idea of how they work I do not know whether they can work without user interaction. If so, I’d say somewhere in the setter of a value the equivalent of this.sendIntentMessage(value). Another way might be to put the html to a file and let the widget on a regular base read and display the content of the file… just any way to let A say to B (or broadcast), hey the value changed, the new one is 42 and let B show 42.

But as said, no time so far.

Hi Llarian an Viray
I am also trying to find a way to make a native android widget communicate with the app itself so I wonder if you found any solution to this challenge?