The problem you've got is that when described as application for parent to monitor their child what you want sounds benign, viewed differently it sounds a bit like malware, as you want an application that:
- Cannot be uninstalled
- Emails home without informing the user
As has been said, you won't be able to prevent uninstallation without a custom build of Android. There are events which are sent on the uninstall of an application but these cannot be intercepted by the app being removed. (So I guess you could install your application and a watchdog application which monitor each other for removal, but if the child goes somewhere with no signal and removes both then they will disappear silently since they can't call home with no internet access.)
Another problem is sending email. The usual way to send an email in Android is through using an Intent
to switch to an Email application with address and content filled in, but this requires confirmation from the user to send, which won't help you and the child could just decline to send the warning email.
So instead of calling home when the application is removed, what you're going to have to do is call home every day when all is well; if the application doesn't call in then the parent knows there is a problem. You could write a Service
which is calls home and and is started daily by an AlarmManager
.
For calling in you're either going to have to connect to a URL via HTTP or write your own code to send emails using SMTP, since you can't send emails silently out of the box. I'd use the former if possible, otherwise you'll have to store your own SMTP configuration as you can't "borrow" this from another appl.
You could display the email application each day and get the child to send the all-is-well email, but the problem there is that the child could easily recreate the email by hand each and send it without the application running unless you went so far as to cryptographically sign and verify each email.