22 Mai 2017
car2go INSIGHTS

One app – different maps

It is a no big surprise that development of Android applications comes with many challenges. Supporting thousands of devices and different form factors is not an easy task by itself, yet that challenge is further complicated by having to support Blackberry and Chinese phones.

Challenge

What do Blackberry and Chinese devices have in common? Two things. Both can run Android applications. Both do not have Google Play Services.

Moreover, China has its own specifics when it comes to geolocation since there is a different coordinate system which is different from one Google uses.

All in all that is a big problem because it means that Google Maps can’t be used anymore which is obviously a core component of the car2go app.

Solution

To solve the problem Google Maps will need to be replaced with something else. Luckily there are different map providers – Open Street Maps for Blackberry and Baidu for Android in China.

However, their API is completely different from Google Maps which poses a new challenge – how can those maps be integrated into the app without the need to rewrite most of the existing codebase?

That’s when Android team at car2go came up with the idea – instead of adapting the car2go app to the new API the new API can be adapted to the one which car2go is already using. That turned out to be a right decision and so AnyMaps was created.

AnyMaps is a library which while using the same API as Google Maps allows usage of different map providers such as Google Maps, Baidu Maps, and Open Street Maps. New providers can be added at any point without any need to modify the existing application.

Proud to share

Even though working on AnyMaps was fun it is, even more, fun to enjoy the results without having to spend the time on the same problem again. That’s why the library is now available to everyone on GitHub.

 

Do you have any questions regarding working with AnyMaps?