I'm developing a mobile application with React Native. I have to write file to mobile storage and I choose react-native-scoped-storage library to pick directory where user want to write file, but this library return uri (content://...) instead of path. With content uri, I just can write a file has small size so I have to use writeStream method (rn-fetch-blob) or write method (react-native-fs). But both methods that support write stream are not support uri (content://...), it just accept file path to write. Anyone can give me a solution for this?
Thanks in advance!
Oh I try sliding file and write the first part and append the rest. And it works perfectly
Related
I am trying to create an app that will be able to display a pdf file in the app itself. I'm currently using the Xamarin.Bindings.PDFView-Android by SIDOVSKY which works really nicely. I can open a file easily from the assets... what I'm struggling to do is open a file from the internet.
Just a single line of code:
FindViewById<PDFView>(Resource.Id.pdf_view).FromAsset("report.pdf").Show();
Is enough to display a PDF that can be pinched to zoom which is great. However, I now want to access a file stored on the local network. Either using a SMB share, or through the intranet. Whichever way I try I can't figure it out.
There is a .FromFile setting, but I can't get it to work by putting a smb path in here. Is there a way to convert this? Or must I download the file to the local device first?
Thanks
Andrew
I am working on an offline app where I want to open and make changes to an offline document.
I am able to open the file from the android uri path i.e. /data/user/0/com.nativetemplate/files/files/default/documents/3377699720528075#1634821435640
but my requirement is to get the content:// uri path so I can save the changes made on the file.
eg: content://com.google.android.apps.docs.storage/document/acc%3D1%3Bdoc%3Dencoded%3D3ANW16SOSAt4EvkKHsYo_159-fKCSyFbzE4zHcCNeew3N7oDXd0jgvbNFDM%3D
how do I get the content uri?
My requirement can also work if the file is converted into base64. But as I have android uri path I think I would need an API to read the file from the uri.
please provide me with any suggestions you may have.
Thanks
I have a plan reading file tiff in android. Yet, if the file tiff has pages, I can’t find solution. Plesea tell me if you have any idea.
what i have done :
I know that it can read the file tiff with only one page
https://code.google.com/p/tiffonandroid/][1]
try give it a try But I’m not successful and even it happens I can hard know how to use it in android
Splitting a multipage TIFF image into individual images (Java)
You can try my library that allow to choose some decode parameters https://github.com/Beyka/Android-TiffBitmapFactory
I am new to phoneGap. I am creating a dummy app to upload an audio file from iOS/android device on local server. So I was wondering if there is a way to open the audio gallery and select the required audio file to upload. Similar to an image gallery.
Is it possible to open audio list and select necessary audio file? If not, what is the alternative?
As far as I remember, you cannot reach the pictures and audio files stored in the media gallery. Therefore, you may need to implement your own native plugin and call the appropriate methods from your JavaScript code.
You can capture audio/image by using Capture plugin of Phonegap. Check this out Capture Plugin
You can perform basic File operations as well. Check this out File Plugin
For your situation, you have to implement native interface which can be accessed by your JavaScript code. This would be an alternative way for it. If you desire to create your own plugin, please have a look at Plugin Development Guide. This might be helpful.
Well I have implemented code using file plugin which will iterate through all the folders recursively to find all the image (created this as I needed multi selection approach which is not directly provided by cordova) . You can modify the extension of image (search) i.e png,jpeg etc with audio extension.
With this code you will get the path of audio files and you can make use of filetransfer to upload it on server
Hope it helps you
Hi is it possible to open a file in an external program from within rhodes? Open / Viewing a pdf or epub?
Thanks a lot!
Yes it is.
Use System.open_url : you can provide any url with any schema(http,
file etc), depending of platform will be run associated application to
handle this url
System.open_url('http://www.rhomobile.com')
It is also explained here in the Rhodes Documentation and you can find a code sample of how to do it here.
rhodes_path = File.join(Rho::RhoApplication::get_base_app_path(), 'local/path/to/file.pdf')
System.open_url(rhodes_path)