Overview of DroidCon UK 2015

80
DROIDCON UK 2015 London, England Elif BONCUK Date (09/12/2015)

Transcript of Overview of DroidCon UK 2015

DROIDCON UK 2015

DROIDCON UK 2015

London, England

Elif BONCUKDate (09/12/2015)

DroidCon 2To support the Android platform and create a global network for developers and companies

First DroidCons at Berlin and London, 2009

Held in Amsterdam, Bangalore, Berlin, Brussels, Bucharest, Dubai, London, Madrid, Moscow, Montreal, Murcia, Paris, Stockholm, Tel Aviv, NewYork, Krakow, Zagreb, Thessaloniki, San Francisco, Tunis and Turin

Ones, Held in Ankara, Android Developer Days, 2014

Mobile devices, to TV, to cars, to gaming, and so much more

DroidCon UK 2015 2

Hosted in Business Design Center London for the 6th year

Europes Largest Android Conference

Speakers from consumer brands, mobile organizations, mobile operators and industries touched by the mobile market including advertising, banking, health, entertainment and education

Presented at more than 50 conference sessions

AgendaAndroid for Java Developers

Meaningful Motion

Mobile Services From Google

Gradle - Gradle Performance

Jack and Jill Build System

RxJava, RxAndroid

Kotlin Language

4Android For Java Developers

The lead of the Android UI Toolkit team at GoogleDeveloping for Android: Contents IntroductionI: Understanding the Mobile ContextII: The Rules: MemoryIII: The Rules: PerformanceIV: The Rules: NetworkingV: The Rules: Language & LibrariesVI: The Rules: StorageVII: The Rules: FrameworkVIII: The Rules: User InterfaceIX: Tools

https://medium.com/google-developers/developing-for-android-introduction-5345b451567c#.nbwgkioul

4Android For Java DevelopersJava Programming LanguageRuntimeHardwareLanguage != PlatformServer - RuntimeServerJava Programming LanguageDalvik

Server-LandAndroidMoving, compacting collectorCPU: very very fastMemory: Basically ARTCPU: wayyyy slowerIdle Compaction No Compaction Java Programming Language

4Android For Java DevelopersMemory

LimitedSharedMemory = Performance

4Android For Java Developers

4Android For Java Developers

4Android For Java Developers

4Android For Java Developers

Fewer allocations lead to:Smaller heapFaster allocation timesFaster collection timesFewer pausesLess CPU usageHappier users!

4Android For Java DevelopersHost tools

SystraceAllocation TrackerTraceviewHierarchyviewerMATMemory monitor

4Android For Java DevelopersDevice tools

StrictModeGPU profilingGPU overdrawScreenrecordHardware layer updates

4Making Your App Better

Author (A) - Principles of Material DesignMotion, cool, fundamental thing for material design.Ancak ne zaman ve nasl kullanlacan bilememek korkutucu olabilir.

4Making Your App Better

Animation APIsViewPropertyAnimatorObjectAnimatorsInterpolatorsCircular revealsTransitionsWindow content transitionsShared element transitionsAnimatedVectorDrawables

4Making Your App BetterViewPropertyAnimatorSimple View Animations - 4.1+

Author (A) - Android 16 dan itibaren ama viewcombat n da var. 4Making Your App BetterObject AnimatorAnimate all the things - 3.0+

4Making Your App BetterInterpolarsEasing in and out

4Making Your App BetterCircular Reveals

4Making Your App BetterTransitions

4Making Your App BetterTransitions

4Making Your App BetterTransitions

4Making Your App BetterWindow content transitions

4Making Your App BetterShared element transitions

4Making Your App BetterAnimatedVectorDrawables

4Mobile Services From Google

Author (A) - Android studioda map activity iin yeni bir template var. Eskiden bir map ieren uygulama yazabilmek iin(google play servicesi kullanan), ilk nce map activityyi yaratyorduk. Ki sadece yaratarak yapabileceimiz hi bir ey yok aslnda. Sonrasnda google developer consolea gidip, gdcda bir application yaratmamz gerekiyordu. Uygulamay yarattktan sonra mapping apiy aabiliyoruz. Servislere eriebilmek iin bir API key alyoruz. Android Studiodaki map templatein yaratrsak, arkada hidden olarak api keyi de yaratm oluyor. 4Mobile Services From GoogleTip One: New Android Studio Template

4Mobile Services From GoogleTip Two: Use Lite Mode Maps https://developers.google.com/maps/documentation/android-api/lite?hl=en

4Mobile Services From GoogleTip Three: Consider GeoJSON or KML

