Peeble
1. The idea
Note: Peeble is a client-server
application. The software works only if both the client and the server
parts are installed and started properly.
Peeble got its name from a sci-fi novel by Stanislaw Lem where one main
character is an intelligent advisor (the "peeble") that analyses the
neighbourhood and provides its owner with useful advices. This
applicartion simplifies this futuristic vision like the following: the
application collects position data statistics of the user and allows
the user to define "interesting places" in form of search terms. Then
the client part (Android) synchronizes with the server and based on the
statistics collected and the search terms specified, the server updates
the client's "relevant places" database. When the user gets close to
one of these "relevant places", he or she receives a warning.
This is an off-line, mobile-optimized version of the "find businesses"
feature of Google Maps. The value added to Google Maps is based on the
following assumptions.
- That cheap, ubiquitous access needed by the full interactive
Google Maps application will not be available for the mobile client.
- That the entire Google Maps database cannot be replicated to the
client for different reasons (business or technological reasons like
the commercial value of the database and the storage capacity of the
client).
Instead, the system tries to guess which locations may be relevant to
the user by collecting and analyzing location data based on the
assumption that many people move frequently along the same or similar
routes. This allows the server to determine a relatively small set of
"relevant places" that can be safely stored on the client and update by
the server during the next synchronization session.
2. Limitations
The application provided here is just a prototype of the idea and is
heavily simplified at places.
In particular:
- The UI of the client part is not very attractive.
- Client databases are not locked during the synchronization
session.
- There is no effort made to notify the user about a "relevant
place" other than the display of the mobile device (e.g. no sound, no
vibra)
- The synchronization trigger is manual and is not e.g. timed or
launched by the availability of fast and cheap data connection.
- There is no persistence on the server side, if the server
application is restarted, the server-side databases are lost.
- There is no integration with internet databases (e.g. that of
Google Maps) on the server side, the server-side location databases
contain only some handpicked locations.
- Authentication on the server side is not solved (although
multiple users get separate copies of databases).
- The search algorithm used on the server side is extremely
simplistic.
3. Installation
Prerequisites:
- Windows operating system (some installation scripts depend on it,
otherwise the application is platform-independent)
- Android M5-RC14 SDK
- JBoss 4.2.2 GA application server
- JDK 1.6.0
Directories are denoted as follows:
- Peeble package is installed in directory %PEEBLEDIR%
- JBoss app server is installed in directory %JBOSSDIR%
First install the server. Enter %PEEBLEDIR%\server directory and edit
the build.xml script so that the "home" property points to
%PEEBLEDIR%\server and the "jbosshome" property points to %JBOSSDIR%.
Now issue the "ant" command. The server package is installed in the the
JBoss application server. Enter the %JBOSSDIR%\bin directory and
execute run.bat.
Open a console window, go to %PEEBLEDIR%\tools and execute: "java
PipeProxy localhost 8080 8088". This will launch a TCP piping proxy to
the JBoss webserver. For reasons unknown to me, the emulator's HTTP
client is not able to connect directly to JBoss webserver on port 8080,
only if this piping proxy is inserted. This is clearly a mistery and I
did not have time to investigate it. It may be related to the network
interface configuration of my computer and may not occur elsewhere.
Now launch the Android emulator and install Peeble.apk from the
%PEEBLEDIR%\client\bin directory. Enter the %PEEBLEDIR%\tools directory
and execute the push_providers.bat script. This installs the example
tracks as location providers.
Restart the emulator.
When the emulator restarts, launch the Peeble application and select
"Configure ..." from the menu. Edit the IP address part of the sync
server according to the IP address of your computer. Select the
"barking1" location provider and press "Save".
4. Demo use case
The Peeble background service is started automatically at device
(emulator) startup and is already analysing your location (this
can be followed in the emulator log).
Note: on my emulator installation,
the Phone application often crashes on startup. When it does, the
emulator does not start the Peeble background service. There is a
manual service start option in the Peeble menu to start the service.
The behaviour is inconsistent, therefore I suspect that this is a fault
in the emulator or the emulator installation on my machine.
Allow 1 minute for the "barking1"
example route to complete. Meanwhile, select "Search terms ..." from
the menu and add the "supermarket" search term by using the "Add
search term" menu command of the term manager activity. Wait the 1
minute for the track to complete and select "Synchronize ...". The
server should react to the synchronization command by displaying debug
messages in its console window. If you allow the route to continue,
occassionally you will see "relevant places" to be displayed in the
main window of the Peeble activity. If you enable warning popup in the
configuration activity, these relevant places are displayed even if you
navigate away from the Peeble UI. In order not to annoy the user with
constant popups, each "relevant place" is displayed only once in the
popup activity (but is always available on Peeble's main screen).
5. Organization of the software
The client-side application consists of Peeble's own content provider,
its background service and a number of activities interacting with the
user. The HighlightDisplay activity is the pop-up which is launched by
the background service. The synchronization framework was also
developed by me for an earlier project, this provides SyncML DS-based
synchronization features for both the client and the server. The server
is essentially a Java servlet.