android api call return simple array
<p>i am calling an api which should return an array of length between 0 to 9. Now i am not understanding how to get that array. for getting simple string other api's 
My code is:are working fine according to this code.</p>

<pre><code>private String test(String url)
{
    String str = null;
    int c;
    try
    {
    URL hp = new URL(url);  //The String hp1 is passed in URL

    URLConnection hpCon = hp.openConnection();  
    hpCon.setUseCaches(false);
    hpCon.setConnectTimeout(10000);
    System.out.println("*url content for: " + url);
    InputStream input=hpCon.getInputStream();
    StringBuffer sb = new StringBuffer();

    while(((c=input.read())!= -1))
    {
        sb.append((char)c);
    }
    str=sb.toString();
    sb = null;
    //System.out.print(str);

    input.close();
    input = null;
    hpCon = null;
    hp = null;
    }
    catch(Exception e)
    {

    }
    return str;  
}
</code></pre>
