Closed rahmatnazali closed 7 years ago
Hi rahmatnazali! I also have same problems. I successfully downloaded file through my app but got corrupted file. If you open file in binary mode you will see that data is scattered - there are empty spaces between data stream. Hope this issue will be handled fast
To @knkpxt and other people having the same issue, I found the workaround! :) This is not an elegant way, but at least this works.
Before moving further, you guys would need to find the address of the camera's IP, which is mCameraIP
variable inside the API. In my case, I made a brand new custom API just to print/log the mCameraIP
, and found that (ofcourse) the IP address is 192.168.42.1
, just like the IP we used to connect to the camera. I tested it for like 20 times and the camera IP address did not change, so I assume that it was a static address.
So after knowing where to download the files, I just use Glide to download the image via android, using the code from here, or like so:
Bitmap theBitmap = Glide.
with(getBaseContext()).
load("http://192.168.42.1/DCIM/100MEDIA/YDXJXXXX.JPG").
asBitmap().
into(100, 100). // Width and height, fill it with (Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) for the original size
get();
you can then able to modify the image or even save it to external storage.
This solution makes me able to continue the project.
I hope this helps :)
Hi all, @knkpxt @rahmatnazali This issue was just fixed.
Hi @Water-bamboo , thanks for answering my issue :)
Super glad to hear you guys are on it. If you guys need another informations from me to provide regarding this issue, please let me know :)
-- Edit: Thanks a million for this fix! :)
Please pull new code from master branch.
@Water-bamboo Thanks! I already downloaded the newest JAR from master branch, if that is what you mean.
Hi! :)
So I have a YI 4k Action Camera. Using YI open API, I'm trying to make Android apps that control the camera, capture a photo, and download the captured photo to an external storage on my device.
All were working well, until I try to download the image captured using
ActionCamera.downloadFile("YDXJXXXX.JPG")
. Here's the detail:DownloadTask.downloadBytes == DownloadTask.totalBytes
Did I make a mistakes here? Please let me know.
Thanks in advance.
P.S. These are the codes to call the
downloadFile()
function, though I'm not sure if this will helps: