Professional Documents
Culture Documents
calculator;
import
import
import
import
import
import
import
import
import
import
import
android.content.Intent;
android.graphics.Bitmap;
android.graphics.BitmapFactory;
android.net.Uri;
android.provider.MediaStore;
android.support.v7.app.AppCompatActivity;
android.os.Bundle;
android.util.Base64;
android.view.View;
android.widget.Button;
android.widget.Toast;
import
import
import
import
import
import
import
import
import
import
com.android.volley.AuthFailureError;
com.android.volley.Request;
com.android.volley.RequestQueue;
com.android.volley.Response;
com.android.volley.VolleyError;
com.android.volley.toolbox.StringRequest;
com.android.volley.toolbox.Volley;
com.google.android.gms.appindexing.Action;
com.google.android.gms.appindexing.AppIndex;
com.google.android.gms.common.api.GoogleApiClient;
import
import
import
import
java.io.ByteArrayOutputStream;
java.net.URL;
java.util.HashMap;
java.util.Map;
}
});
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data
) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 100 && resultCode == RESULT_OK) {
Bitmap bm = data.getParcelableExtra("data");
}
}
public String getStringImage(Bitmap bmp) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.JPEG,50,baos);
byte[] imageBytes=baos.toByteArray();