SlideShare a Scribd company logo
1 of 19
Download to read offline
USING OPEN DATA IN!
MOBILE APPLICATIONS
Using Open Data in
Mobile Applications
   •  Allan Lykke Christensen"
                       •  14 years experience"
                       •  B.S.c. 1. Class Honours Computer
                          Science & E-Business"
                       •  Career"
                           –  Director

                            Interactive Media Management"
     ABOUT                –  Vice President

                            Danish ICT Management"
        ME
               –  Business Analyst

  ALLAN@I2M.DK!             PRO€INVEST (EU)"
                          –  Software Engineer

                            Siemens Communications"
                          –  Technical Consultant

                            Metrocomia"
                           –  Independent Consultant"
                       •  Open source and open data solutions"
                       •  LinkedIn

                         http://dk.linkedin.com/in/allanlykkechristensen"
Using Open Data in
Mobile Applications




                       •    Introduction to Open Data"
                       •    Open Data Services"
PURPOSE
               •    Open Data in Mobile Apps"
   OPEN DATA &
   MOBILE APPS!        •    Success Factors"
                       •    Getting Started!"
Using Open Data in
Mobile Applications
   1.   Access"
                       2.   Redistribution"
                       3.   Reuse"
                       4.   Absence of Technological
                            Restriction"
  WHAT IS              5.  Attribution"
    OPEN               6.  Integrity"
                       7.  No Discrimination against Persons
   DATA?
                   or Groups"
   FROM OPEN
DEFINITION.ORG!
                       8.  No Discrimination against Fields of
                            Endeavour"
                       9.  Distribution of License"
                       10. License must not be specific to a
                            package"
                       11.  License must not restrict the
                            distribution of other works"
Using Open Data in
Mobile Applications
   •    Government"
                             –  Kenya Government 

                                http://opendata.go.ke"
                             –  World Bank

                                http://data.worldbank.org"
                             –  United Nations

                                http://undata-api.org/"
                             –  Data.gov


   OPEN
                                http://www.data.gov"
                             –  Data.gov.uk

                                http://www.data.gov.uk"

   DATA                • 
                             "
                            Non-government"

SERVICES
                             –  OpenStreetMap

                                http://openstreetmap.org"
                             –  Wikipedia

       NOT ALL                  http://www.dbpedia.org

                                "
  SERVICES ARE
                       •    Portals and Providers"
          FREE!
                             –  Infochimps

                                http://www.infochimps.com"
                             –  Socrata

                                http://opendata.socrata.com"
                             –  Freebase

                                http://www.freebase.com"
                             –  DataMasher

                                http://www.datamasher.com"
Using Open Data in
Mobile Applications
                       •    CDFMonitor"
                       •    Msema Kweli"
                       •    Huduma (SMS)"
                       •    K-Traffic"
                       •    mHealth (Ethiopia)"
   MOBILE
                       •    PHSRP (India)"
    APPS
       EXAMPLES!
Using Open Data in
Mobile Applications
   •  Protocols / Query"
                           –  SOAP"
                           –  REST"
                           –  XML-RPC"
                           –  X over HTTP"
                           –  SPARQL"
    DATA                   –  YQL"
                           –  OData"
EXCHANGE
              •  Formats"
     COMMON                –  JSON"
PROTOCOLS AND
     FORMATS!
                           –  XML"
                           –  RDF"
                           –  XLS"
                           –  CSV"
                           –  TXT"
                           –  HTML"
                           –  PDF"
Using Open Data in
Mobile Applications




                       •    Flat rates"
                       •    Smart phones"
SUCCESS                •    Marketing of solutions"
FACTORS
               •    Partnerships"
   CONSTRAINTS!
                       •    More open data!"
Using Open Data in
Mobile Applications

                       •  Find a service"
                       •  Explore the datasets"
                           –  Register API key"
                       •  Determine protocol"
GETTING                •  Determine format"
STARTED
               •  Identify client API libraries"
    DEVELOPERS!
                       •  Design queries"

                       Don’t just consume, PRODUCE!"
Using Open Data in     h"p://opendata.go.ke	
  
Mobile Applications




GETTING
STARTED
                                          h"p://www.infochimps.com	
  
 FIND A SERVICE!
