开发者

Problem when taking a backup of media files?

I've developed a Backup application. Now, it could takes backup for contacts, settings and browser I would take these backups by that host like

    Backup bu = new Backup(this);
    bu.runBackup(Contacts.People.CONTENT_URI);
    bu.runBackup(Settings.System.CONTENT_URI);
    bu.runBackup(Browser.SEARC开发者_开发百科HES_URI);

I've use gethost method in Backup class like

    int count=0;
    String file = uri.getHost() +"-"+ System.currentTimeMillis();

    Cursor cursor = cr.query(uri, null, null, null, null);
    count = cursorToCSV(cursor, file);
    cursor.close();

    String msg = String.format("Backed up %d records to %s file", count, file);
    Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
    return count;

I would like to take backup for media files images, videos, musics Is it possible to do that? How can i do like this? Anyone knows mean tell me otherwise what's the alternate way?


I've done this by my own Coding...

bu.runBackup(Images.Media.CONTENT_URI);
bu.runBackup(Video.Media.CONTENT_URI);
bu.runBackup(Audio.Media.CONTENT_URI);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