AbsolutePath - Get Absolute Path From URI. Using AI2 FilePicker.

AbsolutePath
Converts content URIs provided by a File Picker (AI2 Component) into absolute paths.

GIF_20250125_043041_320

I made this function for another function I made that needed absolute paths.


GetAbsolutePathFromUri


Update v1.0.1 Mar 01, 2025.

You can now get the path from the SD card.



You can't get the paths from other locations, only from these two locations at the moment.


Update v1.0.1 Mar 01, 2025.

aiaProject:
PathFromUri.aia (9.9 KB)

Extension:
joejsanz.joedevabsolutepath.aix (7.8 KB)


minSdk: 21
maxSdk: 34
JDK: 11

Created with Fast. v2.4.2
fast-cli


Thanks.

Github

5 Likes

Much needed standalone function. :slight_smile: Should be in AI2 by default.

3 Likes

Thanks a lot Tim
I think the same.

2 Likes

This works well if you select a file from emulated/0 but it doesn't works if you select a file from sd card...

Yes, I have fixed that in the new version but I haven't published it yet because I found other bugs.

When creating the APK it doesn't get the path to some documents.

:question:

Android 5 (SDK 21):

I think I made a mistake when putting the minSdk: 26. I copied it from other documentation I made so as not to write so much and I didn't notice that, I'm going to review the code because I think it is minSdk: 21.

Update v1.0.1 Mar 01, 2025.

E.g. on a Huawei P20:

1 Like

I'll take a look at it tonight, why doesn't my device get any error when I try all the files I have?

I didn't try it in Companion.

Or maybe your file is different from the ones I have?

APK works fine. The issue is only with Companion.

1 Like

Thanks Anke, I'll check it out on companion.

Doesn't it work?

Try it and tell me.

  • I don't use SAF, but it works on the same routes as your extension...

Try it as apk.

I tried your extension and it's good.

No, SAFLight doesn't work when picking a file from a removable SDcard, neither with Companion nor with the APK.

1 Like