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

Today in Mobile: Building with Kotlin and Flutter

Adora Nwodo
November 16, 2018

Today in Mobile: Building with Kotlin and Flutter

Mobile application development has evolved over time. This presentation covers the new technologies used in building Native Android (Kotlin) and Multi-platform applications (Flutter).

Adora Nwodo

November 16, 2018
Tweet

More Decks by Adora Nwodo

Other Decks in Technology

Transcript

  1. Today in Mobile: Building with Kotlin & Flutter Nenne Adaora

    ‘Adora’ Nwodo | DevFest Ajah 2018
  2. 2 Hi, I’m Adora Full Stack Web Developer Google Associate

    Android Developer Writer, adorahack.com @theadoranwodo, @adorahack @adoranwodo
  3. 1. More mobile users. Over 65% of users spend most

    of their time on social media apps. 3 2. Apps for smartwatches, TVs, and even vehicles now exist. The ‘app culture’ is becoming dominant. 3. A typical smartphone user unlocks their phones over 80 times a day. This generates over 2,700 strokes/swipes per day.
  4. 8

  5. ▪ Boosts productivity by 100% ▪ Runs on Java JVM

    ▪ No boilerplate code ▪ Safe ▪ Interoperable ▪ Goodbye, NullPointerException 9 Why move to Kotlin?
  6. Less is more SampleCode.java public class Person{ private String firstname,

    lastname; public Person(String fname, String lname){ this.firstname = fname; this.lastname = lname; } public String getFirstname(){ return firstname; } public String getLastname(){ return lastname; } Public void setFirstname(string firstname){ this.firstname = firstname; } Public void setLastname(string lastname){ this.lastname = lastname; } } 10 SampleCode.kt data class Person(var firstname: String, var lastname: String)
  7. Version 1.1 - JavaScript - Type aliases - Sealed and

    data classes - also(), takeIf(), takeUnless() Version 1.2 -Smart cast is better - Serializable regex - Java-default method calls Version 1.3 - Say hello to code contracts - Multiplatform - Progressive mode 11 Kotlin’s evolution ...
  8. Kotlin Android Extensions //in build.gradle apply plugin: 'kotlin-android-extensions //in Activity.kt

    import kotlinx.android.synthetic.main.<layout>.* ... findViewById<TextView>(R.id.textView) textView.setText("Hi, Adora!") 13 Image from www.raywenderlich.com
  9. Anko Library providing a set of Kotlin-friendly wrappers around the

    Android APIs, as well as a DSL that lets you replace your layout .xml files with Kotlin code. Anko Commons, Anko Layouts, Anko SQLite, Anko Coroutines 14
  10. Write once, Test once, Deploy anywhere Flutter allows you to

    build Android & iOS apps from a single codebase. The Flutter SDK uses Dart. 17
  11. An Object Oriented, Class defined language used to build high-quality,

    multi platform applications. Productive, Fast, Portable, Approachable, Reactive 19
  12. builder: (BuildContext context) { return RaisedButton( onPressed: () => greetAdora(context),

    color: Colors.indigoAccent, child: Text('Say Hi to Adora'), ); } 20
  13. Flutter Widgets 24 class BigText extends StatelessWidget { Widget build(context)

    { return new Text('text'); } } Widgets must have the build method
  14. User Interface in Flutter 25 ▪ Combine different widgets to

    build layouts ▪ Stateful widgets ▪ Stateless widgets ▪ Material & Coupertino ▪ Navigation & routing
  15. More Flutter 26 ▪ Data ▪ State management ▪ Using

    platform channels ▪ Accessibility Scanner & Accessibility Inspector ▪ Flutter Analyze ▪ Unit tests, Widget tests & Integration tests