android - 在 google images JSON android 上上传图像

标签 android json jsoup

我想知道是否可以在不使用任何 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/

相关文章:

ios - 如何在 Swift 4 中将 Encodable 或 Decodable 作为参数传递?

javascript - 如何将 JSON 保存到本地文本文件

java - 使用 JSOUP 获取多个同名类

java - 无法使用 JSoup 获取页面的完整内容

android - 以编程方式更改后如何设置布局常量的背景颜色?

java - HttpDelete 参数与 setEntity 在 android 上?

php - MYSQL : Selecting from Multiple Databases (an error occured)

java - 通过 Jsoup 将提取的元素显示到 JTable

android - "Clear User Data"机器人

安卓:抓取语音