Posts

Showing posts with the label Dependency Service

Xamarin.Forms Walkthrough 1: Getting Started with Xamarin

Image
In this walkthrough we will be learning the basic concepts of the world of Xamarin and Xamarin.Forms, that is a historical step in the creation of cross-platform mobile applications. Here we will talk about why or how Xamarin’s approach to create a framework differs from some of the other cross-platform frameworks. We’ll also explain the prestigious concepts of  Write Once, Run Everywhere/Anywhere. In the very beginning, there were many manufacturers of mobile devices, who had their own view or vision about the world of mobile technology look like with their operating systems. They began to build their own tools and Software Development Kits (SDKs) to support their technology, that was a little confusing for developers about how to choose the one among the others that can crack the future! If you wanted to target Android, you had to learn Java. If you wanted to target the iOS, you had to learn Objective-C. And if you dared to target the Windows Phone, you had to learn C#....

Authentication by Xamarin.Auth in Xamarin.Forms

Image
We always encounter the need for authentication in most of our applications. It's a struggling process to authenticate the user by interacting with services like Twitter, Facebook and so on. Here I'm creating a simple method of authentication using  Xamarin.Auth.  The Xamarin.Auth component is a great time saver for authentication. The authentication cardinals are given for authentication. Authenticators are responsible for managing the user interface and communicating with authentication services. Authenticators take a variety of parameters, like the Client ID, its authorization scope, the authorization URL, redirect URL and so on, since it varies depending on the authenticators. var  auth  =  new  OAuth2Authenticator   (   clientId: "", // your OAuth2 client id   scope: "", // the scopes for the particular API y...

Code to Launch the Phone Dialer in Xamarin.Forms

Image
When we code to start a voice call, we must be aware of  Dependency Service  in Xamarin.Forms. DependencyService in Xamarin.Forms provides access to the native functionality and some platform-specific implementations of the iOS, Android and Windows Phone SDKs from your PCL or Shared Project. To start a voice call there are some platform-specific implementations and permissions. 1.  The following is the procedure to implement the voice call in Xamarin.Forms. Let's create a ContentPage with an entry and a button as  HomePage.cs. 2.  Create an interface  IPhoneCall.cs  in the shared code that shows the functionality that we intend to implement. 3.  The Interface must be implemented in each platform-specific application project. Android implementation:  Before implementing the interface in Android don't forget to set some permissions in  AndroidManifest.xml . These permissions are necessary for invoking a voice call in Andr...