1

I am writing an Appointments app. I want my app to be able to send appointment data from one phone to the same app on another phone. The app will read the data and add the appointment to the list. What I don't want is the user to be able to read the SMS itself. Is there a way to do this?

W.K.S
  • 9,787
  • 15
  • 75
  • 122
  • 2
    Why SMS? I'd be very interested in seeing how (not if) this can be done, but I wonder why SMS? It seems a bad method of data transfer. For one sometimes SMS's take hours to make their way to their destination. I frequently get messages hours after they are sent by my wife. If that lead time is acceptable, then I wish you luck. – baash05 Nov 12 '12 at 12:03
  • I'm writing this application as part of University coursework. One of the suggested features was to send appointments via SMS. I found the idea interesting so I'm trying to implement it. Don't worry, I would never put this feature in an actual market app :) – W.K.S Nov 12 '12 at 12:35

2 Answers2

3

Don't use SMS, it usually costs money and people won't use your appointment application if permission list says "SEND_SMS". There are plenty of other protocols, simplest one is http, that allows you to send the data over the net and store to the server, and then another device can retrieve it when necessary.

lenik
  • 23,228
  • 4
  • 34
  • 43
0

Define a format so you can identify your SMSs and discern between them and regular messages. You can send the SMS programmatically, there's no problem here (I'm almost sure the message doesn't show in the outbox).

In your app, register an SMS listener so that incoming SMSs are first scanned by you. If the message matches your format, process it and delete it from the inbox. This part is tricky, as there's no API to do that. Check this question: How to delete an SMS from the inbox in Android programmatically?

That said, SMS is very unreliable, has a very small payload, and to use it without the user knowing is bad practice. You could setup a mail server and give a mail account for each user, and send/receive behind the scenes using JavaMail. That would also give the user the ability of receiving messages via an external client in PC. Or you could send the messages to a WS, store it in a DB, and let the app pull for new messages periodically. Or even use GCM which is a push approach (http://developer.android.com/training/cloudsync/gcm.html).

Community
  • 1
  • 1
Mister Smith
  • 27,417
  • 21
  • 110
  • 193