Archives de l’auteur : frogsparks

Nicer track rendering

One of MyTrails’ design principles has always been performance. I’m very proud of the fact that no other Android mapping application is as fast and smooth as MyTrails. This is partly because it uses OpenGL to render the map and tracks.

A big part of that is that MyTrails has to be able to display tens of tracks with thousands of track points without slowing down, and because of this, I have been hesitant to change the track rendering algorithm.

Things came to a head recently when I implemented the new Time and Distance colorizations. Suddenly (and especially in an emulator running on my low-pixel density computer display), the track looked very crude to me. And it’s always been: zoom out enough and it degenerates into a mess of horizontal and vertical hatches. Even up close, sharp edges in the track look broken. This is because OpenGL’s support for lines is very, very crude.

Also, it’s limited in terms of the thickness of lines it can draw (based on the GPU in each model of phone), and high-density screen in devices that use low-end GPUs (such as the Nexus 4) caused the tracks to be thinner than they should, and lack a border.

No more! In MyTrails 1.4.0, I’ve rewritten the track rendering algorithm, and lines are smoothly blended, can be rendered at any width, and are unbroken at any zoom level. And they’re still very fast (56 frames per second on a Galaxy S3, compared to 57fps for the previous algorithm).

New track rendering

New track rendering

During the beta period for 1.4.0, I will try to keep the hidden option ‘toggle track mode’ operational so you can compare the modes for yourself (there’s an intermediate mode that uses un-smoothed lines). If some phones are too slow for the new rendering mode, I can make it an official option for the release.

You can test the new rendering in MyTrails 2.0.0a6 and shortly in 1.4.0b1.

A few more screenshots to compare the old and new modes.

1.3.24-1.3.26

  • Nouvelle carte: VTTrack-ST (couche transparente sentiers de VTT)
  • Nouvelle colorisations: distance et temps
  • Les cartes à base de calques peuvent être mises hors-ligne
  • Icône GPS désactivée lorsqu’aucune donnée n’est envoyée par le GPS
  • Le verrouillage de l’écran n’est pas activé lors de l’utilisation d’un dialogue (uniquement Android 4.2 et plus)
  • La progression de l’envoi d’une trace sur un serveur est plus régulière
  • Retrait du contournement du bug IGN pour Android 2.1
  • GPSies: téléchargement de vos propres traces privées

1.3.25 et 1.3.26 sont des corrections de bug, désolé!

New colorizations: distance and time

In MyTrails 1.3.24 (currently in beta), I am very excited to add two new colorizations (or 4, depending how you look at them)!

How this came about was: one user wanted an easier way to figure out which way a track that circled back on itself came into and left the intersection. Playing with different possibilities, I realized that being able to visualize time and distance on the track (other than by looking at the speed visualization and performing differential math in our heads), would be useful.

I think my favorite is the distance colorization: it uses alternating black and white bands every 100m (100yd if you’re using imperial units), so you can very easily count the distance between two points on the track. It’s also easier than looking at the scale imagine twisting it along the track.

Distance dashed

Distance dashed

This only works if the track contains a high-enough density of points that MyTrails can alternate colors (which can happen only on a track point, not between points). Generated tracks (from a driving direction service, or by manually adding track points), or highly-simplified tracks (such as you may get from an online track sharing service) may not contain enough track points. Similarly, zooming out causes MyTrails to simplify the track and lose the ability to correctly represent the track.

Similarly, if you want to count how long it took to go from one point to another, the time colorization is very helpful. Each band corresponds to one-minute intervals.

Time dashed

Time dashed

The « rainbow » versions of these colorizations look silly, but they’re useful to try and follow the track through an intersection. Just keep in mind the sequence of colors, and follow along.

Distance rainbow

Distance rainbow

Unfortunately, when you look at these in MyTrails 1.3.24, they will not look as nice and smooth as these screenshots. This is because these were taken with an alpha version of 1.4.0, which I will tease more in another post soon!

Why don’t I see my offline maps when I connect my phone to my computer via USB?

This should only happen on CyanogenMod-based ROMs.

In order to avoid having the Android Media Manager index all the files MyTrails uses for offline maps (thus wasting space and battery on every startup), MyTrails adds a .noscanandnomtp file to offline maps.

This in turn prevents MTP (which your desktop uses to connect to the phone) from seeing these files.

If you wish to transfer an offline map from your phone to your desktop (perhaps to share the offline map with a friend), you can:

  • create a ZIP archive of the offline map (on your phone)
  • or temporarily remove or rename the .noscanandnomtp file (using an Android file manager) which is inside the main directory for your offline map, then cause Android to re-index the directory, perhaps by rebooting the phone and waiting a few minutes

