Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Iterator;
import java.util.Map;

import android.util.Log;

public class Main {
    /**
     * Utility method for building up URL param string.
     * 
     * @param params
     * @return URL parameter string
     */
    private static String buildParamString(Map<String, String> params) {
        StringBuffer paramBuf = new StringBuffer();
        if (params != null && params.size() > 0) {
            paramBuf.append('?');
            Iterator<Map.Entry<String, String>> iter = params.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry<String, String> param = (Map.Entry<String, String>) iter.next();
                paramBuf.append(param.getKey() + "=" + param.getValue());
                if (iter.hasNext()) {
                    paramBuf.append('&');
                }
            }
        }
        Log.i("PARAM STRING CHECK", paramBuf.toString());
        return paramBuf.toString();
    }
}