Using FilePicker in Xamarin Essentials to Pick PDFs, Images and More!

Поділитися
Вставка
  • Опубліковано 19 гру 2024

КОМЕНТАРІ • 201

  • @jfversluis
    @jfversluis  4 роки тому +4

    With the introduction of FilePicker in Essentials we are going to retire the separate file picker plugin (github.com/jfversluis/FilePicker-Plugin-for-Xamarin-and-Windows/). Thanks everyone for your support on that plugin!

  • @sipepguru
    @sipepguru 4 роки тому +4

    Hello Gerald, you can see from the quick amount of questions, this is a very useful and required API , I am tryiing to get the file paths to upload to a server, however filepath returns "content://com.android.providers.media.documents/document/image%3A27" which is not working, do I need to do a string concate with the file name?

    • @jfversluis
      @jfversluis  4 роки тому +2

      Love it that you are using it already! So, what I think you should do is copy it to a local folder first or just use the stream directly. Have a look at the Essentials sample here where I think they do that: github.com/xamarin/Essentials/blob/main/Samples/Samples/ViewModel/FilePickerViewModel.cs#L100

    • @sipepguru
      @sipepguru 4 роки тому

      @@jfversluis var copyPath = Path.Combine(FileSystem.CacheDirectory, image.FileName); OMG this is the answer I was looking for!!! thank you

    • @jfversluis
      @jfversluis  4 роки тому

      @@sipepguru Woohoo! Glad you figured it out!

    • @Soda-js2vx
      @Soda-js2vx 4 роки тому +1

      Awesome, was having trouble figuring this out, thanks!

    • @jfversluis
      @jfversluis  4 роки тому +1

      @@Soda-js2vx Seems like I should do a follow up video for this :)

  • @aaronlovely7503
    @aaronlovely7503 4 роки тому +1

    This is great and super easy to grab images. That said, I can't seem to find an example of how to get the file path for an image (and WHERE we would execute the code to do so). I'm trying to grab a string file path to install in a sqlite database (which will display the image in a collectionview based on the file path). I can't figure out how to do this, but it seems like it should be a simple matter of grabbing the image path and doing some data binding. Any pointers?? Thank you so much!

    • @jfversluis
      @jfversluis  4 роки тому +1

      I'm not sure if I fully understand what you want to do. But here is one thing to consider: watch out with filepaths. Especially if you're working with images coming from the gallery. For iOS for instance, images might not be on the device but on iCloud and will be downloaded on-the-fly. Having that said; the file path is supplied as part of the picked file, right? So you should be able to work with that?

    • @aaronlovely7503
      @aaronlovely7503 4 роки тому +1

      @@jfversluis Thanks for the response, I'll think on this and see what I can do. To clarify what I meant before: I'm using a SQLite database to store objects that contain textual data as well as an associated image, so I was hoping to use a file path that points to the Android photo gallery rather than convert a photo to a byte array to load into the object. I know that a string point to a web url can be used to load images in a CollectionView, so I was hoping a file path pointing to the phone's image gallery would work the same way

    • @jfversluis
      @jfversluis  4 роки тому

      Gotcha! Understandable but I don’t think recommendable. With all the permissions and differences in permissions on different Android versions and vendor versions and... do I need to go on? 😅

  • @ronaldspinelli1097
    @ronaldspinelli1097 3 роки тому

    Excellent video and good explanation .. a question please may be silly but I am new to xamarin ..... How do I show in the collectionView that the file was added? or that shows an image of the extension of it?

  • @andrewtruckle1695
    @andrewtruckle1695 3 роки тому +1

    Very useful tutorial. Thank you. What I would like to do is populate a Picker with a list of file names (of type XSL) for a specific folder (MacOS). So I don't need a File Picker at this stage but just obtain the list of filenames in folder x and populate Picker. Is this possible? I have other questions but I deal with one at a time. Keep up the great work.

    • @jfversluis
      @jfversluis  3 роки тому +1

      I've noticed the questions! I guess that sure is possible. Be careful with the new permissions models in Catalina. James Montemagno's StreamTimer might have some file I/O in combination with macOS. Shouldn't be different than regular System.IO in .NET

    • @andrewtruckle1695
      @andrewtruckle1695 3 роки тому

      @@jfversluis Yeah - no one seems to like my questions. All downvoted. Oh well! You mention System.IO and I was just about to try that as a method. Doesn't System.IO work with MacOS? My permissions should be OK because they will be /Users/Shared//Styles/.

    • @andrewtruckle1695
      @andrewtruckle1695 3 роки тому

      @@jfversluis Look here: forums.xamarin.com/discussion/140069/how-can-i-get-a-list-of-all-local-files-in-a-directory Seems like I can use System.IO.

    • @andrewtruckle1695
      @andrewtruckle1695 3 роки тому +1

      @@jfversluis Resolved. 😊

  • @moussababaousmail805
    @moussababaousmail805 3 роки тому

    Thank you for the video.
    How can i acces the app folder returned by "Application.Context.GetExternalFilesDir(null).ToStrting()" with FilePicker on Android Device API30

  • @nirmitbhatt7959
    @nirmitbhatt7959 3 роки тому

    Hey Gerald thanks for the video. This was really helpful. I am also trying to get all the audio files in my storage in a list but I am not able to do it with this method. Is there any other way?

  • @generalchannel8833
    @generalchannel8833 2 роки тому

    Great video!! But, please I have a question, why can't I get the actual file path on my system, instead of the actual file path, I get aa.companyname..... etc

    • @jfversluis
      @jfversluis  2 роки тому

      That's how mobile operating systems work. Your app is in a sandbox and is not just allowed to go through your whole filesystem typically :)

  • @faisalmohamed7204
    @faisalmohamed7204 Рік тому

    hi, I am Faisal from yemen,I am programmer in Visual Studio C# and Maui. I work in an application for issuing collection bonds to customers using the Maui application. How can I print that bond using a Bluetooth printer?

  • @TheNewfieSoldier
    @TheNewfieSoldier 3 роки тому +1

    If the feature for "StorageRead" and "StorageWrite" is not supported in the documentation for my UWP app I'm making, is there any other workaround to enable permissions for accessing files on the C: drive?

    • @jfversluis
      @jfversluis  3 роки тому +1

      If you can, you probably want to choose a different location. Have a look at this Docs page for a full explanation: docs.microsoft.com/windows/uwp/files/file-access-permissions

  • @gandolfyoutube1994
    @gandolfyoutube1994 4 роки тому +1

    Hi Gerald, awesome video! I'm tryng to take a pdf instead of an image on Android but i can't show it in the Image box. It works but the image box is empty, how can i visualize it in a pdf viewer?
    Thank you

    • @jfversluis
      @jfversluis  4 роки тому +1

      Thanks for the kind words Luca!
      You can't just show a PDF file in an Image control since it's not an image. So either you will have to open the file, which you can do with the Xamarin.Essentials Launcher for instance (docs.microsoft.com/xamarin/essentials/launcher) or incorporate your own PDF viewer. There aren't many out there, I have a blog post about it here: blog.verslu.is/xamarin/xamarin-forms-xamarin/showing-pdf-files-xamarin-forms/ or use a component like from SyncFusion, I think they have one.
      Hope that helps!

    • @gandolfyoutube1994
      @gandolfyoutube1994 4 роки тому +1

      @@jfversluis Thank you for the answer!! I will check soon and i will let you know! Have a good night!

    • @gandolfyoutube1994
      @gandolfyoutube1994 4 роки тому

      @@jfversluis Sorry for the double answer, but i have another question: if i want to display a .doc/.docx or .xls/.xlsxa or .txt file what object can i use?

    • @jfversluis
      @jfversluis  4 роки тому

      @@gandolfyoutube1994 I think that is even a bit harder than PDF. With SyncFusion you can do it though: www.syncfusion.com/word-framework/xamarin
      Note that SyncFusion has a community license that you can use for free if you're not a big company :)

  • @JohnJohn-fm3dx
    @JohnJohn-fm3dx 4 роки тому +1

    In order to specify per platform file type. Where can i find that? For example in windows I want to pick an exe and in android I want to pick an installed application or at least the apk file. Do i specify that as .exe for UWP and as .apk for android etc etc ? Is there a table or something with that information ?

    • @jfversluis
      @jfversluis  4 роки тому +1

      I’m afraid there is no real list. Not that I know of at least. The iOS built-in ones are here; developer.apple.com/documentation/uniformtypeidentifiers/uttype/system_declared_types
      For Android You could use this to discover the mime type: developer.android.com/reference/android/webkit/MimeTypeMap
      Or here is a (self declared) complete list: www.sitepoint.com/mime-types-complete-list/
      And for Windows you can just use the extension. Details on how to make it platform specific are here: docs.microsoft.com/xamarin/essentials/file-picker?tabs=ios#pick-file

    • @JohnJohn-fm3dx
      @JohnJohn-fm3dx 4 роки тому +1

      @@jfversluis Thank you very much for your quick response. Didn't expect this :)

    • @jfversluis
      @jfversluis  4 роки тому

      Of course! No problem! That’s why I’m here :)

  • @gideonhuyo-a9337
    @gideonhuyo-a9337 3 роки тому

    Thanks for this video Gerald. I would like to ask if there is a way of hiding other files not included on the selected filetype? So if pdf only PDF Files will display on the selection.

    • @jfversluis
      @jfversluis  3 роки тому

      This uses whatever the OS offers so if it doesn’t do that then there is no way to hide it with this plug-in

  • @makatozi
    @makatozi 3 роки тому

    Nice work - really easy to use! It would be handy to be able to initialise the FilePicker with an optional file path so it opens up the dialog at a specific location. Do you know if its possible with the current version or if it could be incorporated into a future release?

    • @jfversluis
      @jfversluis  3 роки тому

      Oh that would be handy! That is not in there now, but might be worth opening an issue for :)

  • @alainweber3716
    @alainweber3716 4 роки тому +1

    Hi, please how do you put files or images in the Android emulator for testing ? The demo works for me but there's nothing to pick in the emulator. thanks

    • @jfversluis
      @jfversluis  4 роки тому

      Did you try simply drag and dropping it on the emulator? ;)

    • @alainweber3716
      @alainweber3716 4 роки тому

      @@jfversluis It works, thank you

  • @shubhamgarg9840
    @shubhamgarg9840 4 роки тому +1

    Hi Gerald, how to store multiple pdfs. Same as you do with multiple images. I mean what will be the list type for pdfs?

    • @jfversluis
      @jfversluis  4 роки тому

      Hey Shubham! You should be able to just do the same with PDFs indeed. I'm not sure what you mean with "list type for PDFs"?

  • @benjones7848
    @benjones7848 3 роки тому

    Have you done a video on being able to drag and drop file like many Mac apps do?

    • @jfversluis
      @jfversluis  3 роки тому

      Specifically for Mac? No. That will definitely involve platform-specific code at this point :)

  • @Gyver4000
    @Gyver4000 3 роки тому

    Hi thank for this videos, is it possible te read a file text with filepicker ?

    • @jfversluis
      @jfversluis  3 роки тому

      You can sure pick one, reading and getting contents should be done after that :)

  • @danielcoryat5741
    @danielcoryat5741 3 роки тому +1

    Excellent tutorial, thanks
    (-_-)
    I have a question about the part of selecting multiple images, if I want to get from each image both the name and stream, how can I send them to the view and how can I work with them in the view?

    • @jfversluis
      @jfversluis  3 роки тому +1

      Thank you! I think you’ll get a collection back with all the selected files, right? So loop through that :)
      Else I’ll need some more details about what you’re trying to do

    • @danielcoryat5741
      @danielcoryat5741 3 роки тому

      @@jfversluis Thanks for the quick response,
      I was able to get the name and path of each image, but I could not pass the information to the view.
      I will try to detail it with code I created in GitHub
      github.com/DanielDanielDanielD/FilePicker-in-Xamarin/blob/main/FilePicker-in-Xamarin

    • @jfversluis
      @jfversluis  3 роки тому +1

      I think if you have a datatemplate in your CollectionView with an Image and set the Source of the image to {binding .} it should show the image actually :)

    • @danielcoryat5741
      @danielcoryat5741 3 роки тому

      @@jfversluis You're right, I did it on the view page and it's work for the image, but I was trying to display in DataTemplate also the name of the image. Anyway I got along with this, Thx

    • @jfversluis
      @jfversluis  3 роки тому +1

      In that case you’ll have to create a custom object that holds that imagesource and a string and then change the template to show a label and image and set the bindings to {binding yourimageproperty} and the same for your text

  • @AldairOH
    @AldairOH 3 роки тому +1

    Is there an explanation about you said of : Not having async void methods ? ... Why not, Thank You !

    • @jfversluis
      @jfversluis  3 роки тому

      You probably want to have a look at this to get a better understanding of all of it: github.com/brminnick/AsyncAwaitBestPractices

  • @devvveloper9931
    @devvveloper9931 3 роки тому

    Thank you very much ♥ ️
    But I want to ask you something
    Is he getting all the data for a picture file

    • @jfversluis
      @jfversluis  3 роки тому +1

      Not sure if I understand what you’re asking, but you get all the bytes of the image so you can do whatever you want with it :)

  • @ravitejasriram4284
    @ravitejasriram4284 4 роки тому

    Hey Gerald, great video. One question, are there any options provided to restrict the file size?

    • @jfversluis
      @jfversluis  4 роки тому

      Thank you Raviteja! I don’t think there is right now. Check to see if there is an issue for it or open one yourself.
      One way to go about it right now is to let the user open the file and then check the file size then. Not ideal in terms of UX maybe, but it’s something :)

  • @tecomunico
    @tecomunico 3 роки тому

    Thank you Gerald. You're the Best. Question: How can i upload the files to server (just the files selected) ?

    • @jfversluis
      @jfversluis  3 роки тому +1

      See answer on the other thread

  • @CosimoDavideViggiano
    @CosimoDavideViggiano 3 роки тому

    Hi mr Gerald, I follow your videos and they are so well made and easy to understand.
    I have a problem with this FilePicker and I don't know why:
    I followed all your instructions in the video but still I get a NullPointerException at the line "var pickResult = await FilePicker.PickAsync(...)". Why this happens? It is because of permissions (but I granted them)? Can you help me?

    • @CosimoDavideViggiano
      @CosimoDavideViggiano 3 роки тому

      Damn I figured out, the NuGet Package need to be initialized in the OnCreate() in the .Droid solution. Ok now it works!

    • @jfversluis
      @jfversluis  3 роки тому +1

      Glad you found it!

  • @jorgeantoniopaisanoherrera3508
    @jorgeantoniopaisanoherrera3508 2 роки тому

    Great example, bro. I still have a doubt, could i use it for .txt files?

  • @udhayg507
    @udhayg507 3 роки тому

    Hi, Hope u r doing good, And i have a question here - i am able to select multiple images on the android platform, but not able to select the multiple image on iOS platform. can u pls add your comments on this

    • @jfversluis
      @jfversluis  3 роки тому

      Should work as far as I know :)

  • @StevenGomezCandanoza
    @StevenGomezCandanoza Рік тому

    Thanks!!
    Have some example to show local Pdf (Pdf viewer)

    • @jfversluis
      @jfversluis  Рік тому

      Yep! Save and Show PDF Files with This Library in Xamarin.Forms
      ua-cam.com/video/FqetV1Lh-9c/v-deo.html

  • @alkabhatnagar9473
    @alkabhatnagar9473 3 роки тому

    Hi Gerald, can you pls. explain how to share PDF files to other Apps.

    • @jfversluis
      @jfversluis  3 роки тому

      Did you have a look at the Share functionality also in Essentials?

  • @raghunaikoti3361
    @raghunaikoti3361 4 роки тому +1

    hi
    Gerald Versluis Thanks for the Vedio Can you please provide the demo for uploading the file using FilePicker....

    • @jfversluis
      @jfversluis  4 роки тому

      Check out this video for uploading it: ua-cam.com/video/KPDGtLeNClQ/v-deo.html

    • @raghunaikoti3361
      @raghunaikoti3361 4 роки тому

      @@jfversluis Hi I need to upload Pdf or any type of file using FilePicker in Android
      can you Please provide it

    • @jfversluis
      @jfversluis  4 роки тому

      If you combine the code from those two videos you should have exactly that

    • @raghunaikoti3361
      @raghunaikoti3361 4 роки тому

      @@jfversluis i have send it through API ... I am new to this Please help me out in File Uploading (PDF)

  • @philippedoumet6073
    @philippedoumet6073 4 роки тому

    Hi, thank you so much for your help! We don't unfortunately usually find good help for Xamarin tutos online.

    • @jfversluis
      @jfversluis  4 роки тому

      Glad I am able to provide some! Which resources do you know of? Maybe I can provide you with some additional ones!

    • @philippedoumet6073
      @philippedoumet6073 4 роки тому

      @@jfversluis I just faced a problem on the OpenReadAsync... can you please help me with it on insta, by mail or by whatsapp?

  • @andrewtruckle1695
    @andrewtruckle1695 3 роки тому

    I have a custom FileType: {DevicePlatform.macOS, new[] {"xsl"} }. Is it possible to drill down further and limit with file title wild card? Eg: Elderly*.xsl?

    • @jfversluis
      @jfversluis  3 роки тому +1

      I don't think so, not 100% sure. The concept is different than on Windows. Here you select filetypes and not so much by a filename pattern. Of course the obvious way around this is to check the incoming filename on the selected file

  • @vikaschoudhary4373
    @vikaschoudhary4373 4 роки тому +1

    how to get file for mail in xamrine form bcz this path content://com.android.providers.media.documents/document/image%3A655 say that does not found filr

    • @jfversluis
      @jfversluis  4 роки тому

      Have a look at this example: github.com/xamarin/Essentials/blob/main/Samples/Samples/ViewModel/FilePickerViewModel.cs#L106
      You have to copy it to a local folder first

  • @shahzadali8349
    @shahzadali8349 3 роки тому

    Hi All,
    Can you please guide me if the user wants to open the "Gallery" Folder rather than the "Recent" folder.?

    • @jfversluis
      @jfversluis  3 роки тому

      I don't think that is something you can specify with this API

  • @madraven37
    @madraven37 3 роки тому

    Is there any way to select only the folder path? I'm developing an app where the user must select a folder first before saving the files.

    • @jfversluis
      @jfversluis  3 роки тому +1

      I don’t think that is in there right now

    • @madraven37
      @madraven37 3 роки тому

      @@jfversluis I hope it'll be included soon.

  • @fernandogoncalves1891
    @fernandogoncalves1891 3 роки тому

    HI Gerald. I want to use FIlePicker to choose an sqlite file to be read. Somwhow Filepicker only appears after I try to open bd. How I force my app to wait until FIlepicker shows? Thanks

    • @jfversluis
      @jfversluis  3 роки тому

      Sorry I don’t understand “after I try to open bd”? Do you mean your code continues executing when you try to pick the file? Are you using await to wait for the filepicker call to finish?

    • @fernandogoncalves1891
      @fernandogoncalves1891 3 роки тому

      @@jfversluis My code does not stop when I call Filepicker . it continues. So when I need the name of the file I don't have. I have this in my code var result = await FilePicker.PickAsync();

  • @mpini83
    @mpini83 3 роки тому

    Hi Gerald, i can't filter sqlite (.db3) files (no MIME associated) so my only option is filter all files; P.S: after calling FilePicker, if i use userDialog.AlertAsync, it doesn't show nothing! I had to call Page DisplayAlert

    • @jfversluis
      @jfversluis  3 роки тому +1

      I think you can still filter on it, but you have to register your own MIME type thing for that

  • @TheISERI
    @TheISERI 4 роки тому +1

    How to pick doc/docx only files?

    • @jfversluis
      @jfversluis  4 роки тому

      You’re able to specify certain extensions and file types as I show in the video :)

  • @colonel666
    @colonel666 4 роки тому

    Hi, can we use Expansion Files in Xamarin or Xamarin.Forms?

    • @jfversluis
      @jfversluis  4 роки тому

      What are expansion files? :)

    • @jfversluis
      @jfversluis  4 роки тому

      It seems you can: applandeo.com/blog/5-steps-using-expansion-files-android-xamarin-forms/
      Didn't hear of this, thanks! I learned something today :)

  • @michaelfelleisen6424
    @michaelfelleisen6424 3 роки тому

    I love how you incorporate your 'subscribe to my channel' message in a fun way in every video! :D I really did not expect this one! Awesome video as always.
    - 'Well, isn't that convenient?..' :D

    • @jfversluis
      @jfversluis  3 роки тому

      Haha thanks! This way I don't have to add the annoying animation in there and try to incorporate some fun at the same time :)

  • @elvinvicente7122
    @elvinvicente7122 3 роки тому

    Hello bro. Its possible open a pdf file using FilePicker from internal storage, i would like a video step to step

    • @jfversluis
      @jfversluis  3 роки тому

      What is not clear from this video? :) I think this should get you a long way there

  • @johanmulder3940
    @johanmulder3940 4 роки тому

    Hi Gerald, awesome video. Just one question , does this also work on Android X. I recently had many problem with AndroidX and Xamarin relating to accessing files other than those in gallery images because of AndroidX latest privacy settings.

    • @jfversluis
      @jfversluis  4 роки тому

      Thanks for the kinda words Johan!
      That is a great question. I must admit I didn’t test that specifically. I will and get back to you. Do you have any more details on the problems you had? Filed any issues or anything somewhere?

    • @johanmulder3940
      @johanmulder3940 4 роки тому

      @@jfversluis Yes , I cross checked my solution with github.com/CrossGeeks/MultipleMediaPickerSample Same thing happened here , on Android 8.1 Simulator the video picker works perfectly, using Android 10 Simulator (same code) then I can't access the full path name. Upgrading to AndroidX made no difference also. So the problem is on AndroidX I can't access the full pathname. I filed an issue in same repo above.

    • @jfversluis
      @jfversluis  4 роки тому

      Ah, so you can’t access the path? Can you access the stream? What I’ve seen happening in the Essentials sample app for the FilePicker is that they copy the file first to a local folder within the app sandbox. Maybe that’s the way to do it? That is also how iOS does it, but there it happens automatically

    • @johanmulder3940
      @johanmulder3940 4 роки тому +1

      @@jfversluis Thanks Gerald. There seems to be a problem In James Montemagno plugin CrossCurrentActivity. The same issue exist in Xamarin.Essentials. I will follow it up in Essentials repo. Thanks for the help anyway , much appreciated.

    • @jfversluis
      @jfversluis  4 роки тому

      Oooh interesting! Make sure to tag me there if needed :) and my pleasure! Hope you’re liking the content and let me know if you need anything else

  • @eddiesonvergara5995
    @eddiesonvergara5995 3 роки тому

    Hi sir Gerald please notice me i got this error "Failed to resolve Xamarin.Essentials.FileResult" if i run the program i researched it and i didnt find please help me

    • @jfversluis
      @jfversluis  3 роки тому

      Make sure you installed the same version of Essentials on all of your projects

  • @andrewtruckle1695
    @andrewtruckle1695 3 роки тому

    Is this correct for XSL files on iOS: {DevicePlatform.iOS, new[] { "com.microsoft.xsl"} } ? I am trying an iPad simulator and when the file picker displays it just says "loading'. At the moment the path is hardcoded to a folder on my Mac so I don't know it that is the problem with it just saying loading?

    • @andrewtruckle1695
      @andrewtruckle1695 3 роки тому

      I changed the path temporarily to literal and removed the file type parameter and now the window displays. I can navigate to my iCloud and see all files. I just can’t work out this custom xsl parameter string. 🤔

    • @andrewtruckle1695
      @andrewtruckle1695 3 роки тому

      Hi Gerald. Update! From my research it seems that Xamarin does not support XSLT transformations anyway. I could be wrong. I have asked on the Xamarin Forum. So I decided to look at the overall design of my app to see if I could do something else that still gives the user some flexibility for styles. I have come up with a WebView and setting the HtmlViewSoiurce. Currently using static HTML text to test. But it uses a pathed CSS file. That is the trick - allowing the user to select a CSS file from a drop-list picker. So I am back to my same question. I kindly ask for advice about how to filter for CSS files. I looked at all the approved file types with Adobe and the have public.html but not one for CSS. 😩

    • @jfversluis
      @jfversluis  3 роки тому +1

      I think you need to register that extension yourself: stackoverflow.com/questions/21937978/what-are-utimportedtypedeclarations-and-utexportedtypedeclarations-used-for-on-i/50993269#50993269

    • @andrewtruckle1695
      @andrewtruckle1695 3 роки тому

      @@jfversluis I did wonder that. I also came across a similar question here: stackoverflow.com/questions/4186401/how-do-i-register-a-custom-filetype-in-ios. But technically I don't want to create my own "file association". CSS is a standard file type as you know and with respects to my app the CSS file is only being used by the WebView component that is displaying the HTML content. This is why I was hoping for a more generic official file type for CSS like there is for HTML. I will investigate this in due course.

    • @jfversluis
      @jfversluis  3 роки тому +1

      I understand that you think that and that’s how Windows works, however this is a different world 😄 iOS (at least) all works with the uttypes and as long as there isn’t one registered, it doesn’t exist. From my quick 1 minute investigation this seems to be needed

  • @WaveForceful
    @WaveForceful 2 роки тому

    How do you pick a file that is stored in the assests folder?.

    • @jfversluis
      @jfversluis  2 роки тому

      Not sure if that is possible tbh, because that lives inside of your app sandbox

    • @WaveForceful
      @WaveForceful 2 роки тому

      @@jfversluis Ah damn. I'm trying to do it for my final year project at college. My app will basically display DFP fiels that i have written myself. It's just to gather data, doesnt need to be fancy.
      I was hoping there was a way to pick files from the assests folder rather than the emulators storage.
      Unless I create these files on the emulator itself

    • @jfversluis
      @jfversluis  2 роки тому

      @@WaveForceful Of course what you could do is copy the file from your assets to the storage in your app startup or something :) but that depends on your requirements of what you're trying to do here

    • @WaveForceful
      @WaveForceful 2 роки тому

      @@jfversluis It's just trying to display the pages to the user really.
      I've basiclaly made a python guide for tutors in onenote and saved them as .pdf files. the mobile app's only job is to display them, it doesnt need to be a technical marvel.
      I've used a flyout app aswell.

  • @arsoftcr1095
    @arsoftcr1095 4 роки тому

    Hello. Extension for word documents??? Android="application/msword" ??? IOS="ms-word" ???

    • @jfversluis
      @jfversluis  4 роки тому

      Here is a list of built-in types for iOS: developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1
      I see the Word one for iOS is com.microsoft.word.doc
      Here is a list of MIME types: www.sitepoint.com/mime-types-complete-list/
      I see the Word one in MIME is application/msword

    • @hesamnamvar7531
      @hesamnamvar7531 4 роки тому +1

      application/vnd.openxmlformats-officedocument.wordprocessingml.document

  • @shreyanshsingh2782
    @shreyanshsingh2782 4 роки тому

    Hii Gerald
    Actually under c-programfiles-x86 Android folder is not getting created while downloading , any idea why it can happen ,means android sdk are not downloading I think

    • @jfversluis
      @jfversluis  4 роки тому

      O no! I'm sorry that is happening to you :( Are you able to create another emulator maybe? You can find how to do that here: docs.microsoft.com/xamarin/android/get-started/installation/android-emulator/device-manager?tabs=macos&pivots=windows or troubleshoot the existing one with this link: docs.microsoft.com/xamarin/android/get-started/installation/android-emulator/troubleshooting?pivots=windows When does this happen exactly?

  • @minhchi1134
    @minhchi1134 3 роки тому

    I do the same to open my excel file but it doesn't work. Can you recommend some solution for this problem ?

    • @jfversluis
      @jfversluis  3 роки тому

      “It doesn’t work” isn’t very specific, that makes it hard to solve :)

    • @minhchi1134
      @minhchi1134 3 роки тому

      @@jfversluis Sorry about that. I tried to open excel file with "{ DevicePlatform.Android, new[] {"application/xlsx"} }" but it doesn't work to me. Can u tell me some solution to open excel file or get the address of excel file in emulator?

    • @jfversluis
      @jfversluis  3 роки тому +1

      @@minhchi1134 what is doesn’t work in this case? It doesn’t show up? Do you see it but is it greyed out?

    • @jfversluis
      @jfversluis  3 роки тому +1

      Also the actual mime type seems to be different: filext.com/faq/office_mime_types.html

    • @minhchi1134
      @minhchi1134 3 роки тому +1

      @@jfversluis thanks for your help, it fixed my problem. It show up but it's greyed out. Your tutorial video is also great , it helps me alot ♥

  • @elvinvicente7122
    @elvinvicente7122 3 роки тому

    Hey bro. thank you for this video. Could you to do a video opening a pdf file, step to step

    • @jfversluis
      @jfversluis  3 роки тому

      Here you go: ua-cam.com/video/FqetV1Lh-9c/v-deo.html

  • @rahulsabu9560
    @rahulsabu9560 2 роки тому

    How to get each file path and each picked file data aray...?

    • @jfversluis
      @jfversluis  2 роки тому

      Loop through the results and get it from the resulting object :)

    • @rahulsabu9560
      @rahulsabu9560 2 роки тому

      Is this the way?
      Picked images on variable,
      Create a list for the path ,
      Then create a foreach loop through the picked image variable ,
      Get it using the results object
      Is this is the method....?

  • @raffimansoor3739
    @raffimansoor3739 4 роки тому

    Hi please tell me how to make app to app VoIP video and audio calls using Xamarin Forms

    • @jfversluis
      @jfversluis  4 роки тому +1

      Hi Raffi! Thanks for your suggestion! I feel like that is a biiiiig topic to cover though :D Do you have any specific service in mind? Because this will need infrastructure on the server-side as well. I'd really like to help you out, but I don't think I can make it happen

    • @raffimansoor3739
      @raffimansoor3739 4 роки тому +1

      @@jfversluis Hi Gerald Thanks for your reply .I am developing one app that needs appa to app call .If you have time please take this topic and do a video for this.still now I don't know how to create App to app call I am searching in google but I don't find a good solution ..if you know any about this please ping me

    • @jfversluis
      @jfversluis  4 роки тому +1

      I was just scrolling over this comment, did you see the Azure Media Services that are announced? Looks like you can do it with that azure.microsoft.com/services/media-services/

    • @raffimansoor3739
      @raffimansoor3739 4 роки тому

      @@jfversluis Thank you very much ..I will check this ...if you have time please make a video about this

    • @raffimansoor3739
      @raffimansoor3739 4 роки тому

      @@jfversluis I have found one solution in www.frozenmountain.com/products-services/icelink/
      but i dont know how to implement this.Please see this if you have time

  • @thielenmeister
    @thielenmeister 4 роки тому

    Any idea when 1.6 will be officially released?

    • @jfversluis
      @jfversluis  4 роки тому

      I don't think they have a very fixed schedule. Seeing from the history releases can come quite quickly, so I would expect in the next couple of weeks

    • @phupham8116
      @phupham8116 4 роки тому

      Can not selects image from photos folder of device on ios?

  • @jsnsoft_official
    @jsnsoft_official 3 роки тому

    Hey Great Video, I am using Media Picker to take photo using camera. I am good with it but somehow it rotates the image.Any fix for that.
    async void ImageButton_Clicked(object sender, EventArgs e)
    {
    IsBusy = true;

    var result = await MediaPicker.CapturePhotoAsync();
    await LoadPhotoAsync(result);
    IsBusy = false;
    }
    async Task LoadPhotoAsync(FileResult photo)
    {
    // canceled
    if (photo == null)
    {
    return;
    }
    var stream = await photo.OpenReadAsync();
    ProfileImage.Source = ImageSource.FromStream(() => stream);

    var content = new MultipartFormDataContent();
    content.Add(new StreamContent(await photo.OpenReadAsync()), "photo", photo.FileName);
    content.Add(new StringContent("1"), "RegID");
    var httpClient = new HttpClient();
    var response = await httpClient.PostAsync("serverURL", content);
    }

    • @jfversluis
      @jfversluis  3 роки тому

      Either rotate the image yourself manually or use the MediaPicker plugin for now which has a method for rotating built-in :)

  • @dreamhunter2895
    @dreamhunter2895 4 роки тому +1

    How to get the full path using filepicker.

    • @jfversluis
      @jfversluis  4 роки тому

      The FileResult has a FullPath property: docs.microsoft.com/dotnet/api/xamarin.essentials.filebase.fullpath?view=xamarin-essentials#Xamarin_Essentials_FileBase_FullPath

  • @gohyingler7980
    @gohyingler7980 4 роки тому

    Hey there, this is a great tutorial!
    I am currently trying to create an android app and wish to have an insert multiple image function.
    However, I have received the following problem when I run the emulator and am currently stuck here:
    The application is in break mode: Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code).
    System.TypeLoadException: 'Could not load type of field 'App5.Views.Image_Sharing.InsertImage+d__2:5__1' (5) due to: Could not resolve type with token 01000078 from typeref (expected class 'Xamarin.Essentials.FileResult' in assembly 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') assembly:Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:Xamarin.Essentials.FileResult member:(null)'

    • @jfversluis
      @jfversluis  4 роки тому +1

      Thank you! Hm this error typically happens when there are different versions of Essentials installed on you shared project and the Android project. Could you double check that?

    • @gohyingler7980
      @gohyingler7980 4 роки тому +1

      @@jfversluis Thank you so much! I went to check and realized that I did not update the essentials under the android project

    • @jfversluis
      @jfversluis  4 роки тому

      Well there you go! Glad I could help 😄

  • @bilalshahbaz3615
    @bilalshahbaz3615 3 роки тому

    sir can you make a video ' upload imeage with sqlite database '

    • @jfversluis
      @jfversluis  3 роки тому

      What do you want to do with the SQLite database?

  • @EdRawrDev5813
    @EdRawrDev5813 4 роки тому +1

    I believe that something supper useful would be how to send that pdf or image to any web service

    • @jfversluis
      @jfversluis  4 роки тому +1

      Did you see my video about uploading files? :)

    • @EdRawrDev5813
      @EdRawrDev5813 4 роки тому

      @@jfversluis oh sir Gerald u always so wise and kind ty I'll check it out

  • @AnimeTrailer2013
    @AnimeTrailer2013 3 роки тому

    Thanks, the issue i faced about attaching file into smtp mailing was fixed by using the code @7:35 mark, ua-cam.com/video/4gV9ZV61rn4/v-deo.html

  • @marthinch
    @marthinch 4 роки тому

    Nice work !

    • @jfversluis
      @jfversluis  4 роки тому

      Thank you Marthin! You have any suggestions for other topics?

    • @marthinch
      @marthinch 4 роки тому +2

      @@jfversluis How to handle api call when navigating a page (best practice).

    • @jfversluis
      @jfversluis  4 роки тому

      @@marthinch So, you mean when you go to a new page and you need to load data from an API?

    • @marthinch
      @marthinch 4 роки тому +1

      @@jfversluisyes, also how to cancel the api call. Cos i dont know the best practice to cancel it on my page if i back to previous page, meanwhile the api call is still processing the request and wait for the result on background thread.

  • @watchaccount
    @watchaccount 4 роки тому

    Why is th FullPath ridiculous and not usable!?

    • @jfversluis
      @jfversluis  4 роки тому

      Why do you think its unusable?

    • @watchaccount
      @watchaccount 4 роки тому

      @@jfversluis its not usable by Java.IO.File

  • @phupham8116
    @phupham8116 4 роки тому

    Ex: the maximum number of selectable files is 5
    I want to set the maximum possible value for it.

    • @SyedAsadUllahTaimoor
      @SyedAsadUllahTaimoor 3 роки тому

      var result = await FilePicker.PickMultipleAsync(new PickOptions
      {
      PickerTitle = "Select file(s)"
      });
      if (result != null)
      {
      List fileList = new List();

      if (Files != null && Files.Count > 0)
      {
      fileList = Files;
      }
      foreach (var file in result)
      {
      fileList.Add(file);
      }
      if (fileList != null && fileList.Count > 5)
      {
      ResponseModel.ErrorMessage = "Please select 5 files";
      ShowPopup = true;
      isError = true;
      }
      else
      fillFiles(fileList);
      }

    • @jfversluis
      @jfversluis  3 роки тому

      Also now check out this plugin ua-cam.com/video/8JvgnlHVyrI/v-deo.html

  • @vikaschoudhary4373
    @vikaschoudhary4373 4 роки тому

    awesome video but not working this method (PickAsync)

    • @jfversluis
      @jfversluis  4 роки тому

      Thank you! What is not working? Do you get any error?

    • @vikaschoudhary4373
      @vikaschoudhary4373 4 роки тому

      ​@@jfversluis after updated xamarine.Essentials 1.6.9 pre than write tha code in my project then not woking PickAsync and PickMultipleAsync method its given error say that does not contain a defination for PickAsync plz help i want to purchase this plugin

    • @vikaschoudhary4373
      @vikaschoudhary4373 4 роки тому

      1.6.0 pre

    • @jfversluis
      @jfversluis  4 роки тому

      Can you find my email on my GitHub profile and send me some more details? What does the code look like and what is the exact error? Then we’ll figure it out :)

    • @vikaschoudhary4373
      @vikaschoudhary4373 4 роки тому

      @@jfversluis var PickResult = await FilePcker.PickAsync(some...) PickAsync is not working.. does not geting ur email

  • @arsoftcr1095
    @arsoftcr1095 4 роки тому

    Awesome!

  • @fazalabbas7407
    @fazalabbas7407 3 роки тому

    helpful

  • @gwisekor
    @gwisekor 4 роки тому

    very thk :)