Skip to content

jarondl/android-zipfileprovider

Repository files navigation

android-zipfileprovider

An android library that allows direct read access to files stored in a compressed zip, via a content provider. It uses ZipResourceFile from Google Play's APK Expansion Zip Library, and actually replaces APEZProvider from the same library. Contrary to APEZProvider, this library allows access to compressed files, and works with arbitrary zip files (not just apk expansion files).

How to use

To use the library, you need to extend the class by implementing two methods:

package com.example.MyPackage;

import net.jarondl.zipfileprovider.ZipFileProvider;


public class MyNewProvider extends ZipFileProvider {
    @Override
    public String getAuthority(){
        return "your_authority";
    }
    @Override
    public String ZipPath(){
        return the_zip_file_path.zip;
    }

}

And you need to add the authority to your manifest:

    <provider android:authorities="com.example.MyPackage"
     android:name=".MyPackage"
     android:exported="true"></provider>

Then any app that can access content providers can read your files using a content://" + AUTHORITY + FILE_PATH uri.

Implementation exmple

The motivation for this library was OxygenGuide. You can see the complete implementation on this branch, specifically notice the manifest and OxygenProvider.java

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages