안드로이드 개발 질문/답변
(글 수 45,052)
Flickr를 사용하여 사진을 업로드하는게 목표입니다. 인증에서부터 막히네요. 코드는 다음과 같습니다.
마지막 로그를 찍는데 아무것도 출력이 안되고 에러를 발생시킵니다.
exception : protocol not found.
어디가 잘 못된건지 알 수 있을까요? 아님 exception을 좀 더 구체적으로 볼 수 있는 방법이라도 좀 알려주시면 감사하겠습니다.
public void HttpFileUpload(String urlString, String params, String fileName) {
try {
String mySecrityKey = MD5.getMd5Hash("xxxxxxxxxxxxxxapi_key010dd3274af7ef8485ab0d3059861c24methodflickr.auth.getFullTokenmini_token968-420-834");
Log.d("Test", "MD5 : " + mySecrityKey);
URL AuthConnectUrl = new URL("http://flickr.auth.getFullToken");
HttpURLConnection authConn = (HttpURLConnection)AuthConnectUrl.openConnection();
authConn.setRequestProperty("api_key","010dd3274af7ef8485ab0d3059861c24");
authConn.setRequestProperty("mini_token", "968-420-834");
authConn.setRequestProperty("api_sig", mySecrityKey);
// get response
int ch2;
InputStream is2 = authConn.getInputStream();
StringBuffer b2 = new StringBuffer();
while( ( ch2 = is2.read() ) != -1 ){
b2.append( (char)ch2 );
}
Log.e("Test", "Auth result = " + b2.toString() + "authConn : " + authConn);
} catch (Exception e) {
e.printStackTrace();
Log.d("Test", "exception " + e.getMessage());
// TODO: handle exception
}
}