Android 및 java의 초보자입니다. AsyncTask를 사용하여 서버에서 이미지를로드하려고합니다. 이미지의 크기는 약 50kb입니다. 그러나 나타나기까지 몇 초가 걸립니다. 다음 코드는 서버에서 이미지를 다운로드하는 데 사용됩니다.서버에서 이미지로드 속도를 높이는 방법 - Android
public static Bitmap getBitmapFromURL(String src) {
try {
URL url = new URL(src);
HttpURLConnection connection = (HttpURLConnection) url
.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
BufferedInputStream bis = new BufferedInputStream(input);
Bitmap myBitmap = BitmapFactory.decodeStream(bis);
return myBitmap;
} catch (IOException e) {
e.printStackTrace();
return null;
}
누군가이 프로세스의 속도를 높일 수있는 방법을 알려주십시오. 이 프로세스가 네트워크 속도와 별도로하는 요인은 무엇입니까?
미리 감사드립니다.