Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Xamarin Blueprints
  • Table Of Contents Toc
Xamarin Blueprints

Xamarin Blueprints

By : Michael Williams
5 (1)
close
close
Xamarin Blueprints

Xamarin Blueprints

5 (1)
By: Michael Williams

Overview of this book

Do you want to create powerful, efficient, and independent apps from scratch that will leverage the Xamarin framework and code with C#? Well, look no further; you’ve come to the right place! This is a learn-as-you-build practical guide to building eight full-fledged applications using Xamarin.Forms, Xamarin Android, and Xamarin iOS. Each chapter includes a project, takes you through the process of building applications (such as a gallery Application, a text-to-speech service app, a GPS locator app, and a stock market app), and will show you how to deploy the application’s source code to a Google Cloud Source Repository. Other practical projects include a chat and a media-editing app, as well as other examples fit to adorn any developer’s utility belt. In the course of building applications, this book will teach you how to design and prototype professional-grade applications implementing performance and security considerations.
Table of Contents (9 chapters)
close
close

Adding additional threading techniques

This is where we will add some finesse with a common threading approach known as asynchronous locking. Since there will only be one instance of the SQLiteStorage object, this means we have the possibility of a race condition as multiple threads can make changes to the same database connection at the same time.

Tip

Race conditions are a common threading issue where multiple threads try to perform operations at the same time on shared data.

How do we solve this problem?

Locking is the most common C# approach for restricting shared resources between multiple threads. In order to avoid this situation, we create an object for locking as follows:

private Object lockObject = new Object();

Then, to restrict code blocks to one thread at any one time, we do the following:

lock (thisLock)
        {
            ...
        }

This is the perfect approach when our code is synchronous. The problem we have is our SQLite implementation is asynchronous, and the restriction...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Xamarin Blueprints
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon