Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java Binding Tips and Tricks 2017

Atsushi Eno
September 21, 2017

Java Binding Tips and Tricks 2017

monkeyfest.io

Atsushi Eno

September 21, 2017
Tweet

More Decks by Atsushi Eno

Other Decks in Programming

Transcript

  1. Java Binding Tips and Tricks 2017

  2. Agenda ▪ ▪ ▪

  3. Java Bindings Libraries in Xamarin.Android Ecosystem Xamarin.Android (Mono.Android.dll) other Java

    Libs Framework Libraries (System*) OpenTK other .NET Libs (PCL, netstandard, XA libs) Android Framework & Java Framework Subset
  4. What are Java Bindings? ▪ ▪ ▪

  5. Why use Java Bindings? ▪ ▫ ▪ ▫ ▫

  6. Which are Java Bindings, for example? ▪ ▪ ▪ ▪

    github:xamarin/XamarinComponents
  7. Discover Java Android Experience ▪ github:wasabeef/awesome-android-ui ▪ ▪

  8. How Java Bindings work ▪ ▪ JNI ▪ ▪

  9. How Java Bindings work ▪ ▪ ▫ ▫ ▪ ▫

    ▪ new
  10. Project Structure Tips and Tricks

  11. Java Binding Project: general steps

  12. How Java Bindings are Built .jar api.xml *.cs *.dll *.cs

    *.cs GenerateBindings CSCompile Metadata.xml additional *.cs reference *.dll reference *.dll ExportJarToXml javadoc .jar
  13. Migrate to new Class parser (if old) ▪ ▪ ▪

    ▫ ▪ ▫ ▫ new
  14. Jar/Aar and Build Actions ▪ ▫ ▫

  15. Xamarin.Build.Download package ▪ ▫ ▫ ▪ ▪ ▫ new

  16. ▪ Library Dependency Tips b.jar class C2 extends a.C1 {

    ... } ABinding.dll public class C1 { ... } a.jar api.xml BBinding.dll public class C2 : A.C1 { ...} a.jar class C1 { ... } b.jar
  17. Library Dependency Tips ▪ ▫ ▫ ▪ ▫ ▫

  18. Give meaningful Parameter Names ▪ ▫ ▫ ▪ ▫ new

  19. Importing API Documentation ▪ ▫

  20. Metadata Fixup Tips and Tricks

  21. ▪ ▪ ▪ ▪ Build Bindings without Metadata fixup

  22. Metadata fixup: why is it required? ▪ ▫ ▫ ▪

    ▫ ▫
  23. ▪ ▪ ▫ ▫ ▫ ▪ ▪ [Java Bindings Metadata]

    Metadata.xml
  24. Find the causes of unexpected results ▪ ▪ ▫

  25. Easiest build fix ▪ ▫ ▪

  26. Individual Metadata fixup Tips ▪ ▪ ▪ ▪ ▪ ▪

    ▪ ▪ ▪ Troubleshooting Bindings
  27. Namespace / Type Name conflicts

  28. Fix Inconsistent Member Access Java C#

  29. Dealing with Variants and Generics Java C#

  30. Dealing with Variants and Generics Java C#

  31. Dealing with Variants and Generics

  32. Name Collision on EventArgs Java C#

  33. Name Collision on EventArgs

  34. Beautifying Managed API ▪ ▫ ▫ ▫ ▪ ▫ →

    ▪ ▫ →
  35. Knowing Limitations...

  36. Future Topics

  37. Java8 Default Interface Methods ▪ ▫ ▪ ▫ ▫ ▪

  38. Java8 Default Interface Methods ▪ ▪ ▪

  39. Android Architecture Components ▪ ▫ ▪ ▫ ▫

  40. Android Architecture Components ▪ ▫ ▫ ▪ ▫ ▫

  41. Thanks ▪ ▫ ▫ ▫ ▫ ▫