2017년 8월 22일 화요일

About a USB path on Android 4.4 / 5.0 and 6+


I need a help to find the USB path, on Android 4.4 and 5.0 the path is always the same, easy to select, but on Android 6.0 the path always change, how can I use the USB source on Android 6?

--
are you trying to access an external storage via USB?
you might be able to get the path using the file extension and its AvailableStorageDirectories method

--
Yes, I try using a external storage USB, its a Android tv box and use a pendrive. the TaifunFile can locate the randon USB on Android 6?

--
you might want to try it... let us know, if it works

--
I try to work with the AvailableStorageDirectories but its not find the path.

The project show a error, just a )  on the path.

How can I use the block? This is a correct?
I dont find examples on google :(


--
update, I suspected the ) on filename, and make some tests to remove the parentheses in path name.

Now the parentheses dont show and I think the path is correct, because now I can see the name of the first video.

But its show the filename without extension, example, I have the A.mp4 and the app show only the A, and say something about cant play the video.

For the first test I use Android 4.4 and  5.0, and works like a charm, the player on Android 6.0 is a different?
Or a blocks error?


--
I make test with the textbox and a buttom to see the path:
--
it seems to be, you are not familiar with working with lists?
the AvailableStorageDirectories method will return a list
what about selecting the first item using the select list item block?

however if there is only one item available in the list, you only have an internal sdcard on the device... 
so you could just use the generic path file:///mnt/sdcard/yourDirectory/yourFilename.mp4

--
I'm understanding the list blocks better, but I need to read an external flash drive.
I'll keep trying, I believe I should continue to use the "available storage directories" block because it is the only way to read the external flash drive in android 6.0.

--
what exactly does the method return?
use Do it to find it out
--
Hi Taifun, I make some tests.
I post some results in few days.

--
after some tests on 
I finally understood what was happening.
This block give all the sources path on device, as the name itself says. 

I put the textblock to start working from there.

Its show this:

/storage/82C3-E96C/
/storage/emulated/0/

The first path is external flash drive SERIAL NUMBER, and second is internal memory.

If i put the first path on any test, video or image, the blocks works, but only for this flash drive, because the SERIAL NUMBER changes for each flash drive.

I belive I need a variable to copy the path and paste on my blocks:
I search the way how to copy the external path, because the "availablestoragedirectories" show this: "/storage/82C3-E96C/ /storage/emulated/0/"
and I need only the first 19 letters.

--

댓글 1개:

  1. If you need your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (no matter why you broke up) you got to watch this video
    right away...

    (VIDEO) Win your ex back with TEXT messages?

    답글삭제