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

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -