기본적으로 내가하고 싶은 것은 갤러리에서 이미지를 선택한 다음 동일한 이미지를 내 Cloudin 계정으로 업로드하는 것입니다. Cloudinary의 문서를 본 적이 있지만 작동 방식을 이해하지 못하는 이유는 무엇인지 모릅니다. 그것을 내 코드에서 구현할 수 있습니다.android에서 Cloudinary로 이미지를 업로드하는 방법은 무엇입니까?
upload_image.class ... 여기 가 나는 경우 다른 사람의 정보가 필요 가지고 링크 ... https://github.com/cloudinary/cloudinary_java/tree/master/cloudinary-android
입니다 그리고 이것은 내가 지금까지 무엇을 가지고
public class edit_profile_activity extends AppCompatActivity
{
private static int RESULT_LOAD_IMG = 1;
String imgDecodableString;
public void loadImagefromGallery(View view)
{
Intent galleryIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(galleryIntent, RESULT_LOAD_IMG);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
try
{
if (requestCode == RESULT_LOAD_IMG && resultCode == RESULT_OK && null != data)
{
Uri selectedImage = data.getData();
String[] filePathColumn = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(selectedImage,filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
imgDecodableString = cursor.getString(columnIndex);
cursor.close();
ImageView imgView = (ImageView) findViewById(R.id.circleImageView);
imgView.setImageBitmap(BitmapFactory.decodeFile(imgDecodableString));
} else {
Toast.makeText(this, "You haven't picked Image",Toast.LENGTH_LONG).show();
}
} catch (Exception e)
{
Toast.makeText(this, "Something went wrong", Toast.LENGTH_LONG) .show();
}
}
}
도움이 되겠습니다.
설명서를 읽어 내 doInBackground이 코드를 가지고
그들은 명확하게 언급했다 –
@jitesh mohite 나는 이미 그 코드를 구현하려했지만 작동하지 않는다 : –
어떤 오류가 발생 했나요? –