1
Es Problem hier ist, wenn die Post Bitmap in Schnur durch Volley wird es mit kleiner Auflösung sehr kleines Bild posten, obwohl ich 100 Qualität für SetPost sehr kleines Bitmap mit kleiner Auflösung
private void takeImage() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
selectedImage = data.getData();
photo = (Bitmap) data.getExtras().get("data");
String[] filepath = {MediaStore.Images.Media.DATA};
Cursor cursor = getContentResolver().query(selectedImage, filepath, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filepath[0]);
picturePath = cursor.getColumnName(columnIndex);
cursor.close();
Bitmap photo = (Bitmap) data.getExtras().get("data");
imageView = (ImageView) findViewById(R.id.tokenImage);
imageView.setImageBitmap(photo);
}
}
......
ByteArrayOutputStream bao = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.JPEG, 100, bao);
byte[] by = bao.toByteArray();
bitmap1 = Base64.encodeToString(by, Base64.DEFAULT);
======= ===========================================
Das ist schrecklich, Sie sollten keine Dateien über Volley senden. es ist NICHT dafür gebaut – thepoosh
@thepoosh werfen Sie einen Blick https://www.simplifiedcoding.net/android-volley-tutorial-to-upload-image-to-server/ – majed
Ich schlage vor, stark zu lesen Dokumente für diese Bibliothek 'Volley ist nicht geeignet für große Download- oder Streaming-Operationen, da Volley alle Antworten während des Parsens im Speicher hält. Verwenden Sie für große Downloadvorgänge eine Alternative wie den DownloadManager. Http://developer.android.com/training/volley/index.html – thepoosh