Giter Club home page Giter Club logo

sms-db-slave's Introduction

Warning

There is already a nice open-source implementation of this application on android: SMSSync

sms-db-slave

An Android application that sends and receives SMS and update to sms-db.

Install and configure

  • API URL for sms_received - Received SMS will be POST-ed to this API
  • API URL for pending - A URL to fetch SMS that are waiting to be sent
  • API URL for sent - When SMS is sent, POSTs the id to this API
  • API Key - Every SMS terminal has to have its specific api key. It has to be passed whenever an API request is made.
  • Crash report URL - An acralyzer application URL to POST submit report to.
  • Crash report username
  • Crash report password

How does it work?

There are 3 entities interacting throughout this application.

  • SMSDB - Stores SMS that are received and to be sent
  • SQLite - Stores SMS that are being sent or received. Whenever Mobile network or Internet failure occurs, it will retry the stored SMS.
  • Periodic Service:
    • Send - Fetch pending SMS from SMSDB and save to DB
    • Send - Get pending SMS from DB and send. Delivery report will set the SMS state to sent in DB.
    • Send - Get pending SMS which has been successfully delivered from DB and post to SMSDB
    • Receive - Triggered by android.provider.telephony.SMS_RECEIVED. Saves received SMS to DB.
    • Receive - Get received SMS from DB and posts to SMSDB
    • Cleanup - Remove SMS that are marked as synced

Following types of SMS might occur in the SQLite Database:

+----+------+--------------+---------------------+----------+--------+--------+
| id | body |    phone     |     created_at      |  status  | sms_id | synced |
+----+------+--------------+---------------------+----------+--------+--------+
| 1  | abc  | +97698111111 | 2014-02-06 08:24:00 | to_send  |   71   |   0    |
| 1  | abc  | +97698111111 | 2014-02-06 08:24:00 | sending  |   71   |   0    |
| 1  | abc  | +97698111111 | 2014-02-06 08:24:00 |   sent   |   71   |   0    |
| 1  | abc  | +97698111111 | 2014-02-06 08:24:00 |   sent   |   71   |   1    |
| 1  | abc  | +97698111111 | 2014-02-06 08:24:00 | send_fail|   71   |   0    |
| 1  | abc  | +97698111111 | 2014-02-06 08:24:00 | send_fail|   71   |   1    |
| 2  | foo  | +97688776655 | 2014-02-07 09:00:00 | received |  null  |   0    |
| 2  | foo  | +97688776655 | 2014-02-07 09:00:00 | received |   78   |   1    |
+----+------+--------------+---------------------+----------+--------+--------+

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.