SmsRadar, First Open Source Android Library released by Tuenti

Publicado el 02/6/2014 por Pedro Gómez, Mobile Apps Engineer

SmsRadar is the first open source library released by our Android team. This library has been implemented to listen to every incoming and outgoing SMS that the user’s device receives or sends. This Android library works for Android 2.X or higher versions.

SmsRadar has been implemented because intercepting incoming SMS is not a trivial task, if an Android developer wants to intercept an outgoing SMS he can use BroadcastReceivers because Android SDK allows you
to listen to SMS intent filter. But, what about incoming SMS? You can’t use BroadcastReceivers to implement this because there is no intent filter to listen to incoming SMS. Another option is to configure your application to work as an SMS native application, but this SDK feature is not available for all Android versions.

This Android library implementation is based on an Android SDK element called ContentObserver. To be able to listen to a native SMS database we have registered a ContentObserver implementation called SmsObserver to the native SMS ContentProvider. The following class diagram represents the main classes involved in this library.

The visible part of this library -from the library user's point of view- is:

To use SmsRadar developers have to register SmsRadarService into their AndroidManifest and start/stop SmsRadar library using two main methods available in SmsRadar class: “initializeSmsRadarService” and “stopSmsRadarService”.

SmsRadar is just the first Android library released by Tuenti. We will continue working to contribute to Android Open Source Community.