Packaging Android resource files within a distributable Jar file

后端 未结 9 2278
自闭症患者
自闭症患者 2020-11-28 18:26

I am working on some reusable Android code that I would like to distribute to other developers for use within their own applications. The code has some resource dependencies

9条回答
  •  -上瘾入骨i
    2020-11-28 19:10

    I just found that the aapt tool in the Android SDK allows the following option:

       --non-constant-id
           Make the resources ID non constant. This is required to make an R java class
           that does not contain the final value but is used to make reusable compiled
           libraries that need to access resources.
    

    This sounds promising, though I have not tried this so I haven't a clue if it works. I suspect this is to get around the problem addressed by @J.J.Kim's post above.

提交回复
热议问题