Posts

Showing posts from April, 2014

Get Current Song Information with Xamarin.Android

Image
Hey with this thread, we can learn to get a music players song information and download a thumbnail from iTunes Apple =). First add a Xamarin.Android project Now in the Project add the follow components Json.Net Android Support Library v4 After this add a Main.axml layout with only one button. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/myButton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Start Service" /> </LinearLayout> Now this is the MainActivity.cs Code its very easy we add two clases one as a BroadcastReceiver and the other one as a Service using System; using Android.App; usi...

C# Interface Ejemplo Sencillo

Image
Inicamos con un poco de teoria que es una interface en el paradigma orientado a objetos son una coleccion de acciones o propiedades que definen una clase en este caso nuestra interface sera IAve la cual contendra un par de metodos que todas las aves realizan Volar() y Comer(). public interface IAve { void Volar(); void Comer(); } Ahora crearemos una clase la cual implementara la interface anteriormente realizada. public class AvePropiedades:IAve { public int Patas=2; public int Alas=2; public int Cola=1; public string Nombre{ get; private set;} public AvePropiedades(string NAve) { this.Nombre = NAve; } public void Volar() { Console.WriteLine ("Volar"); } public void Comer() { Console.WriteLine ("Comer"); } } Como vemos hemos implementado ambos metodos de nuestra interface(Volar();, Comer();) en caso de no implementarlos se generaria un error debido a que estas propiedades o metodos deben de ser obligatorios para poder impl...

Facial Detection with Xamarin.Android

Image
hey hooo¡¡¡¡¡ today we work with the Face Detection Android's Api its very easy to use and a great tool First, create a new Android Ice Cream Sandwich app because Face Detection Api only works with Android 4 and above: In the Main Layout put a TextView and a Button <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dip"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Click Take a Picture button" android:gravity="center_horizontal" android:layout_weight="1.0" /> <Button android:layout_width="wrap_content" android:layout_height=...