Problem while opening Asset File with the help of Content Provider

前端 未结 1 1383
误落风尘
误落风尘 2021-01-12 11:16

My requirement is to open one app\'s Asset file from another app via content provider.(I am exposing that file with ContentProvider implementation)

I am able to open

相关标签:
1条回答
  • 2021-01-12 12:11

    Android tries to compress all assets, unless it's useless, like for *.mp3 files. I don't know if there is a complete list of filetypes that don't get compressed, but you should be fine if you just rename your files to .mp3 (the decision to compress or not is only based on the extension)

    A little google search revealed:

    http://osdir.com/ml/android-ndk/2010-04/msg00086.html

    If you have sufficient control over the build process, you can use the "-0" flag with zip or aapt to add the assets.

    -0  specifies an additional extension for which such files will not
        be stored compressed in the .apk.  An empty string means to not
        compress any files at all.
    

    aapt is located in your

    android-sdk\platforms\android-VERSION\tools

    directory

    from the link cited above:

    static const char* kNoCompressExt[] = {
    ".jpg", ".jpeg", ".png", ".gif",
    ".wav", ".mp2", ".mp3", ".ogg", ".aac",
    ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",
    ".rtttl", ".imy", ".xmf", ".mp4", ".m4a",
    ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",
    ".amr", ".awb", ".wma", ".wmv"
    };
    
    0 讨论(0)
提交回复
热议问题