Vous êtes sur la page 1sur 22

Development

Android
Communica-on

From the beginning


GSM GPRS WAP SMS / MMS 3G / 3.5G GPS / A-GPS What are they ?

Mobile networks
GSM (Global System for Mobile Communica-ons)
Quad Band?
GSM900 / GSM1800 GSM850 / GSM1900
Europe, Middle East, Australia , Asia Canada , United States

Services

One of the key features of GSM is the Subscriber Iden-ty Module (SIM card)

GSM Localiza-on MMS WAP Cell broadcast NITZ (Network Iden-ty and Time Zone)

First GPRS
General packet radio service (GPRS) GPRS was originally standardized by European Telecommunica-ons Standards Ins-tute (ETSI) In 2G systems, GPRS provides data rates of 56-114 kbit/ second Supports
PPP IP X.25 connec-ons

TCP/IP is used, each phone can have more one or more IP addressed allocated GPRS will store and forward the IP packets to the phone even during handover GPRS is a 2G technology that allowed mobile phones to extend their usability a lot further than by simply making calls.

Then came 3G
Interna-onal Mobile Telecommunica-ons-2000 (IMT 2000), be`er known as 3G or 3rd Genera-on Standards are branded as 3G
UMTS W-CDMA TD-SCDMA HSPA

A 3G system must allow simultaneous use of speech and data services, and provide peak data rates of at least 200kbit/s according to the IMT-2000 specica-on

WAP
Wireless Applica-on Protocol (WAP) The Wireless Applica-on Protocol (WAP) is an open, global specica-on that empowers mobile users with wireless devices to easily access and interact with informa-on and services instantly.

GPS
It is a radio-naviga-on system consis-ng of 24 satellites orbi-ng the earth, and their respec-ve ground sta-ons. To calculate a posi-on, these satellites serve as reference points when calcula-ng posi-ons rela-ve to a ma`er of meters. In other words, GPS triangulates the posi-on of a satellite, its ground sta-on and the area you want to locate. However, this is done in a more scien-c and nite measurement of travel -me, distance, signal experiences, and atmospheric delays. To measure GPS points, you must use a GPS receiver that calculates its posi-on by the signals transmi`ed to the satellites. These satellites send messages containing informa-on such as the -me the message was sent and the satellites orbital informa-on. Once it receives this informa-on, the GPS receiver will then measure the transit -me of the sent message and calculate the distance of the GPS receiver to the each of the satellites. The loca-on is then displayed through GPS maps

Determining Loca1on by Tri-latera1on


In the image on the top, you see two circles. Imagine the circles as the signals from the GPS satellites. In this setup, you are basically somewhere in the yellow area In the image on the bo`om, there are three circles. Note that all the circles radii are dierent. But the addi-on of the third circle signicantly reduced the size of the area, which is the black area.

A-GPS
Assisted GPS improve the startup performance, or TTFF (Time To First Fix) of a GPS satellite-based posi-oning system

Others..
Wi-
builds on IEEE 802.11 standards connect to the Internet when within a range of a wireless network connected to the internet a proprietary open wireless technology standard for exchanging data over short distances ( using short wave length radio transmission ) from xed and mobile devices, crea-ng personal area networks (PAN) with high levels of security DUN / PAN prole

Bluetooth

Web Feeds
Technical Background: Web Feeds Web feeds allow sogware programs to check for summary updates published on a website. The Atom Syndica-on Format is an XML language used for web feeds (this format has been adopted by Google). A feed contains entries which may be headlines full-text ar-cles excerpts summaries and/or links to content on a website along with various metadata.

Internet feeders
World weather
h:p://www.rssweather.com/dir

News
feed://www.channelnewsasia.com/rss/ latest_cna_sg_rss.xml

Money Exchange
h:p://themoneyconverter.com/RSSFeeds.aspx

Entertainment
feed://www.gv.com.sg/rss/nowshowing_index_rss.xml

Back to Android
Apache HGpComponents API H`pComponents implement the most fundamental aspects of the HTTPprotocol (HTTP is REST compliant). The methods included in HGpComponents are sucient to develop basic client side and server side HTTP services with a minimal footprint and no external dependencies. The HGpClient component (included in the API) facilitates building HTTP-aware20110client applica-ons (such as web browsers and web services).

What to do with the feed ?


The goal is to grab the feed, and create a document holding the tree parsed from the XML document. Each item will be dissected and the pieces arranged into a manageable object form.

Example
Earthquake update Feed url : h`p://earthquake.usgs.gov/eqcenter/ catalogs/1day-M2.5.xml

<?xml version="1.0"?> <feed xmlns="h`p://www.w3.org/2005/Atom" xmlns:georss="h`p://www.georss.org/ georss"> <updated>2010-12-11T18:27:13Z</updated> <-tle>USGS M2.5+ Earthquakes</-tle> <sub-tle>Real--me, worldwide earthquake list for the past day</sub-tle> <link rel="self" href="h`p://earthquake.usgs.gov/earthquakes/catalogs/1day- M2.5.xml"/> <link href="h`p://earthquake.usgs.gov/earthquakes/"/> <author><name>U.S. Geological Survey</name></author> <id>h`p://earthquake.usgs.gov/</id> <icon>/favicon.ico</icon> <entry> </entry>

RSS Feed

RSS Feed
<entry> <id>urn:earthquake-usgs-gov:ak:10136135</id> <-tle>M 3.5, Central Alaska</-tle> <updated>2010-12-11T17:25:59Z</updated> <link rel="alternate" type="text/html" href="h`p://earthquake.usgs.gov/ earthquakes/recenteqsww/Quakes/ak10136135.php"/> <summary type="html"><![CDATA[<img src="h`p://earthquake.usgs.gov/images/ globes/65_-150.jpg" alt="62.884&#176;N 150.796&#176;W" align="leg" hspace="20" /><p>Saturday, December 11, 2010 17:25:59 UTC<br>Saturday, December 11, 2010 08:25:59 AM at epicenter</p><p><strong>Depth</strong>: 95.00 km (59.03 mi)</p>]]></summary> <georss:point>62.8840 -150.7961</georss:point> <georss:elev>-95000</georss:elev> <category label="Age" term="Past day"/> </entry>

Example
// connec-ng to the RSS providerURL url = new URL(urlAddress); URLConnec-on connec-on; connec-on = url.openConnec-on(); H`pURLConnec-on h`pConnec-on = (H`pURLConnec-on) connec-on; int responseCode = h`pConnec-on.getResponseCode(); if (responseCode == H`pURLConnec-on.HTTP_OK) { // get XML and make a document // holding the parse tree constructed from the input }

Example
// USE h`pConnec-on to get XML and make a document // holding the parse tree constructed from the input InputStream in = h`pConnec-on.getInputStream(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document dom = db.parse(in); Element docEle = dom.getDocumentElement(); // search the tree looking for entry nodesNodeList nl = docEle.getElementsByTagName("entry); if ((nl != null) && (nl.getLength() > 0)) { for (int i = 0; i < nl.getLength(); i++) {// extract components and store them in a convenient way dissectNode(nl, i); } }

Dissec-on
Element entry = (Element)nl.item(i); Element -tle = (Element) entry.getElementsByTagName("-tle").item(0); Element g = (Element) entry.getElementsByTagName("georss:point").item(0); Element when = (Element) entry.getElementsByTagName("updated").item(0); Element link = (Element) entry.getElementsByTagName("link").item(0);

Examples

Vous aimerez peut-être aussi