spr
spr

Reputation: 322

turn on/off gps without shownig icon in status bar

In my android application, I succeed with turning on/off gps dynamically whenever required. But I am struggling with hide the gps icon in status bar when turn on gps. How can I do it?

NOTE: I also succeed with hiding whole status bar by making full screen. But I want to hide only gps icon.

Upvotes: 1

Views: 8316

Answers (4)

Hanuman
Hanuman

Reputation: 968

I too got same problem, means when I am asking for gps to give location updates then it will show that gps icon, so if you remove those updates calling like locationmanager.removeupdates(locationListener), then it will remove that gps icon in status bar

Upvotes: 0

nick.yu
nick.yu

Reputation: 99

if you have sdk source file, it's easy:

modify NotificationManagerService.java in methed enqueueNotificationInternal, add a flag (db file or create a file in /data/) ,when the gps application try to send notification, block it(refer to the packagename).

but if you do not have one ....

sorry ,i don't know.

Upvotes: 0

user1706698
user1706698

Reputation:

Why would you hide GPS icon?

I think this is a bad idea, since users want to know whether their GPS is active or not.

This would allows applications to snoop users position without them being aware of that fact, which is NOT a good practise. And this is why your app requires a permission to access phone location.

Upvotes: 1

Anup Cowkur
Anup Cowkur

Reputation: 20563

You cannot do this. The status bar icon is controlled by the system and it will not allow third party apps to hide it when GPS is on. This is for security reasons as well. Any rogue app could secretly perform malicious operations using the user's location without the user knowing about it if s/he has no indication that GPS is active.

Upvotes: 2

Related Questions