1
私はHttpComponentsを使用してポート8080上の特定のサーバーに接続する必要があるアンドロイドクライアントを作成する必要があります。 今のところ私が見つけたのはApache-サイトに接続するポートを除いて、私が必要とするものにほぼ完全です。HttpComponents - 別のポートに接続する
if (isSet)
{
throw new IOException("Hostname or Port are not set!");
}
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(serverURL + ":" + serverPort + "/maps");
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
if (entity != null)
{
InputStream instream = entity.getContent();
int l;
byte[] tmp = new byte[2048];
while ((l = instream.read(tmp)) != -1)
{
}
}
ポートを変更する方法はありますか? ご協力いただければ幸いです。