Status Bar When Screen is Locked android - android

I am starting activity with application context when screen is locked. However Status bar is not usable, doesnt get dropped down. Is there any way to make status bar and notifications usable when screen is locked ? (ICS-Android)

No, this cannot be done. This is a security feature of android, if the notification bar could pulled down while the user has the device locked, then it opens the user to security issues as personal information may be in the notification bar such as missed calls, text messages and emails etc.

Well.. GravityBox has an option to allow this.
However I'd be interested on what file you'd have to mod inside the SystemUI/res folder in order to make it work without Gravitybox...

Related

How to disable "Screen is Pinned" dialog android from kiosk mode

iam developing screenlock app for android using a React Native and a little annoyed with the screen pinned dialog that always appears, is there a way to just get rid of it? so what I really want is no dialogue interaction at all with the user
enter image description here
If you're calling startLockTask() and your device isn't set up as a dedicated device with your app whitelisted, then no you can't prevent it:
Otherwise, the current task will be launched into screen pinning mode. In this case, the system will prompt the user with a dialog requesting permission to use this mode. The user can exit at any time through instructions shown on the request dialog.
The dialog is there to help users understand what's happening, give permission for the app to take over their screen, and know how to get out of it later. It's baked into Android by design, so malicious apps can't cause problems - it's just a limitation you have to deal with, unless you're working with a dedicated device (which can be set up to give apps more control and users less)
Have you thought about immersive mode instead, where you hide the nav bar? The user can get out of that too by swiping to reveal the controls, but it's less intrusive. There's no way to automatically lock the user's screen with no interaction though

How to add an icon to the Android status bar without creating a notification?

I have read: https://developer.android.com/guide/topics/ui/notifiers/notifications.html but I cannot see how to display an icon on the top of the screen, without making a notification.
I have an app with a long-running service, and I want to show an icon that reflects the internal state of that service, at the top of the screen.
How can I do this?
I want to show an icon that reflects the internal state of that service, at the top of the screen. How can I do this?
Make a Notification.
Or, download Android's source code, modify it to allow random apps to put icons in the status bar that the user cannot control, build your modified version of Android, package that into a custom ROM, and convince people to use your custom ROM on their devices.
The only non-Notification status bar icons that apps can semi-directly control are:
whether there is a GPS-active icon, by registering for location updates
whether there is an alarm-clock icon, by using setAlarmClock() on AlarmManager

Any chances that we can override the action of pulling down the status bar?

All I want is that, when users pull down the status bar, instead of seeing notifications or settings, they will see an activity of my app. If not then, can I use 2 fingers to pull down the status bar and they'll see my activity, if still not, can I pull down from the left/ right of the status bar to do that stuff. I've seen several ROMs that allow users to do that. Can we do that with application?
No this is not possible. There is no event that is fired, and no way to detect the action.

hiding GPS notification icon from the status bar

i need to hide the GPS icon from the status bar when my service uses it. I've been making some research and found that it's not possible programatically.
but i found that it is possible if my phone is rooted by installing something on the memory card. anyone can help with the root thing and if it is possible, can it be done programatically without going through the root thing.
thx a lot :D
No, it's not possible to do it with the public API.
Yes, you will need a rooted phone, but that's not enough. You will need to modify services.jar (and perhaps framework.jar also) in order to check whether your service is working or not.
Alternatively, as suggested by Someone Somewhere, you can hide the status bar altogether.
As a side note after the comment below, I would not set up the service to run all the time as it seems you're planning to do. Instead, I would register a BroadcastReceiver to read the SMS and start an Intent upon reception of a specific message. You could hide the status bar in that moment. See this for more details: Can we delete an SMS in Android before it reaches the inbox?

Add Buttons Above the Notifications Tab in the Status Bar

I am developing an Android app that will run as a service most of the time. The user would be able to control it via the status bar -- including the ability to stop the service altogether.
Even though I am able to make a custom view and put buttons on the Notifications area [see Figure 1], I would like to be able to put it above the "Android"/Service Provider's name. Much in the same way as the Music Player app does this [see Figure 2]. That way, even if the user clears their notifications, my app's control panel will remain active as long as the service is running.
What's the best way to do that, please?
Original Image Link
Your ROM has hidden the Ongoing header; both the Music player and the hardware control widget use the ONGOING_EVENT flag to remain where they are (someone correct me if I'm wrong). Confirm this by loading your app onto your patched phone - the documentation specifically names e.g. Music players (and other times your process is still going on in the background) as times when you should use this flag.
You might like to note that the same page recommends the FLAG_NO_CLEAR flag - if all you want is for it not to be cleared when the user clicks clear notifications (this is recommended for ongoing apps).

Categories

Resources