我想知道是否可以在不使用任何 Google API 的情况下在 Android 中使用 JSON 或 JSOUP 将图像上传到“search by image”页面。提前致谢
最佳答案
Yes it is possible to convert an image in Base64 string and send to server using Json or any other way.
e.g.
Bitmap bitmap=BitmapFactory.decodeResource(getResources(),R.drawable.facebook);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 70, stream); byte[] byteArray = stream.toByteArray();
String encodedImage = Base64.encodeToString(byteArray,Base64.DEFAULT);
关于android - 在 google images JSON android 上上传图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31042353/