Wish: Use widgets in apps

NeoTechni

Well-Known Member
Licensed User
Longtime User
Since we can now make widgets it'd be nice if we could use them inside our apps somehow
 

corwin42

Expert
Licensed User
Longtime User
Since we can now make widgets it'd be nice if we could use them inside our apps somehow

?????

I think nobody understands what you mean. What do you want to do?
 

Cableguy

Expert
Licensed User
Longtime User
I see two possible questions:

1 Can we have in the same package (apk) a normal activity app and a widget?
2 Can an app exchange info with a widget?

I dont know the answer for the first one, but , for the second, if the developers introduces the right mecanisms, it should be possible to an App to change a related widget info...
But then again, this may even not be what the "question" was about...
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
I'm sure most people understood that. It's self explanatory if you know what widget and an app are.

Actually NO!...a Widget is a different type of "app" in the android system, as it has very limited functions...relying in services running in the background doing the hard work...
A widget can never run INSIDE an app, but you can recreate a widget and its functions in it...
 

corwin42

Expert
Licensed User
Longtime User
I'm sure most people understood that. It's self explanatory if you know what widget and an app are.

I know what widgets and apps are and I know how they are supported by and work in B4A and therefore I don't understand what your wish is. Because everything I can imagine what your wish may be is already possible and supported with B4A.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
A widget can never run INSIDE an app, but you can recreate a widget and its functions in it...

It is possible to run widgets in an app, widget locker does it as do numerous home screen replacements
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
I know what widgets and apps are and I know how they are supported by and work in B4A and therefore I don't understand what your wish is. Because everything I can imagine what your wish may be is already possible and supported with B4A.
so you can say, use the winamp widget within your app?

If not, then no. B4a doesn't support what I askes
 

vb1992

Well-Known Member
Licensed User
Longtime User
Such an intriguing question to me (and I think others), that really makes you think deeper of all the possibilities and solutions beyond the original posters actual question here.

So you have a widget that just displays the HIGH SCORE and Trophy collection for a car racing app you made. When the user finishes the game/app you talk to the widget to update the high score and graphical trophy.

You would think to write the high score to a file and have the widget scan that file for an updated score then re-display the updated high score but I am still thinking of possibilities why an app would want to talk to a widget directly. Maybe the trophy graphics are designed by the user community dynamically and hosted on a web server.

It intrigues me.

Has this been discussed previously in another thread?
 
Last edited:

NeoTechni

Well-Known Member
Licensed User
Longtime User
Home screen widgets are special features of Android. You cannot simply host such a widget in a regular application. This is not related to Basic4android.

But I've seen apps do it. Download widgetlocker
 

Cableguy

Expert
Licensed User
Longtime User
I have downloaded the app...
Like any other 'System feature' replacement, it just uses the undetlying framework and changes the behaviour... The widgets are still hosted by the OS itself and NOT by widgetLockee.
Also, hosting and talking to a third party widget requirea that that particular widgets has 'talking' capabilities and that they are open to thirds...
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
There's no way to have B4A make it's widgets in a way that could be used as custom controls then?
 

Cableguy

Expert
Licensed User
Longtime User
Custom control to be used were?
Inside a B4A app, we dont call it widget, but a view, module or library...
Ouside B4A, in third party apps, there's just no direct way, it had to be a joint effort between both developers, in order to create a base-standart of comunication between them.
 

Cableguy

Expert
Licensed User
Longtime User
You already can create "Custom Views"....

Create a layout of how the custom-view should look, and then create a code module to deal with the Custom-view's internal views...
Then you just load your Custom-View layout into an activity or a Panel... Thats it!
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
You already can create "Custom Views"....

Create a layout of how the custom-view should look, and then create a code module to deal with the Custom-view's internal views...
Then you just load your Custom-View layout into an activity or a Panel... Thats it!

Actually, that sounds really simple.
 
Top