|
DeveloperHelp
IntroductionWebSMS 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! DetailsTo build your own Connector you will have to think about:
APIWell, 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. ArchitectureHere 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:
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. FAQPlease have a look on the DeveloperFAQ. |
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.