My first Android App

Yesterday, my first Android App hit the Market. Just search for flightpred and you should find it. It should run on any device running Android 1.5 and above. The App doesn’t do a lot so far. Essentially, it downloads an xml file from the flightpred server and displays the predictions for how many kilometers it thinks are possible to fly in the next three days in some flying sites on the small screen. Later I also want to add a GoogleMapsView with the circles like on the flightpred website.

I used to develop some small projects and my diploma work in Java some ten years ago. Since then the language progressed noticeably. I especially like the templatized containers. Back in the days, the containers were not type safe and I always had to cast when accessing elements. Also, the lambda’s look good.

missing env variables when running from cron

Today I solved another problem that bugged me for a while. Namely, I wanted to run the free flight prediction runs automatically from cron. When I ran it from the commandline or a script, it worked well, but when I tried to run it directly or through the same script from cron, it always failed with the following message : “critical error : basic_string::_S_construct NULL not valid”

Continue reading “missing env variables when running from cron”

debian/postinst froze when restarting apache2

With my flugbuch2 and flightpred projects I had a problem for a while in the debian packages. Namely the installation froze after restarting apache2, while the installation seemed to have succeeded as the websites were accessible. When I reloaded apache instead of restarting, the installation ran through but the websites could not be found.

After endless googling, I found that the debian gallery packages used to suffer the same problem and that it was fixed. So I examined the source. What triggered the problem is an apache installation that’s not properly configured. Namely, if your apache complains that it cannot resolve the fully qualified hostname upon startup, then restarting apache inside my old postinst script would fail the postinst script. It has something to do with debconf waiting on some open file descriptors.

To make it short: move the db_stop to just before the apache restart and that solves the problem.