Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - how to add a [Toggle button] in the Notification Panel ? (the place where you can toggle Wifi, bluetooth, Plane Mode, ect ..)

I'm trying to make my app add a toogle button in the [Notification Panel] the place where you can toggle Wifi, bluetooth, Plane Mode, ect .., (I've spent the last 6 hours searching and I found nothing)

Here's are 2 Examples of what I'm talking about in one picture :

-In the 2 blue frames, those 2 buttons are custom buttons (meaning they have nothing to do with stock android, they've been added by apps from the Playstore),

#1 button : The Shazam button is a shortcut to open shazam (that's not what I need, although would love to know how it's done)

#2 button : First press it starts recording a video on my rear camera (the button becomes activated (blue)), second press it stops recording and saves the video, all this happens in the background, the app that does this never opens (meaning that this is not just a shortcut to the app)

=> So I'm trying to do is to have a custom button for my app, a button like the #2 button, for my app activating/disabling it would make my app's background service send TCP messages to a server, (just in case you want to know what I'm trying to do)

My phone is not Rooted, and I know for a fact that this doesn't require a Rooted phone.

(I'm trying to do this with Xamarin/c#)

enter image description here

like image 674
Robert258 Avatar asked Oct 20 '25 22:10

Robert258


1 Answers

sadly no one answered, so i kept searching and i found out that what i called the Notification Panel Menu, was in fact called the "Quick Panel" ..

anyways, here are some links that helped me quite much : Link 1 , Link 2

like image 160
Robert258 Avatar answered Oct 23 '25 11:10

Robert258



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!