Dienstag, 28. Juni 2011

UpDownMeter: how does it work?

Someone recently asked me a how a specific feature of UpDownMeter works and I realized that I so far did not provide any documentation at all (which, of course, is a bad thing). So here we go. (BTW: it does not matter if you use the free or pro version. Besides widgets and ads they are essentially the same app.)

The app consists of two components. A user interface and a measuring service. This enables the app to continually measure the in- and outgoing traffic, even if the user interface is not displayed. The service component starts to measure traffic as soon after your phone is switched on by default. This behaviour can be altered though (see comments on preferences below).

The measuring of traffic works like this:
  1. get amount of traffic of currently active network device (i.e. mobile/wifi) since it was last activated
  2. if this is not the first measurement
    • calculate the difference between the last measurement and this one
    • store the difference
    • if any notifications (or widgets in the pro version) are active calculate the throughput per second and update the respective notifications

Which means that frequent measuring is only needed if any notifications or widgets are enabled. That is why there are two intervals that can be set in the preferences (see comments on preferences and additional notes below).

User Interface
The user interface is pretty straight forward (I hope):

The tabs let you switch between the traffic statistics of the different network devices and applications respectively. In the Mobile and WiFi tabs you'll see the amount of traffic (caused by apps and the system) that went over the respective network interface. If you press and hold of the interval items (today, this month, total) you'll get a context menu that allows you to set or clear an alarm or clear the traffic related to the respective interval.

The update button will instantly carry out a measurement (see above) and update the user interface to display the updated traffic data.

A note on units: UpDownMeter uses binary prefix units. If you want to be able to switch between binary and decimal units (e.g. kibibyte/kilobyte) let me know and I'll consider adding it as a feature.

The Apps tab will show the the amount of traffic caused by individual apps (if supported), regardless of the utilized network interface.

The preferences can be accessed by pressing the menu button of your android device while in the main user interface.

Autostart: If activated the measuring service (see above) will start measuring automatically after you switched on your android device.

Run service in foreground: The android system kills services when it is low on memory. If you enable this, the measuring service will more likely survive.

Incoming, Outgoing, In/Out Notifications: Enable or disable the notifications you (don't) want to be displayed.

Notification/Widget update interval: If any notifications are enabled or widgets are active this will specify how often traffic will be measured (interval in seconds)

Measuring interval: If no notifications are enabled and no widgets are active this will specify how often traffic will be measured (interval in minutes)

First day of month: If your plan starts new months on a different day than the first you can specify this here.

The rest should be self explanatory.

Additional notes
About the measuring interval: Should you set the measuring interval higher because of battery consumption? No. The battery usage of the measuring task is very low and setting a high measuring interval bears the following risk: If you deactivate the network device in between two measurements, all traffic since the last measurement will be lost. This of course is irrelevant as long as you have at least one notification/widget enabled.

Mittwoch, 11. Mai 2011


Finally! After dealing with a lot of other stuff (as well as a decent amount of procrastination) I finally did it. I released the 1.0 of my first android application. I proudly present to you: UpDownMeter Free.

What does it? Let's paste the description from the market:
This application lets you monitor the currently used bandwith of all your network devices (mobile, wifi, bluetooth, ...) by displaying the incoming and/or outgoing traffic in the notification area (at the top).

Furthermore it counts all your traffic and stores the information on your phone, so that you're able to see how much data you have transferred today, this month and in total. Especially useful if you're on a plan with a traffic limit.

The application is free. It supports the developer by showing advertisements, but only while the application is in the foreground. So if you keep the app closed or in the background you will see the bandwith used notifications but no ads!

This application requires 4 permissions:
- ACCESS_NETWORK_STATE: to detect if network devices are up and for advertisements
- INTERNET: for advertisements and to allow remote logging of application errors (this can be disabled)
- RECEIVE_BOOT_COMPLETED: So that the notifications nad counting of traffic can be automatically started after your phone starts (this can be disabled)
- WAKE_LOCK: so that the notifications and counting of traffic
can continue while the application is not in the foreground

And of course some screenshots:

So there you go. Enjoy the fruits of my labor (and hammer your index finger down on the ads like a maniac).

Dienstag, 4. Januar 2011

other Software

I am currently developing an android app that will show the currently used network bandwith in the status bar as well as keeping track of your daily/weekly/monthly used traffic. My initial motivation to set up this blog was to promote this and any future apps. But now this blog is set up and I have no mobile app to show yet, so my first post will be about something else I made a while ago.

If you own more than one computer you will probably run into a problem regarding having your personal files available on all of them. When I ran into that problem I bought myself a consumer grade NAS called LinkStation Live (TM). Now I don't want to do any promotion on the producer's behalf, actually I think the read/write performance of this thing is rather poor (less than 10MB/sec either way) but it came at a reasonably price and has some nice features like a builtin DNLA server (to be able to watch movies/listen to music stored on the device) and BitTorrent client (to download, erm, Linux distributions). Now the BitTorrent Client itself is again not the greatest, most importantly it lacks DHT support, but it works for torrents with trackers that are not mostly down and this lets you save a lot of energy by shutting down your power hungry PC and letting the LinkStation do the downloading.

The LS BT client lets you add torrents either from URL or from a .torrent file via its web interface:

Both methods are rather cumbersome, because adding from an URL does not allways work and both methods require you to do multiple steps:
1. copy link location/save torrent
2. open client web interface
3. paste url/choose .torrent file

What I wanted was something more along the lines of
1. Click link - DONE

So that's what I made, a program that takes a .torrent file as an argument and sends it to the LinkStation and gives some feedback, e.g.


Just link .torrent files to the executable in the browser of your choice and voila - one click adding of torrents. The application is called Torrent2LS and you can get it here. If you have trouble compiling it or just can't be bothered write me a mail, I'll send you the binary.