-1

I want to create an android app which will tell me when I have unlocked my phone in past day also track the location where I have unlocked the phone using GPS. Is there a way to achieve this?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Sibaprasad Maiti
  • 507
  • 8
  • 19
  • 1
    Yes it is achievable. Start writing the code. – Ranjan Jan 04 '18 at 18:54
  • Actually I wanted to ask is there any android api that I can use here? I know about **android.app.usage**, but that does not give me the information when user unlocked his phone. – Sibaprasad Maiti Jan 05 '18 at 04:54

1 Answers1

1

You have to use broadcast receiver for receiving system messages. For checking when the device is unlocked you can use ACTION_USER_PRESENT intent filter for you receiver. Start a service when your receiver receives broadcast from system and log your current location data.

This might help in the way - A way to get unlock event in android?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Ranjan
  • 1,096
  • 10
  • 22