Google Summer of Code 2016

Berkman Klein Geek Hour

Thursday 18. August 2016 20:58:19 UTC+02:00 - David Haselberger

Here is our presentation for Geek Hour at Berkman Klein Center, Harvard University, today at 2PM EST: http://soleil-alpin.com/geekhourlibboxpresentation/

It features a short demo video of the application.

LibraryBox iOS Application in Swift

Wednesday 17. August 2016 15:55:20 UTC+02:00 - David Haselberger

In the course of Google Summer of Code 2016, an iOS application was written in Swift to support the LibraryBox project. The main goal was to offer an easy-to-use way to locate and connect to LibraryBoxes in the area for iOS devices. With the app, users can range for box- iBeacons . On entering an iBeacon area of a LibraryBox, a push notification informs the user. The notification can also be displayed on a watch running the WatchKit OS. Further, boxes can be found on a map interface. The app allows to geo-tag box locations on proximity and using address look-up. Close to a box, users can open WiFi-settings from within the application to select the LibraryBox network. Returning to the app, a connection to the box contents is established.

My commits to the project can be found on GitHub:

https://github.com/LibraryBox-Dev/librarybox_ios/commits/master?author=davidhaselb

Class documentation can be found here:

https://soleil-alpin.com/libraryboxiosdocs/index.html

The code is released under MIT license .

A key area that still needs further development is collaborative geo-tagging. Google Fusion Tables was successfully tested to store location data online. Though the integration with MyMaps using KML link files is not supported. The need to login to Google to authenticate for using the RESTful API of Fusion Tables is comprehensible, yet potentially decreases user experience. Thus, in a next step, a CloudKit backend is realized. CloudKit was chosen because it integrates with the iOS user experience.

LibraryBox is an exciting project. I enjoyed designing and implementing the iOS app. I learned a lot about the Swift programming language and mobile development.

Many thanks to my mentor, Jason Griffey , who supported me the last months with suggestions and feedback.

Collaborative geo-tagging

Wednesday 17. August 2016 13:56:49 UTC+02:00 - David Haselberger

A central finding in this Google Summer of Code Project is that no collaborative geo-tagging service could be retrieved for the following requirements:

  • Storing Location-data along with a title, maybe a description
  • Providing a RESTful API for mobile app access (GET and POST) without the necessity for user authentication
  • Displaying locations on a map
  • Online map interface to pin locations
  • Possibility to manage location data without low-level database knowledge
  • Free

The LibraryBox project so far uses MyMaps, based on Googles GoogleMaps Engine Lite, to pin locations on an online map. Google provides several tools for users logged in to their Google accounts to shape a shared map online. MyMaps lacks a RESTful API. MyMaps can export KML that can be parsed in LibraryBox iOS to present LibraryBox locations on a map interface. For the iOS application, Google Fusion Tables was considered. Fusion tables is, oversimplified, a spreadsheet-like database offering a RESTful interface. Geo-data can be exported as KML link file , which is great because link files update as soon as the data storage updates. The idea for LibraryBox was to add a KML link file from Fusion Tables to a layer in MyMaps. KML files can be added to MyMaps, but they are parsed only once. No data updates. Moreover, users need to authenticate with OAuth2 to the Google servers, when they want to pin a location in the app. Hopping to a login screen when trying to add a pin to a map is no good user experience. An online spreadsheet would be a good place to manage LibraryBox locations pinned from a mobile app without the need for a database-backend. Yet, the popular Google Spreadsheet (which would enable KML export as well) also needs users to login to perform POST operations from a mobile app. Sheetsu.com could enable an API, but has a small margin for calls in the free plan. MyMaps integration would need to be done manually. Openstreetmap doesn´t provide a collaborative geo-tagging service as of yet. Mapbox is not free.

Towards solutions

In iOS applications, CloudKit could be used as easy-to-integrate data-store backend. CloudKit takes care of security and scales well. Not necessarily free, but the data plans are reasonable as of yet. Otherwise, a CouchDB database could be set up to store location data. A script could be written to translate database entries to KML with pyKML or SimpleKML to integrate data from the backend into a MyMaps layer. To keep http-calls from the mobile app to the web to a minimum, another server script could pull KML from MyMaps to integrate location points from MyMaps into the backend after checking for duplicates. The app could then update box locations from the backend only. Considering the use of LibraryBox on iOS devices in locations with little internet connectivity, caching map tiles or providing an offline map could be supportive. Still, storing tiles increases internal storage use.

On Swift

Wednesday 17. August 2016 13:54:14 UTC+02:00 - David Haselberger

The last months I tried to dig into Swift and iOS programming. While I enjoy Objective-C particularly because program syntax is sort-of written in sentences, Swift appears logical and concise. It feels like having to write less to get somewhere, which makes it quite beautiful. LLVM , XCode and the iOS frameworks add up to this impression. A neat overview of the language can be found at Wikipedia ). Apple published a book introducing Swift . The company open-sourced the language in 2015. On linux, it is possible to start programming right away now. IBM offers open-source server-solutions based on Swift . Interested people can get to know Swift in the IBM Swift Sandbox . Rumours exist that Google considers Swift as alternative to Java for Android app development. Particularly interesting from the perspective of teachers and students alike is probably Swift playgrounds , an app to learn programming with Swift. With playgrounds Swift could make a motivating first programming language .

Further interesting links

Wednesday 17. August 2016 13:53:59 UTC+02:00 - David Haselberger

Including Open Source Licenses

User Interface Design

WatchKit

Box Content Handling

Swift Documentation

Paper Prototypes

Wednesday 22. June 2016 18:17:19 UTC+02:00 - David Haselberger

Here I want to share several paper prototypes of the first LibraryBox iOS app version.

One of the first sketches of the LibraryBox iOS map interface:

1mainInterfaceAlpha

A hypothetical, basic content interface:

2HypotheticalContentInterface

A sketch of the main app interface:

3mainInterface

Some sketches of the beacon ranging view:

4rangingView1

5rangingView2

Research

Wednesday 22. June 2016 17:45:43 UTC+02:00 - David Haselberger

Following, a link collection for the LibraryBox iOS project that I started prior to programming. It is continually complemented.

iOS Networking

Wifi

Bluetooth

iBeacon

iBeacon and Swift

Raspberry Pi iBeacon

Geospacial information

Distance sensing

Geocoding

KML

iOS Programming

Swift

Views and View Controllers

Layout

Animations

Copyright © 2016