Android about set Image on the List -
i have little trouble android. have data in database(phpadmin) , data type varchar(20). content of data "r.drawable.imagename". how should data database? , if data,how should put data array(the type of array integer). because want set image on list. graph: (database)────>(get data)────>(put list) tks ur help. p.s. sorry english not well.except u can understand want ask.
since mentioned "phpadmin" (phpmyadmin?), i'm assuming you're using mysql database on server somewhere instead of local sqlite database on android device (which recommend).
as far know, mysql support in android sdk limited or non-existent, have create small php/perl/... wrapper around mysql database , have return data json or xml consumed android application.
as loading resources, suggest store drawable identifier image_name
opposed r.drawable.image_name
. way, can following id of needed resource , store in array of integers:
int resource_id = getresources().getidentifier("image_name", "drawable", getpackagename());
after that, it's matter of using adapter load images specified identifiers list.
let me know if need clear up.
Comments
Post a Comment