0

I'm distributing my android application (apk) along with some encrypted audio files in SD card. After installing the apk on the android phone, i want the apk to be deleted automatically. Actually I dont want the apk to be copied by others. Is there any solution such that apk cant be installed or copied by others?

Satyam
  • 15,493
  • 31
  • 131
  • 244

2 Answers2

3

By distributing it on an SD card you're making it very easy for people to copy. What's to stop them from just copying the card? Even if you come up with a way to prevent this from being done on Android, they could just insert the card into any other type of computer.

mimicocotopus
  • 5,280
  • 4
  • 22
  • 24
  • You are right. I'm trying to find a solution to avoid using my app even after copying from the SD card/computer. – Satyam Sep 01 '12 at 17:48
  • Automatically, deleting from the card or from the phone? Deleting from the card is easy. File todelete = new File("/mnt/sdcard/myApp.apk); todelete.delete(); along with the permission Of course this doesn't stop people from making a backup of the card before putting it in their phone. – mimicocotopus Sep 01 '12 at 21:00
  • Where should this code be put so that immediately after installation the apk must be deleted from the SD card. – Satyam Sep 02 '12 at 06:16
  • The best you can do is make the code run the first time the app is run. See http://stackoverflow.com/questions/3700974/is-there-a-way-to-make-my-android-app-run-some-custom-code-upon-installation You'd do this with code in the onCreate method of the Application class. http://developer.android.com/reference/android/app/Application.html – mimicocotopus Sep 02 '12 at 06:22
0

i want the apk to be deleted automatically

Automatic deleting no , you can prompt the user for for that at max.

I do not why you want to do this but you can definitely make your app inactive, implement :

x times run policy or implement run for x days only depending on your need but then again when they reinstall the app will work.

So add an online activation module and keep phone details to avoid reactivation

Sunny Kumar Aditya
  • 2,806
  • 4
  • 26
  • 38