src/org/ohmage/lib/OhmageApi.java
public List<MobilityPoint> readMobilityPoints(final String authenticationToken, 
			final String username, final String password, final String client,
			final DateTime date) throws ApiException, RequestErrorException {

		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put(InputKeys.USER, username);
		parameters.put(InputKeys.PASSWORD, password);
		parameters.put(InputKeys.AUTH_TOKEN, authenticationToken);
		parameters.put(InputKeys.CLIENT, client);
		
		if(date != null) {
			parameters.put(InputKeys.DATE, DateTimeUtils.getIso8601DateString(date, false));
		}
		
		parameters.put(
			InputKeys.COLUMN_LIST, 
			"mobility:id,mobility:time,mobility:timestamp,mobility:timezone,mobility:location,mobility:subtype,mobility:sensor_data,mobility:mode");
		
		JSONArray response;
		try {
			response = new JSONArray(
					processJsonResponse(
							makeRequest(
									new URL(url.toString() + RequestBuilder.getInstance().getApiMobilityRead()), 
									parameters, 
									false), 
							MobilityReadRequest.JSON_KEY_DATA
						)
				);
		}
		catch(MalformedURLException e) {
			throw new ApiException("The URL was incorrectly created.", e);
		}
		catch(IllegalArgumentException e) {
			throw new ApiException("The response was not proper JSON.", e);
		}
		catch(JSONException e) {
			throw new ApiException("The response body was not proper JSON.", e);
		}
		
		int numResults = response.length();
		List<MobilityPoint> results = new ArrayList<MobilityPoint>(numResults);
		
		for(int i = 0; i < numResults; i++) {
			JSONObject currResult = response.optJSONObject(i);
			
			// All Mobility points from the server are "mode_only", but that is
			// not included in the response. We add it here for the 
			// constructor's benefit.
			/*
			try {
				currResult.put(MobilityColumnKey.SUB_TYPE.toString(false), MobilityPoint.SubType.SENSOR_DATA.toString());
			}
			catch(JSONException e) {
				throw new ApiException("Error adding the subtype to the response.", e);
			}
			*/
			
			try {
				results.add(new MobilityPoint(currResult, MobilityPoint.PrivacyState.PRIVATE));
			}
			catch(DomainException e) {
				throw new ApiException("The server returned an malformed MobilityInformation object.", e);
			}
		}
		
		return results;
	}
/**
	 * Reads Mobility points.
	 * 
	 * @param authenticationToken The authentication token for the user making
	 * 							  the request. This may be null if a username
	 * 							  and password are provided.
	 * 
	 * @param username The username of the user that is making the request. 
	 * 				   This may be null if the authentication token is 
	 * 				   provided.
	 * 
	 * @param password The hashed password of the user that is making the 
	 * 				   request. This may be null if the authentication token is
	 * 				   provided.
	 * 
	 * @param client The client value.
	 * 
	 * @param date The date for which the Mobility points will be gathered.
	 * 
	 * @return A, possibly empty but never null, list of MobilityInformation
	 * 		   objects.
	 * 
	 * @throws ApiException Thrown if there is a library error.
	 * 
	 * @throws RequestErrorException Thrown if the server returns an error.
	 */
Reads Mobility points.

@param authenticationToken The authentication token for the user making
the request. This may be null if a username
and password are provided.

@param username The username of the user that is making the request.
This may be null if the authentication token is
provided.

@param password The hashed password of the user that is making the
request. This may be null if the authentication token is
provided.

@param client The client value.

@param date The date for which the Mobility points will be gathered.

@return A, possibly empty but never null, list of MobilityInformation
objects.

@throws ApiException Thrown if there is a library error.

@throws RequestErrorException Thrown if the server returns an error.
Reads Mobility points . @param authenticationToken The authentication token for the user making the request . This may be null if a username and password are provided . @param username The username of the user that is making the request . This may be null if the authentication token is provided . @param password The hashed password of the user that is making the request . This may be null if the authentication token is provided . @param client The client value . @param date The date for which the Mobility points will be gathered . @return A possibly empty but never null list of MobilityInformation objects . @throws ApiException Thrown if there is a library error . @throws RequestErrorException Thrown if the server returns an error .
public List<MobilityPoint> readMobilityPoints(final String authenticationToken, 
			final String username, final String password, final String client,
			final DateTime date) throws ApiException, RequestErrorException {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put(InputKeys.USER, username);
		parameters.put(InputKeys.PASSWORD, password);
		parameters.put(InputKeys.AUTH_TOKEN, authenticationToken);
		parameters.put(InputKeys.CLIENT, client);
		if(date != null) {
			parameters.put(InputKeys.DATE, DateTimeUtils.getIso8601DateString(date, false));
		}
		parameters.put(
			InputKeys.COLUMN_LIST, 
			"mobility:id,mobility:time,mobility:timestamp,mobility:timezone,mobility:location,mobility:subtype,mobility:sensor_data,mobility:mode");
		JSONArray response;
		try {
			response = new JSONArray(
					processJsonResponse(
							makeRequest(
									new URL(url.toString() + RequestBuilder.getInstance().getApiMobilityRead()), 
									parameters, 
									false), 
							MobilityReadRequest.JSON_KEY_DATA
						)
				);
		}
		catch(MalformedURLException e) {
			throw new ApiException("The URL was incorrectly created.", e);
		}
		catch(IllegalArgumentException e) {
			throw new ApiException("The response was not proper JSON.", e);
		}
		catch(JSONException e) {
			throw new ApiException("The response body was not proper JSON.", e);
		}
		int numResults = response.length();
		List<MobilityPoint> results = new ArrayList<MobilityPoint>(numResults);
		for(int i = 0; i < numResults; i++) {
			JSONObject currResult = response.optJSONObject(i);
			/*
			try {
				currResult.put(MobilityColumnKey.SUB_TYPE.toString(false), MobilityPoint.SubType.SENSOR_DATA.toString());
			}
			catch(JSONException e) {
				throw new ApiException("Error adding the subtype to the response.", e);
			}
			*/
			try {
				results.add(new MobilityPoint(currResult, MobilityPoint.PrivacyState.PRIVATE));
			}
			catch(DomainException e) {
				throw new ApiException("The server returned an malformed MobilityInformation object.", e);
			}
		}
		return results;
	}
public List < MobilityPoint > readMobilityPoints ( final String authenticationToken , final String username , final String password , final String client , final DateTime date ) throws ApiException , RequestErrorException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( InputKeys . USER , username ) ; parameters . put ( InputKeys . PASSWORD , password ) ; parameters . put ( InputKeys . AUTH_TOKEN , authenticationToken ) ; parameters . put ( InputKeys . CLIENT , client ) ; if ( date != null ) { parameters . put ( InputKeys . DATE , DateTimeUtils . getIso8601DateString ( date , false ) ) ; } parameters . put ( InputKeys . COLUMN_LIST , "mobility:id,mobility:time,mobility:timestamp,mobility:timezone,mobility:location,mobility:subtype,mobility:sensor_data,mobility:mode" ) ; JSONArray response ; try { response = new JSONArray ( processJsonResponse ( makeRequest ( new URL ( url . toString ( ) + RequestBuilder . getInstance ( ) . getApiMobilityRead ( ) ) , parameters , false ) , MobilityReadRequest . JSON_KEY_DATA ) ) ; } catch ( MalformedURLException e ) { throw new ApiException ( "The URL was incorrectly created." , e ) ; } catch ( IllegalArgumentException e ) { throw new ApiException ( "The response was not proper JSON." , e ) ; } catch ( JSONException e ) { throw new ApiException ( "The response body was not proper JSON." , e ) ; } int numResults = response . length ( ) ; List < MobilityPoint > results = new ArrayList < MobilityPoint > ( numResults ) ; for ( int i = 0 ; i < numResults ; i ++ ) { JSONObject currResult = response . optJSONObject ( i ) ; /*
			try {
				currResult.put(MobilityColumnKey.SUB_TYPE.toString(false), MobilityPoint.SubType.SENSOR_DATA.toString());
			}
			catch(JSONException e) {
				throw new ApiException("Error adding the subtype to the response.", e);
			}
			*/ try { results . add ( new MobilityPoint ( currResult , MobilityPoint . PrivacyState . PRIVATE ) ) ; } catch ( DomainException e ) { throw new ApiException ( "The server returned an malformed MobilityInformation object." , e ) ; } } return results ; }
Reads Mobility points.
Reads Mobility points .
// All Mobility points from the server are "mode_only", but that is // not included in the response. We add it here for the  // constructor's benefit.