Want to learn more about SQLite? Check out this video on how to implement the CRUD actions: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-8_cqUvriwM8.html Or maybe you want to learn how to encrypt your database as well, that's in this video right here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-O1UQfoh4710.html
James Montemagno didn't cover this topic but you did. Thanks a lot. It would take me days or even weeks to figure out this very tricky Microsoft path issue.
Thanks Gerald i follow you in the social network, i've tried to do implement many option and searching many solution but up to i was view exactly this video gave me the solution how i can to embebbed the data base, without using dba command because i would have many steps to get permission in my device but now don't need anymore that. Thanks for shared your knowledge you are very kind!
Gerald, Like your video and style. However, I'm having difficulty converting to a.NET Maui. I can get my code to find an existing SQLite db (MAUI Asset) located in the Project folder and it is connected and displays data in a Collection View for the Windows project. However, the problem is with the Android project. I can't find a good resource for where to place the existing sqlite db ,eg. "Resources"... and how to set the properties. A .NET Maui sample for existing sqlite db's would be a great assist for the devs, jumping into the Maui pool :) Thanks in advance.
I'm one of those who commented on your .Net Maui SQLite video and asked whether you could do this - I literally found this video about 10 minutes after posting the comment! So thank you - this is great! One thing is bothering me though. Does this actually make a second copy of the database on the target device? It feels like the dB is going to get downloaded to the target in wherever it's placed (in the root in the caseof this example), and then copied to the working target directory. Is that actually what happens or is there some sort of weird virtual mapping going on? My dB is 500K and it feels extravagant to have two copies of it! Thanks again - and I think the "EmbeddedResource" build option is what fixed this for me. I had seen someone else saying it should be "MauiAsset", but I just couldn't get that to work
Hello Gerald. Thank you so much for this educational channel, I really learned a lot from you. My question relative to this video, how to replace mock address data in a class with data coming from sqlite
Thanks for this. You said the Main constructor isn't the right place to put that code, could you tell us where is? Also anything you can point me towards for the "TODO Only do this when app first runs" please?
It kind of depends on what you prefer. You probably want to do it somewhere in the App.xaml.cs which bootstraps your application. That's what I would be doing. And for the only when the app first runs you can either do some check on the database file if it is a new one or it has been edited, or you can use AppInfo APIs to determine if an app is ran for the first time or not: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qr_5mwqTxY0.html
Hi Gerald Thanks for your fantastic videos. I have been following you and learning a lot about Xamarin forms and SQLite. I was earlier programming in C# and using SQLite on wince based systems. Now can you advice how to copy SQLite database from PC to android device and use it in xamarin forms . Also after updating the database I would like to copy the database back to PC
Thank you so much! Unfortunately, I don't know how much advice I can give you. I think I will need to know more specifics before being able to say something useful. That all sounds very possible though :)
Hi! When you create the table of the DB, it is not a best option to wait to complate the execution? Like this: "_database.CreateTableAsync().Wait();"? Or it is not necesary and congrats for your videos!!!
I want to check if there is no .db3 file, then copy the .db3 file I provided. I want to do it in splash screen (written in project.android) so is there any way to do the test in the main project (project share source)? Thanks
You should take look at Entity Framework and Xamarin. Its incredible how easy it is. really! My absolut recommendation to use SQLite its amazing! And super simple about 5 Lines of Code!
The mein benefit is to share and reuse code from Backend for example. We Have a Xamarin.forms App Solution containing our whole ASP.NET Core API Backend. In ASP we are using EF with all the models and so on. We can reuse them in the exact way we are using them in Backend for our local SQLite DB. There is simply no difference. Its simply not one more different way to use it and in addition with a bit more time its pretty simple to create migrations. Even simpler with MAUI (because it need .NET Standard 2.1 for minimum)
There is many factors that influence this so it’s hard to recommend anything. If you want to do something with iOS/macOS, get a Mac, you want to do something with Windows, get a windows machine. All the rest pretty much works on both machines.
I Like your Maui-Content, it´s on the Spot. And with this I need some help. I´ve written all what you´ve told in a .net6 and in a .net7 Maui App and I can´t figure out why "stream" is null if I run this.
Also it appears Gerald is developing on a Mac. I think like me you are developing on a Windows machine which could be part of the problem. It seems there is an underlying permission issue.
I am getting an InvalidOperationException on the Stream read. Is this a permission problem? If so how do I set the permissions within the app to that it can be cross platform?
Question: I have (basically finished) Maui app that uses Sqlite. Is it possible to use that DB (and all my code) but still make use of Azure Mobile Apps to sync to a cloud db?
It seems to use SQLite! But not sure how it will integrate with your existing code: learn.microsoft.com/azure/developer/mobile-apps/azure-mobile-apps/quickstarts/maui/offline
@@jfversluis It looks like I would have had to start with Mobile Apps. It would be a rewrite to use it at this point. I'm writing my own sync code now. Thanks for the reply!
Hey Gerald!! In one of my MAUI Blazor project, Android Emulator is not in the list but Windows machine and also for all other projects I am able to debug using android emulator. What I need to change or update in that project to see Android emulator
Hi Gerald Thanks for your fantastic videos. I need help - I have existing SQLite database and want to update data and at the end of the day copy SQLite database to computer. I need your help to achieve this. Appreciate !! Thanks.
hi is it possible to detect incoming phone call accept the call and play already exist recording or music .all thins should be done in background. I need just android
@@jfversluis I think there are lots of issues in Maui Blazor, but for Maui app everything works. That's why when I try to implement filesystem it's not able to read the file I created at /data/user/0/files location.
Ok so while it does work i do have 2 problems that i cant wrap my brain around, 1. How to make a checkbox save its state (currently it just goes back to false) 2. How to make it so the searchbar actually works (yes both are on the same page using the video code as a base) Edit: did the second one using this ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-PvEAuGGZ_8o.html
@@jfversluis had problems with the code since the one in the video is not async , getting error in the foreach part of the code when i change everything to async
I'm getting this error "Access to the path '/data/user/0/com.companyname.myapp/files' is denied" on calling "File.WriteAllBytes(path, memoryStream.ToArray());"
Now I have this problem, System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.' public class BrandRepository { SQLiteConnection db; public static string DbPath { get; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal) , "MyDataBase.db"); public BrandRepository() { db= new SQLiteConnection(DbPath); db.CreateTable(); } public List List() { return db.Table().ToList(); } } show exception in line db.CreateTable();