Create library for Android development?

后端 未结 3 1384
暖寄归人
暖寄归人 2021-01-01 05:21

I\'m pretty new to Android development, but I have some experience with Java and Eclipse. I\'m looking for ways to create re-usable libraries (controls, helpers, \"standard

3条回答
  •  無奈伤痛
    2021-01-01 05:58

    Thanx for your solution. From what I understand, you still can not access the resources private to the library from within the libary code. So assume your library has a string resource named "my_lib_resource" under res/values in the library. You bundle this in the jar along with the source code. Can you access this resource from the library source code using something like:

    int id = res.getIdentifier("com.example.mylib:string/my_lib_resource",null,null) 
    

    assuming your library package name is com.example.mylib.

    For me this does not work.

提交回复
热议问题