you will then be able to see the map (or its archive) through MTP.

MyTrails 2 Preview

MyTrails 2 is finally ready for preview!

What’s new?

The headline features in this upcoming version are stats and graphs, which I have previously teased. The track manager has also been completely rewritten and the main parts of the UI have been transitioned to a Holo UI.

Stats

MyTrails now has what is probably the most complete stats functionality of any smartphone-based navigation app. Not only can you choose among a very large selection of variables, but you can also display stats for multiple tracks, with the UI scaling to display as much information as possible within the available space.

To select other stats or reorder them, tap the Edit (pencil) button. You can select a different font by tapping the eye button. Please let me know your preferences.

Long-tap a stat to add it to the HUD (maximum 3); highlighted stats are displayed in the HUD.

Stats

Graphs

Graphs can be displayed for multiple tracks simultaneously, and they are updated in real-time. You can choose from a wide variety of variables to plot.

You can use pinch-zooming to zoom in on the graph, and then pan.

Graphs

New Track manager

The track manager makes it easier to find tracks by searching and sorting. Tap and hold on a track to select multiple tracks, so you can (for example) upload multiple tracks at once.

Tap on a track for details about that track; swipe among 4 views: track details, map view, stats and graph.

On tablets, the detail of the track(s) is displayed next to the list of tracks.

On the main map view, tap on a track (except the current recording) to see details about that track.

New track manager

Limitations of the alpha

The following are known bugs or limitations, please don’t report them:

  • some stats do not update in the HUD when the GPS is not recording (fixed in a10)
  • # satellites stat doesn’t update correctly (fixed in a10)
  • reordering stats (by tap-and-hold) is odd, and makes it hard to get the desired order (fixed in a9, there is a completely different mechanism for reordering and selecting stats)
  • the new features are enabled for all users (Pro and non-Pro), except for the fact that in non-Pro mode only one track can be displayed; this will probably change before the final release
  • pinch-zooming on a graph doesn’t work with a vertical gesture, use a horizontal pinch (fixed in a9)
  • text on the graph is displayed very small on high-density screens (fixed in a3)
  • in the Track Manager, attempting to save multiple tracks at once only saves the first one (fixed in a9)
  • in the behavior preferences, choosing a folder (for offline maps) doesn’t do anything, and the corresponding button in the offline downloader is also non-functional (fixed in a9)
  • most translations (including French) are very incomplete when it comes to the new features
  • some sort orders can not be reversed
  • the keyboard pops up inopportunely in the track manager (fixed in a3)
  • there is no option to load all tracks in a folder yet (fixed in a9)

What you should report

In order of decreasing importance:

  1. Any crashing bug, or any loss of data
  2. incorrect statistics (there are so many, I haven’t been able to thouroughly test them all yet)
  3. missing features and graphical glitches

How to install

First option: side-by-side with MyTrails 1

This is the safest option, as you can continue to use MyTrails 1 for your day-to-day activities if you find MyTrails 2 to miss some essential feature, or if you’re afraid it’s not production-quality (this option only recently became available, based on Android’s new build system).

Just download the preview version here.

Drawbacks:

  • your two versions of MyTrails are separate: different preferences and loaded tracks, etc. You can load in both the tracks you save in either, but that is a manual process
  • once you have a second instance of MyTrails installed, you can no longer sign in to Dropbox (unless you use a tool to freeze one of the instances so you can log in to the other; you only need to do this once); recent versions of Dropbox crash if you try to authorize MyTrails when the 1.x and 2.x versions are installed side-by-side.
  • I have not enabled in-app purchases on the preview, so you can’t purchase maps or the Pro version from it (it will let you try, but you will get an error message); just connect to your Google or FrogSparks account from both apps and make any purchases from MyTrails 1

Second option: use the Play Store alpha track

This is a true alpha version: do not rely on it for important track recordings! I would strongly discourage installing this alpha without first making and securing a backup of MyTrails with Titanium Backup or a similar tool: it’s entirely possible that the alpha will mess up the list of tracks (not the GPX files themselves) and the rest of your MyTrails settings.

  • Even you are already a member of the MyTrails Google+ community, you need to join the MyTrails 2.0 alpha community.
  • Then click on this link and click Become a tester. I believe you will need to do this even if you are already part of the beta testing (for MyTrails 1.4.x).

Once this is done, the Play Store will offer to update MyTrails the next time it checks for updates. It unfortunately doesn’t specify which version it’s downloading, but when you launch MyTrails the version log will tell you what’s changed.

Please note that MyTrails 2 will only be available for Android 2.2 (Froyo) and later. MyTrails 1.4.x will continue to be updated with bug fixes and new maps, but little else.

