Android TVとXamarinとKotlin

Android TVとXamarinとKotlin

1fe26e11357f3ba7250b6668ca61309f?s=128

Mayuki Sawatari

January 21, 2017
Tweet

Transcript

  1. None
  2. http://github.com/mayuki

  3. Android TV AgqrPlayer for Android TV Xamarin Kotlin

  4. None
  5. TV Android #10ft=3m … Android==

  6. UI https://www.google.com/design/spec-tv/ Recommendation

  7. Design Pattern: Browse Lane

  8. Design Pattern: Detail View

  9. Design Pattern: Wizard

  10. None
  11. None
  12. None
  13. None
  14. None
  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. Android ( )

  23. adb shell & logcat

  24. None
  25. A&G+

  26. None
  27. http://agqr.jp/

  28. None
  29. None
  30. presents 17:00 30 YouTube https://www.youtube.com/playlist?list=PLAJedE0KWalQUzGD354wuweVYEdJxqwTg

  31. A&G+

  32. None
  33. None
  34. None
  35. None
  36. JetBrains JVM Better Java Java IntelliJ(Android Studio) IDE

  37. AgqrPlayer for Android TV Xamarin Kotlin

  38. ( )

  39. None
  40. Kotlin null Primary Constructor if, when Delegation override by default

    Type Erasure Lazy
  41. C# Java null

  42. class Greeter(val message: String) { private val prefix = "Hello!"

    fun hello() { println("$prefix $message") } } class Program { fun main() { Greeter("Konnichiwa!").hello() // => Konnichiwa! } }
  43. // 再代入不可 (プロパティも同じ) val valueA = "Hello" valueA = "Konnichiwa!"

    // Compile Error: Val cannot reassigned var valueB = "Hello" valueB = "Konnichiwa!" // OK // null許容 var valueNullable: String? = "Hogehoge" valueNullable = null // null非許容 var valueNonNullable = "Mogemoge" valueNonNullable = null // Error: Null can not be a value of a non-null type String
  44. C# class NanikaData(val valueA: String, val valueB: Int) { }

    NanikaData("Hoge", 1).valueA // => Hoge
  45. (0..10) // ラムダ式のデフォルト引数 it .map({ it * 2 }) //

    カッコ不要 .filter { it > 5 } // 引数に名前を付ける .forEach { i -> println(i) }
  46. val value = NantokaType.ARIENAI // when, if val message =

    when (value) { NantokaType.SUGOI -> "Sugoi" NantokaType.YABAI -> "Yabai" else -> "Majikayo" } println(message) // => "Majikayo" enum class NantokaType { SUGOI, YABAI, ARIENAI }
  47. var valueA: String? = "nantoka" // この時点では null かもしれないので ?.

    または !! が必要 valueA?.substring(0, 3) if (valueA == null) { return } // ここに来れば null ではないと判断され null-safe/non-null assert 不要 valueA.substring(0, 3)
  48. val valueB: Any = "Nantoka" // Any == Object if

    (valueB is String) { valueB.substring(0, 3) // 値が String だと判断できる } valueB.substring // Compile Errorで呼べない TypeScript
  49. interface BaseA { fun hoge() } interface BaseB { fun

    moge() } class BaseAImpl : BaseA { override fun hoge() = println(“BaseA”) } class BaseBImpl : BaseB { override fun moge() = println(“BaseB”) } class AAndBImpl(b: BaseB) : BaseA by BaseAImpl(), BaseB by b { // BaseAの実装BaseAImpl, BaseBはb // mix-in } class NantokaKantoka { fun methodA() { AAndBImpl(BaseBImpl()).hoge() // => BaseA AAndBImpl(BaseBImpl()).moge() // => BaseB } }
  50. Delegated Proeprties

  51. None
  52. None
  53. Kotlin Kotlin JVM 1

  54. IDE

  55. No LINQPad & No ConsoleApplication REPL&Playground

  56. is hard

  57. Xamarin

  58. C#

  59. None
  60. Android TV A&G+ Kotlin C#