Packaging Android resource files within a distributable Jar file

后端 未结 9 2282
自闭症患者
自闭症患者 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条回答
  •  Happy的楠姐
    2020-11-28 18:58

    If you are using Eclipse, go to project "Properties->Java Build Path". Under tab "Source", add the res folder you want to pack (e.g. res/raw).

    It will add the following line into the .classpath file

    After building done, the new jar file will contain the files in res/raw/ folder. You can access them as user558185 suggested.

提交回复
热议问题