Back to project page Recipe-Puppy-Android.
The source code is released under:
Apache License
If you think the Android project Recipe-Puppy-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jerin.utilities; /*from w ww . j ava2s . c o m*/ import android.net.Uri; import android.os.Bundle; /** * Class to hold utility methods. * * @author jerin * */ public class Utilities { private static final String URL_SCHEME = "http"; /** * Builder utility method to generate http query * * @param authority * @param path * @param parameters * @return */ public static Uri buildUri(String authority, String path, Bundle parameters) { Uri.Builder builder = new Uri.Builder(); builder.scheme(URL_SCHEME); builder.authority(authority); if (null != path && (path.trim().length() > 0)) { builder.path(path); } if (null != parameters) { for (String key : parameters.keySet()) { Object parameter = parameters.get(key); if (parameter instanceof String) { builder.appendQueryParameter(key, (String) parameter); } } } return builder.build(); } }