Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent Android app from getting uninstalled during deployment with Xamarin Studio?

Every time I deploy a new version of an Android app with Xamarin Studio the app gets uninstalled first and then installed again. This is causing some problems for me because I'm using XPrivacy on my devices.

I wonder if there is a way to simply deploy the new version without uninstalling them in the first place (like when deploying with Android Studio or Eclipse)?

like image 926
kaolick Avatar asked Oct 14 '14 15:10

kaolick


People also ask

How do I stop programmatically uninstalling Android apps?

Use AppLock If you want to prevent other users from uninstalling your apps, launch AppLock, go to Privacy, and under Advanced, lock the Settings app. In this manner, users will need to use the authentication method you previously set to open the Settings app.


1 Answers

When building and deploying apps to your device, by default Xamarin will delete any existing application data/cache. This is not always ideal as it resets your data as if it were a fresh install.

To preserve data, you need to update the option:

  • In Xamarin Studio, select Tools > Options > Projects > Android... Check "Preserve data/cache between application deploys"

  • In Visual Studio, select Tools > Options > Xamarin > Android Settings... Check "Preserve data/cache between application deploys"

Once you do this, any shared preferences or data files created in the local application folder will remain.

like image 185
Kiliman Avatar answered Sep 28 '22 14:09

Kiliman