I need to add images into res/drawable folder dynamically as the user select images of his choice from a server…then store the corresponding R.drawable.imageid to Database..so as to load the user chosen images on the next run…Is there no way to do so…?
int[] images = {
R.drawable.m1,R.drawable.m2, R.drawable.m3,
R.drawable.m4,R.drawable.m5, R.drawable.m6,
R.drawable.m7, R.drawable.m8,
R.drawable.m9
};
ImageView iv = (ImageView)findViewById(imageViews[next]);
iv.setImageResource(images[j]);
Here R.drawable.m1, R.drawable.m2, R.drawable.m3, R.drawable.m4, R.drawable.m5, R.drawable.m6, R.drawable.m7, R.drawable.m8, R.drawable.m9 should be ids of images chosen by user from the server
Quoting Android Engineer RomainGuy
However you can look for other alternatives like external storage.
Links to consider are
android image save to res/drawable folder
How to convert a Drawable to a Bitmap?
Android: Image save to location