tags:

views:

163

answers:

4

I'm toying around with an idea for an app that, in theory, a parent would install on a phone he/she gives to his/her child. So, main problem is, how would I be able to prevent the child from just uninstalling the application? Any ideas on how to solve this? I'm really doubtful something like this exists but thought asking here was a good way to find out if there were any tricks.

EDIT:

If there's no way to prevent this from happening; how about this: upon uninstall, do something (e.g. send an email to a previously configured email address). This could serve as a disincentive for the child to uninstall the app as the parent could find out about it. Of course, an industrious miscreant would just turn on airplane mode and then uninstall but I'm just fishing for ideas at this point.

A: 

What you want to implement is not possible in Android today. Android is aimed at empowering the user of the phone, which in this case is the child.

CommonsWare
+1  A: 

Provided the child isn't technologically apt you could likely do something like this with a rooted phone.

If you're installing the application and request the appropriate root permissions from the installing user (presumably the parent) you can have your application remount partitions as necessary to store itself or relevant files on a partition that is normally read-only at boot.

Of course, anything you do will be reversible, one way or the other, so you'd better be in for an unpleasant bout of staying one step ahead of the reverse engineering geeks who have snooping parents.

jsoverson
+3  A: 

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.

Dave Webb
Some nice ideas. Thank you!
cakeforcerberus
+1  A: 

Here's an idea. If your application has a service that frequently sends a message to a server, like a ping or something, you would know that there was an issue if this ping was not recieved after a period of time.

Of course there are circumstances that would prevent this from being sent out anyway (poor reception, dead phone, etc.), but I would argue that you could safely assume that if a ping from a device has not been recieved in some time, say a couple days, that the user of the phone has done something to prevent this ping from being sent out (like uninstalled the application).

In that case, you could have the server alert the parents instead of the phone.

Brandon
+1 Good idea too. I was hoping to avoid having to have some sort of server that I had to maintain but it's definitely an option. Thanks for the input.
cakeforcerberus