Using Open APIs In Mobile Apps Activity

From Foss2Serve
(Difference between revisions)
Jump to: navigation, search
(Part 2)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
{| border="1"
 
|-
 
|'''Title''' || Using Open APIs in Mobile Application Development
 
|-
 
|'''Overview''' || In this activity students will learn about Open APIs, how does it relate to open source and how to use in building a mobile application.
 
|-
 
|'''Prerequisite Knowledge''' || CS2 using Java and basics of Android development
 
|-
 
|'''Learning Objectives''' ||
 
* To understand what an Open API is.
 
* To understand how open APIs relate to open source.
 
* To be able to use open APIs in mobile application development
 
* To specifically use the wheelsmap API to build a simple Android accessibility application.
 
|}
 
  
=== Background: ===
+
{{Learning Activity Overview
This activity is meant to educate students about open APIs and how to use them in android app development. The activity is targeted for accessibility APIs to emphasize the humanitarian aspect of HFOSS.
+
|title=
 +
Using Open APIs in Mobile Application Development
 +
|overview=
 +
In this activity students will learn about Open APIs, how does it relate to open source and how to use in building a mobile application.
 +
|prerequisites=
 +
CS2 using Java and basics of Android development.
 +
|objectives=
 +
* Understand what an Open API is.
 +
* Understand how open APIs relate to open source.
 +
* Use open APIs in mobile application development
 +
* Specifically use the FEMA open data API to build a simple Android accessibility application.
 +
|process skills=
 +
}}
 +
 
 +
=== Background ===
 +
 
 +
This activity is meant to educate students about open APIs and how to use them in Android app development. The activity is targeted for crisis management APIs to emphasize the humanitarian aspect of HFOSS.
 +
 
 +
=== Directions ===
  
=== Directions: ===
 
 
==== Part 1 ====
 
==== Part 1 ====
# What is What is an Open API? What is REST? How and why is it open ?
+
# What is an Open API? What is REST? How and why is it open ?
 
http://searchcloudapplications.techtarget.com/definition/open-API  
 
http://searchcloudapplications.techtarget.com/definition/open-API  
  
Line 29: Line 32:
  
 
==== Part 2 ====
 
