Category Archives: UWP

Azure and Xamarin Forms book published!

I am officially a published book author! “Azure and Xamarin Forms” is now available on Amazon as an Apress publication for both the kindle and printed versions or PDF at the Apress site.

When someone asks you if you know a good book to recommend on getting with Xamarin Forms or getting started with Azure for Devs or using them both together, I would be most appreciative on considering a recommendation. To my knowledge it is the only book available like it combining these two technologies in one place. I have received some great feedback so far and am very excited about this book helping devs. Special tanks to my technical reviewer:

Sunny Mukherjee :   https://www.linkedin.com/in/sunnymukherjee/

Here are the links:

Amazon -

https://www.amazon.com/Azure-Xamarin-Forms-Platform-Development-ebook/dp/B07DS9RH87

Or directly thru Apress for the EPub and PDF versions

https://www.apress.com/us/book/9781484235607#otherversion=9781484235614

Happy coding!

 

Deploying a SQLite database file with a Xamarin.Forms app–(UWP update)

Say you have a SQLite DB you want to deploy with your Xamarin Forms app. Here is an excellent article on how to do this from Rob Gibbens of Xamarin University fame…

http://arteksoftware.com/deploying-a-database-file-with-a-xamarin-forms-app/

The article has wp8 but it uses Application.GetResourceStream and that is only for Windows phone, and the code below I have updated for UWP. Also, in November the UWP team posted some great sample code where I found the answer at: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FileAccess

So, just replace the WP8 code in the blog article with this code below and you will all set. The iOS and Android code works fine in the blog.

var storageFile = IsolatedStorageFile.GetUserStoreForApplication();

if (!storageFile.FileExists(dbPath))

{
// copy storage file; replace if exists.
var fileToRead = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri(“ms-appx:///people.db3″, UriKind.Absolute));

Windows.Storage.StorageFolder storageFolder =

Windows.Storage.ApplicationData.Current.LocalFolder;

StorageFile fileCopy = await fileToRead.CopyAsync(storageFolder, “people.db3″, NameCollisionOption.ReplaceExisting);

}