I wanted to know if (and how) you can share files which are stored in tinydb.
Please Watch this Video :
I have to share a file which is saved in the tinydb
can you send the blocks you used?
Taifun
August 15, 2020, 5:05pm
8
you are storing the link to the file in TinyDB...
use Do it to debug your blocks, see also tip 4 here https://puravidaapps.com/learn.php
see also Live Development, Testing, and Debugging Tools
Taifun
Trying to push the limits! Snippets , Tutorials and Extensions from Pura Vida Apps by Taifun.
Convert the TinyDB to file:
guardar_tiny.aia (3.1 KB)
you can also use this extension TinyDBX
Where will the file be stored after converting? in the sd card or android?
Or does it not change?
Anke
August 16, 2020, 5:39am
12
Neither nor. But in the Private directory (→ Internal Storage):
/data/user/0/<packageName>/files/
Btw, what do you mean with "android"?
See also here:
From an Android point of view there are an → Internal Storage and an → External Storage. 1. Internal Storage The Internal Storage can only be accessed with a rooted device. 1.1 The app package is saved in /data/data// 1.2. The Private...
Reading time: 4 mins 🕑
Likes: 97 ❤
The idea of my example was to create the file in "internal storage" and share it.
Works with Companion, but not installed.
Question for @ewpatton , please.
Is it possible to create a file with File component in "program private data directory" and share it?
Anke
August 16, 2020, 11:16am
14
No, even not with the TaifunSharing extension:
The thing is, the files are not in sd card. In fact my device does not even have an sd card. So, all the files are in the internal storage...So, I think the more appropriate question to ask would be, is it possible to share files from the internal storage?
Anke
August 16, 2020, 2:24pm
16
Each device has a virtual SD card (which, from Android's point of view, is an External Storage ).
You are obviously talking about a removable (micro) SD card.
Pleae read this:
From an Android point of view there are an → Internal Storage and an → External Storage. 1. Internal Storage The Internal Storage can only be accessed with a rooted device. 1.1 The app package is saved in /data/data// 1.2. The Private...
Reading time: 4 mins 🕑
Likes: 97 ❤
Taifun
August 17, 2020, 4:25pm
17
the answer is yes
to share a file form the assets first copy it to the internal sdcard and share it from there
Taifun
Trying to push the limits! Snippets , Tutorials and Extensions from Pura Vida Apps by Taifun.
Juan_Antonio:
Question for @ewpatton , please.
Is it possible to create a file with File component in "program private data directory" and share it?
Not at this time, but it seems like something we could (and should) support.
Edit: Filed this as an issue on GitHub:
opened 05:05PM - 17 Aug 20 UTC
help wanted
issue: noted for future Work
status: new
feature request
affects: master
priority: medium
**Describe the desired feature**
When using the Sharing component, allow file… s in the private app data directory to be shared. Currently, the ShareFile method prepends "file://" if the filename doesn't start with that, and tries to load said file. If "foo.txt" is written with the File component, it is written to the app private data directory. If this relative path is given to ShareFile, this attempts to read "file://foo.txt" from /, which fails.
**Give an example of how this feature would be used**
Apps could write files to the private data directory and only make them available to share with other apps when the user elects to share them.
**Why doesn't the current App Inventor system address this use case?**
Attempting to share a file using a relative name fails because it is computed relative to `/`. We can detect if the file name doesn't begin with `/`, which would result in an error anyway, and instead resolve it relative to the app-private data directory.
**Why is this feature beneficial to App Inventor's educational mission?**
One could use this as an opportunity to teach about data access/security and privacy in the context of App Inventor.