0
嘿,我有一個android
應用程序,從圖庫中選擇一個圖像,並顯示在一個ImageView
,我想將攝取的圖像上傳到我的ftp server
,我嘗試使用SimpleFtp
庫,但它只是沒有工作,所以我刪除它,我該怎麼辦?上傳圖像通過Android應用程序FTP服務器
這裏是加載圖像的代碼:
public void loadImage(View view)
{
loadedImage = (ImageView)findViewById(R.id.upload_image1);
Drawable drawable = loadedImage.getDrawable();
if(drawable.getConstantState().equals(getResources().getDrawable(R.drawable.camera_icon).getConstantState())) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "SelectPicture"), SELECT_PICTURE);
}
else
{
Intent i = new Intent(this, ShowImage.class);
i.putExtra("uri",selectedImageURI.toString());
startActivity(i);
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == SELECT_PICTURE) {
selectedImageURI = data.getData();
loadedImage = (ImageView)findViewById(R.id.upload_image1);
loadedImage.setScaleType(ImageView.ScaleType.CENTER_CROP);
Glide.with(this).load(selectedImageURI)
.into((ImageView) findViewById(R.id.upload_image1));
}
}
}
「我嘗試使用SimpleFtp庫,但它只是沒有奏效」什麼都不起作用?您是否嘗試調試並找出問題所在? – Egor