Introduction
Xamarin is a platform to develop cross-platform and multi-platform apps (like Windows phone, Android, iOS). In Xamarin, the code sharing concept is used. In Xamarin Studio, Visual Studio is also available.
WCF
Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service end-point to another. A service end-point can be part of a continuously available service, hosted by IIS, or it can be a service hosted in an application.
Step 1
Create a new blank Android app, using Visual Studio.
Step 2
In your project solution, there is a Main.axml file. Now, open this file in designer view. Drag and drop one Button and one TextView from Toolbox window.
On button click event, I am going to write the code to call a WCF Service.
I have created one WCF Service for this application and hosted this Service on IIS. I am going to call this Service into Android application. For more information, click here
I have created one WCF Service for this application and hosted this Service on IIS. I am going to call this Service into Android application. For more information, click here
If we run this service into a browser, then we will see the following screen shot.
Step 3
Write the code, mentioned below, into Main.axml.
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <Button
- android:text="Show"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:id="@+id/btnAdd" />
- <TextView
- android:text=""
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:id="@+id/labelAPIResult" />
- </LinearLayout>

Abbas NaqviPosted May 4, 2019, 5:58 AM
Not Working Properly even and After using try catch Block.
Yuva RajPosted Apr 22, 2017, 1:24 AM
Team., i have tried all above steps ,but while running i am getting error as "unfortunately application has stopped" . Please guide me ,to sole this issue.
Amit Kumar SinghPosted Dec 4, 2016, 6:02 AM
Nice one sir ..............