It is not really possible to create such apps with newer versions of Android.
You will need to have a foreground service that runs forever. Most devices will kill the app at some point.
Start with this example:
Background location tracking
I looked at that but I got stuck on this line in the manifest.
SetServiceAttribute(Tracker, android:foregroundServiceType, "location")
I am not sure how to modify it for my needs.
If I do this:
1. Can I get a notification that the user has unlocked his phone.
2. Can I read the phone logs to determine when the last unanswered call was received.
3 Can I read the SMS logs to see when the last unread text was received.
If I can do these things then I will figure out how. I would just like to avoid doing all of the monkeys and typewriters work only to find it is not possible.
Thanks for your help.