0

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

wassim
  • 3
  • 1
  • 8
  • 2
    Sounds like someone wants to spy on their girlfriend. I think I'll pass on trying to answer this one. – Haphazard Jun 08 '11 at 23:41
  • lol :P well it's not like that. i'm developing this application as a final year project and it's for mobile security. if the phone is stolen a trigger message is sent which starts the service and uses the GPS to locate the phone. now we don't want to thief to get any suspicions and turn off the phone that's why i need to hide the GPS icon. as for my girlfriend... we hardly are seperated so i guess i won't need it for that purpose :P – wassim Jun 08 '11 at 23:45

1 Answers1

1

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?

Community
  • 1
  • 1
Aleadam
  • 40,203
  • 9
  • 86
  • 108
  • well as someone suggested somewhere the notification bar will be hidden in the activity which is not the case here and which doesn't work with services. here m using a service not a activity plus it's not that practical to hide the notification bar all the time. – wassim Jun 08 '11 at 23:59
  • @wassim I understand the status bar solution is not optimal, but it's the only one you will be able to achieve through the public API. – Aleadam Jun 09 '11 at 01:06
  • @wassim, BTW, see the side note above – Aleadam Jun 09 '11 at 01:11
  • hey that's actually what i did.the thing is can i hide all the notification bar when the service start. i mean the first link shows how to hide the title bar and status bar in an activity. but in the case of a service there's no actual window. the getWindow won't work. and btw thx a lot for helping – wassim Jun 09 '11 at 01:31
  • @wassim good, so we're on the same page then. You can create a dummy activity, use it to hide the notification bar and finish it immediately, and even [make it transparent](http://stackoverflow.com/questions/2176922/how-to-create-transparent-activity-in-android). – Aleadam Jun 09 '11 at 01:42