Optimizing Telerivet for Mobile Web

Software developers like Telerivet face a number of unique challenges when designing and deploying software for users in developing countries:

  • sporadic power and internet connectivity
  • language barriers
  • devices ranging from feature phones to smartphones to PCs
  • older computers, phones, and browsers
  • users with less computer experience
  • higher latency and lower bandwidth
  • increased cost of internet access

Much of our work at Telerivet goes into addressing the particular challenges of building software that works well in developing countries, in places where most other software doesn't work very well.

Among these many challenges, we've recently been focusing on the particular challenge of making Telerivet's web-based tools work on mobile devices.

Even though Telerivet is designed for communicating with non-internet-connected mobile phone users, we initially designed Telerivet.com around the idea that our customers would manage their SMS service from a web browser on an internet-connected PC with a large screen, keyboard, and mouse.

For people using Telerivet's Android app to send and receive SMS, this meant that our customers needed two computing devices: an Android phone, and a PC.

But as we started to reach out to customers in developing countries, we realized that many of them use their phone as their primary computing device, and they didn't have easy access to a PC.

So we are happy to launch two new features today that will make a big difference for many Telerivet customers in developing countries. 

1. A Mobile web version of Telerivet.com that works on any smartphone (and many feature phones)

From any smartphone, simply open http://telerivet.com in your browser, to log in and manage your SMS service while on the go. Telerivet will automatically detect whether you are using a mobile or standard browser, so you use the same URLs on your phone as on your PC.

Mobile-contacts Mobile-messages


Most things work pretty well even on feature phones with Opera Mini (if you have enough patience)!

2. A new version of Telerivet's Android app that embeds Telerivet's web-based tools

For those using Telerivet's Android app, all of Telerivet's web-based administration tools are now available as tabs directly within the app. (For security, these tools require you to log in to your Telerivet account.) You can send and view messages, view and update contact information, view statistics, and configure automated SMS services such as subscriptions, polls, and auto-replies directly from the Android app. No PC necessary.

App-running App-messages

Of course, some actions are inevitably going to be tedious on a small touchscreen device, no matter what we do. So when it's convenient, you can still log into Telerivet.com using a PC with a keyboard and mouse.

How we did it

Instead of building entirely separate interfaces and interactions for mobile and desktop browsers, the two versions share almost all the same code.

(Actually there are three different versions, since the pages that show up within the Telerivet Android app are slightly different from those viewed in a normal mobile web browser.)

Most of the differences between the two (or three) versions of Telerivet.com are simply a matter of sending the browser a different CSS stylesheet. (CSS allows web developers to specify the sizes, positions, and colors of the various visual elements on screen when someone open a web page in your browser.)

Telerivet's desktop version assumes that the browser is at least 920 pixels wide, so the CSS stylesheet often specifies the exact pixel width of various parts of the user interface. In contrast, Telerivet's mobile version automatically adjusts the content to fit the width of the screen.

But some mobile optimizations aren't possible with CSS. In these cases, we create custom HTML templates to render parts of pages differently between the mobile and desktop versions of our website.

For example, in the desktop version of our website, each page includes a header with a graphical Telerivet logo:


On the mobile web version, showing this logo at the top of each page would take up a significant portion of the screen, leaving less space for the actual content (not to mention the extra bandwidth that would be used to download the logo). Instead, the mobile web version simply uses the text "Telerivet", while the version inside the Telerivet app doesn't include the word "Telerivet" at all.

Mobile-header  App-header

However, customizations like these come at a cost — more code for us to maintain and test! Since we're always rapidly adding new features to Telerivet, we don't want it to be twice as much work to support both a mobile and desktop version.

So we try to keep the differences between the desktop and mobile versions at a minimum, and structure our code so that the mobile and standard views can use the same HTML and CSS whenever possible. Only 2% of Telerivet's HTML templates and about 11% of our CSS styles are different between the mobile and standard versions of our website.

