Tag : xamarin

Creating a custom alert view in Android using C#

As mentioned in my earlier post, we can use the default AlertDialog class to display the alerts of screen by setting different properties and methods of it. But still there sounds like, we may need dialogs on screen which would be needed to be customized. They can be accept user inputs, can display an arranged info of an user etc.

How to do it ?


We will follow few simple steps

  • Create a custom view
  • Render the custom view in AlertDialog

Create a custom view


Let’s add a new layout to the project under Resources > layout.
AddedNewLayout

Categories: Android, CSharp, MonoDroid, Visual Studio, Xamarin

Quick Tips : Displaying an Alert in Android using MonoDroid

Displaying an informational alert on screen


Let’s just display a quick informative popup, which will only display an alert on screen with a title and a message in it. It actually gets closed when the back button get touched.

AndroidAlertWithoutButton

Let’s display the OK and Cancel button

We will add OK and Canel button. On click of the buttons, it will display a quick Toast message on screen in order
to differentiate which button is clicked.

Categories: Android, CSharp, MonoDroid, Visual Studio, Xamarin

More data in a row : Android Listview using Xamarin

What do you want ?

I just wanted to add a date along with the each place of earthquake that is in the list in my previous blog.

We can use any of the way, like ListActivity or adding a ListView control to the Layout. Here I am going to do it with the ListView control.

Steps to do it

Pretty simple steps.

  • Add a Listview to the layout
  • Create a class or dictionary to contain the custom list of data
  • Customize the Adapter to contain the custom data
  • Use the custom Adapter instead of the default Adapter

Categories: Android, CSharp, Visual Studio, Xamarin

A simple way to show listview in Android using Xamarin

Ways to do it

There are basically 2 ways to do it in Android.

  • Using the Listview control
  • Using the ListActivity

By using ListActivity

In this way we don’t need to define any Listview in our AXML page. Just few lines of code will do it.

Categories: Android, CSharp, Visual Studio, Xamarin

BBSRAzureCamp Windows Phone App

The Global Azure Boot Camp is getting organized in Bhubaneswar, the Capital City of art, culture and history riched state Odisha, India.

The BBSRAzureCamp app is a FREE hand guide for the attendees to help them to get the detailed info on the event.

Venue

Guides attendees reach in the venue with the street level map view.The Session details puts some light on how the event will proceed on that day.

Speakers

Along with the sessions, the Speakers are also equally important to the attendees. So does the Speakers tab. It also gives a brief introduction of the speakers.

We should not also forget the Organizing team, who spends their dedicated effort and time to make it happen. Also the Sponsors, who have extended their helping hand to make this event happen.

Please download the app and let me know how you feel about it.

Categories: CSharp, Visual Studio, Windows Phone, Xamarin

Xamarin.Forms.Maps integration in WinPhone Project

Map is an external component which will be obtained from the Nuget Component store.

Integration of Maps requires some config changes from platform to platforms. I have targeted the WinPhone project configuration here. In the next blog, will point to other platforms.

Simple Steps

  • Add Xamarin.Forms.Map to every project in the solution
  • Call the FormMaps.Init() method in each project to initialize the map
  • Create the Map object with region co-ordinates
  • Add that Map object in a layout in the PCL/Shared project

nuget-XamarinFormsMaps

In the PCL/Shared project, Let’s add a new Content page and name it as MapPage.cs. Now time to add the below code to it.

Categories: Cross Platform Mobile App, CSharp, Visual Studio, Windows Phone, Xamarin

[Released] : Xamarin support for Apple Watch Kit

Apple announced the Smart Watch last week !!!

What is Apple Watch ??
A smart watch to run in-built apps, download and run store apps, connect people, keeps track of health & fitness, keeps timing etc. Just more than a normal watch.

AppleWatch

Can we develop apps for this ??
Yes, we can.

What are the prerequisites to develop an app for the watch ??

  • XCode 6.2 in MAC with the Apple Watch Kit to develop app for the watch
  • Latest version of Xamarin iOS
  • Visual Studio with Xamarin Plugin installed Or Xamarin Studio

Can we develop app for Apple watch using Xamarin ?
Yes, Xamarin has released support for Apple watch KIT this week. We can use either Visual Studio OR Xamarin Studio IDE to develop app for the Apple watch.

Some key points

  • We cannot install the app directly into the Watch. It needs an iPhone to get the app download, deploy and run in the watch.
  • The C# code to run the app stays in the Phone and the UI elements such as images, storyboard components etc resides in the watch.
  • While developing the app for watch, we need to specify the same bundle ID in the Watch app and in he iPhone app.

More references ?

Categories: CSharp, iOS, Visual Studio, Xamarin

Child control Event handling in Listview using Xamarin.Forms

We can add child controls to Listview in Xamarin.Forms. In order to see the child control in action we will take an example. Let’s display a list of data in the Listview and perform delete option on the list data per row basis.

Since we need to add multiple columns in the list view, we need to use the DataTemplate to define the custom view. Let’s use a model class to assign the data to the custom view.

We will use XAML to design a Listview

InsideXAMLView
In the above XAML, we have used the StackLayout as the parent container for the child views. It contains a Label and a Listview. UI Control is ready.

Time to add event to the child control
We will replace the Button control in the above XAML with the following line

Categories: Android, Cross Platform Mobile App, CSharp, iOS, Visual Studio, Windows Phone, Xamarin, XAML

Display requirement specific keyboard using Xamarin.Forms

Xamarin uses the Keyboard class to show different virtual keyboards depending upon the user request. It contains several static properties to create different kind of virtual keyboards. Xamarin displays the Default Keyboard, if nothing is specified.

Keyboard for Chatting

ChatKeyboard

It opens up the default virtual keyboard in the device, which would be convenient for chatting, having few extra keys.

Categories: Android, Cross Platform Mobile App, CSharp, iOS, Visual Studio, Windows Phone, Xamarin

Using a Scrollview in XamarinForms

What is it ???

The short answer is ScrollView is a Layout. But it can only contain a single Visual Element in its Content property.

Why So ???

Because, the Layouts such as Stack, relative etc. are derived from Layout<T> generic class. This Layout<T> generic class is derived from the Layout class, which is a non-generic class.

ScrollView is inherited from the Non-generic Layout class. That is the same reason, why it does not support a generic way to add children. It only exhibits the Content property to accept a single view or a Layout.

ScrollView

Usage by example

Usage Example #1 : Let’s display a paragraph of scrolling text

Categories: Android, Cross Platform Mobile App, CSharp, iOS, Visual Studio, Windows Phone, Xamarin

%d bloggers like this: