B4A Library [B4A] Uri2Tools - Library.

Hi,
I provide the Uri2Tools library version 1.0 (2022.03.22)
The code requires Android 6.0 or 8.1

The library uses the following libraries:
- B4XCollections v1.12
- ContentResolver v1.50
- Core v11.20
- FileProvider v1.0
- SQL v1.50
- Storage v1.0

I would like to thank the authors for providing them :)

Uri2Tools provides information such as:
- Dir (i.e. full path name of the file)
- FileName (i.e. the name of the file)
- FullPath (i.e. the full path name of the file)
- NamePath (i.e. the name of the folder)
- MimeType (i.e. file type "mime_type")
- Modified (ie the date of last modification "last_modified")
- RealName (i.e. the real file name)
- Size (i.e. file size)
- SizeUnit (i.e. file size (example: 32MB))
- Success (i.e. the status of the operation's success (Load ("* / *", "Choose file"))

in addition, it provides information:
- GetSDKversion (i.e. a working version of the SDK on the phone)
- DirRootExternal (i.e. the name of the full path on the device)
- ExtSDCard (i.e. the name of the full path of the external memory)
- OnlyDevice (i.e. checks if the phone has additional external memory)

I hope the library will be a useful programming aid :)
Greetings.

Uri2Tools: Example:
#Region Copyright
    '******************************************************************************
    ' This file is part of the B4A Project - URI2Tools (Library)
    '
    ' "Copyright (c) 2010 - 2021 Anywhere Software , B4A, Registered version 11.20"
    '
    '
    '******************************************************************************
#End Region

#Region  Project Attributes
    #ApplicationLabel: URI2Tools
    #VersionCode: 1
    #VersionName: 1.0
    #LibraryAuthor: T201016
    #LibraryVersion: 1.0
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

    Private FileHandler As URI2Tools
    Private Storage As Uri2Storage

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
End Sub

Sub Activity_Create(FirstTime As Boolean)
    FileHandler.Initialize
    Wait For (FileHandler.Load("*/*","Choose file")) Complete (result As LoadResult)
  
    'result as LoadResult
    MsgboxAsync(result.Dir,"ResultLoad (DIR)")
    MsgboxAsync(result.FileName,"ResultLoad (FILENAME)")
    MsgboxAsync(result.FullPath,"ResultLoad (FULLPATH)")
    MsgboxAsync(result.NamePath,"ResultLoad (NAMEPATH)")
    MsgboxAsync(result.MimeType,"ResultLoad (MIMETYPE)")
    MsgboxAsync(result.Modified,"ResultLoad (MODIFIED)")
    MsgboxAsync(result.RealName,"ResultLoad (REALNAME)")
    MsgboxAsync("Size: " & result.Size & CRLF & "Size Unit: " & result.SizeUnit,"ResultLoad (SIZE)")
    MsgboxAsync(result.Success,"ResultLoad (SUCCESS)")
  
    'result as Storage
    Storage.Initialize
    MsgboxAsync(Storage.GetSDKversion,"GetSDKversion")
    MsgboxAsync(Storage.MapStorage.DirRootExternal,"DirRootExternal")
    MsgboxAsync(Storage.MapStorage.ExtSDCard,"ExtSDCard")
    MsgboxAsync(Storage.MapStorage.OnlyDevice,"OnlyDevice")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

Attachments

  • Uri2Tools v1.0.zip
    24.8 KB · Views: 278
Last edited:

T201016

Active Member
Licensed User
Longtime User
I checked the above library on Android version 6.0 and 8.1 - I'm curious if it works on others :)
 

AnandGupta

Expert
Licensed User
Longtime User
I checked the above library on Android version 6.0 and 8.1 - I'm curious if it works on others :)
That is what I thought to ask, but you already mentioned it.

Actually as per forum posts, we are facing problem in Android version from 10+
Hope someone posts about them.

Even if part of the info is available in these Android version, then also your library is very very helpful. Thanks for taking the effort to make it, where we have accepted our destiny. ?
 

T201016

Active Member
Licensed User
Longtime User
If I have access to higher versions of Android in the future, e.g. 10 - the new version of the library will certainly be here as well. For now, I am missing all information from the environment of these systems.
 

AnandGupta

Expert
Licensed User
Longtime User
If I have access to higher versions of Android in the future, e.g. 10 - the new version of the library will certainly be here as well. For now, I am missing all information from the environment of these systems.
This is the biggest headache of Android developers. No backward compatibility. Broken features. All in name of user data privacy.
 
Top