Android as a dispatcher

Emergency services all over the world still use some pretty old technology: pagers (or beepers). Old, but reliable. I’ve often said my fire pager is bullet proof, and it is: it’s most definitely taken a severe beating. It still continues to scream (or rattle) to life every time we’re summoned to save our little piece of the world, and only chews through a AA battery once every few months or so. I wish my phone battery lasted that long! All that said, not every fire fighter/paramedic/civil emergency officer has access to a pager. They are a limited resource in some areas, and at times they do break (even though they are ‘bulletproof’… ;-) ).

We have an issue where pagers are in limited supply and not all of our members are afforded the opportunity to carry one. Given the nature of our fire brigade, being entirely volunteer, not everyone can ‘turn out’¬†(fire fighter talk for ‘attending an emergency or incident’) all the time. As you could imagine, this creates headaches when trying to scrape together a crew on very short notice (often minutes) to respond to an emergency, where most of our pager carrying members are unavailable.

The project

This tutorial is to show fire fighters with pagers and an Android phone can notify fire fighters without pagers of the incident by SMS message, quickly and easily. This system is not designed or intended to replace primary turn out devices or methods.

Disclaimer

By following this tutorial, you agree that you will not hold myself, your cellular carrier or any other person responsible for any failures, delays or errors as a result of implementing, trialling and/or use of this system. You are forewarned that implementation, trial and/or use of this system is at your own risk. Under no circumstances is this system to be used as, or replace a primary paging system or other turn out device.

Bear in mind that text messages are at the mercy of network conditions and may be delayed if your (or a recipients) network is congested.

Whilst there is technically no limitation to how many users you can add to this system, this system has not been tested with more than eight users being messaged, to which it has worked extremely well. Be aware that many more users may slow down the dispatch of these messages. It is strongly recommended that this system be tested every time a new recipient is added.

A note on the Apple iPhone

Given the popularity of Apple’s iPhone, no doubt I will be asked: Is this is possible on an iPhone?

Short answer: No.

Long answer: Due to the way Apple has implemented iOS and given their ‘walled garden’ concept of the ecosystem, it is currently not possible to set up a similar system on iOS (and therefore the iPhone). Apple does not publish an Application Programming Interface (or technical list of instructions and ‘languages’ that applications follow and speak to talk to other applications) to allow third party applications access to the SMS system of iOS. Any applications that attempt to interact with the SMS system of iOS without use of the official API’s (which there isn’t one at time of writing), are very likely to be rejected from Apple’s App Store.

If you still wish to implement this system, you might want to consider the next point:

Crash course on Android and Nexus

Nexus is Google’s flagship platform for Android. Long story short, Android is what iOS is to the iPhone, what Windows is to a PC: an operating system. Many phone manufacturers are free to take Android, modify it and build it for their own devices. In addition to this, Google contracts out manufacturing of the Nexus line of phones and tablets but places the vanilla version of Android on each Nexus device.

Android is also available on a multitude of cheap pre-paid handsets that sell typically without a contract but for the purposes of this tutorial, I strongly recommend the Google Nexus line of smartphones, for their power and flexibility.

Google has announced the Nexus 4, which the 8GB model will retail for AU$349 outright (no contract or carrier lock-in; AU$399 for the 16GB model) for a phone that has been said to competitively rival (or beat in some cases) the iPhone 5, which retails for $799 outright for the 16GB model. Not to start a flame war, this comparison (and link) helps put this device in context for non-techy types.

Anyway, this page isn’t to sell Android. ;)

Aim

To set up an Android based handset to be able to quickly text message a list of fire fighters (or other ‘first responders’) at the touch of a button, and to enable (or disable) certain features of the device temporarily to make it safer for the user when responding to an emergency. Recipients do not need to implement this system, messages sent by this system are normal text messages, nothing special.

Despite the short-falls of cellular networks noted above, this system is to try and make attempts to alert emergency services personnel of an incident that wouldn’t otherwise be notified (e.g. if they don’t have a pager), not to replace their current way of being turned out. Whilst strain on cellular networks is possible, every opportunity should be afforded to notify those who are able to assist in times of emergency.

Requirements

To be able to implement this system, there are several requirements and a few optional components that can be used at your discretion:

  • An Android based handset that is running version 1.6 (codenamed ‘Donut’) or higher,
  • Tasker(AU$5.99)
    • The commercial application that drives this system. A 7 day trial is available.

Strongly recommended options

  • A cellular plan that includes¬†unlimited text messaging
    • Pre-paid plans will ultimately allow a member to control costs and prevent ‘bill-shock’, though considering that during ‘busy periods’ this system may need to be used frequently, running out of your allowance will stop this system from working if your carrier blocks messages from being sent until you have sufficient allowance to continue.
  • Locale Password Lock Plugin(AU$1.49)
    • For those who use a PIN or password to lock their phone (note: screen lock, not PUK or password on device power on), using this plugin will allow you to temporarily disable this security when you trigger your ‘fire call’ mode to notify members via SMS.
      A pattern lock plug-in (free) is also available, but does not function on Android 2.2 or higher, due to changes in Android’s security system (Password lock continues to function though).
  • Locale Speakerphone Plugin(AU$0.99)
    • This plugin can be used to automatically activate your device’s speakerphone on incoming calls when you trigger your ‘fire call’ mode. Included as a safety function for the user, as using your phone whilst driving is illegal in Australia. Where it is not illegal, it is still a really, really, really bad idea anyway.
      • That said, it’s handy when you’re taking calls to provide information to fire fighters whilst you’re getting into your gear or preparing other things before responding as it allows you to keep your hands free.
  • Locale Toast Plugin(AU$0.99)
    • Not required but strongly recommended as it allows you to define more meaningful feedback when you create and use your alerts with Tasker.