Standard formats for encoding geo data (GeoJSON) or outlines KMLAndroid Map Utils library includes parsers for theseCan save you a lot of coding in some scenarios, and provides an optimized experience

4Mobile Services From GoogleTip Four: Cluster is not a bad word!

4Mobile Services From GoogleTip Five: Consider Polyline Encoding!

If you collect lots of location data in order to map a taken route, these might help!Example: Dog walking, Map a bike ride or hike etc.

Author (A) - The PolyUtil is useful for converting encoded polylines and polygons to latitude/longitude coordinates, and vice versa.

In Google Maps, the latitude and longitude coordinates that define a polyline or polygon are stored as an encoded string. See the detailed explanation of polyline encoding. You may receive this encoded string in a response from a Google API, such as the Google Maps Directions API.

You can use PolyUtil in the Google Maps Android API Utility Library to encode a sequence of latitude/longitude coordinates ('LatLngs') into an encoded path string, and to decode an encoded path string into a sequence of LatLngs. This will ensure interoperability with the Google Maps API web services. 4Mobile Services From GoogleTip Six: Curated Locations

The Places API is awesomeDont just call it blindlyConsider CurationLocal DBBacked up with PlacesBe careful of TOSDont cache placesUse their IDs

4Mobile Services From GoogleTip Seven: Location Sensor Optimisation

Know when to start and stop listeninggetLastKnownLocationif you need a location quicklyMaintain a best estimateCompare update with previous ones and remove bad dataAdjust the Fused Location Provider as neededRemember, the most sensitive, the higher the cost

4Mobile Services From GoogleTip Eight: Map Overlays

Be careful when using overlaysGood example: traficBad example: different coloured pins on different overlays!Always give the users to turn them on and off.

Author (A) - want to create filters on data and use this data using map overlays 4Mobile Services From GoogleTip Nine: Using Beacons

Consider Beacon VirtualisationTrack the Beacon namespace / id in your own DBAssign these to real world locations

Author (A) - want to create filters on data and use this data using map overlays 4Mobile Services From GoogleTip Ten: API Utility Library

GeoJSON / KMLHeatmapsCustomized MarkersClustersPolyline EncodingDistance, Area, Heading CalculationOpen Source!

Author (A) - want to create filters on data and use this data using map overlays 4Gradle

Author (A) - Android studioda map activity iin yeni bir template var. Eskiden bir map ieren uygulama yazabilmek iin(google play servicesi kullanan), ilk nce map activityyi yaratyorduk. Ki sadece yaratarak yapabileceimiz hi bir ey yok aslnda. Sonrasnda google developer consolea gidip, gdcda bir application yaratmamz gerekiyordu. Uygulamay yarattktan sonra mapping apiy aabiliyoruz. Servislere eriebilmek iin bir API key alyoruz. Android Studiodaki map templatein yaratrsak, arkada hidden olarak api keyi de yaratm oluyor. 4Gradle

4Gradle

4GradleWhy Gradle?

ConcisenessPolyglotMultiple teamsMultiple languagesCoordinated releasesProduct Deliverymore than just building APKSdocumentation with tested code examplesauto-provisioned dev environmentsautomated release process

Author (A) - yaklak 3000 satrda yaplan ii, basit bir ekilde tanmlamamz salyor. ok fazla sayd takm, farkl yazlm dilleri vs olabilir. Bunlara encapsule ediyor.Tamam herey bittikten sonra apky retiyoruz. 4GradleHow to force Gradle to rerun the tasks even if they are up to date? (without clean)

./gradlew build - -rerun-tasks

4GradleBuilding with Gradle

2-phase build:Configuration phase > build task graph Execution phase > execute task graph

Author (A) - xml property files build 4GradleExecution Phase

Incremental Build Feature

Inputs > Task > Output

Define Inputs and Outputs on your custom tasks.

4Gradle

4GradleExecution Phase

Continuous Build Feature

gradlew test -t

4GradleHow to force Gradle to always run a given task Y after task X?

taskY.mustRunAfter taskX

Author (A) - Bireyleri check etiquette hemen sonra baka bir eyin almasn istiyoruz 4GradleBuilding with Gradle - Experimental

Know all things, build some thingsKnow some things, build some things.

Author (A) - Bireyleri check etiquette hemen sonra baka bir eyin almasn istiyoruz 4Gradle

4Jack And Jill Build System

