52 Weeks of Xamarin: Week 15 – Creating an iOS Application Part 1


In the previous two posts in this series, I demonstrated how to create a simple to-do listReviewPageWithBorder using Xamarin.Forms.  In this and the next post, I’ll show how to create pretty much the same program for iOS using Xamarin native code.


To begin, open Xamarin Studio and create a new solution, choosing iOS/App -> Single View App and name it ToDoiOS.  We’ll begin by roughing out the UI.  Open the file Main.storyboard.  You’ll find a View Controller.  Go to the toolbox and drag a Navigation Controller onto the storyboard — notice that it brings its own ViewController.

Continue reading

Posted in Essentials, XAML | 1 Comment

52 Weeks of Xamarin: Week 14 – Thrice (part 2)

In the previous posting I started a new project in Xamarin.Forms that I will reproduce ToDoReview2in
iOS and Android in coming posts.

Today, we’ll take a look at the second page in the Xamarin.Forms version: ListTasksPage.

This lists the tasks that you entered and persisted in the previous posting.

Continue reading

Posted in Xamarin | 1 Comment

Bayesian Probability

[Originally posted Oct. 12, 2009]

Spent the early hours of this morning reading a great blog post by Jeff Atwoodwhich makes reference to a Elizer S. Yudkowsky’s Intuitive Explanationof Bayesian Probability. The timing was good as I had just finished the (highly recommended) book The Drunkard’s Walk which agreed with Jeff that most humans simply are not wired to deal with probability very well.

Continue reading

Posted in Essentials | Comments Off on Bayesian Probability

New Pluralsight Course: Testing Xamarin Apps

TestingXamarin

Posted in Xamarin | Comments Off on New Pluralsight Course: Testing Xamarin Apps

52 Weeks of Xamarin: Week 13 – Writing It Thrice

In this and a number of following posts, I’ll build the same program three times: once in Xamarin.Forms, once in iOS and once in Android.  ToDoListForms

This is directly based on my Pluralsight course, Beginning Mobile Development with Xamarin

To get started, we’ll go through the Xamarin.Forms application fairly quickly as this series has already covered a lot of material on writing Xamarin.Forms applications.   Let’s begin by creating our model class: ToDoItem

Continue reading

Posted in Essentials, Xamarin | 1 Comment

52 Weeks of Xamarin: Week 12 – Advanced Customized Controls

Last week we looked at a simple example of customizing a control and creating a SpecialBoxViewcustom renderer.  This week we go a bit deeper.  Our goal is to give a BoxView a border, and to adjust that border dynamically.

[ This content is taken from my forthcoming Pluralsight course ]

As noted last week, we start with an Element and a Renderer.  In our case, the element will be a SpecialBoxView.  Unlike last week, however, this custom class will have contents; specifically the properties we want to be able to bind to.

Continue reading

Posted in Xamarin | 1 Comment

52 Weeks of Xamarin: Week 11 – Customized Controls for Xamarin.Forms

Xamarin.Forms is a killer framework, and it has a wide variety of very flexible controls.  But sometimes you run into restrictions on the control that you really need to override.  The answer to this dilemma is to create a customized control.

ShadedButton

To understand how to create a customized control, you must first understand that every control consists of an element (e.g., a button) and a renderer (the platform-specific code that tells the phone how to draw the element.

The trick to customizing a control is to override one or more methods in the renderer.  To see this at work, we’re going to start very easy with a shaded button.  Future postings will tackle more complex rendering.

[This blog post is based on material from my forthcoming Pluralsight course]

Continue reading

Posted in Xamarin | 1 Comment

52 Weeks of Xamarin: Week 10 – The UI for our database program

Last week we created the code to add and find a “person” in our SQLite database.  This PersonDBUIweek we’ll finish up by creating the View and the ViewModel.

The View is where most of the action is, in this small demo project.  We’ll have two views: one to capture the information and one to display it (see figure).

Create a page named EnterPerson.xaml to capture the user name.  The user interface is very simple: there is a label to indicate that we are capturing a new person’s name, two entry boxes: one for the first and one for the last name, and three buttons: one for save, one for cancel and one for review that takes you to the second page.

Continue reading

Posted in Xamarin | 1 Comment

52 Weeks of Xamarin: Week 9 – Databases part 1

Working with SQLite as your database in Xamarin.Forms is not difficult but it does involve some specific steps: Database computers small

  • Add the SQLite-.Net PCL library to all three projects
  • Create the ISQLite interface
  • Add a singleton to your app class
  • Open your database in the appropriate directory and use DependencyService to access it
  • Create your table(s)
  • Write your CRUD operations

Piece of cake.

In this and the next posting I’ll go over these steps in detail and in context.

Continue reading

Posted in Xamarin | 2 Comments

52 Weeks of Xamarin: Week 8 – Testing the View Model

Until now, our tests have focused on the model, Projects.  The point of MVVM, however, is to enable sufficient separation of concerns to allow testing of the program’s logic in the ViewModel.

Today, we turn to ViewModel tests, using these tests both to drive the development of the ViewModel, and also to ensure the integrity and correctness of the logic as we refactor the code.

Continue reading

Posted in Testing, Xamarin | 1 Comment

52 Weeks of Xamarin: Week 7 – First Unit Tests

In the previous posting, I set up the ProjectTracker solution, including the xUnit testing folders.   We talk a lot about test-driven design, but the truth is that we (most of us?) start with an overall architecture in mind prior to writing anything.

For ProjectTracker, I know I’m going to have a project model, and I know that it will contain a name and a way to get the total duration of work on the project, as well as “segments” which will hold each “chunk” of work.

I also know that I’ll have multiple projects but that at most one will be active at a time.

Now, the specifics of how to put that into code… well that I’m going to determine test-first:

Continue reading

Posted in Xamarin | 1 Comment

52 Weeks of Xamarin: Week 6 – Starting xUnit Testing

Last week we decided to start with test-first development using XUnit.  To
get underway, let’s create a eggwithlight new Xamarin.Forms application called BlogProjectTracker.

Once the projects are created we’ll return to the solution and add a new .NET project of type Portable Library which we’ll call BlogProjectTracker.Tests.

Finally, we’ll add an empty iOS project which will be used as the test runner, and which we’ll call BlogProjectTracker.Tests.iOS.  We can then do the same for Android calling the new project BlogProjectTracker.Tests.Droid

Continue reading

Posted in Essentials, Xamarin | 2 Comments