My experience with Mobile App Development - GPS Treasure Hunt Game

Shawn Rebello

The Idea

I had just started learning the Ionic Framework for cross platform mobile app development by building demo apps to learn how certain native features work and/or reading Josh Morony's tutorials  when I found this xkcd  on a  reddit post  and it gave me an idea.
What better way to learn a framework than to dive in and build a project?
Besides, on days when I do not have college,  I could continue coding till 3 am.

Development Begins

So I create a new Ionic 2 project and decide to go with a tabs layout and start with the GPS features which I believe (incorrectly) would be the hardest part of the app.

Few hours into the project and the geolocation features where the easiest to add.
 Lucky for me my development machine (Macbook Air) has a GPS receiver and so I'm able to test the location features directly through the browser.

I also manage to add typescript functions to calculate distance between two gps coordinates with Haversine's formula and test the first iteration of the app on a local device.
On noticing the wildly inaccurate distances I realized that GPS is horribly inaccurate within a building , enough to locate the house but with rapidly changing values, off by at least 20-30 meters.

Now that the GPS functionality was added I tried to think of a way to transfer the GPS location from one app user to another, without them having to manually copy paste any data. 
I could make a backend server with Rails and connect it to the app, but that would incur hosting costs.

So a few days later I get the idea to use either deep links or barcodes to allow transferring the data between users, and also encrypt the data so that the average user does not decode the barcode and find the location.

2:39 am and I get the geolocation working!
Development was paused  for the next week and when I resumed I realized that  the Ionic Native barcode scanner as well as cordova barcode scanner allow scanning from camera only not the gallery, guess I hadn't thought this through.

After trying on many solutions, involving plugins not included into Ionic Native I finally got it working using the the port of zxing with the html canvas element and getting the images with cordova imagepicker.

Now that I could finally scan barcodes from gallery within the Ionic 2 app, I had to just implement the media sharing feature and I could then relax and focus on the UI, but that took a bit longer than expected.

