Android Question how to share my text1.txt for app2?android:grantUriPermissions="true"

xiaoyao

Active Member
Licensed User
Longtime User
app1 read app2 text file,how to do?
I found some related technical articles and code snippets on the Internet, but I don't know if they can run.
I hope someone with experience can help test it or is there a "class library" component that has been successfully implemented within B4A that can be called?

manifest:
<manifest>
    <application>
        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
    </application>
</manifest>

or use SharedPreferences?

SharedPreferences is a tool used in Android to save lightweight key-value pair data. It can be used to save user preference settings, login information, application configuration and other needs. It is implemented based on XML files, can achieve fast read and write operations, and is suitable for storing some simple data.
 

xiaoyao

Active Member
Licensed User
Longtime User
i found some,try it
[class] FileProvider - share files | B4X Programming Forum
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…