Taifun
September 7, 2019, 8:38pm
#2
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”…
Taifun
4 Likes
quteboy4
(Sagar Niroula)
September 8, 2019, 3:38am
#3
no i get error when screen initilizes.
Alapjeet
(Alapjeet Singh)
September 8, 2019, 3:53am
#4
which data base You are using.
quteboy4
(Sagar Niroula)
September 8, 2019, 5:22am
#5
i am using google drive to store file whose direct download link is in airtable.
Alapjeet
(Alapjeet Singh)
September 8, 2019, 6:21am
#6
i guess you have to use webview to show pdf online @quteboy4
quteboy4
(Sagar Niroula)
September 8, 2019, 7:05am
#7
Actually its trying to open pdf which are already downloaded for google drive. And error is on initilizing screen not on item clicked.
Boban
(Boban Stojmenovic)
September 8, 2019, 7:23am
#8
Is your permissions granted?
/Boban
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:
quteboy4
(Sagar Niroula)
September 8, 2019, 7:57am
#10
yes permission was not granted.Is this the correct way of asking permission?
Boban
(Boban Stojmenovic)
September 8, 2019, 8:02am
#11
You need to ask for “WRITE_EXTERNAL_STORAGE”, after that permission has been granted, you also are able to READ…
Note : WRITE_EXTERNAL_STORAGE is sufficient as it implicitly grants READ permission.
So no need to ask for READ permission.
[grafik]
/Boban
the permission must be granted manually by going to setting
quteboy4
(Sagar Niroula)
September 8, 2019, 8:13am
#14
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”
1 Like
No.
Of course. See for instructions to get WRITE permission eg here:
It’s really hard to get it working, because there are several issues with the File component:
Sometimes the full path and sometimes the relative is used (see blocks below)
WRITE permission is not queried automatically (only READ), so you have to ask manually for WRITE permission.
Permission granted is not triggered when the app starts for the first time, so you have to reload the screen.
Moreover: the File component can not access the assets with the APK (works only with companion).
To chec…
and read the Description of Taifun’s File extension:
as Boban said:
… but you have to reload the screen first
1 Like
Taifun
September 8, 2019, 4:10pm
#17
@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…
Taifun
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:
It’s really hard to get it working, because there are several issues with the File component:
Sometimes the full path and sometimes the relative is used (see blocks below)
WRITE permission is not queried automatically (only READ), so you have to ask manually for WRITE permission.
Permission granted is not triggered when the app starts for the first time, so you have to reload the screen.
Moreover: the File component can not access the assets with the APK (works only with companion).
To chec…
1 Like
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:
The “Permission Granted” event triggers again each time the screen is opened, not only for the first time.
This issue is not present on AI2.
[grafik]
permissionLoop.aia (4.4 KB)
loop_x264.mp4 (812.7 KB)
1 Like
Taifun
September 8, 2019, 5:11pm
#20
bodymindpower:
With AI2 that works fine, but unfortunately not with Kudular.
In addition, Permission.Granted is not only triggered once , but every time the screen is opened
this then is a bug and should be added to the bug list by @KodularCreator
Taifun
1 Like