==== Part 2 ====
We limit our work to accessibility APIs. Examples of these are the wheelmap APIs (http://wheelmap.org/) and .
+
FEMA (The Federal Emergency Management Agency) has made some of its data public through a REST API http://www.fema.gov/data-feeds#APIs
The wheelmap API provides locations of wheel chairs in a given area (represented as longitude and latitude). The following is sample query that retrieves wheelchair for the location at (13.341,52.505) longitude and (13.434,52.523) latitude.
+
The released data sets are  listed in http://www.fema.gov/data-feeds#APIs and include the following:
 +
* Housing Assistance Owners
 +
* Housing Assistance Renters
 +
* Registration Intake and Individuals Household Program
 +
* Public Assistance Funded Projects: Summary
 +
* Public Assistance Funded Projects: Details
 +
* Hazard Mitigation Grant Program Property Acquisitions
 +
* Hazard Mitigation Grants
 +
* Disaster Declarations Summaries
  
http://wheelmap.org/api/categories/1/nodes?api_key=5cqRDhErg1vvnciMhTk5&bbox=13.341,52.505,13.434,52.523&per_page=10&wheelchair=yes
+
For example, the following http request retrieves data for Housing Assistance Owners.
 +
To test the API, run the http request on your browser. For example, the House Assistance Owners API (http://www.fema.gov/api/open/v1/HousingAssistanceOwners) when executed on the browser runs this partial record.  
 +
"
 +
{"metadata":{"skip":0,"top":1000,"count":0,"filter":"","format":"json","orderby":{},"select":null,"entityname":"HousingAssistanceOwners","url":"/api/open/v1/HousingAssistanceOwners"},"HousingAssistanceOwners":[{"disasterNumber":1983,"state":"MS","county":"Adams (County)","city":"NATCHEZ","zipCode":"39120","validRegistrations":29,"averageFemaInspectedDamage":8176,"totalInspected":16,"totalDamage":130819,"noFemaInspectedDamage":10,"femaInspectedDamageBetween1And10000":3,"femaInspectedDamageBetween10001And20000":0,"femaInspectedDamageBetween20001And30000":1,"femaInspectedDamageGreaterThan30000":2,"approvedForFemaAssistance":9,"totalApprovedIhpAmount":96070,"repairReplaceAmount":69315,"rentalAmount":20347,"otherNeedsAmount":6408,"approvedBetween1And10000":5,"approvedBetween10001And25000":3,"approvedBetween25001AndMax":1,"totalMaxGrants":1,"hash":"5a7d9748949c69e2b8c8bc7d93158820","lastRefresh":"2014-12-12T01:18:19.599Z","id":"546e064687456f7b0c07de85"}
  
Run the http request on your browser and copy the result in your report.
+
"
  
This output is in JSON format. To learn more about JSON read : . To be able to read the output check :
+
Now choose two different APIs, run an http request for the API on your browser and copy a couple of records from the result in your report.  
  
Read the API docs
 
  
=== Deliverable: ===
+
This output is in JSON format.
What will the student hand in?
+
  
=== Assessment: ===
+
==== Part 3 ====
How will the activity be graded?
+
Develop an Android App that provides an interactive interface to search and display a data feed from the FEMA data sets. Your App should use the sample code attached to retrieve data from an API and your task will be to design and develop and App that displays this data.
+
How will learning will be measured?
+
  
Include sample assessment questions/rubrics.
+
=== Deliverable ===
  
=== Comments: ===
+
* A report including answers for part 1 and part 2
What should the instructor know before using this activity?
+
* A .zip and .apk of your Android app.
  
What are some likely difficulties that an instructor may encounter using this activity?
 
  
=== Additional Information: ===
+
== Notes for Instructors ==
{| border="1"
+
 
|-
+
 
|'''Knowledge Area/Knowledge Unit''' || What ACM Computing Curricula 2013 https://www.acm.org/education/CS2013-final-report.pdf knowledge area and units does this activity cover?
+
=== Assessment ===
|-
+
 
|'''Topic''' || What specific topics are addressed? The Computing Curriucula 2013 provides a list of topics - https://www.acm.org/education/CS2013-final-report.pdf
+
{| class="wikitable"
|-
+
! Criteria
|'''Level of Difficulty''' || Is this activity easy, medium or challenging?
+
! Level 1 (fail)
|-
+
! Level 2 (pass)
|'''Estimated Time to Completion''' ||  How long should it take for the student to complete the activity?
+
! Level 3 (good)
 +
! Level 4 (exceptional)
 
|-
 
|-
|'''Materials/Environment''' || What does the student need?  Internet access, IRC client, Git Hub account, LINUX machine, etc.?
+
| '''Understands what is a Open API and how is different that open source'''
 +
| Little to no understanding shown; Answers are made up or unrelated; Didn't read material
 +
| Limited understanding, showing that they read some, but did not dig very deep
 +
| Showed that they have done the readings with limited understanding
 +
| Clearly explain the answer to each question with supporting examples
 
|-
 
|-
|'''Author''' || Who wrote this activity?
+
| '''Testing FEMA APIs'''
 +
| No testing
 +
| Testing with bad results
 +
| Testing with good results
 +
| Testing multiple APIs with the correct result
 
|-
 
|-
|'''Source''' || Is there another activity on which this activity is based?  If so, please provide a link to the original resource.
+
| '''Create an Android App that retrieves data from a REST API'''
 +
| Did not attempt to create the App
 +
| App retrieves data but data is not parsed
 +
| App retrieves data and parses the json data
 +
| App retrieves data, parses data and displays data
 
|-
 
|-
|'''License''' || Under which license is this material made available? (http://creativecommons.org/licenses/)
+
| '''An interactive interface is develped to display data'''
 +
| Did not attempt to create an interface
 +
| Create a limited interface for the app
 +
| Create a complete inteface displaying all retrieved data
 +
| Create an efficient interface with the ability to search/filter the data
 
|}
 
|}
  
 +
=== Comments ===
  
=== Suggestions for the Open Source Project: ===
+
Android Development, JSON data model
Suggestions for an open source community member who is working in conjunction with the instructor.
+
  
 +
=== Additional Information ===
  
--------------------
+
{{Learning Activity Info
This work is licensed under a
+
|acm unit=
[http://creativecommons.org/licenses/by-sa/4.0/ Creative Commons Attribution-ShareAlike 4.0 International License]
+
PBD/Mobile Platforms
 +
|acm topic=
 +
Mobile programming languages
 +
|difficulty=
 +
medium-challenging
 +
|time=
 +
6-8 hours
 +
|environment=
 +
Internet access, Android Studio installed
 +
|author=
 +
Ruby ElKharboutly
 +
|source=
 +
Ruby ElKharboutly
 +
|license=
 +
{{License CC BY}}
 +
}}
  
[[File:CC_license.png]]
+
=== Suggestions for the Open Source Project ===
 +
* ''Suggestions for an open source community member who is working in conjunction with the instructor.''
  
[[Category: Learning_Activity]]
+
[[Category:Learning Activity]]
[[Category: LEARNING_ACTIVITY_SUBCATEGORY]]
+
[[Category:Specification and Design]]
 +
[[Category:Good Draft]]

Latest revision as of 12:39, 8 September 2018


Title

Using Open APIs in Mobile Application Development

Overview

In this activity students will learn about Open APIs, how does it relate to open source and how to use in building a mobile application.

Prerequisites

CS2 using Java and basics of Android development.

Learning
Objectives
After successfully completing this activity, the learner should be able to:
  • Understand what an Open API is.
  • Understand how open APIs relate to open source.
  • Use open APIs in mobile application development
  • Specifically use the FEMA open data API to build a simple Android accessibility application.
Process Skills
Practiced


Background

This activity is meant to educate students about open APIs and how to use them in Android app development. The activity is targeted for crisis management APIs to emphasize the humanitarian aspect of HFOSS.

Directions

Part 1

  1. What is an Open API? What is REST? How and why is it open ?

http://searchcloudapplications.techtarget.com/definition/open-API

  1. What is the difference between open source and open API?

http://toni.org/2007/01/30/open-source-vs-open-apis/

Write a one page summery compiling your understanding of these readings.

Part 2

FEMA (The Federal Emergency Management Agency) has made some of its data public through a REST API http://www.fema.gov/data-feeds#APIs The released data sets are listed in http://www.fema.gov/data-feeds#APIs and include the following:

  • Housing Assistance Owners
  • Housing Assistance Renters
  • Registration Intake and Individuals Household Program
  • Public Assistance Funded Projects: Summary
  • Public Assistance Funded Projects: Details
  • Hazard Mitigation Grant Program Property Acquisitions
  • Hazard Mitigation Grants
  • Disaster Declarations Summaries

For example, the following http request retrieves data for Housing Assistance Owners. To test the API, run the http request on your browser. For example, the House Assistance Owners API (http://www.fema.gov/api/open/v1/HousingAssistanceOwners) when executed on the browser runs this partial record. " {"metadata":{"skip":0,"top":1000,"count":0,"filter":"","format":"json","orderby":{},"select":null,"entityname":"HousingAssistanceOwners","url":"/api/open/v1/HousingAssistanceOwners"},"HousingAssistanceOwners":[{"disasterNumber":1983,"state":"MS","county":"Adams (County)","city":"NATCHEZ","zipCode":"39120","validRegistrations":29,"averageFemaInspectedDamage":8176,"totalInspected":16,"totalDamage":130819,"noFemaInspectedDamage":10,"femaInspectedDamageBetween1And10000":3,"femaInspectedDamageBetween10001And20000":0,"femaInspectedDamageBetween20001And30000":1,"femaInspectedDamageGreaterThan30000":2,"approvedForFemaAssistance":9,"totalApprovedIhpAmount":96070,"repairReplaceAmount":69315,"rentalAmount":20347,"otherNeedsAmount":6408,"approvedBetween1And10000":5,"approvedBetween10001And25000":3,"approvedBetween25001AndMax":1,"totalMaxGrants":1,"hash":"5a7d9748949c69e2b8c8bc7d93158820","lastRefresh":"2014-12-12T01:18:19.599Z","id":"546e064687456f7b0c07de85"}

"

Now choose two different APIs, run an http request for the API on your browser and copy a couple of records from the result in your report.


This output is in JSON format.

Part 3

Develop an Android App that provides an interactive interface to search and display a data feed from the FEMA data sets. Your App should use the sample code attached to retrieve data from an API and your task will be to design and develop and App that displays this data.

Deliverable

  • A report including answers for part 1 and part 2
  • A .zip and .apk of your Android app.


Notes for Instructors

Assessment

Criteria Level 1 (fail) Level 2 (pass) Level 3 (good) Level 4 (exceptional)
Understands what is a Open API and how is different that open source Little to no understanding shown; Answers are made up or unrelated; Didn't read material Limited understanding, showing that they read some, but did not dig very deep Showed that they have done the readings with limited understanding Clearly explain the answer to each question with supporting examples
Testing FEMA APIs No testing Testing with bad results Testing with good results Testing multiple APIs with the correct result
Create an Android App that retrieves data from a REST API Did not attempt to create the App App retrieves data but data is not parsed App retrieves data and parses the json data App retrieves data, parses data and displays data
An interactive interface is develped to display data Did not attempt to create an interface Create a limited interface for the app Create a complete inteface displaying all retrieved data Create an efficient interface with the ability to search/filter the data

Comments

Android Development, JSON data model

Additional Information

ACM BoK
Area & Unit(s)

PBD/Mobile Platforms

ACM BoK
Topic(s)

Mobile programming languages

Difficulty

medium-challenging

Estimated Time
to Complete

6-8 hours

Environment /
Materials

Internet access, Android Studio installed

Author(s)

Ruby ElKharboutly

Source

Ruby ElKharboutly

License

This work is licensed under a Creative Commons Attribution 4.0 International License

CC-BY.png


Suggestions for the Open Source Project

  • Suggestions for an open source community member who is working in conjunction with the instructor.
Personal tools
Namespaces
Variants
Actions
Events
Learning Resources
HFOSS Projects
Evaluation
Navigation
Toolbox