Installation guide
37
password = "123456";
/* Be intelligent, you will understand that the following two statements
* are used for getting values of userName and passWord from two independent
* text in the other activity (which can be used in the login page of the app).
* */
//username = ZRTrafficActivity.userName.getText().toString();
//password = ZRTrafficActivity.passWord.getText().toString();
/* Use the LocationManager class to obtain GPS locations */
mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5*1000, 10, mlocListener);
}
. . . . . .
}
Appendix-3
package com.demo.mobile;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class Hub
*/
public class Hub extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Hub() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// NOTE: to get the value of POINT
String point = request.getParameter("point");
if("location".equalsIgnoreCase(point))