TICAH 1
TICAH 2
CEWOD
Tanzania SMS Election Information Service
1000 Hills Community Center
Twitter Integrated SMS Alert System
Tanzania SMS Election Information Service
Twitter Integrated SMS Alert System
Let’s take a few minutes to review some of your Design Notebooks from last week.
Any issues with your prototypes? Any amazing discoveries?
Let’s take a few minutes to discuss a few of your Design Notebooks.
Any issues? Questions? Observations?
Let’s take a few minutes to review your Design Notebooks from last week.
Continue developing your projects.
Review the The Year of Mobile Payments article
*Assignments are due before class begins on Mondays. Be prepared to present your work in class for discussion.
Let’s take a few moments to review some of your Design Notebook entries for last week.
Update your project pages on the class blog.
Continue developing your projects.
*Assignments are due before class begins on Mondays. Be prepared to present your work in class for discussion.
Let’s take a minute to review the Partner Organization Pages.
Let’s take a few minutes to share some of your Design Notebook entries from last week about alternatives to Twilio in your Partner Organization’s region.
Freedom Fone is a voice content & messaging management system that uses FreeSwitch and a CakePHP front end to manage IVR and SMS messages.
With Freedom Phone, you can create cell phone Polls, Voice Menus, and Leave-a-message applications. Much of what you built using Twilio can be constructed within the GUI Freedom Fone interface – in particular the recorded IVR applications.
Let’s take a few minutes to try out an example Freedom Fone Voice Menu and walk through the GUI interface.
For more info on installing, configuring and using Freedom Fone, check out the User Guide.
FrontlineSync is an Android app that allows you to sync your SMS messages from your Android phone to FrontlineSMS.
Let’s check out the FrontlineSync Overview on FrontlineSMS.
To set it up:
Once configured and connected, you can configure your Android phone to send and receive SMS messages for FrontlineSMS.
IMPORTANT NOTE – FrontlineSync will sync ALL messages between your phone and FrontlineSMS, so the phone should be dedicated to the service you’re setting up. Clear your SMS history before setting it up, otherwise you might spam everyone in your existing history.
*Assignments are due before class begins on Mondays. Be prepared to present your work in class for discussion.
Let’s take a few minutes to share a few of your Vision Documents.
Ushahidi means “testimony” or “witness” in Swahili.
Ushahidi is open source software for information collection, visualization & interactive mapping.
Here’s an example Ushahidi instance we can try out.
*Assignments are due before class begins on Mondays. Be prepared to present your work in class for discussion.
Let’s review your User Personas from before the break.
"FrontlineSMS is a desktop software created to lower barriers to positive social change using mobile technology. By leveraging basic tools already available to most organizations, including those in ‘last-mile’ settings — computers and low-cost modems — FrontlineSMS enables instantaneous two-way communication to any mobile handset. It’s easy to implement, simple to operate, and best of all, the software is free; you only pay for the messages you send. Using FrontlineSMS with FrontlineSync, you can also track missed calls for the first time." - FrontlineSMS Overview
Let’s listen to Laura Walker Hudson’s video overview of FrontlineSMS.
Here are some additional info and case studies on FrontlineSMS.
Text the service at (856) 571-9434, Frontline will automatically add callers’ phone numbers to the system contact database. We can use to create Groups later.
Now let’s send a message from FrontlineSMS to everyone on our contact database.
Bridget McGraw – Bridget is an Educational Technologist, digital artist and entrepreneur. She lived and worked in Africa for almost a decade, assisting organizations including TICAH, CEWOD, iHub and Ni Sisi! to develop interactive multimedia solutions for communicating with their communities.
Meet with your team to discuss your project concept. Use this Vision Document Template as a guide to creating your own Vision Documents for your project concepts. These will be due next week, and you’ll the present them as a team to your respective partner organizations the following week after getting feedback from me.
Each team member will create their own Vision Document, emphasizing your own contributions to your team’s project. When you present to your partner organizations, you’ll present a unified Vision Document for your team.
Post your Vision Document as a comment to this page!
*Assignments are due before class begins on Mondays. Be prepared to present your work in class for discussion.
Let’s take a few minutes to share some of your Design Notebook entries from this week.
Let’s take a few minutes to discuss User Personas & User Stories and to create a couple of examples on Google Drive.
For more info on writing great User Personas, check out this blog post.
For more info on writing User Stories, check out this one.
Over the last couple of weeks, whenever we need to store data for our apps, we wrote it to or read it from comma separated flat text files. This week we’ll have a look at PostgreSQL, “the world’s most advanced open source database”.
PostgreSQL is an object-relational database, which means it can ‘relate’ information together in the form of tables. It used a query language called SQL, or Structured Query Language, to create, update and delete data in the database.
PostgreSQL is used by thousands of organizations, including Etsy, Moby Games, the National Weather Service, Greenpeace, Apple & Skype.
As it turns out, you all have access to a PostgreSQL instance at database.tcnj.edu. Let’s log in and create our database.
For our purposes, we’ll need to do three things to database-enable our apps:
Let’s create a phone book we can use for some of the apps we developed earlier in the semester.
Let’s have a look at the code for hello_mom_psql.php.
Let’s update the incident reporting app we made last week to use a database instead of a file to store our data.
Let’s have a look at the code for sms_map_psql.php, map_incidents.php, and postgresql_map.html
API stands for Application Programming Interface and refers to hooks some applications have that allow other applications to connect to them.
For example, Twitter is an application that allows users to share short status updates through a web or mobile interface. But what if you wanted to show your latest tweets on your blog? You’d need to have some way to allow your blog to communicate with Twitter, application to application, to filter, collect, and present just the appropriate tweets on your blog. Since Twitter has an API, this is a fairly straight-forward thing to do.
Let’s work through a couple of examples of why we might want to use APIs in our applications:
For our geocoding API needs today, we’ll use the Google GeoCoder.
Let’s have a look at the code for geocoder.php.
Smartphones come with GPS capabilities built in. The trick is to integrate those capabilities into a sensible user interface that suits your application.
For SMS-based incident reporting, an elegant solution would be to allow users to geocode SMS messages using their phone’s GPS feature:
Cordova SMS plugin + Cordova GPS plugin = Smartphone GPS-enabled SMS client
Alternatively, you could develop a native app that posts directly to an incident database though the internet protocol (wifi or 3g /4g).
Let’s create an SMS app that let’s the user send an SMS with their Zip Code, City, or other address info and receive back the current weather conditions for that location.
To accomplish this, we needed a couple of things:
Since we’ve got a working geocoder pattern, we went ahead and reused that to geocode user input. And since we were looking for a solution that will work reasonably well internationally, we used Forecast.io for our weather data.
Let’s have a look at the code for current_weather.php.
With your group, complete & deliver your second round of questions to your partner organization. I’d recommend you use Qualtrix for this second round, and strongly urge you to request your partner organization complete the survey by the end of the week so you can use the data in your User Personas and User Stories.
When researching your User Personas, make use of resources such as AudienceScapes and/or MSU’s globalEDGE. These resources can help find answers regarding languages spoken, religions practiced, education levels, as well as information patterns including device & internet usage.
Try to include the following data points in your User Personas:
*Assignments are due before class begins on Mondays. Be prepared to present your work in class for discussion.
Maps are a kind of infographic, they can communicate a great deal of data visually. They’re also great for presenting data in layers.
As an aside, aligning data can be challenging, and, because of the challenges of projecting spherical geographic data onto flat surfaces, can be distorted:
Leaflet.js is an open-sourced Javascript mapping library. Because it is open-sourced, it is ideal for open or non-for-profit applications. Let’s take it for a test drive:
<!-- basic_map.html -->
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Hello Leaflet!</title> <!-- link in the leaflet.js style sheet --> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> <style> #map { height: 650px; margin: 0 auto; } </style> </head> <body> <div id="map"></div> <!-- link in the leaflet.js library --> <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <script> // initialize our map var map = L.map('map').setView([40.268835, -74.78091], 13); // layer in the base map tile L.tileLayer('http://otile4.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', { attribution: '© <a href="www.openstreetmap.org/copyright">OpenStreetMap</a>' }).addTo(map); </script> </body> </html>
Ok. now let’s tweak our Javascript a bit and layer in some additional information:
<!-- markers_map.html -->
<script> // initialize our map var map = L.map('map').setView([16, -24], 3); // add a MapQuest tile layer L.tileLayer('http://otile4.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', { attribution: '© <a href="www.openstreetmap.org/copyright">OpenStreetMap</a>' }).addTo(map); // Add markers // TCNJ L.marker([40.268835, -74.78091]).addTo(map) .bindPopup('<a href="http://www.tcnj.edu" title="TCNJ Website" target="_blank">Go Lions!</a>"'); // TICAH L.marker([-1.3154995, 36.695187]).addTo(map) .bindPopup('<a href="http://ticahealth.org/index.htm" title="TICAH Website" target="_blank">TICAH!</a>'); // 1000 Hills Community Helpers L.marker([-29.7562074, 30.7433415]).addTo(map) .bindPopup('<a href="http://www.1000hch.co.uk/Default.aspx" title="1000 Hills Community Helpers Website" target="_blank">1000 Hills Community Helpers</a>'); // CEWOD L.marker([-5.0904712, 39.093979]).addTo(map) .bindPopup('<a href="http://cewod.org/" title="CEWOD Website" target="_blank">Women Center for Communication and Development</a>'); </script>
Now let’s tweak our Javascript some more, pulling in our marker data from a file:
<!-- data_map.html -->
<script> // initialize our map, centered somewhere around the Cape Verde Islands var map = L.map('map').setView([16, -24], 3); // add a MapQuest tile layer L.tileLayer('http://otile4.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', { attribution: '© <a href="www.openstreetmap.org/copyright">OpenStreetMap</a>' }).addTo(map); // get our data from file using Ajax var xmlhttp =new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // split up the text file by line var lines = xmlhttp.responseText.split('\n'); for(var line = 0; line < lines.length; line++){ // and split each line by coma var vals = lines[line].split(","); for(var val=0; val<vals.length; val++){ console.log(vals[val]); } // place the markers L.marker([parseFloat(vals[1]), parseFloat(vals[2])]).addTo(map) .bindPopup(vals[0]); } } } xmlhttp.open("GET","map_data.txt",true); xmlhttp.send(); </script>
# map_data.txt
TCNJ,40.268835,-74.78091 TICAH,-1.3154995,36.695187 1000 Hills Community Helpers,-29.7562074,30.7433415 Women Center for Communication and Development,-5.0904712,39.093979
It turns out Twilio supplies additional data about callers in the TwiML request variables. Let’s take a minute to look at the Twilio Documentation.
Understanding these options, let’s see what we can get:
// sms_location_vars.php
<?php // we can get the number of the sender using the 'Fromn' request value $from = $_REQUEST['From']; $city = $_REQUEST['FromCity']; $state = $_REQUEST['FromState']; $zip = $_REQUEST['FromZip']; $country = $_REQUEST['FromCountry']; $msg = $_REQUEST['Body']; header("content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; // get the exact time of the response $t = time(); // set the timezone date_default_timezone_set('America/New_York'); // open a file ponter to write our data $fp = fopen("data.txt", "a"); fwrite($fp, $from . "," . $city . "," . $state . "," . $zip . "," . $country . "," . date("c", $t) . "\n"); // close out file pointer fclose($fp); ?> <Response> <Message>Thanks! Here's your phone's area code location: <?php echo $city . ", " . $state . ", " . $zip . ", " . $country; ?></Message> </Response>
Unfortunately, the location variables Twilio provides aren’t really all that useful. The location data returned turns out to be the location data for the area code, or, more specifically, the phone number’s Numbering Plan Area (NPA). This location data doesn’t change depending on where the caller is calling from.
As a result, we need another solution to capture location data for the actual location of the caller.
// sms_map_data.php
<?php // we can get the number of the sender using the 'Fromn' request value $from = $_REQUEST['From']; $msg = $_REQUEST['Body']; header("content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; // break up the message into an array for cleaning $msg_arr = explode(",",$msg); // remove any extra spaces for($i=0; $i<count($msg_arr); $i++){ $msg_arr[$i] = trim($msg_arr[$i]); } // put it back together as coma separated $msg = implode(",",$msg_arr); // open a file ponter to write our data $fp = fopen("twilio_data.txt", "a"); fwrite($fp, $msg . "\n"); // close out file pointer fclose($fp); ?> <Response> <Message>Thanks for the incident report!</Message> </Response>
*Assignments are due before class begins on Mondays. Be prepared to present your work in class for discussion.