To upgrade the Telerivet app on your Android phone, just open the Telerivet app and click the button to upgrade. (If you haven't started using Telerivet yet, sign up for free here.)

Try it out on your phone, and let us know what you think!

(Stay tuned for more blog posts where we'll discuss our work to optimize Telerivet for users in developing countries, and follow us on Twitter for more updates!)

Get phone numbers directly from Telerivet (Android not required)

Using Telerivet's Android app as an SMS gateway is certainly more convenient than alternatives like connecting a GSM modem to a computer. 

However, using Telerivet's Android app does require some care on your part. You need to:

  • keep the Android phone powered on,
  • make sure it has internet connectivity, and
  • refill the phone's credit before it runs out. 

Not difficult… yet still not as easy as it would be if you didn't need your own device at all. 

A service that provides SMS-enabled phone numbers "in the cloud" would be even easier.

Since the beginning, Telerivet has supported Twilio, a service that offers SMS-enabled phone numbers in the United States, United Kingdom, and Canada. By connecting a Twilio phone number to Telerivet, you can send and receive SMS messages with your Telerivet account, and easily build SMS services without needing programming expertise or your own servers. Diagram_twilio2
Until now, using a Twilio phone number with Telerivet used to mean that you had to set up your own account with Twilio and pay them separately for your SMS usage.

But now, we're happy to announce that you can get SMS-enabled phone numbers directly from Telerivet. There's no need to set up your own Twilio account (or even know what Twilio is!). Just sign up for Telerivet, find a phone number that you like, and start sending and receiving SMS. It's that easy.

As you send and receive messages, we simply deduct the cost of each message from your Telerivet account balance ($0.01 for incoming SMS and most outgoing SMS). 

For a limited time, we're even offer a small amount of credit to new users to let you get your own phone number and try sending and receiving SMS for free.

What if you want a phone number in another country besides the U.S., U.K., and Canada? 

Of course, Telerivet's Android app still lets you send and receive SMS with a local phone number in any country.

In the coming months, we look forward to working with other SMS gateway providers (in addition to Twilio) so that we can offer cloud-based phone numbers in as many countries as possible. Stay tuned!

What we did when all the other SMS tools didn’t work

Welcome to Telerivet's new blog!

In the coming weeks/months/years, we'll be using this space to introduce new features and service updates, share tips and tutorials, profile organizations using Telerivet in interesting ways, and discuss our thoughts on the mobile ecosystem in general.

As we post new updates here, we'll tweet about them too — follow us on Twitter to stay updated!

To kick off our new blog, let's introduce how Telerivet fits into the huge ecosystem of SMS tools and services, as we tell the story of why we created Telerivet in the first place.

In 2010, we wanted to set up a SMS service so that grassroots non-profit organizations in Tanzania could publish news to envaya.org, interact with other organizations, and receive notifications, even if they didn't have internet access.

Here's what we tried, and how we ended up building Telerivet instead.

Attempt #1: Online SMS APIs

If we had wanted to set up this SMS service in North America or Europe, instead of East Africa, it would have been simple.

There are a lot of great online SMS gateway API services out there, like Twilio, Clickatell, Nexmo, and Tropo, which allow software developers to easily send and receive SMS messages from their own applications.

However, most of these services only offer phone numbers in a few countries, such as the U.S., U.K., and Canada.

This meant that our users in Tanzania would have to pay extra to send international SMS messages, instead of paying cheaper domestic SMS rates using one of the SMS bundles offered by their mobile network.

And although many of these services were able to send SMS to other countries, we found that international SMS was often unreliable  and sometimes wouldn't reach users on particular mobile networks in East Africa.

Attempt #2: Buy a SMS shortcode

To avoid the problem of sending international SMS, we tried to get a phone number in Tanzania that would let us send and receive SMS domestically.

Unfortunately, in Tanzania there aren't yet any companies like Twilio where you can get an inexpensive "longcode" virtual mobile number with an API for sending and receiving SMS.

However, there are a number of mobile networks and resellers that offer SMS shortcodes.

Often these companies do not offer transparent pricing, and instead negotiate private contracts.

We negotiated with one of them, and they offered a year-long contract amounting to over $5,000, in addition to about 3 cents for each message sent or received.

The non-profit organization we were volunteering for couldn't justify spending that much on a SMS shortcode.

To reduce the cost of SMS shortcodes, many companies offer shared shortcodes, which allow multiple users to build services on top of the same shortcode and reserve different keywords for their applications.

For some uses, shared shortcodes are often an economical option. However, shared shortcodes have the limitation that each incoming SMS message must begin with the user's unique keyword, and we decided they wouldn't work for us.

Attempt #3: Download software to send and receive SMS with a GSM modem

Free downloadable software tools like FrontlineSMS and RapidSMS have proven popular among many non-profits in developing countries.

With these tools, you connect a GSM modem or a basic feature phone to a computer running the software, turning your computer into a SMS gateway.

Tools like FrontlineSMS are indeed useful in some scenarios, especially because you can use them in remote areas where you don't have internet access.

But as we explored using them for our SMS service in Tanzania, it soon became clear that they would prove expensive, unreliable, and unmaintainable in practice.

Connecting a phone or GSM modem to our computer to send and receive SMS was the first challenge.

These software tools interact with phones and GSM modems by using a protocol called the Hayes command set (also known as AT commands), essentially the same way computers interacted with analog modems in the 1990s and earlier, complete with archaic settings like baud rate and COM ports. However, each phone and GSM modem implements a different subset of the protocol, and only a small fraction of current devices are compatible with the software.

None of the phones we already had proved to be compatible with the software, so we ordered one of the devices known to be compatible.  But when it arrived and we tried to connect it, the device drivers wouldn't install correctly on our computer.

As we struggled with connecting the GSM modem, we realized that even if we got it to work correctly, running a SMS gateway on a PC in Tanzania was not going to be maintainable.

In order to provide a SMS service 24/7, we'd need to dedicate a computer to it, make sure the software is always running and doesn't crash, and make sure the computer always has electricity – no easy task in developing countries like Tanzania.

And although software like FrontlineSMS and RapidSMS don't require internet access themselves, we would need reliable internet access in order to integrate with envaya.org. Since the non-profit's office in Dar es Salaam often has power outages that take the network down, this did not seem promising.

And if we wanted to access this computer from elsewhere, even just to send SMS notifications, we would need to host it somewhere where it would have a public IP address.

It was clear that the model of using PC and GSM modem as an SMS gateway was not going to work.

Attempt #4: Use a phone as an SMS gateway

We realized that since phones can send and receive both SMS messages and internet packets, that we could use a phone as a standalone SMS gateway without needing to be connected to a PC.

We started by exploring the possibility of building a J2ME (mobile Java) app that would work on the cheap feature phones common in countries like Tanzania. However, it didn't take long to discover that it simply wasn't possible to build apps that access the necessary SMS functionality on cheap feature phones.

Then, we discovered that on Android, a few SMS gateway apps had already been created — including KalSMS, APK SOFT SMS Gateway, and Ushahidi SMSSync.

We realized that using an Android phone as an SMS gateway was a great solution: sub-$100 Android phones such as the Huawei IDEOS are rapidly proliferating throughout developing countries (and are much less expensive than a computer and GSM modem); they're easy for non-technical people to maintain, and have built-in battery backup and redundant networking (Wi-Fi and mobile data) to stay operational in challenging environments.

Unfortunately, our testing showed that the existing Android apps were quite limited and not very robust. For example, all were limited by Android's restriction of 100 outgoing SMS messages per hour per app, and would freeze if you attempted to send more than 100 SMS per hour. Also, they all struggled with the problem of how to send outgoing SMS — since the Android phone generally does not have a public IP address, it has to constantly poll the server for outgoing messages, using bandwidth and battery life. They also didn't make it easy to figure out what was wrong if the phone was having problems.

Since none of the other Android SMS gateway apps were good enough for us, we built a vastly improved SMS gateway app ourselves, deployed it in Tanzania to power Envaya's SMS interface in October 2011, and shared it with other software developers.

Attempt #5: Start a company

Soon, other people began using our Android SMS gateway app, and non-developers started asking for our help because they didn't have the technical skills to set up servers, or to implement the complex developer API provided by the Android app.

Then we realized our opportunity: to provide a service to make it easy for anyone to build their own services and applications on top of SMS anywhere in the world, even if they didn't have the technical expertise (or didn't want to spend the time, money, or effort) to implement a complex API or run their own servers.

By building a service that combined an Android app with our own servers (aka "the cloud"), we could build something that non-technical users could use to send and receive SMS in developing countries, without all the issues of using a GSM modem with software on a PC.

A couple months of hacking later, we quietly released Telerivet in beta on Leap Day 2012. Telerivet lets people easily create and deploy custom mobile services anywhere in the world, letting them focus on the high-level aspects of creating and running mobile services without getting bogged down by technical barriers.

The response has been amazing.  Spreading mostly by word-of-mouth, leading non-profits and businesses are already using Telerivet to send SMS in many countries around the world, such as:

  • Kiva to facilitate communication between borrowers in Kenya and lenders around the world
  • myAgro (2012 Echoing Green winner) to allow farmers in Mali to save for agricultural supplies (even throughout a coup-d'etat)
  • InVenture to help people establish creditworthiness in India
  • FieldPulse Research to collect data from market sellers in Mogadishu, Somalia

Even if you work in a place with a bit more stability than Mali or Somalia, you can use Telerivet to build automated SMS services like opt-in subscriptions, polls, and informational services, or just send and receive SMS in your browser.

Read more about the amazing things that other people are already doing with Telerivet, and try it out yourself!

Jesse Young is Telerivet's Chief Technology Officer.