[ad_1]
I am constructing a Customized Management (a Gallery Image Picker)
mainly making an attempt to re-make a this : Microsoft.Maui.Media.MediaPicker.PickPhotoAsync()
however i did not discover anyway to retrieve consumer photos on MAUI ..
on Xamarin.Android i used this code :
var uriExternal = MediaStore.Pictures.Media.ExternalContentUri;
string[] projection = { (MediaStore.Pictures.Media.InterfaceConsts.Id),
(MediaStore.Pictures.Media.InterfaceConsts.DateAdded),
(MediaStore.Pictures.Media.InterfaceConsts.RelativePath) };
var cursor = Android.App.Utility.Context.ContentResolver.Question(uriExternal, projection, null, null, MediaStore.Pictures.Media.InterfaceConsts.DateAdded);
if (cursor != null) {
int columnIndexID = cursor.GetColumnIndexOrThrow(MediaStore.Pictures.Media.InterfaceConsts.Id);
int RelativePathID = cursor.GetColumnIndexOrThrow(MediaStore.Pictures.Media.InterfaceConsts.RelativePath);
whereas (cursor.MoveToNext()) {
lengthy imageId = cursor.GetLong(columnIndexID);
string rPath = cursor.GetString(RelativePathID);
//Get the Image's URI
Android.Web.Uri uriImage = Android.Web.Uri.WithAppendedPath(uriExternal, "" + imageId);
...
}
}
with this Code, given the required permissions, i might get the exterior path of all photos of an Android telephone to then use them in my PicturePicking customized management ..
==> how am i able to do that in Microsoft MAUI !! (concentrating on Android & IOS)
(simply to be clear, in fact i do know that i might simply use MediaPicker’s [PickPhotoAsync] operate, however i clearly don’t desire that, it is not an possibility)
Thanks prematurely for any assist !
[ad_2]