Using Open Data in
Mobile Applications
                       h"p://opendata.go.ke/browse	
  




GETTING
STARTED
        EXPLORE
       DATASETS!
Using Open Data in
Mobile Applications
   h"p://dev.socrata.com/	
  




GETTING
STARTED
     DETERMINE
    PROTOCOL &
        FORMAT!
Using Open Data in
Mobile Applications



                       •  For opendata.go.ke we need a
                          REST client that supports JSON"
                       •  Devices:"
GETTING                    –  J2ME"
STARTED
                    •  org.json	
  Java	
  Library	
  
      CLIENT API         –  Android"
        LIBRARY!
                            •  org.json	
  Java	
  Library	
  
                            •  Open	
  Data	
  Kit	
  
                         –  iOS"
                            •  json-­‐framework	
  (Google	
  Code)	
  
Using Open Data in
Mobile Applications
   All queries below should be prefixed http://opendata.go.ke "

                       •    http://opendata.go.ke/api/views.json

                            List of available datasets. Datasets have unique
                            identifiers."

                       •    /api/views/rsim-nh7f.json

                            Get dataset with unique identifier rsim-nh7f (CDF
GETTING                     Projects)"


STARTED
               •    /api/views/rsim-nh7f/rows.json

                            Gets all the data in the data set"
DESIGN QUERIES!
                       •    /api/views/89zb-g69r/rows.json?max_rows=20

                            Gets the first 20 data entries in the data set"

                       •    /api/views/89zb-g69r/rows/2.json

                            Extract record number 2 from the data set"

                       •    http://dev.socrata.com/querying-datasets

                            Filter queries use the HTTP POST method or by
                            predefining queries"
Using Open Data in
Mobile Applications


                       J2ME"
                       "
                       String url = "http://opendata.go.ke/api/
                       views/rsim-nh7f/rows.json?max_rows=100";


GETTING                // Prepare a RESTful connection
                       HttpConnection hc = (HttpConnection)
STARTED
               Connector.open(url);
    WRITING THE        hc.setRequestMethod(hc.GET);
          CODE!        hc.setRequestProperty("Accept-Type",
                       "application/json");

                       // Execute connection
                       int responseCode = hc.getResponseCode();
Using Open Data in
Mobile Applications
   J2ME"
                       "
                       // Read the (JSON) response into a String
                       InputStream is = null;
                       StringBuffer b = new StringBuffer();

                       try {
                            is = hc.openInputStream();
                            long len = hc.getLength();
                            int ch = 0;


GETTING
                            if (len != -1) {
                                 for (int i = 0; i < len; i++) {
                                      if ((ch = is.read()) != -1) {

STARTED
                         }
                                      }
                                           b.append((char) ch);


    WRITING THE             } else {
          CODE!                  // Read till the connection is closed.
                                 while ((ch = is.read()) != -1) {
                                      len = is.available();
                                      b.append((char) ch);
                                 }
                            }
                       } finally {
                            if (is != null) {
                                 is.close();
                            }
                            hc.close();
                       }
Using Open Data in
Mobile Applications
   J2ME"
                       "
                       // Turn response into JSONObject
                       JSONObject json = new JSONObject(b.toString());
                       JSONArray results = json.optJSONArray("data");

                       // Store result in internal data structure
                       Vector projects = new Vector();

                       // Column indexes
                       int COLUMN_ID = 1;
                       int COLUMN_COUNTY = 9;
                       int COLUMN_DISTRICT = 10;

GETTING
                       int COLUMN_CONSTITUENCY = 11;
                       int COLUMN_PROJECT = 12;
                       int COLUMN_SECTOR = 14;


STARTED
                       int COLUMN_EXPECTED_OUTPUT = 17;
                       int COLUMN_STATUS = 19;
                       int COLUMN_ESTIMATED_COSTS = 21;
                       int COLUMN_TOTAL_COSTS = 28;
    WRITING THE
          CODE!        // Iterate through resutls
                       if (results != null) {
                            for (int i = 0; i < results.length(); i++) {
                               JSONArray item = results.getJSONArray(i);

                                CdfProject project = new CdfProject();
                                project.setId(item.get(COLUMN_ID));
                                project.setTitle(item.get(COLUMN_PROJECT));
                                project.setConstituency(item.get(COLUMN_CONSTITUENCY));

                               projects.addElement(project);
                           }
                       }
