Skip to content

  • About Me
  • Activations
  • Contact me
  • FAQ
  • Home
  • People to thank
  • Privacy Policy
  • Register
  • Support

Connecting to the ParksnPeaks server

April 28, 2020 by VK5AYL

When I first started working on ParksnPeaks, the web server was producing data in XML.  I had some code that I found on the internet, massaged it to suit and that gave me the data in a “sort of usable” form.  Okay, it wasn’t that usable!  I could display it as a line of text on a list but breaking it up into bits such as callsign, frequency, location etc wasn’t easy.

Allen (VK3ARH) decided to upgrade the output from the webserver to JSON format which is text based and when you know what you are doing it should be easy, right???  That was a challenge!  I hadn’t had the pleasure of working with JSON before.  I understood the data I was getting and sometimes I could even see it in my debugger but breaking into individual bits so it could be displayed within a list on screen was much harder. 

Many programmers would be looking for the substring command but I definitely didn’t want to go down that path.  So I did a lot of reading and ended up with a data model.  Then I used the Swift JSON Serializer to read the data and separate each field into the model.  From there I plugged each bit of data from the model into labels in a cell on my list.  

I decided to setup a database in MySQL, a web server using PHP so that I could mimic what Allen was producing, then I could play all day and night to my heart’s content.  I also wanted to write back to the server and didn’t want to bother Allen, especially if I was up at 2am and saving lots of Spots and creating havoc on the website. I used to hate PHP but now, oh well, it does the job!  I certainly wouldn’t want to change my career to PHP programmer.

Creating my own test server proved to be very successful.  I inserted some Spots from his website into my database tables and fed it to the iPhone app as JSON data.  In an iPhone list, you can program one cell to hold additional pieces of data.  I had Andrew’s (VK3ARR) Android documentation, so I started with the way he had laid out his data.  My first attempt was to do a test app to just read the data and display it in the list.  It finally worked, even though the site name overwrote the Mode, I had liftoff.  

You can see this is dummy data from my temporary web server.

First Spots Lists

Once I had my app running against my test server, I then hooked it up to Allen’s website and it worked first time.

Here is the first screenshot of my app using real data from ParksnPeaks.

Finally!!

Post navigation

Previous Post:

Swift 3 beta finally arrived – Sep 2016

Next Post:

Saving Spots – September 2016

User guides

What’s new in v3 New
Cheat Sheet v3 New

Comprehensive User Guide v2.4
Quick User Guide v2

Version 2 Blog

  • ParksnPeaks v2 with Logging is on the App Store
  • Push Notifications
  • In-app Notifications
  • Swiping Spots & Alerts
  • Mapping Sites
  • Finding Sites
  • Exporting Logs
  • The QSO Log
  • Version 2 Design
  • Apple Swift & Xcode for those who care!
  • ParksnPeaks v2

Recent Posts

  • ParksnPeaks v2 with Logging is on the App Store
  • Push Notifications
  • In-app Notifications
  • Swiping Spots & Alerts
  • Mapping Sites

Version 1 Blog

  • Archives
  • Latest Posts
  • Version 1
  • Version 2
© 2024 | WordPress Theme by Superbthemes