Problems reading file from EXPANSION FILE

1

I need to read files from an EXPANSION FILE.

In the first Log in which I print expansionFile is working perfectly, ie I was able to read the zip file, but when trying to access the files from inside the zip as it guides the documentation link file returns null

    ZipResourceFile expansionFile = null;

    try {
        expansionFile = APKExpansionSupport.getAPKExpansionZipFile(context,
                2, 1);

    } catch (IOException e) {

        e.printStackTrace();
    }

    Log.d("DEBUG", expansionFile + "expansionFile");

    AssetFileDescriptor fd = expansionFile.getAssetFileDescriptor("enterprise/config.json");
    Log.d("DEBUG", fd + "FILE");

The zip file has the following organization

 /enterprie

     /0

     /config.json

Does anyone know the problem?

    
asked by anonymous 05.09.2014 / 15:12

1 answer

1

I changed this

AssetFileDescriptor fd = expansionFile.getAssetFileDescriptor("enterprise/config.json");

so

InputStream is = expansionFile.getInputStream("enterprise/config.json");

And it worked!

    
08.09.2014 / 16:17