To accomplish this, there would be some server running (could be the router providing internet/wireless) that would store the information to be provided. The information could be stored in anyway, but for me I chose to use XML as there are many parsers available. Here is an example of such an XML file describing the network, and some upcoming events.
<Network>
<name>University of New Orleans</name>
<link>http://www.uno.edu</link>
<policy>http://www.uno.edu/NonDiscrimination.asp</policy>
<Events>
<Event>
<title>Party at the library</title>
<description>Free food</description>
<eventLocation>Library</eventLocation>
<dtstart>1288515600000</dtstart>
<dtend>1288522800000</dtend>
</Event>
<Event>
<title>Campus Meeting</title>
<description>Talk with the governor</description>
<eventLocation>Administration building</eventLocation>
<dtstart>1293890400000</dtstart>
<dtend>1293901200000</dtend>
</Event>
</Events>
</Network>
This XML file describes a campus network that may wish to provide students and other network users of upcoming events, but the idea is clear that other types of information may be presented as described above.
For one of my classes, I decided to craft this idea into an Android project. The fun part about this is that I would use service discovery to automatically discover the server on the network providing the information. This is in contrast to perhaps a static network address or some DHCP information similar to DNS information.
I chose to use zeroconf technology for the service discovery as there was an easy to use java version of mDNS (a portion of zeroconf) that I used for DAAP that works nicely in this situation (well not so nicely, but it works). The idea is that the network server that is providing the information, also registers a service of a network-info service type and clients that join the network request services of the network-info service type that was registered. The server responds and provides the information, which the client displays.
I created an Avahi XML file describing the service so that it would be automatically broadcast on boot. Avahi is an open source implementation of zeroconf and provides utilities such as this to advertise services.
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name>UNO</name>
<service>
<type>_netfo._tcp</type>
<port>9090</port>
</service>
</service-group>
So now that the service is advertised and the information being provided is set up, we just need clients to connect.Here are the screenshots of the implementation I wrote for my mobile computing class.
Screen presented after a server is discovered and information provided. |
Screen presented when an even was clicked, providing more information. |
Clients receive a notification upon emergency information becoming available. |
Information presented when the emergency is clicked. |