DPS923 notes – Tue Mar 24

Follow-up about the recently-completed programming assignment. Topic review. Information about Thursday’s test/evaluation. Introduction to location services.

.

Recently-completed programming assignment

Share your thoughts and experiences about the recently-completed programming assignment.

.

Topic review

This is your opportunity to ask questions before Thursday’s test.

.

Thursday’s test/evaluation

The test will have two parts:

  1. Written answers to questions
  2. Programming task

.

Written answers

While the format of the questions will be similar to those on the quizzes, there may be questions that require a longer and more comprehensive answer.

This part of the test may also include question formats that include multiple-choices, diagram-drawing, and walkthrough.

Resources of any kind are not permitted during this part of the evaluation.

.

Programming task

Your professors will provide you with one or two partially-completed apps.

Then, you will add one or more features.

.

A brief introduction to location services

The course’s GitHub code repository has an app named Where Am I, which introduces location services.

The app uses two services:

  • Location
  • Mapping

.

The MyLocation controller manages a scene (view) that has labels for latitude, longitude, and a map view to display the map. The controller conforms to a location manager delegate protocol.

When the controller loads, it will configure the location service objects. A class-level variable holds the ‘location manager’, and some of its settings need to be configured.

An important task is to ask the device user for authorization to use location services. This task will cause an alert to appear, and the user must give permission for the location services to work properly.

This task must be configured. In your project’s Supporting Files group, you will see a file named “Info.plist“. It has configuration settings for your app. Select it to open it in the editor.

Add a new key – right-click in an empty area of the editor, and “Add Row”. Here’s the settings information:

  • Key: NSLocationWhenInUseUsageDescription
  • Type: String
  • Value: empty, or the text of a message that you want to appear in the alert

.

location-info-plist-setting

.

When a location-related event is detected on the device, the Cocoa runtime will call the locationManager:didUpdateLocations: method.

Then, we can extract the location data from the passed-in data, and if we need to, use a map view to show the location on a map.

.

Running the app

The app must run on a device, for best results. An iPhone is best, but a WiFi-connected iPod touch or iPad will also work.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: