Book Image

Xamarin 4 By Example

By : Engin Polat, Mark Radacz
Book Image

Xamarin 4 By Example

By: Engin Polat, Mark Radacz

Overview of this book

The mobile app market is increasing exponentially every year. Xamarin Studio with its modern and powerful IDEs makes creating applications a lot easier by simplifying the development process. Xamarin will allow you and your team to create native applications by taking advantage of one of the most evolved programming language in the world: C#. This book will provide you with the basic skills you need to start developing mobile apps using C# and Xamarin. By working through the examples in each chapter, you will gain hands-on experience of creating a complete app that is fully functional by all means. Finally, you will learn to publish the app you created on the app market. Each project in this book will take you one step closer to becoming a professional app developer.
Table of Contents (16 chapters)
Xamarin 4 By Example
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
7
Monkey Puzzle Game – Processing Images

Example project Weather


We will now create a new Xamarin.Forms (PCL) solution named Weather. It will allow us to write a location in a text box and it will provide the weather condition of the location using an external service provided as RESTful APIs.

We will use the APIs provided from http://openweathermap.org/api.

We will start importing all the base code we've written for the previous projects and we can add an empty class called HTTPHelper in the Servicessubfolder of the Base layer.

In this class, we will define each method to make a data request:

public class HTTPHelper 
{ 
    public HTTPHelper () 
    { 
    } 
 
    public async Task<string> GET ( string url ) 
    { 
        return "//To implement"; 
    } 
 
    public async Task<string> POST ( string url ) 
    { 
        return "//To implement"; 
    } 
 
    public async Task<string> PUT ( string url ) 
    { 
        return...