Author (A) - Android studioda map activity iin yeni bir template var. Eskiden bir map ieren uygulama yazabilmek iin(google play servicesi kullanan), ilk nce map activityyi yaratyorduk. Ki sadece yaratarak yapabileceimiz hi bir ey yok aslnda. Sonrasnda google developer consolea gidip, gdcda bir application yaratmamz gerekiyordu. Uygulamay yarattktan sonra mapping apiy aabiliyoruz. Servislere eriebilmek iin bir API key alyoruz. Android Studiodaki map templatein yaratrsak, arkada hidden olarak api keyi de yaratm oluyor. 4The Jack and Jill Build SystemASSETSASSETSXML resources (.xml)Compiled XML resources (.xml)Source code(.java)Libraries(.class)Runtime(.class)Java bytecode(.class)Libraries(.class)

Dalvik bytecode (classes.dex)

JavacDxAaptAndroid Build SystemAapt: Android Asset Packaging Tool

4The Jack and Jill Build SystemASSETSASSETSXML resources (.xml)Compiled XML resources (.xml)Source code(.java)Libraries(.class)Runtime(.class)Java bytecode(.class)Libraries(.class)

Dalvik bytecode (classes.dex)

JavacDxAaptProguard

ProguardOptimized Java bytecode(.class)

ProGuard config (.txt)ProGuard mapping (.txt)

4The Jack and Jill Build SystemASSETSASSETSXML resources (.xml)Compiled XML resources (.xml)Source code(.java)Libraries(.class)Runtime(.class)Libraries(.jayce)

Dalvik bytecode (classes.dex)

JackAaptJack and Jill

ProGuard config (.txt)ProGuard mapping (.txt)Runtime(.jayce)

JillJill

4The Jack and Jill Build SystemHow to use Jack using Gradle

Build Tools 21.1.1Android Stuid 1.0.0+

android { ... buildToolsRevision 21.1.2 defaultConfig { // Enable the experimental Jack build tools. useJack = true } ...}

4The Jack and Jill Build SystemUsing command lines

Jack usage:java -jar /build-tools/21.1.1/jack.jar --help

Jill usage:java -jar /build-tools/21.1.1/jill.jar --help

4The Jack and Jill Build SystemImplications of Jack and Jill

Java Annotation processors - supported in JackE.g. Dagger, ButterknifeBytecode processors - only supported via JillE.g. JaCoCo, RetrolambdaOther JVM languages - only supported via JillE.g. Scala, Groovy, art

4The Jack and Jill Build SystemShrinking and Obfuscation support

"--config-proguard" Common options:

@-include-basedirectory-injars-outjars // only 1 output jar supported-libraryjars-dontoptimize // required: Jack does not optimize-dontpreverify // required: Jack does not preverify-dontskipnonpubliclibraryclasses-dontskipnonpubliclibraryclassmembers-forceprocessing-keep-keepclassmembers-keepclasseswithmembers-keepnames-keepclassmembernames-keepclasseswithmembernames-printseeds

4The Jack and Jill Build SystemShrinking and Obfuscation support

Obfuscation options:

-dontobfuscate-printmapping-applymapping-obfuscationdictionary-classobfuscationdictionary-packageobfuscationdictionary-useuniqueclassmembernames-dontusemixedcaseclassnames-keeppackagenames-flattenpackagehierarchy-repackageclasses-keepattributes-adaptclassstrings

4The Jack and Jill Build System

56 sn11 sn9 sn8 sn32 sn53 sn29 sn2m50sn1m48sn20sn9sn9sn11sn

4The Jack and Jill Build System

4The Jack and Jill Build System

4RxJava, RxAndroid

4RxJava, RxAndroidReactiveX created by Microsofta library for composing asynchronous and event-based programs by using observable sequences

RxJavaa Java VM implementation of ReactiveXLightweightPolygot ImplementationJava6+JVM-based languages Groovy, Clojure, JRuby, Kotlin, ScalaRxJava Libraries : Hystrix, Camel RX, rxjava-http-tail, mod-rxvertx - Extension for VertX, rxjava-jdbc, rtree

Author (A) - Of the main thread 4RxJava, RxAndroidRxJava

Simple Observable

Observable countObservable = Observable.from(Arrays.asList(new Integer[]{2, 3, 5,7})). filter(n -> n % 2 !=0). count(). map(n -> String.format("%d items(s)", n));

countObservable.subscribe(new Subscriber(){ @Override public void onCompleted(){

} @Override public void onError(Throwable e){

} @Override public void onNext(String s){ Log.d("get reactive!", s); }});

Author (A) - Farkl threadde alyor. 4RxJava, RxAndroidRxJava

Processing Chain

Transformersmap, flattop, scanFiltersfilter, trottle, take, shipConditionsamb, skipWhile, takeWhileCombinationsconcat, zip, combineLatestAggregatecount, reduce, toList, toMap

Author (A) - Farkl threadde alyor. 4RxJava, RxAndroidRxAndroid: Reactive Extensions for Android

adds the minimum classes to RxJava that make writing reactive components in Android applications easy and hassle-free. provides a Scheduler that schedules on the main UI thread or any given Handler

4RxJava, RxAndroidRxAndroid

Making Listeners Reactive:

Author (A) - Android, plain Java deil, daha ok UI. 4RxJava, RxAndroidRxAndroid

Making Listeners Reactive:

final Observable myButtonClickObservable = Observable.create(subscriber -> { myButton.setOnClickListener(v -> { if (!subscriber.isUnsubscribed()) { subscriber.onNext(v); } }); }); myButtonClickObservable.subscribe(v -> triggerAction());myButtonClickObservable. delay(100, TimeUnit.MILLISECONDS). observeOn(Schedulers.io()). subscribe(v -> triggerAction());

Author (A) - Android, plain Java deil, daha ok UI.Native yazlan bir login ekrannda kullanlabilir. 4RxJava, RxAndroidRxAndroid

RxBindings:

RxView.clicks(myButton).subscribe(v -> triggerAction());

Others and more:

RxView, RxTextView, RxAdapter, RxAdapterView, RxAutoCompleteTextView, RxCheckedTextView, RxCompoundButton, RxMenuItem, RxSeekBar, RxViewGroup, RxProgressBar, RxRadioGroup, RxRatingBar, RxRecylerView, RxRecylerViewAdapter, RxSearchView, RxToolBar..rxbinding-support-v4:0.3.0rxbinding-appcompat-v7:0.3.0rxbinding-design:0.3.0rxbinding-recyclerview-v7:0.3.0rxbinding-leanback-v17:0.3.0

Author (A) - Android, plain Java deil, daha ok UI. 4Kotlin

4Kotlin

Kotlin is a statically-typed programming language that runs on the Java Virtual Machine and also can be compiled to JavaScript source code. Its primary development is from a team of JetBrains.

Philosophy

Development lead Andrey Breslav has said that Kotlin is designed to be an industrial-strength object-oriented language, and to be a better language than Java but still be fully interoperable with Java code, allowing companies to make a gradual migration from Java to Kotlin.

Author (A) - Android, plain Java deil, daha ok UI. 4KotlinWhy Kotlin?

Concise

Author (A) - Android, plain Java deil, daha ok UI. 4KotlinWhy Kotlin?

Safe

4KotlinWhy Kotlin?

Versatile

Author (A) - Android, plain Java deil, daha ok UI. 4KotlinWhy Kotlin?

Interoperable

4KotlinAndroid and Kotlin

4KotlinAndroid and Kotlin

Author (A) - Android, plain Java deil, daha ok UI. 4KotlinAndroid and Kotlin

Author (A) - Android, plain Java deil, daha ok UI. 4KotlinAndroid and Kotlin

Author (A) - Android, plain Java deil, daha ok UI. 64Questions?@elifbonc_+ElifBoncukwww.elifboncuk.wordpress.comThank you!@elifbonc_+ElifBoncukwww.elifboncuk.wordpress.com

64Referenceshttp://droidcon.com/https://skillsmatter.com/conferences/6712-droidcon-2015https://medium.com/google-developers/developing-for-android-introduction-5345b451567c#.nbwgkioulhttps://photos.google.com/share/AF1QipMRnZL6gNbS06fnBNtKffRm9HBaxW8iP6w0L1T4nZYLI6s3wi_l8daT6mq4nwPf-w?key=LThZNmFXUUtmNi04bWlEYmVfcWdPenlvaDdCRU13 http://tools.android.com/tech-docs/jackandjillhttp://reactivex.io/intro.htmlhttps://github.com/ReactiveX/RxJava/wikihttps://github.com/ReactiveX/RxAndroidhttps://github.com/JakeWharton/RxBindinghttps://kotlinlang.org/docs/tutorials/kotlin-android.html https://en.wikipedia.org/wiki/Kotlin_(programming_language)https://kotlinlang.org/ http://developer.android.com/tools/building/configuring-gradle.html http://gradle.org/https://docs.gradle.org https://developers.google.com/maps/documentation/utilities/polylinealgorithm https://developers.google.com/maps/documentation/android-api/utility/?hl=enhttp://gradle.org/feature-spotlight-incremental-builds/http://gradle.org/feature-spotlight-continuous-build/