android 怎样给自己写的函数添加一个参数和返回值 方便其他人调用?

写了一个函数 是访问网络的 贴出来 想给自己的函数加一个参数 就是这个请求用的参数input ,和一个返回值就是response.toString();请问要怎么改啊,求指点。。 代码如下

String input = "32&num=00298";

public void urlCon() {

    try {
        URL url = new URL(PATH + input);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setConnectTimeout(5000);
        connection.setReadTimeout(8000);
        connection.setRequestMethod("GET");
        connection.setUseCaches(false);
        connection.setDoOutput(true);
        connection.setDoInput(true);
        OutputStream outputStream = connection.getOutputStream();
        outputStream.flush();
        connection.getResponseCode();

        InputStream in = connection.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
      StringBuilder response = null;
            response  =  new StringBuilder();
        String line;
        while ((line = reader.readLine()) != null) {
            response.append(line);
        }
        System.out.println(response);
        Log.i("返回的数据是 ", response.toString());

    } catch (MalformedURLException e1) {
        e1.printStackTrace();
    } catch (ProtocolException e1) {
        e1.printStackTrace();
    } catch (IOException e1) {
        e1.printStackTrace();

    }

}

public String urlCon(String input) {

try {
    URL url = new URL(PATH + input);
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    connection.setConnectTimeout(5000);
    connection.setReadTimeout(8000);
    connection.setRequestMethod("GET");
    connection.setUseCaches(false);
    connection.setDoOutput(true);
    connection.setDoInput(true);
    OutputStream outputStream = connection.getOutputStream();
    outputStream.flush();
    connection.getResponseCode();

    InputStream in = connection.getInputStream();
    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
  StringBuilder response = null;
        response  =  new StringBuilder();
    String line;
    while ((line = reader.readLine()) != null) {
        response.append(line);
    }
    System.out.println(response);
    Log.i("返回的数据是 ", response.toString());
            return response.toString();

} catch (MalformedURLException e1) {
    e1.printStackTrace();
} catch (ProtocolException e1) {
    e1.printStackTrace();
} catch (IOException e1) {
    e1.printStackTrace();

}

}

public String urlCon(String input) {
try {
URL url = new URL(PATH + input);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setConnectTimeout(5000);
connection.setReadTimeout(8000);
connection.setRequestMethod("GET");
connection.setUseCaches(false);
connection.setDoOutput(true);
connection.setDoInput(true);
OutputStream outputStream = connection.getOutputStream();
outputStream.flush();
connection.getResponseCode();

InputStream in = connection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));

StringBuilder response = null;
response = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
response.append(line);
}
System.out.println(response);
Log.i("返回的数据是 ", response.toString());
return response.toString();

} catch (MalformedURLException e1) {
e1.printStackTrace();
} catch (ProtocolException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();

}

}

public Object function(int a, String b)//Object 可以换成其他类型,作为返回值类型; a,b是参数
{
...
...
return 返回值;
}

InputStream is = null;
try {

// 定义获取文件内容的URL
URL myURL = new URL("http://xxxxx/xxxx?aaa=AAA&bbb=BBB");
// 打开URL链接

URLConnection ucon = myURL.openConnection();

// 使用InputStream,从URLConnection读取数据

is = ucon.getInputStream();

int size=is.available();
byte[] buf=new byte[size];
is.read(buf);
is.close();
String outStr=new String(buf,"utf-8");
System.out.println(outStr);
} catch (Exception e) {

e.printStackTrace();
} finally {
try {
if(is!=null){ is.close(); }
} catch (Exception e2) {}
}