user1732887
user1732887

Reputation: 298

Android - SMS - Backing Up Technique

I'm making an application that will backup all SMS messages.

These are my choices,

  1. read every sms message details then store it to the server(one by one).

  2. read every sms message details then store it to the server(by batch, like 100sms per batch)

What should be the best way?

On choice 1, the use will wait until the backup is finished.

Upvotes: 0

Views: 124

Answers (2)

Vincent Mimoun-Prat
Vincent Mimoun-Prat

Reputation: 28551

  • Choice n°2 for efficiency: read all SMS not yet backed-up (you can keep your own DB of backed-up messages, for instance an ID + a hash based on the sms content) and sent as big request. Con: you might loose some sms if phone is lost for instance
  • Choice n°1 for safety: backup the SMS as soon as it is received. Con: it is less efficient from connection point of view.

So it boils down to what you want to offer to your users. I think not much more code would be required to have both options, so I would simply leave it as a preference settings to the user: "instant backup" or "scheduled backup").

On the first time application is ran, I would anyway send a batch of all existing SMSs, not sending 1 by 1.

Upvotes: 1

se_bastiaan
se_bastiaan

Reputation: 1704

Option 1 will require a very good internet connection and it will take more time to send every message. Option 2 is more efficient, you need only one connection and one request to the server.

Upvotes: 0

Related Questions