Hackster is hosting Hackster Holidays, Ep. 5: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 5 on Friday!
Ron Dagdag
Published © MIT

Getting Started With Android Things + Xamarin Forms

Hello Android Things World for all C# and Xamarin Developers, a quick tutorial on setting up and build.

BeginnerProtip1 hour5,581
Getting Started With Android Things + Xamarin Forms

Things used in this project

Story

Read more

Code

MainActivity.cs

C#
using System;

using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace firstforms.Droid
{
    [Activity(Label = "firstforms.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            LoadApplication(new App());
        }

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
        }
    }
}

Credits

Ron Dagdag

Ron Dagdag

47 projects • 440 followers
Microsoft MVP award / Lead Software Engineer / Augmented Reality. Developer Passionate to learn about Robotics, VR, AR, ML, IOT

Comments