开发者

Android: Best way to backup data to the internet?

what would be the best way to backup data to a external location ie web server? ive looked in to sql and emailing and file upload but none of these seem to work using the android sdk? (i may be wrong) im trying to back up sms messages preferably to a database somewhere on the internet can anyone maybe suggest a way of doing this? as far as i can see JDBC isn't accessible on android?

thanks in advance.

heres the error i get when adding the JDBC:

        UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.util.ExceptionWithContext
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.util.ExceptionWithContext.withContext(ExceptionWithContext.java:46)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:340)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.processClass(Main.java:369)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.processFileBytes(Main.java:346)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.access$400(Main.java:59)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:294)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.processOne(Main.java:313)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.processAllFiles(Main.java:233)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.run(Main.java:185)
[2011-07-12 17:17:46 - SMS] Dx  at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
[2011-07-12 17:17:46 - SMS] Dx  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[2011-07-12 17:17:46 - SMS] Dx  at java.lang.reflect.Method.invoke(Unknown Source)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:585)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:490)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:394)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.resources.Project.build(Project.java:114)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:145)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2011-07-12 17:17:46 - SMS] Dx Caused by: java.lang.NullPointerException
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.code.Ropper$SubroutineInliner.involvedInSubroutine(Ropper.java:1518)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.code.Ropper$SubroutineInliner.mapOrAllocateLabel(Ropper.java:1539)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.code.Ropper$SubroutineInliner.copyBlock(Ropper.java:1457)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.code.Ropper$SubroutineInliner.inlineSubroutineCalledFrom(Ropper.java:1412)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.code.Ropper.inlineSubroutines(Ropper.java:1286)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.code.Ropper.doit(Ropper.java:652)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.code.Ropper.convert(Ropper.java:252)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:252)
[2011-07-12 17:17:46 - SMS] Dx  ... 39 more
...whi开发者_Go百科le processing reuseAndReadPacket (Lcom/mysql/jdbc/Buffer;I)Lcom/mysql/jdbc/Buffer;
...while processing com/mysql/jdbc/MysqlIO.class

[2011-07-12 17:17:46 - SMS] Dx 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/mysql/jdbc/AssertionFailedException;
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.processClass(Main.java:372)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.processFileBytes(Main.java:346)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.access$400(Main.java:59)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:294)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.processOne(Main.java:313)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.processAllFiles(Main.java:233)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.dx.command.dexer.Main.run(Main.java:185)
[2011-07-12 17:17:46 - SMS] Dx  at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
[2011-07-12 17:17:46 - SMS] Dx  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[2011-07-12 17:17:46 - SMS] Dx  at java.lang.reflect.Method.invoke(Unknown Source)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:585)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:490)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:394)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.resources.Project.build(Project.java:114)
[2011-07-12 17:17:46 - SMS] Dx  at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:145)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
[2011-07-12 17:17:46 - SMS] Dx  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2011-07-12 17:17:46 - SMS] Dx 2 errors; aborting
[2011-07-12 17:17:46 - SMS] Conversion to Dalvik format failed with error 1


Take a look at SMS-backup-plus, it may be what you want.


You can look into Backup Manager for Android. This won't necessarily work on demand, but will let the user keep his/her data in case it's needed.

If you have an SQL database, you can simply send the file by whatever method you need (uploading to your own server, for example).


I can't see why you wouldn't be able to use JDBC. Have you checked all your permissions to make sure your app can use the internet or anything else you might need?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