Using Open Data in
Mobile Applications




                       •    Open data"
                       •    Mobile apps"
                       •    Data exchange"
SUMMARY
               •    Success factors"
                       •    Getting started"
THANKS FOR LISTENING!
   ALLAN@I2M.DK

More Related Content

Similar to Using open data in mobile applications

Introduction to APIs and Linked Data
Introduction to APIs and Linked DataIntroduction to APIs and Linked Data
Introduction to APIs and Linked DataAdrian Stevenson
 
Open Data Portals: 9 Solutions and How they Compare
Open Data Portals: 9 Solutions and How they CompareOpen Data Portals: 9 Solutions and How they Compare
Open Data Portals: 9 Solutions and How they CompareSafe Software
 
Neven Vrček: Internship programme and students’ entrepreneurship as a hub be...
Neven Vrček:  Internship programme and students’ entrepreneurship as a hub be...Neven Vrček:  Internship programme and students’ entrepreneurship as a hub be...
Neven Vrček: Internship programme and students’ entrepreneurship as a hub be...CUBCCE Conference
 
Big data visualization frameworks and applications at Kitware
Big data visualization frameworks and applications at KitwareBig data visualization frameworks and applications at Kitware
Big data visualization frameworks and applications at Kitwarebigdataviz_bay
 
Towards Semantic APIs for Research Data Services (Invited Talk)
Towards Semantic APIs for Research Data Services (Invited Talk)Towards Semantic APIs for Research Data Services (Invited Talk)
Towards Semantic APIs for Research Data Services (Invited Talk)Anna Fensel
 
Linked_Open_Data_Rome_Netcamp_13
Linked_Open_Data_Rome_Netcamp_13Linked_Open_Data_Rome_Netcamp_13
Linked_Open_Data_Rome_Netcamp_13Michele Piunti
 
Our Data, Ourselves: The Data Democracy Deficit (EMF CAmp 2014)
Our Data, Ourselves: The Data Democracy Deficit (EMF CAmp 2014)Our Data, Ourselves: The Data Democracy Deficit (EMF CAmp 2014)
Our Data, Ourselves: The Data Democracy Deficit (EMF CAmp 2014)Giles Greenway
 
Open data for_resilience
Open data for_resilienceOpen data for_resilience
Open data for_resilienceDami Sonoiki
 
Dublinked tech workshop_15_dec2011
Dublinked tech workshop_15_dec2011Dublinked tech workshop_15_dec2011
Dublinked tech workshop_15_dec2011Dublinked .
 
