Thanks for the video Gerald! Are these preferences hidden away from other apps? E.g. If I use a file manager, would I be able to say, navigate to the file where the preferences are saved, open it up in a text editor, and view the preference contents? Or are other apps unable to access and view these preferences?
@@jfversluis I don't really understand how this can be done. I have 3 windows: Registration, Login and Calculator. On the first launch of the application, the Registration page opens with the fields: username and password; and the register button. On the second launch, the Login page should already appear. In this case, how can the saved data be transferred from the Registration page to the Login page?
Hey! Thanks for this video, probably exactly what I am looking for. But I am wondering if there is a better way for my problem. I want to build an app that has a list of questions with dropdown menus behind them that show values from 1 to 5. Now I want my users to be able to answer these questions and close the app after that and continue at a later time. My idea is to store these values for every question in the preferences and load them at the beginning. Is this a good way to solve this, or are there better ways? Thank you for your help!
Glad that you liked it! If it's just a handful of questions with simple types as answers then I guess the preferences are definitely enough. There is no one right way of doing things, if this works for you at the moment, then thats great and it is a good solution! Whenever you have new requirements, go look for something a bit more advanced :)
What do you want to know? I think that uses the same thing because that is the old plug-in this is based on. That means; you also can’t iterate over that
I want to save user data & settings to the cloud, with possibly to edit them. Can I use Firebase database or would Firestore be better? Can you make a video about it?
I have this running on maui and working but am Trying to build unit tests in an Xunit project and running into "This functionality is not implemented in the portable version of this assembly." Does anyone know how to either mock Preferences or just get it to work in unit test?
@@jfversluis I love how responsive you are. I commend your commitment. Ive tried mocking it using FakeItEasy mocking framework by stating if its called then give a specific return but it still throughs the referencing error.
@@jfversluis as a side note. Ive seen your maui unit testing video where you setup the project correctly but you should do a video creating some tests. Ive looked around and for Maui or Xamarin theres not a lot of quality out there.
Thanks this really helped me a lot.. As a newbie im also confused about UI design in Xamarin Forms, Confusion 1. (sorry if this is a bad question) Q1. In flutter we could use media query statement to get device's screen width and height and store it in some var and then design our ui according to that value or we had percentage system. Can i use percentages in Xamarin Forms? For example can i use 20% as width in Box view instead of like 200 px. Q2. Do we really need to get screen width or height for responsive ui? Confusion2: I know there is an api for getting device info in Xamarin Essential but dont know how to implement it in my app since i could not understand the docs. Can you elaborate this api in one of your upcoming vid? Just checked your vid on device display info and worked for me thanks im sorry if i am asking too much. Thank you again this vid was really helpful.
Glad to see it was helpful! There are no bad questions, so don't worry! :) Q1: that kind of depends on what you're doing and how. As far as I know we don't have something like the media query you mentioned. There might be something like that when you're using CSS (yes, you can use CSS!). Anyway, with a Grid for instance you can make relative rows and columns with percentages or use the FlexLayout to make it wrap to your needs. There are a lot of resources here: www.google.com/search?q=xamarin.forms+responsive+design Q2: that depends on how you want to solve it. But you certainly can! :) Device Info. Absolutely! I think I can do that this week or maybe next! Anything specific you are looking for?
@@jfversluis thank you for your response. That Css thing was new to me and since I have a little background with css that really broaden my options! Thanks you.
@@jfversluis I got this working. It has helped a lot. My problem now is that I have to use TabbedPage and not TabView because TabView does not work on MacOS. Whilst I have access to the settings the user selected on page 1 I do not have access to the underlying "data" that page 1 model loaded up from xml.
The automatic intellises created private const variables at the top of my xaml page: private const string PrefNumberMonths = "NumberMonths";. Nothing wrong with that but it means I have to replicate these same keys in the other pages that also use the preferences. Is there a better solution? 🧐
Ah gotcha! Then you probably don't want to use custom renderers but render the tabview entirely. Have a look at this: github.com/jsuarezruiz/Xamarin.Forms.TabView
@@jfversluis thank you I have two questions and I am sorry if I bothering you 1- how I can add a corner radius to it? 2- how I can add the effect of the circle in the selected one?
You're never bothering me. Don't worry :) Unfortunately I don't know the answers to that. I haven't really implemented it yet myself. But I think there is a lot possible with that control. How about you find out and let me know? ;)
Hi Gerald! Great video! I have two questions: Is it possible to share the preferences stored on my device with another device? Like, using a Share button. For example, I configure some setting to make a connection to a web service and I have a bunch of phones that need this exact configuration. The second question is: Is there any way to transition from Dictionaries to Preferences, without user interaction? Thanks a lot for your help.!
@@jfversluis thanks Gerald. How about exporting the preferences to another phone? Let’s say for example, I have some connection settings on my iPhone and I want to share said settings to an android phone. Is that possible? Do you have some kind of example? I have searched all over the web with no luck. Thanks!
@@amigoSeiya I mean, the preferences are nothing more than any other piece of data you send or receive to and from a server :) serialize to json, save on your server and when requested on another phone Android or iOS or something else, serialize to json, get it in the phone, deserialize and save as preferences.
@@jfversluis sorry, sometimes I’m really bad at explaining things haha. I want to share the preferences locally. Let’s say for example using Airdrop or even WhatsApp, no server involved 😃
Thanks straight to the point, worked without any hassle.
Boom! That's the way it's supposed to be! Thanks for letting me know!
Just what I was looking for Thanks!
Perfect! Glad to be of service!
Thanks for the video Gerald!
Are these preferences hidden away from other apps? E.g. If I use a file manager, would I be able to say, navigate to the file where the preferences are saved, open it up in a text editor, and view the preference contents?
Or are other apps unable to access and view these preferences?
Very helpful channel, definitely subbed
Awesome, thank you!
can i send this data to another page?
Absolutely why not?
@@jfversluis I don't really understand how this can be done. I have 3 windows: Registration, Login and Calculator. On the first launch of the application, the Registration page opens with the fields: username and password; and the register button. On the second launch, the Login page should already appear. In this case, how can the saved data be transferred from the Registration page to the Login page?
Thank you. Every video has helped me a lot.😊
That’s great! Thank you!
Hiii, can you save an array of strings??
Preferably not. This is only for simple types. Anything else you can still convert to a string but performance will probably be horrible
good video! i'm wondering if i can use this in xamarin.android project only??
You can definitely use this without Forms as well :)
Hey! Thanks for this video, probably exactly what I am looking for.
But I am wondering if there is a better way for my problem. I want to build an app that has a list of questions with dropdown menus behind them that show values from 1 to 5. Now I want my users to be able to answer these questions and close the app after that and continue at a later time. My idea is to store these values for every question in the preferences and load them at the beginning. Is this a good way to solve this, or are there better ways?
Thank you for your help!
Glad that you liked it!
If it's just a handful of questions with simple types as answers then I guess the preferences are definitely enough. There is no one right way of doing things, if this works for you at the moment, then thats great and it is a good solution! Whenever you have new requirements, go look for something a bit more advanced :)
how to loop through all the preferences or any other method to do that
I don't think there is a way to do that right now
@@jfversluis what about Setting plugin
What do you want to know? I think that uses the same thing because that is the old plug-in this is based on. That means; you also can’t iterate over that
great tutorial
many thanks
I want to save user data & settings to the cloud, with possibly to edit them. Can I use Firebase database or would Firestore be better? Can you make a video about it?
You definitely can! Whether Firebase database or Firestore is better depends on your requirements :)
I have this running on maui and working but am Trying to build unit tests in an Xunit project and running into "This functionality is not implemented in the portable version of this assembly." Does anyone know how to either mock Preferences or just get it to work in unit test?
You’ll probably want to wrap it in some kind of service and mock it
@@jfversluis I love how responsive you are. I commend your commitment. Ive tried mocking it using FakeItEasy mocking framework by stating if its called then give a specific return but it still throughs the referencing error.
@@jfversluis as a side note. Ive seen your maui unit testing video where you setup the project correctly but you should do a video creating some tests. Ive looked around and for Maui or Xamarin theres not a lot of quality out there.
Can this also be used for login session or are there other options?
Then you probably want to look into the secure storage :)
Thanks this really helped me a lot..
As a newbie im also confused about UI design in Xamarin Forms,
Confusion 1.
(sorry if this is a bad question)
Q1. In flutter we could use media query statement to get device's screen width and height and store it in some var and then design our ui according to that value or we had percentage system.
Can i use percentages in Xamarin Forms? For example can i use 20% as width in Box view instead of like 200 px.
Q2. Do we really need to get screen width or height for responsive ui?
Confusion2:
I know there is an api for getting device info in Xamarin Essential but dont know how to implement it in my app since i could not understand the docs.
Can you elaborate this api in one of your upcoming vid?
Just checked your vid on device display info and worked for me thanks
im sorry if i am asking too much.
Thank you again this vid was really helpful.
Glad to see it was helpful! There are no bad questions, so don't worry! :)
Q1: that kind of depends on what you're doing and how. As far as I know we don't have something like the media query you mentioned. There might be something like that when you're using CSS (yes, you can use CSS!). Anyway, with a Grid for instance you can make relative rows and columns with percentages or use the FlexLayout to make it wrap to your needs. There are a lot of resources here: www.google.com/search?q=xamarin.forms+responsive+design
Q2: that depends on how you want to solve it. But you certainly can! :)
Device Info. Absolutely! I think I can do that this week or maybe next! Anything specific you are looking for?
@@jfversluis thank you for your response.
That Css thing was new to me and since I have a little background with css that really broaden my options!
Thanks you.
@@alisaleem2381 Awesome! Let me know how it goes :)
Great video bro! well explained, thank you so much.
Thank you! 😄
What a neat feature. Just what I needed! 😊 Is it worth covering the "binding" approach to the preferences via xaml too? Thanks! 👍
Shouldn’t be different than to binding anything else
@@jfversluis I got this working. It has helped a lot. My problem now is that I have to use TabbedPage and not TabView because TabView does not work on MacOS. Whilst I have access to the settings the user selected on page 1 I do not have access to the underlying "data" that page 1 model loaded up from xml.
Resolved the issue with accessing model data from different pages. I followed your MessagingCenter tutorial. Ever so helpful. Awesome! :)
The automatic intellises created private const variables at the top of my xaml page: private const string PrefNumberMonths = "NumberMonths";. Nothing wrong with that but it means I have to replicate these same keys in the other pages that also use the preferences. Is there a better solution? 🧐
Place them somewhere else and not make them private? :D IntelliSense is just suggesting, not the law
thanks for that
can you share with us a custom renderer of tab view
What do you want to do with the tabs?
@@jfversluis thank you for your replay I appreciate
i just need to do the same design with xamarin forms for ios and android like this
ibb.co/nm2x7B5
Ah gotcha! Then you probably don't want to use custom renderers but render the tabview entirely. Have a look at this: github.com/jsuarezruiz/Xamarin.Forms.TabView
@@jfversluis thank you I have two questions and I am sorry if I bothering you
1- how I can add a corner radius to it?
2- how I can add the effect of the circle in the selected one?
You're never bothering me. Don't worry :)
Unfortunately I don't know the answers to that. I haven't really implemented it yet myself. But I think there is a lot possible with that control. How about you find out and let me know? ;)
Hi Gerald! Great video! I have two questions: Is it possible to share the preferences stored on my device with another device? Like, using a Share button. For example, I configure some setting to make a connection to a web service and I have a bunch of phones that need this exact configuration. The second question is: Is there any way to transition from Dictionaries to Preferences, without user interaction? Thanks a lot for your help.!
Sure :) I am showing this with a UI, but you can do all of this programmatically without any user interaction
@@jfversluis thanks Gerald. How about exporting the preferences to another phone? Let’s say for example, I have some connection settings on my iPhone and I want to share said settings to an android phone. Is that possible? Do you have some kind of example? I have searched all over the web with no luck. Thanks!
@@amigoSeiya I mean, the preferences are nothing more than any other piece of data you send or receive to and from a server :) serialize to json, save on your server and when requested on another phone Android or iOS or something else, serialize to json, get it in the phone, deserialize and save as preferences.
@@jfversluis sorry, sometimes I’m really bad at explaining things haha. I want to share the preferences locally. Let’s say for example using Airdrop or even WhatsApp, no server involved 😃
Aah gotcha! No worries :) I guess you could. Not sure if that would be the best user experience though
Great feature. Nice explanation. Is there a size limit to store (kb)?
I don’t think so, but it’s not the fastest way to store data so I would keep it small and simple, else look at other solutions
How to save DatePickers/TimePickers data??Pls help me.
What do you want to save from it?
sir for me app is crashing if I (Preferences.Get) in the comment then it working sir
That can be because of a lot of reasons. So it’s kind of hard to say something useful about it. It should work :)
@@jfversluis ok sir.
@@jfversluissir sorry my code is wrongly redirecting. your code is working
Glad you figured it out!
thank you bro for this...
Hope it helps you!
Please Please sir make a tutorial on in-app update in app center .
I must admit I never used that myself! But I will look into it :)
@@jfversluis ok just confirm me that in-app update is possible or not with app center?
@@AMIRKHAN-dm2fm It is definitely possible! See: docs.microsoft.com/appcenter/distribution/inappupdates
Thanks for this video :-)
You’re very welcome Salim!
thanks thaks thaks!!!!!!!!!