broadcastreceiver - How to display image meta data on toast when clicking Gallery in android using Broadcast Receiver -
i trying develop app display images meta data i.e. imagename
, imagepath
, capturingdate
, size
, extension. want to use broadcast receiver
, whenever open gallery
, click on image shows data in toast
. please can me?
public class cameraeventreceiver extends broadcastreceiver { private uri imageuri; string getimgname, getimgpath; private databasehelper dbhelp; public void onreceive(context context, intent intent) { dbhelp = new databasehelper(context); sqlitedatabase db = dbhelp.getwritabledatabase(); calendar c = calendar.getinstance(); int s = c.get(calendar.second); int m = c.get(calendar.minute); int h = c.get(calendar.hour); int day = c.get(calendar.date); int month = c.get(calendar.month); int year = c.get(calendar.year); intent = new intent(mediastore.action_image_capture); file photo = new file(environment.getexternalstoragedirectory(), "img"+system.currenttimemillis()+".jpg"); intent.putextra(mediastore.extra_output,uri.fromfile(photo)); imageuri = uri.fromfile(photo); getimgname = photo.getname(); getimgpath = photo.getabsolutepath(); string time = integer.tostring(h) + ":" + integer.tostring(m); string date = integer.tostring(day) + "/" + integer.tostring(month) + "/" + integer.tostring(year); db.delete("camera", null, null); contentvalues imagevalues = new contentvalues(); imagevalues.put("imgname", getimgname); imagevalues.put("imgpath", getimgpath); imagevalues.put("imgtime", time); imagevalues.put("imgdate", date); db.insert("camera", null, imagevalues); new actmon().camera = true; toast.maketext(context, getimgname+"\n"+getimgpath, toast.length_long).show(); } }
i have tried code taking picture using android native camera , stored of meta data on database. code working perfectly. trying to click on image , show meta data on toast. question how can access android native gallery using broadcast receiver.
Comments
Post a Comment