Saturday 2 November 2013

Version 1.3.0 of the Trailer iOS app released, more changes coming soon

I've just had confirmation from Apple that version 1.3.0 of the Trailer iOS app is now available in the app store.

This version doesn't add much new value, apart from being a rebuilt against the iOS7 environment and updating the version of the analytics library from Flurry which is in use, as the old version relies on a unique id API which Apple have removed in iOS7.

I realize there's not been much happening for a while, this has been due to work and other commitments depriving me of time to work on it.  Readers in the software industry may be familiar with the phrase 'whatever it takes' in relation to development processes in our day jobs.  The current project runs quite differently, 'whatever it gets' is a better description.

I'm afraid the web application for generating trails isn't presently working, but I am hoping that I will manage to get it working again (and in a better and more useable state) within the next few weeks.  In the mean time, if you're interested in reading back through the blog entries you are welcome, and the code-based method of creating trails should still be working fine.

I hope I'll be able to post something more interesting soon.

Monday 1 April 2013

Problems with the intent filter in the Trailer application for Android

As I wrote in my previous post, I had some trouble setting up an intent filter which worked for the Trailer Android application.  In my initial release, v1.0, I found a way of creating an intent filter which made the Trailer app handle .tqz files when sent as email attachments, but I found that this filter was too permissive, and Trailer also finished up being offered as a handler for lots of other kinds of content.

I've now released an updated version v1.0.1 which has a filter which I regard as correct (but with an important disclaimer which you will be able to a few paragraphs later in this post).

During my research on this topic on the internet, I could see that I was not the only person having problems with this particular aspect of Android development.  The Stack Overflow site contained quite a lot of material on the topic, but I didn't find any of the recipes there worked quite the way I expected, although when I finally worked out what was going wrong the material I had read on SO started to make sense.

The final filter I decided to use looked like this:
    <activity android:name=".TrailerMainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
      <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="file"/>
        <data android:scheme="content"/>
        <data android:scheme="http"/>
        <data android:host="*"/>
        <data android:mimeType="application/tl-trailer"/>
      </intent-filter>
      <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="file"/>
        <data android:host="*"/>
        <data android:mimeType="*/*"/>
        <data android:pathPattern=".*\\.tqz"/>
      </intent-filter>
    </activity>

This fragment has three intent filters, of which the first one is related to launching the application from its icon on the Android desktop, the second one relates to launching in a context where a MIME type is available, and the third one relates to recognition of the .tqz file extension once a file with that extension is available on the device.

I am now convinced in my own mind that the configuration above is a reasonably correct one (not necessarily the only configuration which would work). Unfortunately this configuration does not presently work in the Gmail application provided with my Android device (a Nexus 7 running Android 4.2.2), but it does work in the Email application. According to this issue in the Android Open Source Project bug database, I'm not the only person who thinks this is a bug in the Android Gmail application, but the response on the issue from the developers is to refer the poster to the Google Mobile application forum, which doesn't seem to have a publicly accessible bug reporting interface, and may mean that there is not much hope of a resolution from Google any time soon.

Anyway, please feel free to try out v1.0.1 of the application, but don't expect .tqz files received as email attachments under the Gmail app to be automatically handled by Trailer.  My recommendation is to use the separate Android Email application instead.

Trailer application for Android updated

I've just released an updated version of the Trailer application for Android&trade;.

The purpose of this new application is to introduce a change to a part of the Android application configuration called the 'intent filter'.  Android applications have a configuration file called 'AndroidManifest.xml' which, among other things, controls the conditions under which applications are launched when attachments they can handle are received over the web, email etc.

When working on the original application version, I had a lot of trouble setting up an intent filter which worked as I wanted, e.g. when an email contains an attachment which has a filename ending in '.tqz', the Android operating system should provide the Trailer application as one of those which are offered
to handle the file.  In the end, I found a combination which worked, but after release of v1.0 I discovered that the filter was a bit too permissive, and the Trailer application was being offered to handle a wider range of things than was intended (including all emails).

Anyway, the new release is intended to fix this, please contact me if you are having problems with it.

I suspect that the problem I was having may not just affect me, so I plan to write up a technical description of the fix I have come up with in case it is useful to other people.

Sunday 17 March 2013

Differences between the Android and iOS versions of Trailer

The Android version of the Trailer mobile application is designed to display user-created annotated maps defined in the same .tqz format as is used in the iOS version. An example of this format has previously been provided in this post.

The Android application allows the user to do the same things on the map as the iOS application, but provides a user interface which fits in with the Android way of doing things.  One difference is that if a map includes a message (not a URL) associated with a zone, on iOS this will be displayed in a new page, whereas in the Android version the message is displayed in the info window which pops up when the zone is clicked.

The Android application has been developed and tested on a Nexus 7 tablet, and the parts of the iOS behaviour associated with providing background notifications when zones in the current trail are entered have not yet been implemented.  I welcome comments from users in relation to whether this feature is considered useful: from my point of view, I find background notifications linke this make a lot of sense from a phone, but less sense from a tablet.  Of course the application is available for use on Android phones as well as tablets, so I do provide to add this behaviour eventually, but it will probably not become a priority unless I get a sense of a significant number of users of the application who feel that the feature is worth having.

One other difference, which also relates to the automated detection of movements across zone boundaries, is that the Android application does not automatically zoom to fill the screen with a zone when a movement into that zone is detected.  Instead, zooming in on zones is achieved by clicking on the zone (which also brings up the info window with the zone details).  Clicking a second time on a zone which has already been zoomed in will result in the map zooming out to cover the entire trail. Again, comments from users are very welcome, but my present opinion is that the automatic zooming behaviour presently implemented in the iOS application is potentially annoying, and I am considering removing this behaviour in the next iOS application release in favour of allowing the user to request zooming in or out by a click, as the Android application does now.


Saturday 16 March 2013

Trailer application for Android released

I've just released an initial version of the Trailer application for Android™ mobile devices.
The Google Play™ link is https://play.google.com/store/apps/details?id=com.blogspot.tltrailer.androidapp.

The Android app accepts the same .tqz file format as the iOS application, and is similar in spirit but has some differences in behaviour.

I'll write more about how the two apps compare in the next few days or weeks.

Android and Google Play are trademarks of Google Inc.


Sunday 24 February 2013

Version 1.2.1 of the Trailer app for iOS available

A new version of the Trailer iOS application is now available in the iOS App Store.  The link for the application (using Apple's new URL scheme for iOS applications) is http://appstore.com/tltrailer.

This version is a bugfix release to v1.2 (which was not announced here because of the bugs
which were discovered shortly after release and are fixed in v1.2.1).

The main changes in v1.2 were largely as a result of user feedback:
  • The application user interface has been rearranged so that the user starts in the list of trails instead of starting in the welcome/help web page.  The web page is still available from the 'About' button at the top right of the trail list page, and was rewritten.
  • Changes have been made to the way background location tracking works to address reported problems with the application draining the battery.   The application is now very aggressive about only using background location tracking periodically for long enough to get a good fix, then turning location tracking off for a variable period which is calculated using the nearest notifiable zone border and a presumed walking speed.
The application also has a settings page which allows following configuration parameters to be set:
  • Parameter 'background location tracking time limit' allows the user to control the maximum length of time for background location tracking to be kept on if no new zone border is reached.  By default this is set to  30 minutes.
  • Parameter 'Diagnostic logging enabled' controls whether the application sends diagnostic events via the Flurry analytics library which relate to the operation of background location tracking and include exact location fix details.  This option is set to 'Disabled' by default, in this state the application still sends some analytics events, but none which include GPS-level location data. 
I am very happy to receive user feedback.  The offer I made some month ago to send an App Store redemption code to allow a free copy of the app anyone who sends me an email request still stands.


Thursday 14 February 2013

Google code scripts for creating .tqz files now also generate .gpx files

A short while ago I checked in a change to the google code project which provides example Python code for building files in the .tqz file format required by the Trailer iOS program.

This change enhances the example code so that as well as generating the .tqz (as used by the Trailer iOS application), it generates a .gpx file, which which can be used during Xcode debugging sessions to provide a feed of synthetic location events which simulate moving between the zones covered in the generated .tqz file at a speed which can be adjusted in the source code.

In theory, these scripts could be used or adapted for generation of .gpx files for use in development/debugging/testing of other iOS apps.

I'd welcome comments on whether anyone would be interested in having a similar feature added to the tl-trailer web application.

Sunday 27 January 2013

The .tqz file format example

The .tqz file format used by the trailer program is a form of XML.  Recommended encoding is UTF-8.
The following text is a shortened version of the file which is used to define the trail for Barcelona which is one of the four built in to the application:

<?xml version="1.0" encoding="utf-8"?>
<tw1>
    <tw1_plaintext description="Places of interest (mostly related to Gaudi and other architects and artists)." locality="Barcelona, Spain" mode="1" version="1">
        <zone address="PARC MONTJUÏC" name="MNAC">
            <coordinates latitude="41.3676819" longitude="2.1540772" radius_metres="250"/>
        </zone>
        <zone address="08038" name="Fundacio Joan Miro" url="http://fundaciomiro-bcn.org/">
            <coordinates latitude="41.3681130" longitude="2.1600900" radius_metres="250"/>
        </zone>
        <zone address="08038" name="Pavello Mies Van der Rohe">
            <coordinates latitude="41.3705850" longitude="2.1499300" radius_metres="250"/>
        </zone>
        <zone address="Provenca 261-265" name="Casa Mila" url="http://www.lapedrera.com">
            <coordinates latitude="41.3952913" longitude="2.1620618" radius_metres="250"/>
        </zone>
        <zone address="Pg Gracia" name="Casa Batllo">
            <coordinates latitude="41.3930617" longitude="2.1637884" radius_metres="250"/>
        </zone>
        <zone address="Portal de la Pau" message="Monument to Christopher Columbus" name="Mirador de Colon">
            <coordinates latitude="41.3761141" longitude="2.1777053" radius_metres="250"/>
        </zone>
        <zone address="C/ Montcada" name="Museu Picasso">
            <coordinates latitude="41.3851630" longitude="2.1807439" radius_metres="250"/>
        </zone>
        <zone address="C/ Joan d'Àustria" name="Parc de Ciutadella">
            <coordinates latitude="41.3957639" longitude="2.1879312" radius_metres="250"/>
        </zone>
        <zone address="Carrer Nou de la Rambla" name="Palau Guell">
            <coordinates latitude="41.3791929" longitude="2.1744567" radius_metres="250"/>
        </zone>
        <zone address="C/ Mallorca" name="La Sagrada Familia">
            <coordinates latitude="41.4033729" longitude="2.1739170" radius_metres="250"/>
        </zone>
        <zone address="Carrer d'Olot" name="Park Guell" url="http://www.barcelona-tourist-guide.com/en/gaudi/park-guell.html">
            <coordinates latitude="41.4134000" longitude="2.1530000" radius_metres="250"/>
        </zone>
        <zone address="Av Marquès de l Argentera" name="Barcelona Franca Station">
            <coordinates latitude="41.3844859" longitude="2.1850869" radius_metres="250"/>
        </zone>
        <zone address="08014" name="Barcelona Sants Bus Station">
            <coordinates latitude="41.3795172" longitude="2.1386865" radius_metres="250"/>
        </zone>
    </tw1_plaintext>
</tw1>