SAF | SAF | Reactive Programming library

 by   fengzhizi715 Java Version: Current License: No License

kandi X-RAY | SAF Summary

kandi X-RAY | SAF Summary

SAF is a Java library typically used in Programming Style, Reactive Programming applications. SAF has no bugs, it has no vulnerabilities, it has build file available and it has low support. You can download it from GitHub.

SAF(Simple Android Framework)最早的定位是一个简单的Android框架,现在它可以为Android App开发提供一系列基础性的组件。这个项目第一次提交到google code是2012年的3月26号,我已经断断续续做了5年多了。. 除了SAF自带的demo app外,魔窗的android demo app也使用了SAF,而且也是开源的.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              SAF has a low active ecosystem.
              It has 297 star(s) with 107 fork(s). There are 31 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 1 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of SAF is current.

            kandi-Quality Quality

              SAF has 0 bugs and 0 code smells.

            kandi-Security Security

              SAF has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              SAF code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              SAF does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              SAF releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              It has 7299 lines of code, 667 functions and 147 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed SAF and discovered the below as its top functions. This is intended to give you an instant insight into SAF implemented functionality, and help decide if they suit your requirements.
            • Register an event bus
            • Dispatch event
            • Dispatches the result of an event
            • Handle an event
            • Get object by key
            • Get byte array
            • Get object from cache
            • Get byte array
            • Compares two strings
            • Compares two numbers
            • Reverses a string array
            • Get phone work name
            • Put object in editor
            • Get an object from preferences
            • Compacts a string
            • Build the URL
            • Get phone carrier
            • Compare two strings
            • Closes database manager
            • Gets the finger printer
            • Configure application
            • Save model
            • Get network generation string
            • Re - reads a model from Parcelable
            • Reads the database attached to the database
            • Upgrade root permission
            • Unregister event bus
            Get all kandi verified functions for this library.

            SAF Key Features

            No Key Features are available at this moment for SAF.

            SAF Examples and Code Snippets

            No Code Snippets are available at this moment for SAF.

            Community Discussions

            QUESTION

            Can Rails search across multiple columns in one query?
            Asked 2022-Apr-03 at 13:34

            I wrote a simple search function that just looks for the value in the "name" field. How can I rewrite it if I want to search more fields at the same time?

            ...

            ANSWER

            Answered 2022-Mar-29 at 15:25

            I understand you want to search across multiple fields in your form. You need to add another field to the form by which you want to search, and you must process the result of the response in the controller action.

            Source https://stackoverflow.com/questions/71664093

            QUESTION

            Flutter: Shared Storage (Storage Access Framework API) Permission for files inside hidden sub-directory not working
            Asked 2022-Mar-07 at 11:43

            How to achieve to listing all files (e.g. Media) inside hidden subdirectory i.e. folder name start with '.' e.g. "(.media)" after using SAF in Flutter/Dart?

            I have used ACTION_OPEN_DOCUMENT_TREE to let the user choose a folder [So to avoid using MANAGE_EXTERNAL_STORAGE] but couldn't view i.e. Read the files inside the hidden subdirectory of the folder.

            Permission Granted folder is media:

            storage/emulated/0/internal storage/Android/media/matrix/.new/

            Issue:

            Not able to list all files inside subfolder .new

            At the same time...

            Able to access files (not folder) inside matrix subfolder

            Also if I rename the subfolder ".new" to new I am able to list all the files inside that folder

            I am using flutter/dart. For Shared Storage Permission, I have used Kotlin custom native code.

            Kotlin Code:

            ...

            ANSWER

            Answered 2022-Mar-07 at 11:43

            Finally I Found a package that can solve SAF issue ! Here is a link Visit

            Source https://stackoverflow.com/questions/70930849

            QUESTION

            What is the MediaStore MIME Type for Directory?
            Asked 2022-Mar-05 at 13:35

            SAF(Storage Access Framework) have the constant DocumentsContract.Document.MIME_TYPE_DIR Which is this string: vnd.android.document/directory as MIME Type for the directory.
            MediaStore have anything like this for directory?

            Below query print corresponding mime type for files and null for directories in Logcat.

            ...

            ANSWER

            Answered 2022-Mar-05 at 13:35

            MediaStore have anything like this for directory?

            No, sorry.

            Is there any alternate way using MediaStore API to determine whether the item is a file or directory ?

            MediaStore only contains what you refer to as files.

            Source https://stackoverflow.com/questions/71360521

            QUESTION

            Saving PDF for sharing using iText with backwards compatibility
            Asked 2022-Feb-10 at 10:29

            A problem with saving a PDF file on Android has been bugging me for weeks, making every Google search I do result in a list of purple links.

            I have attempted numerous approaches, but have only managed to save a PDF file using the built in PDF creator, which does not fulfill my purpose.

            I have a number of questions that I seek an answer to, and hope some of you can help.

            Question 1: Where should you save a PDF file you intend to share and then delete immediately after?

            Q1 a) Is a ContentResolver & ContentProvider required, or is this only when sharing a 'directory' between apps?

            Intuitively it makes most sense for me to save the PDF in the internal cache directory, share it from there and then delete it.

            Question 2: What is the approach for storing files with backwards compatibility?

            From what I have read, different SDK levels require different approaches for file storage, being:

            • <= SDK 28 uses traditional storage methods, which is (using File API)?
            • <= SDK 29 you should request permission for legacy storage, if using external storage
            • >= SDK 30 Android enforces scoped storage

            Using SAF (Storage Access Framework) seems to be the recommended way to store documents like PDFs. However, I don't intend to display a file picker to the user, when they are simply generating and sharing a PDF.

            I am encountering this very generic exception, which occurs when iText closes the output stream. Below are some code examples and their resulting errors.

            SDK 30 File API test

            ...

            ANSWER

            Answered 2022-Feb-10 at 10:29

            You brought up a number of issues. This answer focuses on the actual errors you show.

            The actual errors you show both cause a

            Source https://stackoverflow.com/questions/71058982

            QUESTION

            I Use Storage Access Framework to browse a file link f.cfg, when you select the file, the app need to load another file like f.dat automatically, how?
            Asked 2022-Jan-14 at 23:12

            In Android Studio:

            This app must use COMTRADE files. The COMTRADE files are *.cfg *.dat and *.rio files. For example, (user.cfg, user.dat and user.rio). The main file is *.cfg file, so the user must browse by SAF to find *.cfg files, when the user select this file, the app must load other files ( *.dat and *.rio) automatically.

            I can not use for android level 30

            So I have to use Storage Access Framework, By below code the user browse *.cfg files and select a file like user.cfg

            ...

            ANSWER

            Answered 2022-Jan-14 at 23:12

            Please help me how can I do this?

            You cannot do this, at least by means of using ACTION_OPEN_DOCUMENT, unless you ask the user to open each of your three documents in turn. Just because the user selected a .cfg file does not mean that you have any rights to any other files, including those adjacent to it.

            You could try using ACTION_OPEN_DOCUMENT_TREE and let the user choose the document tree that contains your desired files. From there, you can:

            • Use DocumentFile.fromTreeUri() to get a DocumentFile representing the tree
            • Call listFiles() on that DocumentFile to get the direct contents of that tree, in the form of a list of DocumentFile objects
            • Call getName() on each of those to get their display names, then see which names have your desired file extensions and matching base names (foo.cfg and foo.rio and foo.dat)
            • For those that you want to use, call getUri() on the DocumentFile to get a Uri to use with ContentResolver and openInputStream() to read in the content

            Source https://stackoverflow.com/questions/70717392

            QUESTION

            Starting from Android11, do I need to comply to Android's SAF just to even create a file at public Download location?
            Asked 2021-Dec-06 at 19:38

            I am on Android 11. I just want to be able to create a file in /storage/emulated/0/Download directory on my phone. So, this is the public Download folder that I need to create a file on.

            I don't need access to read/modify/delete other files in /storage/emulated/0/Download. i just want my app to be able to create and replace a file of its own at /storage/emulated/0/Download. Thats it!

            Question:

            • Do I need to go by the Storage Access Framework for this?
            • Do I need any special permission for this?
            • Or is it possible get access to /storage/emulated/0/Documents without going through the hassle of Android SAF?

            My app is able to create a file at /storage/emulated/0/Download using Android 10 but it fails to do that since Android 11.

            My use case is very simple. I just want to create a file at /storage/emulated/0/Download and keep appending more data to the file by replacing it with a new one from time to time.

            Running the following code on Android 11 fails for me:

            ...

            ANSWER

            Answered 2021-Dec-06 at 19:38

            Do I need to go by the Storage Access Framework for this?

            No.

            Do I need any special permission for this?

            No, though you will need WRITE_EXTERNAL_STORAGE for older devices.

            Or is it possible get access to /storage/emulated/0/Documents without going through the hassle of Android SAF?

            Environment.getExternalStoragePublicDirectory() is being undeprecated, so it is safe to use that to access Environment.DIRECTORY_DOWNLOADS. That should give you the same access that you have with MediaStore:

            • You can create files there

            • You can read and write your own files1 there

            • You have no access to other apps' files there

            1 For the purposes of this bullet, "your own" refers to your current app installation — if the user uninstalls and reinstalls your app, files from the old installation of your app are no longer considered to be "your own".

            So, for example, this activity works just fine without any permissions in a targetSdkVersion 31 project:

            Source https://stackoverflow.com/questions/70248631

            QUESTION

            Android 11 - Scoped storage - unable to use java.io.File even after Uri permissions are granted
            Asked 2021-Nov-26 at 06:36

            I'm currently migrating an Android app to Scoped Storage. Moving away from java.io.file is a real nightmare, and feels much of a drawback to me. I'm currently trying to understand if paths returned by getExternalMediaDirs() can effectively be used with direct file paths.

            After asking user to select a given folder

            ...

            ANSWER

            Answered 2021-Nov-26 at 06:36

            Yes, because after granting permissions you have access to Content Scheme Uri of that specific folder not file system paths so you will be unable to list java.io.File objects using this Uri.

            But you can use it to listFiles() which will return you a list of DocumentFile. You can then use these DocumentFile objects to get Uri of that specific file using documentFile.getUri() . Using that Uri you can easily perform basic operations like display,copy,delete,share on that file.

            Below is an example of listing files from a folder of other app.

            I am skiping take permissions part of code assuming that you already have permissions to access that other app's folder

            In this example i am listing files from Android/media/com.whatsapp/WhatsApp/Media/.Statuses

            DOC Ids are

            Source https://stackoverflow.com/questions/70072550

            QUESTION

            takePersistableUriPermission via ACTION_OPEN_DOCUMENT fails when trying to get many documents
            Asked 2021-Nov-18 at 04:55

            For over a week I try to solve weird problem. When i try to get file uri's using SAF and ACTION_OPEN_DOCUMENT and use takePersistableUriPermission() method on them I get SecurityException :

            ...

            ANSWER

            Answered 2021-Nov-17 at 22:16

            On Android 10 and lower, there is a limit of 128 persisted permission grants: https://issuetracker.google.com/issues/149315521

            That limit was raised to 512 for Android 11; I do not know if Android 12 raised it further.

            Source https://stackoverflow.com/questions/70012138

            QUESTION

            Why is DocumentsContract.getTreeDocumentId(uri) giving me the doc ID for a parent of the Uri argument?
            Asked 2021-Nov-16 at 07:11

            The app sends the user to SAF picker with ACTION_OPEN_DOCUMENT_TREE:

            ...

            ANSWER

            Answered 2021-Nov-16 at 07:11

            Uri dirUriParsed = Uri.parse(Uri.decode(result))

            Try:

            Source https://stackoverflow.com/questions/69981553

            QUESTION

            SAF (Storage access network) custom options
            Asked 2021-Oct-19 at 11:11

            I am using the Storage Access Framework (SAF) :

            ...

            ANSWER

            Answered 2021-Oct-19 at 11:11

            where this extras to configure certain SAF options are documented?

            Most are not documented. The few that are will be documented either on ACTION_OPEN_DOCUMENT or will appear as other defined constants on Intent.

            And, as always, using undocumented Intent extras may lead to inconsistent behavior across devices and OS versions, as Google is not considering those extras to be part of a public, supported API.

            Source https://stackoverflow.com/questions/69627870

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install SAF

            You can download it from GitHub.
            You can use SAF like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the SAF component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/fengzhizi715/SAF.git

          • CLI

            gh repo clone fengzhizi715/SAF

          • sshUrl

            git@github.com:fengzhizi715/SAF.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Reactive Programming Libraries

            axios

            by axios

            RxJava

            by ReactiveX

            async

            by caolan

            rxjs

            by ReactiveX

            fetch

            by github

            Try Top Libraries by fengzhizi715

            NetDiscovery

            by fengzhizi715Java

            ProxyPool

            by fengzhizi715Java

            SAF-Kotlin-log

            by fengzhizi715Kotlin

            SAF-AOP

            by fengzhizi715Java

            user-agent-list

            by fengzhizi715Java