android - Static reference to images file in my Database -
let's want create database static references images included in android app. if use drawable folder, ids dynamic , can't use static reference them.
since want use 1 column of database resource suggestion icons in app, using drawables files not simple...
if want it, in folder should put .png files? , in database, url should save each entry?
it's pretty simple use in normal drawable folders , write in db string/text.
the resources
object have few methods deal it:
getidentifier(...)
use integer id of drawable, example:
context.getresources().getidentifier("icon", "drawable", context.getpackagename());
and getresourceentryname(...)
use string name of drawable, example:
context.getresourceentryname(r.drawable.icon);
Comments
Post a Comment