Hello, everyone!
I hope you guys are feeling awesome and healthy today.
I recently tried to develop an app using Kodular, the Fenix version, but I faced a problem.
I am unable to share a file (PDF) using the Sharing component.
Below are the steps I have taken
Using the extension from Taifun (File) and the Sharing component
In this video below, I tried to share the PDF file using the Companion, it successfully copied the PDF from Assets to the internal storage, plus, the share dialogue also successfully appears and thus allows the user to share the PDF.
After that, I exported the app as APK and tried the same way. It results copying the file successfully to the internal storage but the sharing dialogue does not appear. Please watch the video below.
How do I make it right?
Any help would be truly appreciated.
Thank you very much!
Hello Aditya!
Thank you very much for the information, truly appreciate it.
But the problem is not about the information you have provided.
My problem is about the Sharing component, I think it does not matter what the file format is, whatever it is, it is only be able to copy to the internal storage but unable to share it (share dialogue is ot showing), please refer to my first post above and the videos for details.
I successfully share the file with Companion but not with the exported app, I think I have successfully defined the path by that but somehow the app is unable to show the dialogue of sharing component nor sharing the file.
But I will try your solution soon, I will post the result too.
I have changed the value of the Sharing component’s block as below
I, then, tried the APK I exported in my phone, please refer to the video below for the outcome.
The outcome shows that it successfully copy the file from assets to internal storage, but again, the Sharing dialogue is not appearing, thus I am unable to share the file.
I am trying to save an xlsx file in my app’s private directory (ASD).
According to the kodular documentation of the savefile component it says: if the file starts with / (slash) it can be saved in sdcard/myfile.txt but if it doesn’t start with / (slash) the file can be saved in the private folder (ASD).
the problem is that if I save my file with /myfile.txt the file is saved in (ASD) and if I save it without / (slash) is lost I don’t even know where it is saved and therefore the sharing component is not working for me.
the component savefile is doing everything backwards, the test was performed on android 11.
otherwise if I save the file with / (slash) now if it is saved in the private directory (ASD), but the sharing component does not work for me giving the path file:///storage/emulated/0/Android/data/com.myapp/files/myfile.txt for example.
I did another test on adroid 8.0 and the savefile component works fine as the documentation says, but the sharing component still doesn’t work there.
If the filename does not start with a slash, it will be written in the programs private data directory where it will not be accessible to other programs on the phone
To store it in the ASD use an extension, for example
maybe the solution for now is to add taifun’s share extension, but I’m in a challenge of not using too many extensions and instead trying to use native kodular components.
another test in this test the file is generated in the specific directory, here it seems that everything is correct but it does not show the dialog box to share.