Final Projects Demo - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Final Projects Demo

Description:

Map Websites: www.MapQuest.com. map.yahoo.com ... Map Website. ClipServer. Mapquest. MsnMap. YahooMap. Internet. GCF. http/html. XML. Session(cookie) ... – PowerPoint PPT presentation

Number of Views:126
Avg rating:3.0/5.0
Slides: 12
Provided by: ron6
Category:
Tags: demo | final | map | projects | quest

less

Transcript and Presenter's Notes

Title: Final Projects Demo


1
Mobile Computing
Final Projects Demo Maps Navigator
Rong,Yongjun(rong_at_cs.ttu.edu)
2
Outline
  • Introduction
  • Architecture
  • Challenges
  • Demo

3
Introduction
Map Websites www.MapQuest.com
map.yahoo.com map.msn.com Can we use
these map websites if we only has a mobile
device? Help you to find your drive
direction Help you locate yourself
4
Architecture
Mapquest
Map Website ClipServer
Internet
GCF
http/html
MsnMap
XML
YahooMap
Session(cookie) Image adapting HTML parsing WS
client
Get Map Get Direction Save and restore
5
GUI Design
Submit
Save
GetMap
GetDirection
Submit
Save
Save
Display Text
Restore
ShowMap
6
Challenges
Analyze the http packages to make sure whats
the information (URL and cookie) is necessary to
get a map or directions.
7
Challenges
HTML file parsing. . Using
HTMLEditorKit.ParserCallback and Regular
expression to parse and extract the needed
information.
public void handleText(char data, int pos)
if(txt.startsWith("document.cookie"))
String tmps txt.split("") else
if(tmp.matches("1-90-9"))
s.append("---"tmp) numreturn
else if(txt.matches("\\pASCIIbecomes\\pASCII
")) s.append(txt) return
8
Challenges
Image Adapting
private RenderedImage scaleImage(RenderedImage
rImg,int x, int y) BufferedImage img new
BufferedImage(x, y, BufferedImage.TYPE_INT_RGB) G
raphics2D g2d (Graphics2D) img.getGraphics() g2
d.setRenderingHint(RenderingHints.KEY_RENDERING,Re
nderingHints.VALUE_RENDER_QUALITY) RenderingHints
.VALUE_ALPHA_INTERPOLATION_QUALITY )
g2d.drawImage((Image)rImg,0,0,x,y,null)
return img
9
Challenges
Cookie maintaining private String
getCookie(HttpURLConnection httpURL) int
i0 String keyValuenullStringBuffer
cookieBuffer new StringBuffer()
do i String key httpURL.getHeaderFieldKey(i
) keyValuehttpURL.getHeaderField(i) Syste
m.out.println(key""keyValue)
if((key!null) key.equalsIgnoreCase("Set-Cookie
")) cookieBuffer.append(keyValue.substring(0,1
keyValue.lastIndexOf(""))) while(keyValue!nu
ll) if(cookieBuffer.length()!0)
System.out.println("cookieBuffer"cookieBuffe
r.toString()) return cookieBuffer.substr
ing(0,cookieBuffer.lastIndexOf(""))
return this.cookie
10
Demos
11
QA Thanks
Write a Comment
User Comments (0)
About PowerShow.com