SlideShare a Scribd company logo
1 of 53
Xamarin
   Seminar
    9th February 2012
    Copyright 2012 © Xamarin Inc. All rights reserved
Agenda
Top 5 Features of Ice Cream
         Sandwich

                       Mike Bluestein
                       Technical Writer
                       Xamarin Documentation Team
                       mike.bluestein@xamarin.com




                                                        Xamarin
    Copyright 2012 © Xamarin Inc. All rights reserved
Introduction
This session will survey some of the new features
available in Android 4 Ice Cream Sandwich (ICS)




                                                                     Xamarin
                 Copyright 2012 © Xamarin Inc. All rights reserved
Introduction
This session will survey some of the new features
available in Android 4 Ice Cream Sandwich (ICS)


                        Calendar API




                                                                     Xamarin
                 Copyright 2012 © Xamarin Inc. All rights reserved
Introduction
This session will survey some of the new features
available in Android 4 Ice Cream Sandwich (ICS)


                   Calendar API
                ShareActionProvider




                                                                     Xamarin
                 Copyright 2012 © Xamarin Inc. All rights reserved
Introduction
This session will survey some of the new features
available in Android 4 Ice Cream Sandwich (ICS)


                   Calendar API
                ShareActionProvider
                  Action Bar Tabs




                                                                     Xamarin
                 Copyright 2012 © Xamarin Inc. All rights reserved
Introduction
This session will survey some of the new features
available in Android 4 Ice Cream Sandwich (ICS)


                   Calendar API
                ShareActionProvider
                  Action Bar Tabs
                   TextureView




                                                                     Xamarin
                 Copyright 2012 © Xamarin Inc. All rights reserved
Introduction
This session will survey some of the new features
available in Android 4 Ice Cream Sandwich (ICS)


                   Calendar API
                ShareActionProvider
                  Action Bar Tabs
                    TextureView
                   Android Beam


                                                                     Xamarin
                 Copyright 2012 © Xamarin Inc. All rights reserved
Calendar API
Calendar API

• Official Calendar API
Calendar API

• Official Calendar API
• Read-write access to calendar data
Calendar API

• Official Calendar API
• Read-write access to calendar data
 • android.permission.READ_CALENDAR
Calendar API

• Official Calendar API
• Read-write access to calendar data
 • android.permission.READ_CALENDAR
 • android.permission.WRITE_CALENDAR
Calendar Demo
Calendar Demo
Calendar Demo

      • Listing Calendars
Calendar Demo

      • Listing Calendars
      • Listing Calendar Events
Calendar Demo

      • Listing Calendars
      • Listing Calendar Events
      • Adding an Event
ShareActionProvider
ShareActionProvider
• Enables sharing action from the Action Bar
ShareActionProvider
• Enables sharing action from the Action Bar
• Creates list of app that can handle the a
  sharing intent
ShareActionProvider
• Enables sharing action from the Action Bar
• Creates list of app that can handle the a
  sharing intent
• Keeps a history of previously used apps for
  easy access later
ShareActionProvider
• Enables sharing action from the Action Bar
• Creates list of app that can handle the a
  sharing intent
• Keeps a history of previously used apps for
  easy access later
• Consistent user experience for sharing data
  throughout Android
ShareActionProvider Demo
ShareActionProvider Demo


• Sharing an Image
ShareActionProvider Demo


• Sharing an Image
ShareActionProvider Demo


• Sharing an Image
Action Bar Tabs
Action Bar Tabs


• TabActivity deprecated in ICS
Action Bar Tabs


• TabActivity deprecated in ICS
• Action Bar supports tabs in ICS
Action Bar Tabs


• TabActivity deprecated in ICS
• Action Bar supports tabs in ICS
  ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;
Tabs Demo
TextureView
TextureView

• Hardware accelerated 2D rendering
TextureView

• Hardware accelerated 2D rendering
• Display video or OpenGL content stream
TextureView