WORLDMAP: A SPATIAL INFRASTRUCTURE TO SUPPORT TEACHING AND RESEARCH (BROWN BA...
WORLDMAP: A SPATIAL INFRASTRUCTURE TO SUPPORT TEACHING AND RESEARCH (BROWN BA...WORLDMAP: A SPATIAL INFRASTRUCTURE TO SUPPORT TEACHING AND RESEARCH (BROWN BA...
WORLDMAP: A SPATIAL INFRASTRUCTURE TO SUPPORT TEACHING AND RESEARCH (BROWN BA...Micah Altman
 
(PROJEKTURA) Big Data Open Data story for TGG
(PROJEKTURA) Big Data Open Data story for TGG(PROJEKTURA) Big Data Open Data story for TGG
(PROJEKTURA) Big Data Open Data story for TGGRatko Mutavdzic
 
Big Data Europe SC6 WS 3: Ron Dekker, Director CESSDA European Open Science A...
Big Data Europe SC6 WS 3: Ron Dekker, Director CESSDA European Open Science A...Big Data Europe SC6 WS 3: Ron Dekker, Director CESSDA European Open Science A...
Big Data Europe SC6 WS 3: Ron Dekker, Director CESSDA European Open Science A...BigData_Europe
 
What do we want computers to do for us?
What do we want computers to do for us? What do we want computers to do for us?
What do we want computers to do for us? Andrea Volpini
 
2013 04-29 american art collaborative lod meeting - washington dc - web
2013 04-29 american art collaborative lod meeting - washington dc - web2013 04-29 american art collaborative lod meeting - washington dc - web
2013 04-29 american art collaborative lod meeting - washington dc - weblecmaj
 
Enabling Smarter Cities through Internet of Things, Web of Data & Citizen Par...
Enabling Smarter Cities through Internet of Things, Web of Data & Citizen Par...Enabling Smarter Cities through Internet of Things, Web of Data & Citizen Par...
Enabling Smarter Cities through Internet of Things, Web of Data & Citizen Par...Diego López-de-Ipiña González-de-Artaza
 
Global Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastGlobal Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastSammy Fung
 
Gis - open source potentials
Gis  - open source potentialsGis  - open source potentials
Gis - open source potentialsTim Willoughby
 
From open data to API-driven business
From open data to API-driven businessFrom open data to API-driven business
From open data to API-driven businessOpenDataSoft
 

Similar to Using open data in mobile applications (20)

Introduction to APIs and Linked Data
Introduction to APIs and Linked DataIntroduction to APIs and Linked Data
Introduction to APIs and Linked Data
 
Open Data Portals: 9 Solutions and How they Compare
Open Data Portals: 9 Solutions and How they CompareOpen Data Portals: 9 Solutions and How they Compare
Open Data Portals: 9 Solutions and How they Compare
 
Neven Vrček: Internship programme and students’ entrepreneurship as a hub be...
Neven Vrček:  Internship programme and students’ entrepreneurship as a hub be...Neven Vrček:  Internship programme and students’ entrepreneurship as a hub be...
Neven Vrček: Internship programme and students’ entrepreneurship as a hub be...
 
Big data visualization frameworks and applications at Kitware
Big data visualization frameworks and applications at KitwareBig data visualization frameworks and applications at Kitware
Big data visualization frameworks and applications at Kitware
 
Towards Semantic APIs for Research Data Services (Invited Talk)
Towards Semantic APIs for Research Data Services (Invited Talk)Towards Semantic APIs for Research Data Services (Invited Talk)
Towards Semantic APIs for Research Data Services (Invited Talk)
 
Linked_Open_Data_Rome_Netcamp_13
Linked_Open_Data_Rome_Netcamp_13Linked_Open_Data_Rome_Netcamp_13
Linked_Open_Data_Rome_Netcamp_13
 
Our Data, Ourselves: The Data Democracy Deficit (EMF CAmp 2014)
Our Data, Ourselves: The Data Democracy Deficit (EMF CAmp 2014)Our Data, Ourselves: The Data Democracy Deficit (EMF CAmp 2014)
Our Data, Ourselves: The Data Democracy Deficit (EMF CAmp 2014)
 
Open data for_resilience
Open data for_resilienceOpen data for_resilience
Open data for_resilience
 
Dublinked tech workshop_15_dec2011
Dublinked tech workshop_15_dec2011Dublinked tech workshop_15_dec2011
Dublinked tech workshop_15_dec2011
 
WORLDMAP: A SPATIAL INFRASTRUCTURE TO SUPPORT TEACHING AND RESEARCH (BROWN BA...
WORLDMAP: A SPATIAL INFRASTRUCTURE TO SUPPORT TEACHING AND RESEARCH (BROWN BA...WORLDMAP: A SPATIAL INFRASTRUCTURE TO SUPPORT TEACHING AND RESEARCH (BROWN BA...
WORLDMAP: A SPATIAL INFRASTRUCTURE TO SUPPORT TEACHING AND RESEARCH (BROWN BA...
 
(PROJEKTURA) Big Data Open Data story for TGG
(PROJEKTURA) Big Data Open Data story for TGG(PROJEKTURA) Big Data Open Data story for TGG
(PROJEKTURA) Big Data Open Data story for TGG
 
Big Data Europe SC6 WS 3: Ron Dekker, Director CESSDA European Open Science A...
Big Data Europe SC6 WS 3: Ron Dekker, Director CESSDA European Open Science A...Big Data Europe SC6 WS 3: Ron Dekker, Director CESSDA European Open Science A...
Big Data Europe SC6 WS 3: Ron Dekker, Director CESSDA European Open Science A...
 
What do we want computers to do for us?
What do we want computers to do for us? What do we want computers to do for us?
What do we want computers to do for us?
 
2013 04-29 american art collaborative lod meeting - washington dc - web
2013 04-29 american art collaborative lod meeting - washington dc - web2013 04-29 american art collaborative lod meeting - washington dc - web
2013 04-29 american art collaborative lod meeting - washington dc - web
 
Enabling Smarter Cities through Internet of Things, Web of Data & Citizen Par...
Enabling Smarter Cities through Internet of Things, Web of Data & Citizen Par...Enabling Smarter Cities through Internet of Things, Web of Data & Citizen Par...
Enabling Smarter Cities through Internet of Things, Web of Data & Citizen Par...
 
Are you ready for BIG DATA?
Are you ready for BIG DATA?Are you ready for BIG DATA?
Are you ready for BIG DATA?
 
Big Data
Big Data Big Data
Big Data
 
Global Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastGlobal Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 Forecast
 
Gis - open source potentials
Gis  - open source potentialsGis  - open source potentials
Gis - open source potentials
 
From open data to API-driven business
From open data to API-driven businessFrom open data to API-driven business
From open data to API-driven business
 

Recently uploaded

JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 

Recently uploaded (20)

JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 

Using open data in mobile applications

  • 1. USING OPEN DATA IN! MOBILE APPLICATIONS
  • 2. Using Open Data in Mobile Applications •  Allan Lykke Christensen" •  14 years experience" •  B.S.c. 1. Class Honours Computer Science & E-Business" •  Career" –  Director
 Interactive Media Management" ABOUT –  Vice President
 Danish ICT Management" ME –  Business Analyst
 ALLAN@I2M.DK! PRO€INVEST (EU)" –  Software Engineer
 Siemens Communications" –  Technical Consultant
 Metrocomia" –  Independent Consultant" •  Open source and open data solutions" •  LinkedIn
 http://dk.linkedin.com/in/allanlykkechristensen"
  • 3. Using Open Data in Mobile Applications •  Introduction to Open Data" •  Open Data Services" PURPOSE •  Open Data in Mobile Apps" OPEN DATA & MOBILE APPS! •  Success Factors" •  Getting Started!"
  • 4. Using Open Data in Mobile Applications 1.  Access" 2.  Redistribution" 3.  Reuse" 4.  Absence of Technological Restriction" WHAT IS 5.  Attribution" OPEN 6.  Integrity" 7.  No Discrimination against Persons DATA? or Groups" FROM OPEN DEFINITION.ORG! 8.  No Discrimination against Fields of Endeavour" 9.  Distribution of License" 10. License must not be specific to a package" 11.  License must not restrict the distribution of other works"
  • 5. Using Open Data in Mobile Applications •  Government" –  Kenya Government 
 http://opendata.go.ke" –  World Bank
 http://data.worldbank.org" –  United Nations
 http://undata-api.org/" –  Data.gov
 OPEN http://www.data.gov" –  Data.gov.uk
 http://www.data.gov.uk" DATA •  " Non-government" SERVICES –  OpenStreetMap
 http://openstreetmap.org" –  Wikipedia
 NOT ALL http://www.dbpedia.org
 " SERVICES ARE •  Portals and Providers" FREE! –  Infochimps
 http://www.infochimps.com" –  Socrata
 http://opendata.socrata.com" –  Freebase
 http://www.freebase.com" –  DataMasher
 http://www.datamasher.com"
  • 6. Using Open Data in Mobile Applications •  CDFMonitor" •  Msema Kweli" •  Huduma (SMS)" •  K-Traffic" •  mHealth (Ethiopia)" MOBILE •  PHSRP (India)" APPS EXAMPLES!
  • 7. Using Open Data in Mobile Applications •  Protocols / Query" –  SOAP" –  REST" –  XML-RPC" –  X over HTTP" –  SPARQL" DATA –  YQL" –  OData" EXCHANGE •  Formats" COMMON –  JSON" PROTOCOLS AND FORMATS! –  XML" –  RDF" –  XLS" –  CSV" –  TXT" –  HTML" –  PDF"
  • 8. Using Open Data in Mobile Applications •  Flat rates" •  Smart phones" SUCCESS •  Marketing of solutions" FACTORS •  Partnerships" CONSTRAINTS! •  More open data!"
  • 9. Using Open Data in Mobile Applications •  Find a service" •  Explore the datasets" –  Register API key" •  Determine protocol" GETTING •  Determine format" STARTED •  Identify client API libraries" DEVELOPERS! •  Design queries" Don’t just consume, PRODUCE!"
  • 10. Using Open Data in h"p://opendata.go.ke   Mobile Applications GETTING STARTED h"p://www.infochimps.com   FIND A SERVICE!
  • 11. Using Open Data in Mobile Applications h"p://opendata.go.ke/browse   GETTING STARTED EXPLORE DATASETS!
  • 12. Using Open Data in Mobile Applications h"p://dev.socrata.com/   GETTING STARTED DETERMINE PROTOCOL & FORMAT!
  • 13. Using Open Data in Mobile Applications •  For opendata.go.ke we need a REST client that supports JSON" •  Devices:" GETTING –  J2ME" STARTED •  org.json  Java  Library   CLIENT API –  Android" LIBRARY! •  org.json  Java  Library   •  Open  Data  Kit   –  iOS" •  json-­‐framework  (Google  Code)  
  • 14. Using Open Data in Mobile Applications All queries below should be prefixed http://opendata.go.ke " •  http://opendata.go.ke/api/views.json
 List of available datasets. Datasets have unique identifiers." •  /api/views/rsim-nh7f.json
 Get dataset with unique identifier rsim-nh7f (CDF GETTING Projects)" STARTED •  /api/views/rsim-nh7f/rows.json
 Gets all the data in the data set" DESIGN QUERIES! •  /api/views/89zb-g69r/rows.json?max_rows=20
 Gets the first 20 data entries in the data set" •  /api/views/89zb-g69r/rows/2.json
 Extract record number 2 from the data set" •  http://dev.socrata.com/querying-datasets
 Filter queries use the HTTP POST method or by predefining queries"
  • 15. Using Open Data in Mobile Applications J2ME" " String url = "http://opendata.go.ke/api/ views/rsim-nh7f/rows.json?max_rows=100"; GETTING // Prepare a RESTful connection HttpConnection hc = (HttpConnection) STARTED Connector.open(url); WRITING THE hc.setRequestMethod(hc.GET); CODE! hc.setRequestProperty("Accept-Type", "application/json"); // Execute connection int responseCode = hc.getResponseCode();
  • 16. Using Open Data in Mobile Applications J2ME" " // Read the (JSON) response into a String InputStream is = null; StringBuffer b = new StringBuffer(); try { is = hc.openInputStream(); long len = hc.getLength(); int ch = 0; GETTING if (len != -1) { for (int i = 0; i < len; i++) { if ((ch = is.read()) != -1) { STARTED } } b.append((char) ch); WRITING THE } else { CODE! // Read till the connection is closed. while ((ch = is.read()) != -1) { len = is.available(); b.append((char) ch); } } } finally { if (is != null) { is.close(); } hc.close(); }
  • 17. Using Open Data in Mobile Applications J2ME" " // Turn response into JSONObject JSONObject json = new JSONObject(b.toString()); JSONArray results = json.optJSONArray("data"); // Store result in internal data structure Vector projects = new Vector(); // Column indexes int COLUMN_ID = 1; int COLUMN_COUNTY = 9; int COLUMN_DISTRICT = 10; GETTING int COLUMN_CONSTITUENCY = 11; int COLUMN_PROJECT = 12; int COLUMN_SECTOR = 14; STARTED int COLUMN_EXPECTED_OUTPUT = 17; int COLUMN_STATUS = 19; int COLUMN_ESTIMATED_COSTS = 21; int COLUMN_TOTAL_COSTS = 28; WRITING THE CODE! // Iterate through resutls if (results != null) { for (int i = 0; i < results.length(); i++) { JSONArray item = results.getJSONArray(i); CdfProject project = new CdfProject(); project.setId(item.get(COLUMN_ID)); project.setTitle(item.get(COLUMN_PROJECT)); project.setConstituency(item.get(COLUMN_CONSTITUENCY)); projects.addElement(project); } }
  • 18. Using Open Data in Mobile Applications •  Open data" •  Mobile apps" •  Data exchange" SUMMARY •  Success factors" •  Getting started"
  • 19. THANKS FOR LISTENING! ALLAN@I2M.DK