Screen with this set of block works fine on companion but on building apk its shows error. Whats the problem?
when exactly do you get the error?
after picking a pdf to display it?
if yes, then how does an example of your file_path look like?
btw. are you aware, that you can get a “nice” screenshot of your blocks?
just right click onto the blocks editor background and select “Download blocks as image”…
no i get error when screen initilizes.
which data base You are using.
i am using google drive to store file whose direct download link is in airtable.
i guess you have to use webview to show pdf online @quteboy4
Actually its trying to open pdf which are already downloaded for google drive. And error is on initilizing screen not on item clicked.
Is your permissions granted?
you can do the following things:
- Initialise your global variable to “create empty list” instead of “empty text”
- Use full path when selecting or directing the path of any file/folder “/mnt/sdcard/folder/file.extension”
- probably here is the problem:
yes permission was not granted.Is this the correct way of asking permission?
You need to ask for “WRITE_EXTERNAL_STORAGE”, after that permission has been granted, you also are able to READ…
the permission must be granted manually by going to setting
Why? can’t we ask user for permission in app?
Android Restriction, depend on android versions.
You can try asking permission from the screen1 block named “Ask for permission” and the validate the permission from the block just above it named “is permission granted”
Of course. See for instructions to get WRITE permission eg here:
and read the Description of Taifun’s File extension:
as Boban said:
… but you have to reload the screen first
@Boban and @bodymindpower gave you some good hints…
but rather than reloading the screen just use the available events correctly…
in this case only if the permission has been granted, then get the filelist etc., which means, just move your blocks into the PemissionGranted event… you can find that event in the Screen drawer…
But the Permission Granted event is not triggert at Screen.Initialize on the first run, so you must reload the screen.
see also my last post here:
With AI2 that works fine, but unfortunately not with Kodular.
In addition, Permission.Granted is not only triggered once, but every time the screen is opened, see here:
this then is a bug and should be added to the bug list by @KodularCreator