Setting the system up

This tutorial assumes you already have Tasker and each plugin already installed.

Tasker is a very powerful suite of tools rolled into an application. It allows you to perform many functions, automate tasks and even create user interfaces. For our purposes, we won’t be creating anything overly advanced; this is just to point out that Tasker is very powerful can perhaps be a little intimidating, don’t let that frighten you. This system is relatively easy to set up and use once set up.

This system works on the concept of ‘tasks’, sets of instructions defined by you that your phone will follow when you push ‘the magic button’. The possibilities are endless, but most importantly, it permits you to send one generic message to many predefined recipients at the touch of a button. Literally.

In the above screenshot, you’ll notice three tasks:

  • FIRE CALL MODE
    • Does what it says on the box, essentially. This is the primary mode that will be used to alert fire fighters that the brigade has been called and that their assistance has been requested. This mode has also been setup to disable the screen lock for a short period of time and enables the speakerphone automatically.
  • STAND DOWN MODE
    • Does much the same as FIRE CALL MODE, except it sends a message to the effect of “you are no longer required, please resume your life as normal”. This has been included for stop messages and accidental activations (handy if you have many members to contact manually if you accidentally activate this system, as I have done… Once…).
  • Disable FIRE CALL mode
    • This mode doesn’t send any messages, it only restores any phone settings altered by the two modes above back to default, and clears any notifications that had been set.

For the purposes of this tutorial, I’ll be creating another FIRE CALL MODE task, but this time, specific to a motor vehicle accident type of call, since some volunteers may prefer not to attend these types of calls for personal reasons.

To create a new task, press the green plus sign towards the bottom of Tasker’s ‘Tasks’ menu.

You will now be greeted with the New Task window. Enter a name for your new task.

Once you have completed that, you will then be greeted with the Task Edit window. This is where all particular actions of a task are listed and where you can select, rearrange and edit them if you so wish (by long touching).

To add a new task, press the blue plus sign towards the bottom left of this window.
To define an icon for this task, press the paint palette to the bottom right of this window.

You should now see the Action Categories menu, where you can select from a multitude of actions to help you define your tasks.

For now, press the Phone category.

From this category, is a list of functions that Tasker can perform related to the phone. Select Send SMS.


Note
There is a difference between Compose SMS and Send SMS: Send SMS allows you to send a predefined message to a list of recipients, while Compose SMS allows you to do the same as Send SMS but presents you with the default SMS application after executing. Compose SMS does not send the message automatically.

You should now be greeted with an empty Send SMS window, with many options to fill.

To add a phone number, press the magnifying glass.

Phone numbers can either be entered by selecting the contact using the Magnifying Glass button, or they can be entered directly. Whilst it is possible to enter multiple phone numbers, this is not recommended as this makes maintenance difficult and may prevent the correct transmission of messages to members.

Your message can be anything you so desire, for this example “FIRE CALL MVA” was used. Also used were two variables, that grab the current date and time then write these into the message, so that the recipient can tell when a message was sent and make a judgement on whether to attend or not (if a message is delayed).

The two variables are %DATE and %TIME, so the actual text above would read:
FIRE CALL MVA
SENT: %DATE %TIME

Store in Messaging App is an optional setting that will tell Tasker to store any messages you send through this Task into your default SMS application, which is recommended.

Press the green tick at the bottom left of this window to save the changes. Repeat these steps for as many recipients you wish to add to this task. At this stage, there doesn’t appear to be a way to set the entire message as a variable, so if changes need to be made, they only need to be made once. Further investigations will be made into this feature.

In addition to this, you can perform a multitude of other functions depending on your requirements. To the left is a completed example task. Adding those other features is pretty straight forward so I won’t cover those for now.

Press the green tick to save this task.

The magic button

Arguably the corner stone of this system is the ‘one-touch’ functionality, which is relatively easy to set up with Android. For the next few screenshots, Android 4.0 ‘Ice Cream Sandwich’ is used, so older or customised versions of Android may differ, please consult your devices documentation for specific instructions on adding widgets.

In Ice Cream Sandwich, locate the Widgets tab in the Applications tray, then find the ‘Task’ widget, with Tasker’s icon.

Press and hold, then drag this widget to a spare space on your phone’s home screen.

A configuration box will pop up asking which task you would like to set this widget as. Select your FIRE CALL task.

A final configuration box will pop up showing you the list of actions in the task, with an opportunity afforded to change the icon of the widget (using the paint palette button) before setting the widget.

The window to the left shows you what your new widget looks like, just after it has been activated: notification showing and Toast widget providing more information.

To activate your new task (i.e. send a fire call message), touch the widget.

FireAlert has since picked up the message based on keywords and has now sounded the alarm:

What the message looks like when it appears to each recipient (sender being the first message, recipient being the second message, used own number to test this) in this example on the left.

If Store In Messaging App was checked, you will see each message stored for each recipient as shown in the first message, with recipients receiving the message typically within the minute it was sent (though this depends on network conditions).

To the right are the settings I use to remove the notifications, disable the speaker phone and relock my screen. Note, if you use the Locale Speakerphone plugin for your fire call modes, you must use the same plugin (not the in-built one, which may or may not work depending on your device) in your Disable tasks, as speaker phone will remain on after the task has been disabled by not using the same action.

Conclusion

That’s pretty much all there is to it. If you prefer, you can add more actions to suit your specific needs, though this is the basic idea behind the system. It works wonderfully for us and I hope that it will benefit many other fire fighters, remunerated and volunteer alike.

Any questions can be dropped into the comments section and I’ll respond to them as soon as I can.

Lastly, please tell your recipients that you will be notifying them with this scheme! You may end up getting very confused calls and messages back at the wrong moment!

Stay safe!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>