If you encounter a crash, please provide your email address in the crash comment and make sure you send the crash report.

How to leave the alpha test

Click on this link and click Leave the test, or leave the MyTrails 2.0 alpha community (use the second option if you want to stay on the beta track). This in itself will not roll back MyTrails to the latest released version, you will need to do that yourself.

Look at the instructions in the FAQ for leaving the beta for details on how to backup, uninstall and reinstall MyTrails.

Switching translation in MyTrails

I realized I hadn’t written an post about this, so if you didn’t read the release notes, you might have missed this feature, introduced in MyTrails 1.3.17: the ability to switch MyTrails to a different language.

You’ll find this at the bottom of the Appearance preferences, and you can use it to force MyTrails to English if the default translation for your language is lacking, or to force a different language than the system language.

2013-08-28 08.48.06

The translator for the currently-used language is credited there as well.

New translation tool

Notice: the translation server is currently unavailable…

For many months I have been using a wobbly system for translation: a combination of the impressive android2po, which transforms Android string files (in xml format) to the ubiquitous .po format, and a translation server based on Drupal Localization server, which is barely maintained, and missing many features.

I had looked at several hosted services such as MyGengo String (promising, but flawed and now defunct), Crowdin (started out ugly and free, now less-ugly, full-featured but expensive), Get Localization (very nice and free, but never fixed the fatal flaws in their Android support) and took a quick look at other very expensive commercial solutions…

Finally, I settled on using Weblate. It’s pretty, it’s fast, it’s full-featured, its developer is friendly and responsive, it has good documentation, it’s very easy to integrate (if you’re using git for source control and you have your own server) and it fully supports Android. Because it directly uses git, I can keep an eye on all translation changes easily and fix anything that is amiss.

Instructions for translators

Whether you’ve already been contributing to MyTrails translations on the old server or whether you’re a new contributor, please connect to the new server and register (sorry, I haven’t been able to migrate accounts across). You will receive an activation email (if you don’t please contact me).

http://weblate.frogsparks.com

Once your account is activated, please let me know so I can accept you as part of the Translators group. If your language is not yet present in the interface, please specify it, so I can activate it.

If you don’t have a Save button on the translation page (just a Suggest button), you haven’t yet been accepted as a translator; you can start translating, but you’ll have to later approve each translation.

You can edit your profile to specify the language(s) you’re interested in translating (this adds shortcuts in the Weblate menus). You should also subscribe to Notifications on new strings to translate and Notification on new suggestion so you can stay on top of your translations.

Once you’re ready to start translating, navigate to your language and the relevant MyTrails subproject (at the moment, latest is the current active project) and click the Translate button to start translating untranslated strings.

1.3 @ Weblate 2013-08-27 17-50-21

In the translation interface, you will see the English version of the string (and of any other Secondary language you selected in your profile). Edit the translation and click Save (the next untranslated string will be loaded automatically).

You can use Google Translate in the Machine translation tab as a starting point by clicking the Copy button next to it.

1.3 - Italian @ Weblate 2013-08-27 17-56-02

In some cases, it may be useful to check the Nearby messages tab to get a bit of context. In some cases the Comments or Source tabs will have some guidance.

For more information, please see the full Weblate manual.

Suggesting translations

If you are not an official translator you can still easily suggest a translation, even without creating an account, if you find a typo or awkward translation. Simply navigate to the language you’re interested in, and in the Search tab, type the word as it is misspelled in the application, which will lead you to the offending entry.

1.3 - French @ Weblate 2013-08-28 09-06-08

There, you can simply fix the translation and click the Suggest button. The official translator will integrate your suggestion if they agree with it.

1.3 - Français @ Weblate 2013-08-28 09-08-27

 

Thank you all for your contributions!

Translation status

MyTrails calcule les distances et vitesses de façon incorrecte

MyTrails utilise les méthodes standard d’Android pour calculer les distances (et les vitesses). Malheureusement un petit nombre de téléphones utilisent une version d’Android dans laquelle un composant critique (le JIT compiler de Dalvik) souffre d’un bug qui fausse gravement ces calculs.

Ce problème peut aussi se manifester sous la forme de lignes obliques qui traversent l’écran.

Dans MyTrails 2.0 et suivants, vous pouvez utiliser l’option Calcul de distance alternatif dans les préférences visuelles de l’application.

Dans MyTrails 1.3.23 et suivants, vous pouvez contourner ce problème en utilisant l’option cachée toggle alternate distance.

1.3.23

  • Correction pour IGN Littoral et photos aériennes
  • Contournement d’un bug Android de comptage des distances pour certains téléphones