My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
DeveloperHelp  
If you want to code your own Connector, please read this page.
Featured, Phase-Implementation
Updated Nov 8, 2010 by felix.bechstein

Introduction

WebSMS is built modular. This makes it very easy to implement new Connectors.

Each Connector is installed separately. This makes it very easy to build your own Connector and even deploy it on your own!

Details

To build your own Connector you will have to think about:

  1. Where to host the code:
    • Think about adding your own connector to http://github.com or any other git hosting site. This makes it very easy for me to look on your code and add some patches.
    • You may even use this Google Codes site too.
  2. Who should publish it to market:
    • You may publish it on your own.
    • I may publish the Connector for you. (First is prefered, for letting me deploy it, i need you to host your code on http://github.com)

API

Well, as you decided where to implement your Connector, you will need the public API of WebSMS's Connector framework.

There is a javadoc run hosted here.

For examples, just check out the code on any of the connectors hosted on github. Just pick the one, that fits you best. Some are using XML, some are using custom HTTP methods, some are using very simple HTTP APIs.

Basically you just need to inherit the Connector or even simpler the BasicConnector class. But see the example or any other Connector for more details.

With all this, you should be able to build and deploy your own Connector \o/ If something is unclear. Do not hesitate to ask me.

Architecture

Here is a sequence diagram showing how the inner communication is working:

The main app is just an activity with all it's GUI and logic behind. there is nothing special. But: It is not able to communicate with any webservice without a Connector. Each connector is installed as single apk (only the GSM SMS Connector is shipped with WebSMS.apk). Each connector is living in it's own context.

Communication is done with Broadcasts. If WebSMS is running the update, bootstrap or send command. It is sending a broadcast to the specific connector. The connectors context will spawn here, if it's not alife anymore. The connector spawns (in most cases) a Service, that may run in background without disturbing the user. This service runs a AsyncTask to do the real IO work. At this point the API ends, this is where the doBootstrap(), doUpdate() or doSend() methods are called.

As you might have seen, there are some more methods you could overwrite:

  • initSpec() is run once to initialisize some strings and stuff on spawning.
  • getSpec() is run, everytime it is needed. the connector context will cache the actual instance.

On startup, WebSMS will check, if the number of connectors has changed. If not: it will use the cached instances of all installed connectors. If it changed: it will clear the cache and run a broadcast (info request) to all connectors. They will spawn, run initSpec() and getSpec() and send back the instance to websms. That's why no IO should be done in either of these methods.

FAQ

Please have a look on the DeveloperFAQ.

Comment by smoh...@gmail.com, Jan 16, 2012

Hi

I have been using this app for more than a year now and I feel it is an essential app. I bought Galaxy Nexus running on Android 4.0.2 and when sending message it force closes. It fetch the available credit balance which means that it communicates with the betamax server but when sending message it says that betaxmax connector closes. I feel that connector is crashing.

Looking forward to a fix.


Sign in to add a comment
Powered by Google Project Hosting