Page 1 of 1

filepath to internal storage

Posted: Mon Mar 02, 2020 6:46 am
by orthomaker
Hello,

I have made a soft who parse user text.

I have try it on a Galaxy Tab E tablet , a Samsung J3 phone and android TV. It works well but, I have have some problem to know filepath to user internal storage.

I enter manually "/storage/emulated/0/Lecture". It's work well on Galaxy Tab E and Samsung J3.

First problem :
"/storage/emulated/0/Lecture" is the filepath for Teatcher User (Administrator)

it may be
"/storage/emulated/10/Lecture" for Student (Low level User)

1 - How can livecode know which User is running ?

With Android TV the internal filepath storage may contain "/Mémoire interne" but I don't know to complete filepath.

2 - How do I know the user internal storage path ? (specialfolderPath??)

Re: filepath to internal storage

Posted: Mon Mar 02, 2020 7:50 am
by FourthWorld
orthomaker wrote:
Mon Mar 02, 2020 6:46 am
1 - How can livecode know which User is running ?
Does Android now support a multi-user UI?
2 - How do I know the user internal storage path ? (specialfolderPath??)
Yep.

Re: filepath to internal storage

Posted: Mon Mar 02, 2020 9:24 am
by orthomaker
I work with old Samsung Galaxy Tab E , running android 4.4 and we have 2 users profil (Teatcher and student)

Re: filepath to internal storage

Posted: Mon Mar 02, 2020 1:01 pm
by orthomaker
Is there a keyword for specialFolderPath that refer to user internal storage?
Engine and Documents doesn't work for this ...

Re: filepath to internal storage

Posted: Mon Mar 02, 2020 3:54 pm
by orthomaker
It's work now on a Android TV.
The filepath to user storage is "/mnt/sdcard/Lecture".

Is there a way to know the kind of Android Device where the app is running?

Re: filepath to internal storage

Posted: Mon Mar 02, 2020 5:31 pm
by jacque
The path to the shared file system is specialFolderPath("external documents"). All the other special folder paths are inside the app sandbox.

You might be able to get the user device by getting "the machine".

You will need to find out from the user whether they are a student or a teacher. This is often done by requiring a login, but that means that you must set up a server to recognize the login. Or you could ask the user on first launch and store their role on disk for later access, but that relies on students telling the truth. Or you could create two versions of the app, one for teachers and another for students.

Re: filepath to internal storage

Posted: Mon Mar 02, 2020 10:26 pm
by orthomaker
That's work
Many thanks
:D :D :D