The Canvas.decode function nested inside the ImagePicker kept on failing and multiple solutions to get it working failed, until I finally found out the issue:
the scope of this was changed and that's why Canvas couldn't be used.
So I assign this to another variable and manage to get it working again

      ImagePicker.getPictures(options).then((results) => {
        for (var i = 0; i < results.length; i++) {
          var tempObj= this;

Now that all the main functionality was done I could focus on the UI so I write a function in the provider to dynamically generate a color code based on the percentage of distance covered and use it in the view.
A cup of coffee and some scss later I've got the app ready for deployment

Android 6.x.x issues with Ionic 2

So all this while I was using the browser to test the non-native stuff and the spare device to test the native features, the app worked perfectly on that phone (android 4) and I assumed it would work on later versions as well.

But I had some issues with the runtime permissions on Android 6.x.x.
Installing Ionic native diagnostic plugin raised some 'Unmet Peer Dependency Warning' , so I decided to give the cordova diagnostic plugin a try instead which worked like a charm.


Designed an icon, splashscreen and created app intro slides with photoshop.
Tested the app on an emulator running Android 6 and then pushed it to the play store.

You can check it here at: and leave me a feedback in the comments.

A few screens:

Thanks for reading this and have a great day!

Shawn Rebello / Author & Editor

Shawn Rebello is an engineering student who likes learning new languages, tools, libraries or frameworks. When he is not coding, he binge watches TV shows and spends time on Wikipedia and Reddit.


  1. Such supplements are made with a Biogenic Xr variety of herbal substances that encomp herbal extracts, minerals and amino acids.

  2. Cla Safflower Oil This saves the belly from being burnt with the aid of its very own acid fluid. Additionally a nicely hydrated frame reduces the urge to drink dangerous liquids which introduce greater pollution for your body.

  3. Testro T3 In reality, there are just two things that are at present known to build estimate by inches. These eventual surgery and hand schedules; Very other pill, elixir, and direct out there is trash.

  4. Testx Core As a matter of first importance, the couple of minutes daily won't comprise of popping pointless pills.

  5. I read your post its great thanks. Waiting for more new update.

  6. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from TypeScript Training in Chennai . or learn thru Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. Javascript Online Training from India

  7. CLA Safflower Oil shedding off extra fat from the body at 00 kilos was not at all an easy deal. It become very miserable to see human beings laughing at my lower back.

  8. Dermagen IQ It may be the case that on the off chance that you utilize chemicals at work, certain family cleaning operators, air fresheners and scented washing cleansers, these may be in charge of your skin break out episodes Dermagen IQ for UK.

  9. Dermagen IQ Why is it so unique? In view of its astounding properties and magnificent advantages: It has astonishing cancer prevention agent properties which shields the skin from free radical harm.

  10. Rapiture Muscle Builder Use home made marinades, and ditch the condiments altogether. Grill your meats, or boil them in stews (while disposing of the fatty oil inside the water Rapiture Muscle for Spain.

  11. Perlelux for disappointment. They simply don't have the propelled hostile to maturing healthy skin fixings expected to really have some impact on your skin.

  12. D BAL Max the frame into glucose, that is then released into the bloodstream and transported to the diverse muscle businesses.

  13. Slimfire Forskolin We can choose yet there's no finish. Give me a chance to Forskolin make this reasonable 'choosing' without activity.

  14. Xtrfact The particular distinction being that in making your own particular wellbeing and health items.

  15. This comment has been removed by the author.

  16. Pure CBD Oil They contain the greater part of the fundamental amino acids and unsaturated fats important to keep up sound human life.

  17. Dermagen IQ out about fixings that are contained in your Botanical healthy skin items Since your Dermagen IQ for UK skin is presented to numerous destructive .

  18. Perlelux That they have rosacea They surmise that they simply flush or become flushed effortlessly or are simply excessively touchy.

  19. Nitridex lastly hereditary qualities Since this is the principle component bosom advancement will be in full just when we dispose of the destructive impacts.

  20. Zylix Plus through the lymphatic framework to another zone of the body. What's more, a moment task may be required.

  21. I am unquestionably making the most of your site. You certainly have some extraordinary understanding and incredible stories.

    WorldWide Life Styles
    Download AcMarket

  22. If your main aim is to increase your profile and presence in the mobile space, it's a good idea to start off by taking advantage of existing technologies.ShowBox APK 2018

  23. When you open the site of any versatile application advancement organization, begin by checking their portfolios. Custom Software Development Company


  24. Hats off to your presence of mind..I really enjoyed reading your blog. I really appreciate your information which you shared with us.
    ionic training in chennai

  25. Have you ever thought about including a little bit more than just your articles? I mean, what you say is valuable and everything. However think of if you added some great visuals or videos to give your posts more, “pop”! Your content is excellent but with images and clips, this site could definitely be one of the best in its field. Amazing blog! facebook

  26. Brilliant showed data. I thank you about that. Most likely it will be exceptionally valuable for my future ventures.
    Digital Marketing And Security Services

  27. This application is entirely simple to utilize, yet at the same time a Help segment may be convenient. Vehicles in Sandbox: Construction is one of the best apps in its classification. speech app reviews

  28. You may or may not already know about mobile phone recycling operators. Mobile phone recycling companies buy old phones from the public. refurbished iphone ireland

  29. Be that as it may, inside portable programs don't enable you to get to these capacities from it. create app with ease

  30. The Car Global Positioning System showcase has certain unmistakable viewpoints. The report tosses light on every one of these perspectives and concentrates the different sections of the market in detail.meilleur gps

  31. TutuApp for Android.TutuApp brings a most convenient way to download apps from here tutuapp

  32. keto slim rapid diet keto slim powder reviewsExperts explain that some weight-related problems such as obesity are a consequence of insulin imbalances. keto slim plus keto slim price

  33. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work Copier Care Tips

  34. Buying Anabolic Steroids Online 100% Legal! SDI Labs prison steroids alternative to HGH, Testosterone, Deca Durabolin, Winstrol, Anabolics, Dianabol for bodybuilding.
    'Young and Restless' star Kristoff St. John had previously threatened suicide and recently recounted that a determine never receives over the loss ...
    Let's begin the 12 months out right with this Low-Carb Deconstructed Pizza Casserole!

  35. Thanks for sharing this valuable content. In my view, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. Lexis Poker

  36. TutuApp APK iOS Free Download Latest Version 2019 Best Version Free! here And Also more...
    Download TutuApp
    Snaptube PC
    Tubemate APK


Leave a comment here!