android-backup-service

App crashes with java.lang.UnsatisfiedLinkError for Oreo devices with Xamarin.Android

倖福魔咒の 提交于 2019-12-23 05:14:00
问题 I'm receiving crash reports in Google Play Console for my app, and the stacktrace is as follows: java.lang.UnsatisfiedLinkError: at mono.android.Runtime.register (Native Method) at md5f3dc63ecaad575af71bd7a9b1622f75b.n.<clinit> (n.java:20) at java.lang.Class.newInstance (Native Method) at android.app.ActivityThread.handleCreateBackupAgent (ActivityThread.java:3431) at android.app.ActivityThread.-wrap3 (Unknown Source) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1813) at

Mysterious ClassNotFoundException when Android system engage BackupAgent

喜欢而已 提交于 2019-12-22 09:14:00
问题 I have got a few (4) error reports on my app from when the Android system decides to do the backup to Google cloud using the BackupAgent. I am using the SharedPreferencesBackupHelper. The stack trace looks like this (my real package name is replaced below by com.xxx.yyy): java.lang.RuntimeException: Unable to create BackupAgent com.xxx.yyy.MyBackupAgent: java.lang.ClassNotFoundException: com.xxx.yyy.MyBackupAgent in loader dalvik.system.PathClassLoader[/mnt/asec/com.xxx.yyy-1/pkg.apk] at

Problems restoring to multiple devices using Android BackupManager

戏子无情 提交于 2019-12-21 17:30:52
问题 I've implemented backup/restore of SharedPreferences using BackupManager as per the Android docs, but I'm having trouble restoring preferences to a second device. I believe the implementation is fine, since I can restore settings to a single device, i.e. if I run the app, make changes, uninstall and reinstall I get the modified preferences that I expect. However, if I subsequently install the app on a second device, I don't see the changes, even if I use the bmgr tool to force a backup on the

BackupManager & BackupAgent in Android 2.2

夙愿已清 提交于 2019-12-20 04:56:11
问题 I've reviewed the docs and the sample BackupRestore app and written my own test app implementing android:backupAgent . I extended the BackupAgent class because my main concern is being able to backup data from a database. I can't seem to even make a simple proof-of-concept app work with this feature. To make things exceptionally simple, I declared the android:backupAgent as MyBackupAgent in the manifest. I then created a class MyBackupAgent.java, extending BackupAgent . I then created

Android SharedPreferences Backup Not Working

半腔热情 提交于 2019-12-18 16:56:09
问题 I've been doing my homework on how to backup SharedPreferences in my Android application, especially using reflection to maintain backwards compatibility. At least I've been trying. Unfortunately, none of my code actually ends up creating a backup! This includes forcing adb bmgr commands on the emulator as explained here. So I'm wondering if the community could perhaps help me out and in the process come up with some better documentation? Here's my code. To keep this as generic as possible

In android is there any way to preserve SharedPreferences after an uninstall

人走茶凉 提交于 2019-12-17 09:33:35
问题 I am keeping some application meta data in SharedPreferences . Whenever I uninstall the application and reinstall it, the SharedPreferences are deleted. Is there any way to get that to remain, so that if the user does an uninstall and reinstall, they can recover their old data? 回答1: You should add a BackupAgentHelper to your app. Together with the SharedPreferenceBackupHelper , it backups the SharedPreferences to the cloud (if the device supports it). When the app is reinstalled the data is

What is “android:allowBackup”?

扶醉桌前 提交于 2019-12-17 06:58:06
问题 Since the new ADT preview version (version 21), they have a new lint warning that tells me the next thing on the manifest file (in the application tag): Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data) In the official website, they've written: A couple of new checks: you must explicitly decide whether your app allows backups, and a label check. There's a new command line flag for setting

Android - Preserve or delete files created by the application on uninstall

≯℡__Kan透↙ 提交于 2019-12-17 06:41:33
问题 I created an application which creates and stores files to sdcard. Is there a way to bind the folder with application in order to delete all files when the user runs uninstall on android device? 回答1: There's no way for your application to know that it is being uninstalled (without modifying the kernel). All files created in the data/data/your.app.package is deleted automatically upon application uninstall. I don't think anything is cleared from the sdcard. You can do a quick test and find

When I clear all recent apps, android system kills my app service on Android v7.1.2

偶尔善良 提交于 2019-12-13 02:49:57
问题 enter image description hereI want to create an app which runs in the background. I have tried all stackoverflow solutions. Those solutions are all working when the app is cleared by myself. But when I'm performing "clear all recent apps". The service stops. I'm using Android v7.1.2 Android Nougat. @Override public int onStartCommand(Intent intent, int flags, int startId) { log("Received start command flags:%d, startId:%d", flags, startId); Notification.Builder builder = new Notification

BackupAgent: “unable to restore package …”

巧了我就是萌 提交于 2019-12-12 08:39:49
问题 I have implemented the BackupAgent as described at Data Backup, registered an API key and declared the BackupAgent in my Manifest. The Backup part work's quite well, I think; When I run adb shell bmgr run in command line, the following output appears in LogCat: 01-11 22:23:09.002: DEBUG/PerformBackupThread(97): starting agent for backup of BackupRequest{app=ApplicationInfo{4547c5b8 com.meins.nightclock} full=false} 01-11 22:23:09.002: DEBUG/BackupManagerService(97): awaiting agent for