src/org/ohmage/lib/OhmageApi.java
public void uploadMobilityPoints(final String username, 
			final String hashedPassword, final String client, 
			final Collection<MobilityPoint> points) 
			throws ApiException, RequestErrorException {

		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put(InputKeys.USER, username);
		parameters.put(InputKeys.PASSWORD, hashedPassword);
		parameters.put(InputKeys.CLIENT, client);
		
		JSONArray dataArray = new JSONArray();
		for(MobilityPoint point : points) {
			if(point == null) {
				continue;
			}
			
			JSONObject pointJson;
			try {
				pointJson = point.toJson(false, MobilityColumnKey.ALL_COLUMNS);
			}
			catch(JSONException e) {
				throw new ApiException("One of the Mobility points could not be converted to JSON.", e);
			}
			catch(DomainException e) {
				throw new ApiException("One of the Mobility points could not be converted to JSON.", e);
			}
			
			dataArray.put(pointJson);
		}
		parameters.put(InputKeys.DATA, dataArray);
		
		try {
			processJsonResponse(
					makeRequest(
							new URL(url.toString() + RequestBuilder.getInstance().getApiMobilityUpload()), 
							parameters, 
							false), 
					null);
		}
		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);
		}
	}
/**
	 * Uploads a collection of Mobility points.
	 * 
	 * @param username The username of the user who is attempting the upload.
	 * 
	 * @param hashedPassword The user's hashed password.
	 * 
	 * @param client The client value.
	 * 
	 * @param points The collection of points to be uploaded.
	 * 
	 * @throws ApiException Thrown if there is a library error.
	 * 
	 * @throws RequestErrorException Thrown if the server returns an error.
	 */
Uploads a collection of Mobility points.

@param username The username of the user who is attempting the upload.

@param hashedPassword The user's hashed password.

@param client The client value.

@param points The collection of points to be uploaded.

@throws ApiException Thrown if there is a library error.

@throws RequestErrorException Thrown if the server returns an error.
Uploads a collection of Mobility points . @param username The username of the user who is attempting the upload . @param hashedPassword The user ' s hashed password . @param client The client value . @param points The collection of points to be uploaded . @throws ApiException Thrown if there is a library error . @throws RequestErrorException Thrown if the server returns an error .
public void uploadMobilityPoints(final String username, 
			final String hashedPassword, final String client, 
			final Collection<MobilityPoint> points) 
			throws ApiException, RequestErrorException {
		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put(InputKeys.USER, username);
		parameters.put(InputKeys.PASSWORD, hashedPassword);
		parameters.put(InputKeys.CLIENT, client);
		JSONArray dataArray = new JSONArray();
		for(MobilityPoint point : points) {
			if(point == null) {
				continue;
			}
			JSONObject pointJson;
			try {
				pointJson = point.toJson(false, MobilityColumnKey.ALL_COLUMNS);
			}
			catch(JSONException e) {
				throw new ApiException("One of the Mobility points could not be converted to JSON.", e);
			}
			catch(DomainException e) {
				throw new ApiException("One of the Mobility points could not be converted to JSON.", e);
			}
			dataArray.put(pointJson);
		}
		parameters.put(InputKeys.DATA, dataArray);
		try {
			processJsonResponse(
					makeRequest(
							new URL(url.toString() + RequestBuilder.getInstance().getApiMobilityUpload()), 
							parameters, 
							false), 
					null);
		}
		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);
		}
	}
public void uploadMobilityPoints ( final String username , final String hashedPassword , final String client , final Collection < MobilityPoint > points ) throws ApiException , RequestErrorException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( InputKeys . USER , username ) ; parameters . put ( InputKeys . PASSWORD , hashedPassword ) ; parameters . put ( InputKeys . CLIENT , client ) ; JSONArray dataArray = new JSONArray ( ) ; for ( MobilityPoint point : points ) { if ( point == null ) { continue ; } JSONObject pointJson ; try { pointJson = point . toJson ( false , MobilityColumnKey . ALL_COLUMNS ) ; } catch ( JSONException e ) { throw new ApiException ( "One of the Mobility points could not be converted to JSON." , e ) ; } catch ( DomainException e ) { throw new ApiException ( "One of the Mobility points could not be converted to JSON." , e ) ; } dataArray . put ( pointJson ) ; } parameters . put ( InputKeys . DATA , dataArray ) ; try { processJsonResponse ( makeRequest ( new URL ( url . toString ( ) + RequestBuilder . getInstance ( ) . getApiMobilityUpload ( ) ) , parameters , false ) , null ) ; } 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 ) ; } }
Uploads a collection of Mobility points.
Uploads a collection of Mobility points .