일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- Google Map
- 버전 업그레이드
- #YOLO #darknet # cuda #gpu
- 지도
- virtualenv
- bazel
- ubuntu
- Android Studio
- yolo mark
- Python
- googlemp
- YOLO
- 이미지인식
- 자신만의
- CUDA
- 안드로이드 스튜디오
- GPU
- deep learning
- 안드로이드
- cudnn
- 현재위치
- opencv
- API
- tensorflow
- 이미지 인식
- Android
- Today
- Total
Be happy
안드로이드 스튜디오로 웹서버로 전송하기 본문
private void getImage1() {
String id = editTextId.getText().toString().trim();
class GetImage1 extends AsyncTask<String, Void, Bitmap> {
ProgressDialog loading;
@Override
protected void onPreExecute() {
super.onPreExecute();
loading = ProgressDialog.show(Book.this, "Uploading...", null, true, true);
}
@Override
protected void onPostExecute(Bitmap b) {
super.onPostExecute(b);
loading.dismiss();
imageView1.setImageBitmap(b);
}
@Override
protected Bitmap doInBackground(String... params) {
String id = params[0];
String add1 = "url 주소";
URL url1 = null;
Bitmap image1 = null;
try {
url1 = new URL(add1);
image1 = BitmapFactory.decodeStream(url1.openConnection().getInputStream());
PublicValues.Book_bitmap1 = image1;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return image1;
}
}
GetImage1 gi1 = new GetImage1();
gi1.execute(id);
}
우선, db에 저장할 이미지를 이미지를 불러옵니다.
그리고 AsyncTask 기능을 사용하여
add1 = php 주소로 저장하고,
원래쓰실 image를 텍스트형태로 바꿉니다
image1 = BitmapFactory.decodeStream(url1.openConnection().getInputStream());
그리고 그 텍스트화된이미지를 php에 같이 보냅니다.
http://prettymen.tistory.com/37?category=753669
'Fish in my hands (2018.3~2018.6) > 안드로이드 스튜디오' 카테고리의 다른 글
안드로이드 스튜디오에서 웹서버에서 보낸 이미지 받기 (0) | 2018.06.22 |
---|---|
Yolo mobile사용하기 (0) | 2018.06.12 |
ubuntu에 android studio 설치하기 (0) | 2018.05.28 |