Installation guide

32
AG2417 Web and Mobile GIS
Autumn 2012
Rui Zhu and Gyözö Gidófalvi
Lab 8: Combination of a Dynamic Website and an Android app
Due Oct 8
24. Task
In this lab, you will (1) upload your real time physical GPS coordinates from a smart phone to a
dynamic website; (2) show GPS position on the website by OpenLayers (without using
GeoServer); (3) create WMS to draw geometrics on a web map (also accessible on the mobile);
and (4) do an optionally task based on a web-based tutorial to realize a Web Feature Service
(WFS) such that users could use the function also via a smart phone.
Section 1 Upload Your Coordinates
There is a good web-based Servlet and JSP tutorial that you can refer:
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/.
1.1. Complete Your Android app
Based on the result of Section 3 in Lab 7, now the purpose is sending your current GPS
coordinates (latitude and longitude) to the server side. Firstly, modify class MyLocationListener
as it is shown in Appendix-1. Change the URL strUrl as your current IP addcress and Port (as we
did in the previous lab). Now the whole picture of the code structure is shown in Appendix-2.
1.2. Create a Dynamic Website (JSP) in Eclipse
JSP website is built in three constructed layers: Servlet, JavaBeans, and Database Access. In
Eclipse, click File -> New -> Other -> Web -> Dynamic Web Project -> Next. Fill DynWeb in the
Project name: field, click Next -> Next -> Finish. Now you will see a dynamic website project as
it is shown below in the Project Explorer.
Right click scr -> New -> Package, fill com.demo.mobile in the Name: field, and click Finish.
Right click com.demo.mobile -> New -> Servlet, fill Hub (Servlet) in the Class name: field, click
Next -> Next -> Finish. Modify Hub.java as it is shown in Appendix-3. Right click