Internet data in Mobile applications
-
Upload
vishwaksolutions -
Category
Documents
-
view
214 -
download
0
Transcript of Internet data in Mobile applications
![Page 1: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/1.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 1/24
Internet data in Mobile
applications
Sheik Dawood Jainullabudeen(sheikd at vishwak.com)
Vishwak Solutions Pvt Ltd
![Page 2: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/2.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 2/24
Types of Internet Data
Web Service
JSON
XML (RSS feed)
![Page 3: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/3.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 3/24
Web Service
Web services are typically application programminginterfaces (API) or web APIs that can be accessed
over Internet, and executed on a remote system
hosting the requested services
![Page 4: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/4.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 4/24
JSON
JSON, short for JavaScript Object Notation, is a
lightweight computer data interchange format. It is atext-based, human-readable format for representing
simple data structures and associative arrays (called
objects).
![Page 5: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/5.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 5/24
RSS
RSS (most commonly expanded as Really SimpleSyndication) 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
![Page 6: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/6.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 6/24
UI Elements
Screen1: Lists the Category Titles
Screen2 : On Select of category ,2nd screen shows
the Description of the RSS story
![Page 7: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/7.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 7/24
Web API served from Web
![Page 8: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/8.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 8/24
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
![Page 9: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/9.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 9/24
Choose the Data Source(RSS feed )
Here we are connecting to RSS feedhttp://rss.cnn.com/rss/edition.rss
![Page 10: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/10.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 10/24
Retrieve the VVF feed fromwebserver
Before we do parsing and data manipulation of anRSS 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 GETHTTP GET operation to retrieve the RSS
data.
The data which comes back is not a file, it is a streamof XML data. The URL class is employed to fetch the
data.
![Page 11: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/11.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 11/24
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.
![Page 12: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/12.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 12/24
Parse the RSS Feed(XML)
Two most popular approaches used for parsing the XMLnamely 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.
![Page 13: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/13.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 13/24
Store the RSS data as localobjects(Array, List)
The RSS feed extracted from the XML data streammust 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.
![Page 14: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/14.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 14/24
Display the RSS feed in to AndroidUI Components
This RSS Application employs two Activity classes toprovide 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.
![Page 15: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/15.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 15/24
Mobile Components Comparison
Sl. No Features RSS feed Address Retrieve the RSS
feed from
webserver
XML Parser -
(Parse the XML
data stream)
Store the RSS data Display the RSS feed in
to Mobile UI
Components
1 Android http://rss.cnn.com/rss/edition.rss Perform an HTTP
GET operation to
retrieve the RSS
data
SAX, DOM XML
Parser
Array, List TextViews, ListView
2 iPhone http://rss.cnn.com/rss/edition.rss Perform an HTTP
GET operation to
retrieve the RSS
data
NSXMLParser
,libxml2 SAX
Array, List Table View, UIView,
ImageView
3 Blackberry http://rss.cnn.com/rss/edition.rss Perform an HTTP
GET operation to
SAX, DOM XML
Parser
Array, Vector ListField
4 Windows Phone7 http://rss.cnn.com/rss/edition.rss Perform an HTTP
GET operation to
DOM Parser V ector Panoramic View Control
Comparisons of XML Parser, UI Elements
![Page 16: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/16.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 16/24
Challenges Faced Minimal dataexchange 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.
![Page 17: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/17.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 17/24
Challenges Faced Minimal dataexchange 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.
![Page 18: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/18.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 18/24
XML VS JSON Data Bytes
Various API¶s and their size in XML, JSON format¶s
No
¡ ¢ F
£ ¤ c
¥
¦
o¤
§
̈
¦
¥
©
Fo
§
¥
¤
o
B©
¥
o
B©
¥
P
c
¤
¥
§
g §
©
co
¦
o¤
%
1 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
XM' ( )
60
80
1 0
1 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
JS2
3
0
9) 1 ( )
0
8
1 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
XM ' ( 1 1 1 1205 ) 1
2 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
JS2
3
0
0) 8 90
0 ) 0
1 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
XM ' 1089 ) ) 2 29
2 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
JS2
3 511 486 5
1 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
XM ' 4275 1276 70
2 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
JS2
3
0
131 1045 67
1 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
XM ' 4158 1216 71
2 http://r! !
"
# $ $
"
#
% &
/r! !
/editi%
$
" r! !
JS2
3 3052 958 69
4
c¦
§
̈
4
§
c
5 :
§
¥
go
©
¢
¦
¥
¦
¤
g :
V¦
o
f o
§
¥
go
©
:
6
%
li!
t out all videos as per its rati $ 7
6 o list all categories
To list the videos from the particluar
categor8
To show the particular video
To list out all videos as per the keyword
K
© 9
o
4
§
c
5 :
V¦
o F
P§
g
:
![Page 19: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/19.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 19/24
Uncompressed XML vsCompressed JSON Data
Comparison between XML vs Compressed JSON format.
The JSON compressed data size is reduced compared to XML
format
![Page 20: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/20.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 20/24
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.
![Page 21: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/21.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 21/24
VVF on Iphone
![Page 22: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/22.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 22/24
![Page 23: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/23.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 23/24
VVF on Blackberry
![Page 24: Internet data in Mobile applications](https://reader033.fdocuments.us/reader033/viewer/2022052916/577d2bef1a28ab4e1eab81e1/html5/thumbnails/24.jpg)
8/7/2019 Internet data in Mobile applications
http://slidepdf.com/reader/full/internet-data-in-mobile-applications 24/24
Thank you