How to get the path of a file that already exists in android? -
i have photo called barbara.bmp in internal memory, inside dcim folder, want path file pass argument function not know how it
thanks in advance
the code of method follow:
public class mainactivity extends appcompatactivity { file photo; string photopath; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final textview texto=(textview)findviewbyid(r.id.textview); final button button = (button) findviewbyid(r.id.button); button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { // code here executes on main thread after user presses button photo=environment.getexternalstoragepublicdirectory(environment.directory_dcim); photopath=photo.getabsolutepath(); myndk myndk = new myndk(); string[] arguments = new string[]{"-c","-qt","1","-i",photopath}; texto.settext(myndk.compresion(arguments)); } }); } }
Comments
Post a Comment