Transparent activity? floating widget type thing?

kanaida

Active Member
Licensed User
Longtime User
Anyone know how 'cool tool' works as far as the activity?

It's a little floating rectangle with cpu info, it's always on top of all apps, you can drag it at anytime with your finger to move it around.

If i had to guess maybe make an activity transparent and draw a panel?? not sure how i'd do this exactly... any ideas?
 

susu

Well-Known Member
Licensed User
Longtime User
Hi JonPM, I think Kanaida talked about floating icon. It means you can drag the icon around the screen and it doesn't lock another apps behind. I also want to know how to do it :D
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Take a look at the attached sample, it creates a small panel that can be dragged around on a transparent activity.

Read the comments in the code to understand how is done. ;)

Enjoy!
 

Attachments

  • TransparentActivity.zip
    7 KB · Views: 1,041
Upvote 0

satomware

Member
Licensed User
Longtime User
Hi everybody!

NJDude, I think that kanaida was talking about a floating label that is always on top of all apps and that lets you interact with the application in the background.
There are some similar applications on the market, so i think that it would be possibile to do!

I'm looking for a similar solution too! :sign0085:
 
Upvote 0

kanaida

Active Member
Licensed User
Longtime User
It's the like an 'always on top' panel with no activity behind it...
The strange thing, as far as I know is that android only ever runs a single activity at any time unless i'm mistaken. It's ridiculously customizable as well if you've ever used it, and can be hidden or shown at will. I use it to measure phone temp and cpu usage in games for example.

almost like dark magic :), adding a view to the currently focused app and somehow handling it's events via it's own service perhaps???
 
Upvote 0

bluejay

Active Member
Licensed User
Longtime User
I assume it is a service using a Remote View. Like a Widget but not restricted to the Home Screen.

I have no idea how it relocates a widget to another activity.

BlueJay
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
I may be wrong, but I believe the clue is in the permissions used by the app.

If you look on the Play store, you can see that it uses the

display system-level alerts

Permission

Then if you google this permission you will see posts that mention using system alert dialogs.

So, my guess is it's a custom system alert dialog.
 
Upvote 0

satomware

Member
Licensed User
Longtime User
barx, I think you are right! :icon_clap:

I found on the market a couple of apps that have this feature... All of them use the "display system-level alerts" permission.

Now Erel, what do you think about it? :D

How could we implement such a feature with b4a?
 
Upvote 0

salmander

Active Member
Licensed User
Longtime User
barx, I think you are right! :icon_clap:

I found on the market a couple of apps that have this feature... All of them use the "display system-level alerts" permission.

Now Erel, what do you think about it? :D

How could we implement such a feature with b4a?
Here is my post on this behaviour. I am also looking for such feature in b4a.
 
Upvote 0

kostas3001

Member
Licensed User
Longtime User
In Manifest Editor: AddPermission(android.permission.SYSTEM_ALERT_WINDOW)

any more about Activities with TYPE_SYSTEM_ALERT ?
 
Upvote 0
Top