Hello
I created an application that manages about audio files, video and other files. I have used several things, including ContentChooser. ContentChooser returns files like "content:// media/external/video/media/1".
I saw on the forum how access the file, basically copying it to another folder. But, I need original name of file, but not how to recover actual path of selected file and it's name.
I've seen on the internet, many sites that indicate how to obtain it with the following code.
Is there any possibility to run this code through reflection or otherwise from B4A?
Perhaps a good solution would be to integrate a method in ContentChooser that returns the original path, not olny URI path. Is posible en next releases?
Thanks in advance
I created an application that manages about audio files, video and other files. I have used several things, including ContentChooser. ContentChooser returns files like "content:// media/external/video/media/1".
I saw on the forum how access the file, basically copying it to another folder. But, I need original name of file, but not how to recover actual path of selected file and it's name.
I've seen on the internet, many sites that indicate how to obtain it with the following code.
B4X:
public String getRealPathFromURI(Uri contentUri)
{ String[] proj = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(contentUri, proj, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
Is there any possibility to run this code through reflection or otherwise from B4A?
Perhaps a good solution would be to integrate a method in ContentChooser that returns the original path, not olny URI path. Is posible en next releases?
Thanks in advance
Last edited: