You Just Got Served

you_just_got_served

So, despite appearing to be only considering making plans to implement a tile server, I’ve sorta gone ahead and done it over the weekend.

It’s a little rough and ready at the moment (I’m still tidying bits up before I make the first Git commit), but essentially I’ve got a fully working API endpoint that can produce a map of anywhere on Earth, at zoom levels 6-9, which looks like this:

http://{url}:{port}/api/getmap?zoom={zoom}&coord={x%2Cy}&key={API key}

The key check has been stubbed at the moment, but will eventually be used to keep a track of which application(s) is/are using the server (which will also go towards preventing abuse).

So far, without including the road names etc., images look like this:

getmap

Pretty pleased with that!

Next goals:

  • Improve map rendering
    • Include land/water as background
    • Rendering road names
    • Rendering city names
    • etc.
  • Implement a metrics API (similar to what exists on GeeOhServer)
  • Implement API key usage properly
    • Probably need to plan this out in detail
  • Plug in control of this to PHP admin system, if/where appropriate
    • Obviously limited to controlling DB settings (if any)
      • eg. The ability to toggle the service on/off would be good
  • Begin to implement the consumption of this service via MakingTracksGPS

That seems enough for now. Exciting stuff!

 

TRP

To Serve Or Not To Serve?

mdg : Waiter holding tray

Been playing around with the idea of implementing a tile server for these maps, since I’m starting to come up against some serious limitations with “on the fly” processing in Android (plus the data volumes of some of the larger scale grid squares).

Not that I’ve decided to commit to this yet, but I’ve drawn up a list of pros and cons, and I will soon be drawing up some plans for implementation – if I decide that is what I will end up doing.

Pros:

  • Minimised processing on device
  • Minimised storage on device
  • Should remove occurrence of empty bitmaps
  • Could actually ship app with pre-loaded maps

Cons:

  • Would require universal homeLocation
  • Added pressure to produce good quality map images
  • Additional maintenance, having to make sure server is always up etc.
  • For any clicking of the map, would need an API call to detect the location of that click, since the data is no longer local to query
  • Have to actually generate all those images
  • Have to design and implement the APIs

 

It’s certainly starting to look favourable to implement this server. Let’s see how the “hypothetical” planning stage goes…

 

TRP

Maps At Last

img_0236

So, the mobile maps have come spluttering back into life. This is the very first pic of the OSM map data being rendered in MakingTracksGPS, and there is a long way to go yet, but this was a huge milestone.

I still have to tidy up the code before I commit it at this stage, and then I will be immediately looking to optimise things, ie. Project and paint the GridSquare once to a Drawable object, and stretch that to the GridSquare’s corners each time it is rendered.

Anyway, I’m happy with it so far. Looking forward to get this up and running properly!

 

TRP

Maven, Android And The Increasing Desire To Kill Myself

suicidal-robot

I’ve been struggling with reconciling my existing (previously working) Android project, MakingTracksGPS, with the new Maven-build friendly library structure, and it is a painful, painful process. One that doesn’t appear likely to be completed any time soon, either. I’ve hit a brick wall.

I made some really good progress in finally getting the Maven build to – apparently – work, but I don’t seem to be able to get it to run on the Samsung S3. I keep getting this error:

E/AndroidRuntime(24698): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{makingtracksgps.main/makingtracksgps.main.MakingTracksGPS}: java.lang.ClassNotFoundException: Didn't find class "makingtracksgps.main.MakingTracksGPS" on path: /data/app/makingtracksgps.main-1.apk
...
E/AndroidRuntime(24698): Caused by: java.lang.ClassNotFoundException: Didn't find class "makingtracksgps.main.MakingTracksGPS" on path: /data/app/makingtracksgps.main-1.apk

I have tried everything I can find on the internet to solve this, but nothing it making a difference. Feeling a lot more helpless that I can recently remember, at least in terms of programming prospects.

I’m determined to solve this, though, without throwing everything out and starting with Android Studio or something. One day I will install/upgrade to that, but not yet.

Anyway, I’m giving myself a number of weeks to do this. I know it’s an essentially simple task, but it’s fucking difficult, so I want to take the pressure off myself.

I will let you know if/when I succeed.

 
TRP