Maps app for Android: general strategy

Before developing the app, I researched what solutions can be applied to create a lightweight maps app for Android.

The main use of the app is while hiking and therefore below <requirements -> the app must meet:

  • Use as little hardware resources as possible.
  • Should be able to save map data for later offline use for the selected local area.
  • Should be able to load custom data generated with 3dparity such as kml files and custom markers.

Main application flow :

Some site communities contribute custom markers and files like kml (or other data type) for the desired area.

The app combines a map provider's map (e.g. Google Maps, OpenStreetMaps) + Community data for a desired region and provides users with an offline experience. Where users can prepare a map with internet connection before hiking and use it offline while hiking.

Strategy and main problems to solve:

  • Choose the lightweight sdk card.
  • Solve the problem with offline maps.

Choice of lightweight sdk cards and related issues:

When hiking, people often use older versions of smartphones that drain less battery power because they come with an older version of Android, so apps for older versions of android use less processing power.

A common solution is Google Maps SDK 2.0, which itself is provided by the Google Play SDK, but over time the Google Play SDK becomes more and more heavy, and it requires the user to have installed an almost newer version of Google Play Services as I believe.

The advantages of the Google Maps SDK 2.0 are that it provides an excellent code base for future extensions, as well as a great MapView component ready with all the UI customization.

Versus Google Maps SDK 2.0 requires the user to install Google Play Services, which drains the cost of the phone by itself. In addition, new components of the MapView interface may require more processing power.

Solving the problem with offline maps :

As I researched, it is possible to provide custom tiles stored anywhere on the device in the Google Maps SDK using the TileProvider interface , which provides excellent control over the tiles. Its main abstract method is:

public Tile (int width, int height, byte[] data).

      

Other SDKs:

MapBox android sdk is getting close to Google Maps SDK 2.0. It's a promise, but it's still beta and open source. Compared to other lesser known maps, Android Maps MapBox has tender documentation, great tools, almost lightweight and has a community, but still contains bugs.

Also I tried an app in my opinion, developed with Google Maps SDK 2.0 https://play.google.com/store/apps/details?id=com.vecturagames.android.app.gpxviewer

In my best guesses, this app uses the Google Maps SDK MapView to display maps from a variety of sources like OpenStreetMap, MapBox, and almost every map provider available on the web, including Google.

Questions:

  • What are your best practices for developing lightweight Android apps with maps and offline tile support?
  • Is it possible to avoid dependence on Google Play Services when using the Google Maps SDK?
  • Are there any other open source SDKs that are performance compatible? For example, using the OpenStreetMaps database.
+3


source to share





All Articles