Your SlideShare is downloading. ×
What's new in xamarin.android, Jonathan Pryor
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

What's new in xamarin.android, Jonathan Pryor

1,018
views

Published on

Published in: Technology, Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,018
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
37
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Jonathan PryorXamarin.Android LeadXamarinjonp@xamarin.comWhat’s New inXamarin.Android
  • 2. What’s in Xamarin.AndroidIDERuntimeJava library bindingPackagingUnified Components•••••
  • 3. Visual StudioLayout EditorNon-Modal DeploymentTarget Selection•••Released
  • 4. Xamarin StudioLayout EditorRazor HTML Generator••Released
  • 5. Runtime: New FoundationMono 3.0 base, includes most .NET 4.5 APIsStream.ReadAsync(), System.Net.Http.dll“Breaking” Change on OS X:new Java.Lang.Object() // CS1540Xamarin.Android ≤ 4.6: “Silverlight” basedXamarin.Android ≥ 4.7: .NET 4.5-based -System.Configuration•••••Beta
  • 6. 01020304050607080910111213141516Runtime: C#4 Dynamicvar books = @"<books pubdate=2009-05-20><book price=45.99 title=Open Heart Surgery for Dummies><authors><author><name><first>Mortimer</first><last>Snerdly</last></name><email address=mort@surgery.com/></author></authors></book></book>";dynamic dx = new DynamicXml(books);Console.WriteLine("Book list publication date={0}", dx.pubdate.Value);Console.WriteLine(" Book count={0}", dx.book.Count);Console.WriteLine(" first book title={0}", dx.book[0].title.Value);Console.WriteLine(" first book price={0}", dx.book[0].price.Value);Console.WriteLine(" first book authors count={0}", dx.book[0].author.Count);// Output:// Book list publication date=2009-05-20// Book count=1// first book title=Open Heart Surgery for Dummies// first book price=45.99// first book authors count=1http://blogs.captechconsulting.com/blog/kevin-hazzard/fluent-xml-parsing-using-cs-dynamic-type-part-1Released
  • 7. 01020304050607080910111213141516Runtime: C#4 Variant Genericsinterface IEnumerable<out T> : IEnumerable {new IEnumerator<T> GetEnumerator ();}interface IEnumerator<out T> : IDisposable, IEnumerator {new T Current {get;}}void Cat (IEnumerable<Stream> streams, Stream destination){foreach (var stream in streams)stream.CopyTo (destination);}Cat (new List<MemoryStream> {}, Stream.Null); // CS0266 in C#3Cat (new List<FileStream> {}, Stream.Null); // CS0266 in C#3Beta
  • 8. 01020304050607080910111213141516Runtime: C# < 5// Old and bustedGetUserAsync ("migueldeicaza").ContinueWith (t =>PostStatusAsync (t.Result, "Having an awesome time at #Xamarin Evolve!")).Unwrap().ContinueWith (t => {if (t.IsFaulted) {ShowError (t.Exception.Flatten().InnerException);return;}UpdateUI();}, TaskScheduler.FromCurrentSynchronizationContext());Released
  • 9. 01020304050607080910111213141516Runtime: C#5 Async// New Hawtnesstry {var user = await GetUserAsync ("migueldeicaza");await PostStatusAsync (user, "Having an awesome time at #Xamarin Evolve!");UpdateUI();}catch (Exception ex) {ShowError (ex);}Beta
  • 10. Runtime: New FeaturesNew default ARM ABI: armeabi-v7a (armv7)F# supportProfiling [Beta!]$ adb shell setprop debug.mono.profile log:sample# Run app on device...$ adb pull /data/.../files/.__override__/profile.mlpd$ mprof-report profile.mlpd | less•••BetaReleased
  • 11. Binding ImprovementsExpose more of the Java APIEmbed Java libraries into assembliesBuild action: EmbeddedJar, EmbeddedReferenceJarJava Library Project supportproject.properties file(Build action: LibraryProjectProperties)library.zip file(Build action: LibraryProjectZip)••••••BetaReleasedReleased
  • 12. What’s new in App Packaging?Native library remapping (provide .dll.config)Bundle assemblies into native codeSatellite AssembliesEnvironment support (Build action: AndroidEnvironment)# CommentsENV_VAR=env-valuedebug.mono.log=grefdebug.mono.env=MONO_LOG_LEVEL=debug••••ReleasedBetaBeta
  • 13. Packaging: Library ResourcesLibrary project assemblies may contain:Android Resources (Build action: AndroidResource)Native libraries (Build action: EmbeddedNativeLibrary)Problem: default Library template may not support AndroidResources.Solution: Hack itCreate a new Android Application projectEdit .csprojRemove <AndroidApplication/> element.Reopen project.•••••1.2.3.4.BetaReleased
  • 14. 01020304050607080910111213141516Packaging: [Export]<!-- ResourceslayoutMain.axml --><Buttonandroid:id="@+id/myButton"android:layout_width="fill_parent"android:layout_height="wrap_content"android:text="@string/hello"android:onClick="MyButton_OnClick" />// MyActivity.csnamespace MyApp {public partial class MyActivity : Activity{[Java.Interop.Export]public void MyButton_OnClick (View view){((Button) view).Text = "clicked!";}}}Released
  • 15. 01020304050607080910111213141516Packaging: AndroidInterfaceDescription// AIDLpackage com.android.vending.billing;import android.os.Bundle;interface IMarketBillingService {/** Given the arguments in bundle form, returns a bundle for results. */Bundle sendBillingRequest(in Bundle bundle);}// C# generated codeinterface IMarketBillingService : Android.OS.IInterface {Android.OS.Bundle SendBillingRequest (Android.OS.Bundle bundle);}abstract class IMarketBillingServiceStub : Binder, IInterface, IMarketBillingService {public abstract Bundle SendBillingRequest (Bundle bundle);public partial class Proxy : Java.Lang.Object, IMarketBillingService {}}Released
  • 16. Unified ComponentsComponent Assembly may contain:ECMA CIL (code)ECMA Resources (Build action: EmbeddedResource)Android Resources (Build action: AndroidResource)Native librariesAllows entire components to be shipped as single assembly, likeXamarin.iOS••••••ReleasedReleasedReleasedBeta