BackupAgent usage and implementation in core apps

14 views
Skip to first unread message

garth

unread,
Oct 13, 2010, 6:54:18 PM10/13/10
to Android Contributors
Hi,

I've been looking at BackupAgent and was wondering why it's not
implemented in more apps? The Only place it seems to be used are:-

* package/apps/Browser - Backup bookmarks
* LatinIME - Backup Settings
* UserDictionaryProvider - Backup user dict

It seems with the SharedPreferencesBackupHelper class it's very easy
to add backup of a users settings. I've knocked up a example for the
Calender settings here https://review.source.android.com/#change,17552
(Sorry about the bit of a mess it's my first time using git/repo/
gerrit and I messed it up a bit! )

I'm planning on doing the rest of the apps too including :-

* DeskClock - SharedPreferences + Alarms
* Camera - SharedPreferences
* Contacts - SharedPreferences
* Mms - SharedPreferences
* Email - Maybe the accounts + SharedPreferences
* Music - SharedPreferences
* Phone - SharedPreferences


Would this be of interest to the community?

Cheers

Garth

Christopher Tate

unread,
Oct 13, 2010, 7:03:00 PM10/13/10
to android...@googlegroups.com
On Wed, Oct 13, 2010 at 3:54 PM, garth <garth....@gmail.com> wrote:
> Hi,
>
> I've been looking at BackupAgent and was wondering why it's not
> implemented in more apps? The Only place it seems to be used are:-
>
> * package/apps/Browser  - Backup bookmarks
> * LatinIME - Backup Settings
> * UserDictionaryProvider - Backup user dict
>
> It seems with the SharedPreferencesBackupHelper class it's very easy
> to add backup of a users settings. I've knocked up a example for the
> Calender settings here https://review.source.android.com/#change,17552
> (Sorry about the bit of a mess it's my first time using git/repo/
> gerrit and I messed it up a bit! )

Thanks for the contribution; I'll be reviewing it in Gerrit.

> I'm planning on doing the rest of the apps too including :-
>
> * DeskClock - SharedPreferences + Alarms
> * Camera - SharedPreferences
> * Contacts - SharedPreferences
> * Mms - SharedPreferences
> * Email - Maybe the accounts + SharedPreferences
> * Music  - SharedPreferences
> * Phone - SharedPreferences
>
>
> Would this be of interest to the community?

This sort of thing is definitely of interest! The one caveat is that
sometimes the settings being backed up are not all appropriate to have
propagated to a new device, so a certain amount of review is really in
order when deciding how to approach writing the backup/restore agent
for a given application. With that in mind, though, we're certainly
happy to see work along these lines being contributed.

--
christopher tate
android framework engineer

garth

unread,
Oct 13, 2010, 7:18:59 PM10/13/10
to Android Contributors
Ah got it wrong it's https://review.source.android.com/#change,17553

Sorry about the messy patch.

I'll have a go at sorting it out for another patchset once I get a
grip on git.
I'm coming from a world of cvs/svn and assumed the commit would just
add changed files.

Garth Bushell

unread,
Oct 16, 2010, 1:18:54 PM10/16/10
to Android Contributors
I've updated the patch with respect to your comments


I've then removed the debugging code left in! 


Sorry still gettnig used to git / repo /gerrit.

Is there a way I can combine my changes into one big patch to review in one big change instead of it tracking my changes committed?

Wink Saville

unread,
Oct 17, 2010, 12:16:09 PM10/17/10
to android...@googlegroups.com
look at "git help merge" or "git help rebase" two possibilities are:

   git merge --squash

       or

   git rebase --interactive


-- Wink
Reply all
Reply to author
Forward
0 new messages