• Hardware accelerated 2D rendering
• Display video or OpenGL content stream
• Supports view transformations
TextureView Example
TextureView Example
 public class TextureViewActivity : Activity, TextureView.ISurfaceTextureListener
 {
      Camera _camera;
      TextureView _textureView;

     protected override void OnCreate (Bundle bundle)
     {
         base.OnCreate (bundle);

            _textureView = new TextureView (this);
            _textureView.SurfaceTextureListener = this;

            SetContentView (_textureView);
      }

     public void OnSurfaceTextureAvailable (Android.Graphics.SurfaceTexture surface, int width, int height)
     {
         _camera = Camera.Open ();

            var previewSize = _camera.GetParameters ().PreviewSize;
            _textureView.LayoutParameters =
                new FrameLayout.LayoutParams (previewSize.Width, previewSize.Height, (int)GravityFlags.Center);

            try {
                _camera.SetPreviewTexture (surface);
                _camera.StartPreview ();
            } catch (Java.IO.IOException ex) {
                Console.WriteLine (ex.Message);
            }

            // this is the sort of thing TextureView enables
            _textureView.Rotation = 45.0f;
            _textureView.Alpha = 0.5f;
      }
      ...
 }
TextureView Example
Android Beam
Android Beam
• Allows sharing data using Near Field
  Communication (NFC)
Android Beam
• Allows sharing data using Near Field
  Communication (NFC)
• Pushes messages when devices are close
Android Beam
• Allows sharing data using Near Field
  Communication (NFC)
• Pushes messages when devices are close
• Activity on one device creates a message
Android Beam
• Allows sharing data using Near Field
  Communication (NFC)
• Pushes messages when devices are close
• Activity on one device creates a message
 • Specifies Activity that can push it
Android Beam
• Allows sharing data using Near Field
  Communication (NFC)
• Pushes messages when devices are close
• Activity on one device creates a message
 • Specifies Activity that can push it
• Intent invoked on second device contains
  the message data
Android Beam Example
Android Beam Example
Create a message
Android Beam Example
    Create a message
protected override void OnCreate (Bundle bundle)
{
    ...

    _nfcAdapter = NfcAdapter.GetDefaultAdapter (this);
    _nfcAdapter.SetNdefPushMessageCallback (this, this);
}

public NdefMessage CreateNdefMessage (NfcEvent evt)
{
    DateTime time = DateTime.Now;
    var text = ("Beam me up!nn" + "Beam Time: " +
        time.ToString ("HH:mm:ss"));
    NdefMessage msg = new NdefMessage (
        new NdefRecord[]{ CreateMimeRecord (
             "application/com.example.android.beam",
             Encoding.UTF8.GetBytes (text)) });
        } };
    return msg;
}

public NdefRecord CreateMimeRecord (String mimeType, byte [] payload)
{
    byte [] mimeBytes = Encoding.UTF8.GetBytes (mimeType);
    NdefRecord mimeRecord = new NdefRecord (
        NdefRecord.TnfMimeMedia, mimeBytes, new byte [0], payload);
    return mimeRecord;
}
Android Beam Example
    Create a message                                                    Receive a message
protected override void OnCreate (Bundle bundle)
{
    ...

    _nfcAdapter = NfcAdapter.GetDefaultAdapter (this);
    _nfcAdapter.SetNdefPushMessageCallback (this, this);
}

public NdefMessage CreateNdefMessage (NfcEvent evt)
{
    DateTime time = DateTime.Now;
    var text = ("Beam me up!nn" + "Beam Time: " +
        time.ToString ("HH:mm:ss"));
    NdefMessage msg = new NdefMessage (
        new NdefRecord[]{ CreateMimeRecord (
             "application/com.example.android.beam",
             Encoding.UTF8.GetBytes (text)) });
        } };
    return msg;
}

public NdefRecord CreateMimeRecord (String mimeType, byte [] payload)
{
    byte [] mimeBytes = Encoding.UTF8.GetBytes (mimeType);
    NdefRecord mimeRecord = new NdefRecord (
        NdefRecord.TnfMimeMedia, mimeBytes, new byte [0], payload);
    return mimeRecord;
}
Android Beam Example
    Create a message                                                          Receive a message
protected override void OnCreate (Bundle bundle)                        IParcelable [] rawMsgs = Intent.GetParcelableArrayExtra (
{                                                                           NfcAdapter.ExtraNdefMessages);
    ...
                                                                        NdefMessage msg = (NdefMessage)rawMsgs [0];
    _nfcAdapter = NfcAdapter.GetDefaultAdapter (this);
    _nfcAdapter.SetNdefPushMessageCallback (this, this);
}

public NdefMessage CreateNdefMessage (NfcEvent evt)
{
    DateTime time = DateTime.Now;
    var text = ("Beam me up!nn" + "Beam Time: " +
        time.ToString ("HH:mm:ss"));
    NdefMessage msg = new NdefMessage (
        new NdefRecord[]{ CreateMimeRecord (
             "application/com.example.android.beam",
             Encoding.UTF8.GetBytes (text)) });
        } };
    return msg;
}

public NdefRecord CreateMimeRecord (String mimeType, byte [] payload)
{
    byte [] mimeBytes = Encoding.UTF8.GetBytes (mimeType);
    NdefRecord mimeRecord = new NdefRecord (
        NdefRecord.TnfMimeMedia, mimeBytes, new byte [0], payload);
    return mimeRecord;
}
Android Beam Example
References



Introduction to Ice Cream Sandwich
http://docs.xamarin.com/android/tutorials/Introduction_to_Ice_Cream_Sandwich




                                                                             Xamarin
                         Copyright 2012 © Xamarin Inc. All rights reserved
Xamarin
    Seminar
   Please give us your feedback
  http://bit.ly/xamfeedback


      Follow us on Twitter
        @XamarinHQ

        9th February 2012
        Copyright 2012 © Xamarin Inc. All rights reserved

More Related Content

Similar to Top 5 Features of Ice Cream Sandwich with Mono for Android 4.0

Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
Jagdish Gediya
 

Similar to Top 5 Features of Ice Cream Sandwich with Mono for Android 4.0 (20)

Spring in the Cloud - using Spring with Cloud Foundry
Spring in the Cloud - using Spring with Cloud FoundrySpring in the Cloud - using Spring with Cloud Foundry
Spring in the Cloud - using Spring with Cloud Foundry
 
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndroid 101 - Introduction to Android Development
Android 101 - Introduction to Android Development
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting Started
 
Realm database
Realm databaseRealm database
Realm database
 
Xamarin.Mac Introduction
Xamarin.Mac IntroductionXamarin.Mac Introduction
Xamarin.Mac Introduction
 
Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017Introduction to Xamarin for Visual Studio 2017
Introduction to Xamarin for Visual Studio 2017
 
OpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentOpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino Development
 
Cloud foundry
Cloud foundryCloud foundry
Cloud foundry
 
Visual Studio 2017 Launch Event
Visual Studio 2017 Launch EventVisual Studio 2017 Launch Event
Visual Studio 2017 Launch Event
 
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
Creating personalized cross platform mobile apps with the Sitecore Mobile SDKCreating personalized cross platform mobile apps with the Sitecore Mobile SDK
Creating personalized cross platform mobile apps with the Sitecore Mobile SDK
 
Cloud Function For Firebase - GITS
Cloud Function For Firebase - GITSCloud Function For Firebase - GITS
Cloud Function For Firebase - GITS
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
HasGeek Meteor Workshop
HasGeek Meteor WorkshopHasGeek Meteor Workshop
HasGeek Meteor Workshop
 
EastBay.net Building Mobile Apps with Xamarin and Visual Studio
EastBay.net Building Mobile Apps with Xamarin and Visual StudioEastBay.net Building Mobile Apps with Xamarin and Visual Studio
EastBay.net Building Mobile Apps with Xamarin and Visual Studio
 
The TIMES Cloud Service & the TIMES/MIRO App
The TIMES Cloud Service & the TIMES/MIRO AppThe TIMES Cloud Service & the TIMES/MIRO App
The TIMES Cloud Service & the TIMES/MIRO App
 
Refresh controller
Refresh controllerRefresh controller
Refresh controller
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
 
Xamarin UI Test And Xamarin Test Cloud
Xamarin UI Test And Xamarin Test CloudXamarin UI Test And Xamarin Test Cloud
Xamarin UI Test And Xamarin Test Cloud
 

More from Xamarin

More from Xamarin (20)

Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin University Presents: Building Your First Intelligent App with Xamarin...Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin University Presents: Building Your First Intelligent App with Xamarin...
 
Xamarin University Presents: Ship Better Apps with Visual Studio App Center
Xamarin University Presents: Ship Better Apps with Visual Studio App CenterXamarin University Presents: Ship Better Apps with Visual Studio App Center
Xamarin University Presents: Ship Better Apps with Visual Studio App Center
 
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinGet the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
 
Get the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
Get the Most out of Android 8 Oreo with Visual Studio Tools for XamarinGet the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
Get the Most out of Android 8 Oreo with Visual Studio Tools for Xamarin
 
Creative Hacking: Delivering React Native App A/B Testing Using CodePush
Creative Hacking: Delivering React Native App A/B Testing Using CodePushCreative Hacking: Delivering React Native App A/B Testing Using CodePush
Creative Hacking: Delivering React Native App A/B Testing Using CodePush
 
Build Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft AzureBuild Better Games with Unity and Microsoft Azure
Build Better Games with Unity and Microsoft Azure
 
Exploring UrhoSharp 3D with Xamarin Workbooks
Exploring UrhoSharp 3D with Xamarin WorkbooksExploring UrhoSharp 3D with Xamarin Workbooks
Exploring UrhoSharp 3D with Xamarin Workbooks
 
Desktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
Desktop Developer’s Guide to Mobile with Visual Studio Tools for XamarinDesktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
Desktop Developer’s Guide to Mobile with Visual Studio Tools for Xamarin
 
Developer’s Intro to Azure Machine Learning
Developer’s Intro to Azure Machine LearningDeveloper’s Intro to Azure Machine Learning
Developer’s Intro to Azure Machine Learning
 
Customizing Xamarin.Forms UI
Customizing Xamarin.Forms UICustomizing Xamarin.Forms UI
Customizing Xamarin.Forms UI
 
Session 4 - Xamarin Partner Program, Events and Resources
Session 4 - Xamarin Partner Program, Events and ResourcesSession 4 - Xamarin Partner Program, Events and Resources
Session 4 - Xamarin Partner Program, Events and Resources
 
Session 3 - Driving Mobile Growth and Profitability
Session 3 - Driving Mobile Growth and ProfitabilitySession 3 - Driving Mobile Growth and Profitability
Session 3 - Driving Mobile Growth and Profitability
 
Session 2 - Emerging Technologies in your Mobile Practice
Session 2 - Emerging Technologies in your Mobile PracticeSession 2 - Emerging Technologies in your Mobile Practice
Session 2 - Emerging Technologies in your Mobile Practice
 
Session 1 - Transformative Opportunities in Mobile and Cloud
Session 1 - Transformative Opportunities in Mobile and Cloud Session 1 - Transformative Opportunities in Mobile and Cloud
Session 1 - Transformative Opportunities in Mobile and Cloud
 
SkiaSharp Graphics for Xamarin.Forms
SkiaSharp Graphics for Xamarin.FormsSkiaSharp Graphics for Xamarin.Forms
SkiaSharp Graphics for Xamarin.Forms
 
Building Games for iOS, macOS, and tvOS with Visual Studio and Azure
Building Games for iOS, macOS, and tvOS with Visual Studio and AzureBuilding Games for iOS, macOS, and tvOS with Visual Studio and Azure
Building Games for iOS, macOS, and tvOS with Visual Studio and Azure
 
Intro to Xamarin.Forms for Visual Studio 2017
Intro to Xamarin.Forms for Visual Studio 2017Intro to Xamarin.Forms for Visual Studio 2017
Intro to Xamarin.Forms for Visual Studio 2017
 
Connected Mobile Apps with Microsoft Azure
Connected Mobile Apps with Microsoft AzureConnected Mobile Apps with Microsoft Azure
Connected Mobile Apps with Microsoft Azure
 
Building Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual StudioBuilding Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual Studio
 
Building Your First Android App with Xamarin
Building Your First Android App with XamarinBuilding Your First Android App with Xamarin
Building Your First Android App with Xamarin
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Top 5 Features of Ice Cream Sandwich with Mono for Android 4.0

  • 1. Xamarin Seminar 9th February 2012 Copyright 2012 © Xamarin Inc. All rights reserved
  • 2. Agenda Top 5 Features of Ice Cream Sandwich Mike Bluestein Technical Writer Xamarin Documentation Team mike.bluestein@xamarin.com Xamarin Copyright 2012 © Xamarin Inc. All rights reserved
  • 3. Introduction This session will survey some of the new features available in Android 4 Ice Cream Sandwich (ICS) Xamarin Copyright 2012 © Xamarin Inc. All rights reserved
  • 4. Introduction This session will survey some of the new features available in Android 4 Ice Cream Sandwich (ICS) Calendar API Xamarin Copyright 2012 © Xamarin Inc. All rights reserved
  • 5. Introduction This session will survey some of the new features available in Android 4 Ice Cream Sandwich (ICS) Calendar API ShareActionProvider Xamarin Copyright 2012 © Xamarin Inc. All rights reserved
  • 6. Introduction This session will survey some of the new features available in Android 4 Ice Cream Sandwich (ICS) Calendar API ShareActionProvider Action Bar Tabs Xamarin Copyright 2012 © Xamarin Inc. All rights reserved
  • 7. Introduction This session will survey some of the new features available in Android 4 Ice Cream Sandwich (ICS) Calendar API ShareActionProvider Action Bar Tabs TextureView Xamarin Copyright 2012 © Xamarin Inc. All rights reserved
  • 8. Introduction This session will survey some of the new features available in Android 4 Ice Cream Sandwich (ICS) Calendar API ShareActionProvider Action Bar Tabs TextureView Android Beam Xamarin Copyright 2012 © Xamarin Inc. All rights reserved
  • 11. Calendar API • Official Calendar API • Read-write access to calendar data
  • 12. Calendar API • Official Calendar API • Read-write access to calendar data • android.permission.READ_CALENDAR
  • 13. Calendar API • Official Calendar API • Read-write access to calendar data • android.permission.READ_CALENDAR • android.permission.WRITE_CALENDAR
  • 16. Calendar Demo • Listing Calendars
  • 17. Calendar Demo • Listing Calendars • Listing Calendar Events
  • 18. Calendar Demo • Listing Calendars • Listing Calendar Events • Adding an Event
  • 20. ShareActionProvider • Enables sharing action from the Action Bar
  • 21. ShareActionProvider • Enables sharing action from the Action Bar • Creates list of app that can handle the a sharing intent
  • 22. ShareActionProvider • Enables sharing action from the Action Bar • Creates list of app that can handle the a sharing intent • Keeps a history of previously used apps for easy access later
  • 23. ShareActionProvider • Enables sharing action from the Action Bar • Creates list of app that can handle the a sharing intent • Keeps a history of previously used apps for easy access later • Consistent user experience for sharing data throughout Android
  • 29. Action Bar Tabs • TabActivity deprecated in ICS
  • 30. Action Bar Tabs • TabActivity deprecated in ICS • Action Bar supports tabs in ICS
  • 31. Action Bar Tabs • TabActivity deprecated in ICS • Action Bar supports tabs in ICS ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;
  • 35. TextureView • Hardware accelerated 2D rendering • Display video or OpenGL content stream
  • 36. TextureView • Hardware accelerated 2D rendering • Display video or OpenGL content stream • Supports view transformations
  • 38. TextureView Example public class TextureViewActivity : Activity, TextureView.ISurfaceTextureListener { Camera _camera; TextureView _textureView; protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); _textureView = new TextureView (this); _textureView.SurfaceTextureListener = this; SetContentView (_textureView); } public void OnSurfaceTextureAvailable (Android.Graphics.SurfaceTexture surface, int width, int height) { _camera = Camera.Open (); var previewSize = _camera.GetParameters ().PreviewSize; _textureView.LayoutParameters = new FrameLayout.LayoutParams (previewSize.Width, previewSize.Height, (int)GravityFlags.Center); try { _camera.SetPreviewTexture (surface); _camera.StartPreview (); } catch (Java.IO.IOException ex) { Console.WriteLine (ex.Message); } // this is the sort of thing TextureView enables _textureView.Rotation = 45.0f; _textureView.Alpha = 0.5f; } ... }
  • 41. Android Beam • Allows sharing data using Near Field Communication (NFC)
  • 42. Android Beam • Allows sharing data using Near Field Communication (NFC) • Pushes messages when devices are close
  • 43. Android Beam • Allows sharing data using Near Field Communication (NFC) • Pushes messages when devices are close • Activity on one device creates a message
  • 44. Android Beam • Allows sharing data using Near Field Communication (NFC) • Pushes messages when devices are close • Activity on one device creates a message • Specifies Activity that can push it
  • 45. Android Beam • Allows sharing data using Near Field Communication (NFC) • Pushes messages when devices are close • Activity on one device creates a message • Specifies Activity that can push it • Intent invoked on second device contains the message data
  • 48. Android Beam Example Create a message protected override void OnCreate (Bundle bundle) { ... _nfcAdapter = NfcAdapter.GetDefaultAdapter (this); _nfcAdapter.SetNdefPushMessageCallback (this, this); } public NdefMessage CreateNdefMessage (NfcEvent evt) { DateTime time = DateTime.Now; var text = ("Beam me up!nn" + "Beam Time: " + time.ToString ("HH:mm:ss")); NdefMessage msg = new NdefMessage ( new NdefRecord[]{ CreateMimeRecord ( "application/com.example.android.beam", Encoding.UTF8.GetBytes (text)) }); } }; return msg; } public NdefRecord CreateMimeRecord (String mimeType, byte [] payload) { byte [] mimeBytes = Encoding.UTF8.GetBytes (mimeType); NdefRecord mimeRecord = new NdefRecord ( NdefRecord.TnfMimeMedia, mimeBytes, new byte [0], payload); return mimeRecord; }
  • 49. Android Beam Example Create a message Receive a message protected override void OnCreate (Bundle bundle) { ... _nfcAdapter = NfcAdapter.GetDefaultAdapter (this); _nfcAdapter.SetNdefPushMessageCallback (this, this); } public NdefMessage CreateNdefMessage (NfcEvent evt) { DateTime time = DateTime.Now; var text = ("Beam me up!nn" + "Beam Time: " + time.ToString ("HH:mm:ss")); NdefMessage msg = new NdefMessage ( new NdefRecord[]{ CreateMimeRecord ( "application/com.example.android.beam", Encoding.UTF8.GetBytes (text)) }); } }; return msg; } public NdefRecord CreateMimeRecord (String mimeType, byte [] payload) { byte [] mimeBytes = Encoding.UTF8.GetBytes (mimeType); NdefRecord mimeRecord = new NdefRecord ( NdefRecord.TnfMimeMedia, mimeBytes, new byte [0], payload); return mimeRecord; }
  • 50. Android Beam Example Create a message Receive a message protected override void OnCreate (Bundle bundle) IParcelable [] rawMsgs = Intent.GetParcelableArrayExtra ( { NfcAdapter.ExtraNdefMessages); ... NdefMessage msg = (NdefMessage)rawMsgs [0]; _nfcAdapter = NfcAdapter.GetDefaultAdapter (this); _nfcAdapter.SetNdefPushMessageCallback (this, this); } public NdefMessage CreateNdefMessage (NfcEvent evt) { DateTime time = DateTime.Now; var text = ("Beam me up!nn" + "Beam Time: " + time.ToString ("HH:mm:ss")); NdefMessage msg = new NdefMessage ( new NdefRecord[]{ CreateMimeRecord ( "application/com.example.android.beam", Encoding.UTF8.GetBytes (text)) }); } }; return msg; } public NdefRecord CreateMimeRecord (String mimeType, byte [] payload) { byte [] mimeBytes = Encoding.UTF8.GetBytes (mimeType); NdefRecord mimeRecord = new NdefRecord ( NdefRecord.TnfMimeMedia, mimeBytes, new byte [0], payload); return mimeRecord; }
  • 52. References Introduction to Ice Cream Sandwich http://docs.xamarin.com/android/tutorials/Introduction_to_Ice_Cream_Sandwich Xamarin Copyright 2012 © Xamarin Inc. All rights reserved
  • 53. Xamarin Seminar Please give us your feedback http://bit.ly/xamfeedback Follow us on Twitter @XamarinHQ 9th February 2012 Copyright 2012 © Xamarin Inc. All rights reserved

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n