//넘겨주는 url인데 한글을 넘겨줄때 인코딩을 해서 넘겨줘야 한다는것!
String url_str = "http://map.naver.com/local/search.nhn?query=";
String searchName = URLEncoder.encode("부산 남구 감만2동 경명중국관");
try {
InputStream inputStream = new URL(url_str+searchName).openStream();
InputStreamReader isr = new InputStreamReader(inputStream, "UTF-8");
BufferedReader br = new BufferedReader(isr);
File file = new File("/mnt/sdcard/url.txt");
OutputStream out = new FileOutputStream(file);
writeFile(br, out);
out.close();
}
catch (Exception e) {
}
finally {
Toast.makeText(parsingtest.this, "저장완료", Toast.LENGTH_SHORT).show();
}
//AndroidManifest.xml에 권한 추가하기
<!-- 외부메모리에 저장할때 작성 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />