You are on page 1of 24

Internet data in Mobile

applications

Sheik Dawood Jainullabudeen


(sheikd at vishwak.com)
Vishwak Solutions Pvt Ltd
Types of Internet Data

 Web Service
 JSON
 XML (RSS feed)
Web Service

 Web services are typically application programming


interfaces (API) or web APIs that can be accessed
over Internet, and executed on a remote system
hosting the requested services
JSON
 JSON, short for JavaScript Object Notation, is a
lightweight computer data interchange format. It is a
text-based, human-readable format for representing
simple data structures and associative arrays (called
objects).
RSS

 RSS (most commonly expanded as Really Simple


Syndication) is a family of web feed formats used to
publish frequently updated works—such as blog
entries, news headlines, audio, and video—in a
standardized format
UI Elements

 Screen1: Lists the Category Titles


 Screen2 : On Select of category ,2nd screen shows
the Description of the RSS story
Web API served from Web
Mobile RSS Reader

1. Choose the Data Source


2. Retrieve the RSS feed from webserver
3. Parse the RSS Feed
4. Store the RSS data as local objects(Array, List)
5. Display the RSS feed in to Mobile UI
Components
Choose the Data Source
(RSS feed )

 Here we are connecting to RSS feed


http://rss.cnn.com/rss/edition.rss
Retrieve the VVF feed from
webserver

 Before we do parsing and data manipulation of an


RSS feed, the application should talk to internet and
retrieve the RSS feed
 The Application connect to the site hosting RSS feed
through an Internet connection (GPRS or Wi-Fi) and
perform an HTTP GET operation to retrieve the RSS
data.
 The data which comes back is not a file, it is a stream
of XML data. The URL class is employed to fetch the
data.
Parse the RSS Feed(XML)

 We can parse XML data with multiple mechanisms.


 All of them involve the navigation of the data stream
and moving of one data element from another with
the opportunity to store the data.
Parse the RSS Feed(XML)

 Two most popular approaches used for parsing the XML


namely the DOM Parser, SAX Parser.
 The DOM approach is well suited for complex XML documents
as it builds a node-oriented representation of the XML data in
memory.
 The SAX approach uses callbacks whenever new tags are
encountered, allowing the application to store only the data it
is interested in.
Store the RSS data as local
objects(Array, List)

 The RSS feed extracted from the XML data stream


must be put into a Mobile application (SDK)
understandable form.
 RSSFeed and RSSItem, which store the parsed form
of the RSS XML data stream in memory.
 Once the XML data stream is fully parsed, the
application interacts with these classes to render the
information.
Display the RSS feed in to Android
UI Components

 This RSS Application employs two Activity classes to


provide the user interface.
 The primary screen lists the RSS feed title and
publication date followed by a list of the RSS items.
 Once an item is selected through a tap, or enter in
the Android Emulator, the ShowDescription Activity
displays the full detail including the Title, Publication
Date, Description and Link elements of the RSS item.
Mobile Components Comparison

Comparisons of XML Parser, UI Elements


Sl. No Features RSS feed Address Retrieve the RSS XML Parser - Store the RSS data Display the RSS feed in
feed from (Parse the XML to Mobile UI
webserver data stream) Components

1 Android http://rss.cnn.com/rss/edition.rss Perform an HTTP SAX, DOM XML Array, List TextViews, ListView
GET operation to Parser
retrieve the RSS
data
2 iPhone http://rss.cnn.com/rss/edition.rss Perform an HTTP NSXMLParser Array, List Table View, UIView,
GET operation to ,libxml2 SAX ImageView
retrieve the RSS
data
3 Blackberry http://rss.cnn.com/rss/edition.rss Perform an HTTP SAX, DOM XML Array, Vector ListField
GET operation to Parser
4 Windows Phone7 http://rss.cnn.com/rss/edition.rss retrieve
Perform the RSS
an HTTP DOM Parser Vector Panoramic View Control
GET operation to
Challenges Faced – Minimal data
exchange between mobile &
internet
 Internet Data in mobile connection (GPRS)
environment is very slow.
 The application cannot retrieve the data using mobile
internet(GPRS) fast as internet connectivity.
 So the application should be talking to quick and
minimal data
 Mobile Applications quickly get the data from the feed
and process it for display.
Challenges Faced – Minimal data
exchange between mobile &
internet
 Mobile Application in Offline mode.
 When user tries to connect Mobile application which
suppose to connect to internet should have interface
to show case the cached information available in the
device
 Caching of data will help user to navigate minimum
level of information and when internet is available the
rest of the information will be shown.
XML VS JSON Data Bytes

Percentag
UnCompressed Compressed e saved by
No URL Functionality Format
(Bytes) (Bytes) compressi
on(%)
Category Listing :
1 http://rss.cnn.com/rss/edition.rss To list all categories XML 476 383 20
2 http://rss.cnn.com/rss/edition.rss JSON 397 247 38
Videos from Category :
1 http://rss.cnn.com/rss/edition.rss To list the videos from the particluar XML 4222 1205 71
2 http://rss.cnn.com/rss/edition.rss category JSON 3078 930 70
Video Feed Page :
1 http://rss.cnn.com/rss/edition.rss To show the particular video XML 1089 772 29
2 http://rss.cnn.com/rss/edition.rss JSON 511 486 5
Keyword Search :
1 http://rss.cnn.com/rss/edition.rss To list out all videos as per the keyword XML 4275 1276 70
2 http://rss.cnn.com/rss/edition.rss JSON 3131 1045 67
Special Search :
1 http://rss.cnn.com/rss/edition.rss To list out all videos as per its rating XML 4158 1216 71
2 http://rss.cnn.com/rss/edition.rss JSON 3052 958 69

Various API’s and their size in XML, JSON format’s


Uncompressed XML vs
Compressed JSON Data

Comparison between XML vs Compressed JSON format.


The JSON compressed data size is reduced compared to XML
format
PhoneGap

 PhoneGap is an open source development tool for


building fast, easy mobile apps with JavaScript
 Mobile Development with different SDK , IDE
 iPhone SDK(using Objective-C)
 Android SDK (using Java)
 Blackberry SDK (using JavaME)
 Phonegap supports cross-platform framework for
device-neutral mobile development.
 Application is developed using Javascript libraries.
VVF on Iphone
VVF on Android
VVF on Blackberry
Thank you

You might also like