Android applications

This page is dedicated to a couple of Android apps I did for fun in the past. They are nothing special, but have been popular for a while and I decided to release their source code. Note that these apps are not maintained and probably do not work in recent Android versions. I keep them here for reference:

  • Mobilog (aka Mobility logger, aka Mobile network logger) is an Android wardriving application that logs wifi and cellular network details. 
  • H3G likehome locker is an application to enable selective roaming (i.e. permit data roaming only in selected networks)

Mobilog

Mobilog is an Android wardriving application that allows to log GPS coordinates, Cellular Network details (e.g. cell-IDs, RSSIs, Neighboring Cells, Connection States, etc.), and Wifi Access Points information (e.g. SSID, BSSID, RSSI, Frequency, Encryption).

Tracks are saved into the SD-CARD (or built-in internal storage) of your android-based smartphone. You can decide whether to just use plain CSV format, or to additionally include for each path a KML file for visual analysis on Google Earth and Google Maps.

Download links (source code is released under GPLv2):
- Mobilog v1.0 (Android 2.2+):
APK (src).
- Mobilog v2.0 (Android 4.0+): APK (src).
- A high level documentation about the app and its design is availble here.

Known bugs:
- BER is always -1 (this is what Android communicates through the API, no way to solve it)

About Mobilog:
I did this application in the context of my PhD studies at the University of Vienna - Faculty of Computer Science (Research Group Entertainment Computing). I had a desperate need for an application that logs cellular network details, and I failed to find a stable one in the Android market. So I decided to create one on my own.

The original aim of Mobilog was therefore to log all details provided by the Android API about the cellular network (including cellids, location areas, signal strengths and neighboring cells). Later I decided to add an option to include wifi access point in the logs, turning it into a sort of wardriving app.

The application is designed to be energy-efficient and simple. This means you will not find super nice map views and graphical add-ons. While coding, my first priorities were efficiency and stability, sometimes overlooking elegance and code reusability.

How to use Mobilog:
1) Launch the application,
2) Be sure to choose your options by going to menu->Settings,
3) Press <Start> and optionally close the app to avoid contiuous refreshes of the screen and save some battery,
4) Drive, walk, bike, jog, or sit in a public transport,
5) Reopen the app (if closed) and press <Stop>.
6) You will find your log into /<SD-CARD>/Mobilog



Cellular Tab (1/2) Cellular Tab (2/2) GPS Tab

Wifi Tab  Settings Tab (1/2) Settings Tab (2/2)


Available settings:
By pressing the menu button you can enter the settings panel. Settings can be changed also while logging, but will be effective only for the next logging session. This is to avoid csv files with different number of elements per line.
Here a list of the available settings followed by the respective explanation:

- Log RSSI:
If enabled, each logged data point will also contain the measured RSSI (Received Signal Strength Indicator) from the current cell. PLEASE NOTE that the Android operating system provides RSSI through the API, ONLY AND ONLY IF the screen is ON. Therefore, if this option is enabled the application will try to keep the screen ON (but at minimum brightness) by acquiring a wakelock. If you switch off the screen (for example by pressing the power button) the RSSI value will not be updated anymore (some phones behave differently).
- Log neighboring cells:
If enabled, each logged data point will also contain the list of neighboring cells including the respective measured RSSI (therefore screen on). In case of a 2G network, neighboring cells will be identified by their cell-ID. In case of a 3G network, neighboring cells will be identified by their PSC (Primary Scrambling Code).
- Log Wifi hotspots:
If enabled, each logged data point will include data about the currently visible Access Points, i.e. SSID, BSSID, Frequency, RSSI, Encryption algorithm.
- Export as KML:
If enabled, the application will generate two logs: <date>_<time>.csv and
<date>_<time>.kml. You can open the kml in Google Earth. Normal datapoints are marked with a green point. Cell changes are marked with a yellow point. Change of Location Area Code are marked with a red point. Each placemark contains a baloon as shown in the following image:

Example of a kml placemark


- Continuous Wifi scanning
If enabled, the application will continuously scan for new access points. The application will execute a new scan as soon as the current one finishes. This is a bit power consuming, but required if you want to get everything at every instant. If this option is NOT enabled, the scans will be performed as designed by your phone manufacturer (for me, they are done every 60s).
A small hint for rooted users: If you don't want to perform continuous scans, but you find the 60s time interval too large, you can just change the value of the periodic scans by modifying the build.prop file in the directory /system/. A search on google will help you to find out the right key to modify. This has effect on a system level, so remember to put it back to the original value when you are finished.

- Cell Change logging:
If enabled, a new data point will be added when there's a cell change AND no GPS coordinates are present.
There's no reason to disable this. So I'll probably remove this option.

- Logging Interval (Seconds):
The interval for saving data-points. Data points will be saved even if no changes are detected by the GPS chipsets. (Set this to zero if you prefer asynchronous logging based on events from GPS and cell changes).

- GPS Refresh Interval (Seconds)
Minimum number of seconds between each datapoint (Suggested value: zero).

- GPS Refresh Interval (Meters)
Minimum number of meters between each data point. Too large values make your log inaccurate. Too small values make your log crowded of points.
I always use 10, since in my mobile phones, values below 10 generate datapoints even if I am not moving (probably due to the inaccuracy of the GPS chipset).


FAQ:

1) Why I don't see anything in this FAQ?
Because I didn't prepare one yet.
2) Why does this application require XYZ permission?
I included only the permissions extremely necessary for the application to work. Here some explanation: 
- Change wifi state: Required to perform continuous scannings
- View WiFi state: Required to check whether WiFi is ON and to get scanning results
- Read Phone State and Identity: Required to access SIM card information and show it on the Cellular Tab
- Modify/Delete SD-Card content: Required for acessing writing the logs to the SD-Card
- Prevent phone from sleeping: Required to keep the screen on if RSSIs are logged
- Fine (GPS) location: Required to read from the GPS receiver
- Coarse (Network-based) location: Required to read location areas and cellIDs
As you can see, there are NO requests for internet connection, i.e. noway your logs are transferred over the internet. Everything is done locally. Don't have to worry about your privacy. 
3) What about battery life?
I'll explain later... No time now...



H3G likehome locker

Link removed.

I developed this app for my own use. 
H3G offers free roaming to its users traveling in any H3G-covered country (Australia, Austria, Denmark, Hong Kong, Macau, Indonesia, Ireland, Italy, Sweden, and United Kingdom). However, once in the visited country, the phone might switch occasionally to other networks. In other words, before you even notice it, you will end up with an expensive bill. In order to avoid this, you would need to select manually H3G in the network settings of Android. However, this is valid for network selection in general, i.e., if there is no coverage from H3G , the phone remains unreachable.

H3G likehome locker lets the phone attach to any network, but allows data transfer ONLY if the phone is attached to a H3G likehome network. Basically, as soon as the seen MNC does not belong to any operator of the H3G group, any data connection through the mobile network will be automatically disabled (APN renamed to a non-existing one).