2017년 4월 15일 토요일

Where have all the files Gone - Part II (fetching files withing .apk package)


Jose or anyone, I meant this as a follow-up to my Where Have all the Files Gone thread, but it looks like it got closed (Completed).   

I watched your video about sharing files, and wanted to use a button to share a file, such that a filemanager or whatever would open it.   Basically

⦁ When BUTTON1 Click.
⦁  Call SHARING1 .Sharefile
   File =  Text "flename.extention"    (or get VARIABLE (with filename in it))   

But when I click the button, it says it cannot find my file, which I uploaded into Designer and built the .apk with that in mind. 

So, either the .apk does not build with my filename.extention, or it is called something different or in a different path ("asset") ?   Can you help me on this aspect ?    (It is not an image nor a sound file, and I verifiied my filename is correct in the code.  And in this case, it is NOT a file I want to read/write from/to, just a file that need opening or sharing or accessing by another application like a filemanager.)   

--
PS:  I found another thread up here on the forum with a related question, through Error 2001 about file not found.     I hope the answer in that thread is not true.   There are many reasons for allowing an .apk file program to access files uploaded through the .apk file.       See here: Sharing a sound (mp3 file) in ai2 app inventor

If the ultimit answer is that one cannot share files stored in the .apk package (which were uploaded to Designer before building the .apk) then my next question is, is it possible to have the .apk-provided program open and save the files to file://somewhere/...   meaning opening it as a binary and saving it to actual file location file://...    ?   

--  
the Sharing component can only share files stored on the sdcard of the device, but not from the assets of the app

for images, you could store temporarily on the sdcard, you can use a canvas for that 
then send the image from the location on the sdcard

PS: you still can add something to a completed thread, this only means, the question is answered... just try it...
--
 Can you help me on this aspect ?    (It is not an image nor a sound file
for other file types, an alternative could be to download these files on first run of the app from the internet


--
Thank you Taifun.  It does look like webprefetch may be the way to go.    

--

댓글 없음:

댓글 쓰기