gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 02:03:57 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com