SlideShare ist ein Scribd-Unternehmen logo
1 von 80
DROIDCON UK 2015
London, England
Elif BONCUK
Date (09/12/2015)
DroidCon
2
• To 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
• Europe’s 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
Agenda
• Android for Java Developers
• Meaningful Motion
• Mobile Services From Google
• Gradle - Gradle Performance
• Jack and Jill Build System
• RxJava, RxAndroid
• Kotlin Language
4
Android For Java Developers
The lead of the Android UI Toolkit team at Google
Developing for Android: Contents Introduction
I: Understanding the Mobile Context
II: The Rules: Memory
III: The Rules: Performance
IV: The Rules: Networking
V: The Rules: Language & Libraries
VI: The Rules: Storage
VII: The Rules: Framework
VIII: The Rules: User Interface
IX: Tools
https://medium.com/google-developers/developing-for-android-introduction-5345b451567c#.nbwgkioul
4
Android For Java Developers…
Java Programming Language
Runtime
Hardware
Language != Platform
Server - Runtime
Server
Java Programming Language
Dalvik
Server-Land Android
Moving,
compacting
collector
CPU: very
very fast
Memory:
Basically ∞
ART
CPU: wayyyy
slower
Idle
Compaction
No
Compaction
Java Programming Language
4
Android For Java Developers…
Memory
• Limited
• Shared
• Memory = Performance
4
Android For Java Developers…
4
Android For Java Developers…
4
Android For Java Developers…
4
Android For Java Developers…
Fewer allocations lead to:
• Smaller heap
• Faster allocation times
• Faster collection times
• Fewer pauses
• Less CPU usage
• Happier users!
4
Android For Java Developers…
Host tools
• Systrace
• Allocation Tracker
• Traceview
• Hierarchyviewer
• MAT
• Memory monitor
4
Android For Java Developers…
Device tools
• StrictMode
• GPU profiling
• GPU overdraw
• Screenrecord
• Hardware layer updates
4
Making Your App Better
4
Making Your App Better…
Animation APIs
• ViewPropertyAnimator
• ObjectAnimators
• Interpolators
• Circular reveals
• Transitions
• Window content transitions
• Shared element transitions
• AnimatedVectorDrawables
4
Making Your App Better…
ViewPropertyAnimator
Simple View Animations - 4.1+
4
Making Your App Better…
Object Animator
Animate all the things - 3.0+
4
Making Your App Better…
Interpolars
Easing in and out
4
Making Your App Better…
Circular Reveals
4
Making Your App Better…
Transitions
4
Making Your App Better…
Transitions
4
Making Your App Better…
Transitions
4
Making Your App Better…
Window content transitions
4
Making Your App Better…
Shared element transitions
4
Making Your App Better…
AnimatedVectorDrawables
4
Mobile Services From Google
4
Mobile Services From Google
Tip One: New Android Studio Template
4
Mobile Services From Google
Tip Two: Use Lite Mode Maps
https://developers.google.com/maps/documentation/android-api/lite?hl=en
4
Mobile Services From Google
Tip Three: Consider GeoJSON or KML
• Standard formats for encoding geo data (GeoJSON) or
outlines KML
• Android Map Utils library includes parsers for these
• Can save you a lot of coding in some scenarios, and
provides an optimized experience
4
Mobile Services From Google
Tip Four: Cluster is not a bad word!
4
Mobile Services From Google
Tip 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.
4
Mobile Services From Google
Tip Six: Curated Locations
• The Places API is awesome
Don’t just call it blindly
• Consider Curation
Local DB
Backed up with Places
• Be careful of TOS
Don’t cache places
Use their IDs
4
Mobile Services From Google
Tip Seven: Location Sensor Optimisation
• Know when to start and stop listening
• getLastKnownLocation
• if you need a location quickly
• Maintain a best estimate
• Compare update with previous ones and remove bad
data
• Adjust the Fused Location Provider as needed
• Remember, the most sensitive, the higher the cost
4
Mobile Services From Google
Tip Eight: Map Overlays
• Be careful when using overlays
• Good example: trafic
• Bad example: different coloured pins on different
overlays!
• Always give the users to turn them on and off.
4
Mobile Services From Google
Tip Nine: Using Beacons
• Consider Beacon Virtualisation
• Track the Beacon namespace / id in your own DB
• Assign these to real world locations
4
Mobile Services From Google
Tip Ten: API Utility Library
• GeoJSON / KML
• Heatmaps
• Customized Markers
• Clusters
• Polyline Encoding
• Distance, Area, Heading Calculation
• Open Source!
4
Gradle
4
Gradle
4
Gradle…
4
Gradle…
Why Gradle?
• Conciseness
• Polyglot
• Multiple teams
• Multiple languages
• Coordinated releases
• Product Delivery
• more than just building APKS
• documentation with tested code examples
• auto-provisioned dev environments
• automated release process
4
Gradle…
• How to force Gradle to rerun the tasks even if they are up
to date? (without clean)
./gradlew build - -rerun-tasks
4
Gradle…
Building with Gradle
2-phase build:
• Configuration phase —> build task graph
• Execution phase —> execute task graph
4
Gradle…
Execution Phase
• Incremental Build Feature
Inputs —> Task —> Output
Define Inputs and Outputs on your custom
tasks.
4
Gradle…
4
Gradle…
Execution Phase
• Continuous Build Feature
gradlew test -t
4
Gradle…
• How to force Gradle to always run a given task Y after task
X?
taskY.mustRunAfter taskX
4
Gradle…
Building with Gradle - Experimental
• Know all things, build some things
• Know some things, build some things.
4
Gradle…
4
Jack And Jill Build System
4
The Jack and Jill Build System
ASSETS ASSETS
XML resources
(.xml)
Compiled
XML resources
(.xml)
Source code
(.java)
Libraries
(.class)
Runtime
(.class)
Java bytecode
(.class)
Libraries
(.class)
Dalvik bytecode
(classes.dex)
Javac Dx
Aapt
Android Build System
Aapt: Android Asset Packaging Tool
4
The Jack and Jill Build System
ASSETS ASSETS
XML resources
(.xml)
Compiled
XML resources
(.xml)
Source code
(.java)
Libraries
(.class)
Runtime
(.class)
Java
bytecode
(.class)
Libraries
(.class)
Dalvik bytecode
(classes.dex)
Javac Dx
Aapt
Proguard
Proguard
Optimized
Java
bytecode
(.class)
ProGuard
config (.txt)
ProGuard
mapping (.txt)
4
The Jack and Jill Build System
ASSETS ASSETS
XML resources
(.xml)
Compiled
XML resources
(.xml)
Source code
(.java)
Libraries
(.class)
Runtime
(.class)
Libraries
(.jayce)
Dalvik bytecode
(classes.dex)
Jack
Aapt
Jack and Jill
ProGuard
config (.txt)
ProGuard
mapping (.txt)
Runtime
(.jayce)
Jill
Jill
4
The Jack and Jill Build System…
How to use Jack using Gradle
Build Tools 21.1.1
Android Stuid 1.0.0+
android {
...
buildToolsRevision ‘21.1.2’
defaultConfig {
// Enable the experimental Jack build tools.
useJack = true
}
...
}
4
The Jack and Jill Build System…
Using command lines
Jack usage:
java -jar <SDK>/build-tools/21.1.1/jack.jar --help
Jill usage:
java -jar <SDK>/build-tools/21.1.1/jill.jar --help
4
The Jack and Jill Build System…
Implications of Jack and Jill
• Java Annotation processors - supported in Jack
E.g. Dagger, Butterknife
• Bytecode processors - only supported via Jill
E.g. JaCoCo, Retrolambda
• Other JVM languages - only supported via Jill
E.g. Scala, Groovy, art
4
The Jack and Jill Build System…
Shrinking 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
4
The Jack and Jill Build System…
Shrinking and Obfuscation support
Obfuscation options:
-dontobfuscate
-printmapping
-applymapping
-obfuscationdictionary
-classobfuscationdictionary
-packageobfuscationdictionary
-useuniqueclassmembernames
-dontusemixedcaseclassnames
-keeppackagenames
-flattenpackagehierarchy
-repackageclasses
-keepattributes
-adaptclassstrings
4
The Jack and Jill Build System…
56 sn
11 sn
9 sn
8 sn
32 sn
53 sn
29 sn
2m50sn
1m48sn
20sn
9sn
9sn
11sn
4
The Jack and Jill Build System…
4
The Jack and Jill Build System…
4
RxJava, RxAndroid
4
RxJava, RxAndroid
ReactiveX
• created by Microsoft
a library for composing asynchronous and event-based
programs by using observable sequences
RxJava
• a Java VM implementation of ReactiveX
• Lightweight
• Polygot Implementation
• Java6+
• JVM-based languages Groovy, Clojure, JRuby, Kotlin,
Scala
• RxJava Libraries : Hystrix, Camel RX, rxjava-http-tail,
mod-rxvertx - Extension for VertX, rxjava-jdbc, rtree
4
RxJava, RxAndroid…
RxJava
Simple Observable
Observable<String> 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<String>(){
@Override
public void onCompleted(){
}
@Override
public void onError(Throwable e){
}
@Override
public void onNext(String s){
Log.d("get reactive!", s);
}
});
4
RxJava, RxAndroid…
RxJava
Processing Chain
• Transformers
• map, flattop, scan
• Filters
• filter, trottle, take, ship
• Conditions
• amb, skipWhile, takeWhile
• Combinations
• concat, zip, combineLatest
• Aggregate
• count, reduce, toList, toMap
4
RxJava, RxAndroid…
RxAndroid: 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
4
RxJava, RxAndroid…
RxAndroid
Making Listeners Reactive:
4
RxJava, RxAndroid…
RxAndroid
Making Listeners Reactive:
final Observable<Void> 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());
4
RxJava, RxAndroid…
RxAndroid
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.0
rxbinding-appcompat-v7:0.3.0
rxbinding-design:0.3.0
rxbinding-recyclerview-v7:0.3.0
rxbinding-leanback-v17:0.3.0
4
Kotlin
4
Kotlin
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.
4
Kotlin…
Why Kotlin?
• Concise
4
Kotlin…
Why Kotlin?
• Safe
4
Kotlin…
Why Kotlin?
• Versatile
4
Kotlin…
Why Kotlin?
• Interoperable
4
Kotlin…
Android and Kotlin
4
Kotlin…
Android and Kotlin
4
Kotlin…
Android and Kotlin
4
Kotlin…
Android and Kotlin
64
Questions?
Thank you!
@elifbonc_
+ElifBoncuk
www.elifboncuk.wordpress.com
64
References
• http://droidcon.com/
• https://skillsmatter.com/conferences/6712-droidcon-2015
• https://medium.com/google-developers/developing-for-android-introduction-
5345b451567c#.nbwgkioul
• https://photos.google.com/share/AF1QipMRnZL6gNbS06fnBNtKffRm9HBaxW8iP6w0L1T4nZYLI6
s3wi_l8daT6mq4nwPf-w?key=LThZNmFXUUtmNi04bWlEYmVfcWdPenlvaDdCRU13
• http://tools.android.com/tech-docs/jackandjill
• http://reactivex.io/intro.html
• https://github.com/ReactiveX/RxJava/wiki
• https://github.com/ReactiveX/RxAndroid
• https://github.com/JakeWharton/RxBinding
• https://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=en
• http://gradle.org/feature-spotlight-incremental-builds/
• http://gradle.org/feature-spotlight-continuous-build/

Weitere ähnliche Inhalte

Was ist angesagt?

Incremental deployment of new features
Incremental deployment of new featuresIncremental deployment of new features
Incremental deployment of new featuressullis
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011sullis
 
Production Ready Web Services with Dropwizard
Production Ready Web Services with DropwizardProduction Ready Web Services with Dropwizard
Production Ready Web Services with Dropwizardsullis
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersAmbarish Hazarnis
 
Kirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UIKirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UIjhugman
 
A realtime infrastructure for Android apps: Firebase may be what you need..an...
A realtime infrastructure for Android apps: Firebase may be what you need..an...A realtime infrastructure for Android apps: Firebase may be what you need..an...
A realtime infrastructure for Android apps: Firebase may be what you need..an...Alessandro Martellucci
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Bitbar
 
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Matt Raible
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...Matt Raible
 
Azure mobile apps
Azure mobile appsAzure mobile apps
Azure mobile appsDavid Giard
 
Google Glasses Integration with SAP
Google Glasses Integration with SAPGoogle Glasses Integration with SAP
Google Glasses Integration with SAPGh14Cc10
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureVijay Rastogi
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitAriya Hidayat
 
Engineering and Industrial Mobile Application (APP) Development
Engineering and Industrial Mobile Application (APP) DevelopmentEngineering and Industrial Mobile Application (APP) Development
Engineering and Industrial Mobile Application (APP) DevelopmentLiving Online
 
Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5Oswald Campesato
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumTechday7
 
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Matt Raible
 
Choosing a Java Web Framework
Choosing a Java Web FrameworkChoosing a Java Web Framework
Choosing a Java Web FrameworkWill Iverson
 

Was ist angesagt? (20)

Incremental deployment of new features
Incremental deployment of new featuresIncremental deployment of new features
Incremental deployment of new features
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011
 
Production Ready Web Services with Dropwizard
Production Ready Web Services with DropwizardProduction Ready Web Services with Dropwizard
Production Ready Web Services with Dropwizard
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - Beginners
 
Kirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UIKirin - Making Single Page Web Apps with a Native UI
Kirin - Making Single Page Web Apps with a Native UI
 
A realtime infrastructure for Android apps: Firebase may be what you need..an...
A realtime infrastructure for Android apps: Firebase may be what you need..an...A realtime infrastructure for Android apps: Firebase may be what you need..an...
A realtime infrastructure for Android apps: Firebase may be what you need..an...
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
Mobile Development with Ionic, React Native, and JHipster - ACGNJ Java Users ...
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
 
Android Test Automation Workshop
Android Test Automation WorkshopAndroid Test Automation Workshop
Android Test Automation Workshop
 
Azure mobile apps
Azure mobile appsAzure mobile apps
Azure mobile apps
 
Google Glasses Integration with SAP
Google Glasses Integration with SAPGoogle Glasses Integration with SAP
Google Glasses Integration with SAP
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
 
Engineering and Industrial Mobile Application (APP) Development
Engineering and Industrial Mobile Application (APP) DevelopmentEngineering and Industrial Mobile Application (APP) Development
Engineering and Industrial Mobile Application (APP) Development
 
Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
Spring Boot APIs and Angular Apps: Get Hip with JHipster! KCDC 2019
 
Choosing a Java Web Framework
Choosing a Java Web FrameworkChoosing a Java Web Framework
Choosing a Java Web Framework
 

Andere mochten auch

What we use to build Android apps at Silicon Straits
What we use to build Android apps at Silicon StraitsWhat we use to build Android apps at Silicon Straits
What we use to build Android apps at Silicon StraitsSilicon Straits
 
Optimizing apps for better performance extended
Optimizing apps for better performance extended Optimizing apps for better performance extended
Optimizing apps for better performance extended Elif Boncuk
 
Workshop on Search Engine Optimization
Workshop on Search Engine OptimizationWorkshop on Search Engine Optimization
Workshop on Search Engine OptimizationAdarsh Patel
 
Project Analysis - How to Start Project Develoment
Project Analysis - How to Start Project DevelomentProject Analysis - How to Start Project Develoment
Project Analysis - How to Start Project DevelomentAdarsh Patel
 
Workhsop on Logic Building for Programming
Workhsop on Logic Building for ProgrammingWorkhsop on Logic Building for Programming
Workhsop on Logic Building for ProgrammingAdarsh Patel
 
Hack'n Break Android Workshop
Hack'n Break Android WorkshopHack'n Break Android Workshop
Hack'n Break Android WorkshopElif Boncuk
 
Lecture 04. Mobile App Design
Lecture 04. Mobile App DesignLecture 04. Mobile App Design
Lecture 04. Mobile App DesignMaksym Davydov
 
What's new in Android at I/O'16
What's new in Android at I/O'16What's new in Android at I/O'16
What's new in Android at I/O'16Elif Boncuk
 
Android Udacity Study group 1
Android Udacity Study group 1Android Udacity Study group 1
Android Udacity Study group 1Aly Abdelkareem
 
Fundamental of android
Fundamental of androidFundamental of android
Fundamental of androidAdarsh Patel
 
Working better together designers &amp; developers
Working better together   designers &amp; developersWorking better together   designers &amp; developers
Working better together designers &amp; developersVitali Pekelis
 
Management Innovation
Management Innovation Management Innovation
Management Innovation Elif Boncuk
 
Workshop Android for Java Developers
Workshop Android for Java DevelopersWorkshop Android for Java Developers
Workshop Android for Java Developersmhant
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your appVitali Pekelis
 
Lecture 06. iOS Programming. Основи Objective-C
Lecture 06. iOS Programming. Основи Objective-CLecture 06. iOS Programming. Основи Objective-C
Lecture 06. iOS Programming. Основи Objective-CMaksym Davydov
 
Workshop on How to crack interview
Workshop on How to crack interviewWorkshop on How to crack interview
Workshop on How to crack interviewAdarsh Patel
 
Android Development Workshop
Android Development WorkshopAndroid Development Workshop
Android Development WorkshopPeter Robinett
 

Andere mochten auch (20)

What we use to build Android apps at Silicon Straits
What we use to build Android apps at Silicon StraitsWhat we use to build Android apps at Silicon Straits
What we use to build Android apps at Silicon Straits
 
App indexing api
App indexing apiApp indexing api
App indexing api
 
Optimizing apps for better performance extended
Optimizing apps for better performance extended Optimizing apps for better performance extended
Optimizing apps for better performance extended
 
Workshop on Search Engine Optimization
Workshop on Search Engine OptimizationWorkshop on Search Engine Optimization
Workshop on Search Engine Optimization
 
Project Analysis - How to Start Project Develoment
Project Analysis - How to Start Project DevelomentProject Analysis - How to Start Project Develoment
Project Analysis - How to Start Project Develoment
 
Workhsop on Logic Building for Programming
Workhsop on Logic Building for ProgrammingWorkhsop on Logic Building for Programming
Workhsop on Logic Building for Programming
 
Hack'n Break Android Workshop
Hack'n Break Android WorkshopHack'n Break Android Workshop
Hack'n Break Android Workshop
 
Lecture 04. Mobile App Design
Lecture 04. Mobile App DesignLecture 04. Mobile App Design
Lecture 04. Mobile App Design
 
Android development session 3 - layout
Android development   session 3 - layoutAndroid development   session 3 - layout
Android development session 3 - layout
 
What's new in Android at I/O'16
What's new in Android at I/O'16What's new in Android at I/O'16
What's new in Android at I/O'16
 
Android development session 4 - Fragments
Android development   session 4 - FragmentsAndroid development   session 4 - Fragments
Android development session 4 - Fragments
 
Android Udacity Study group 1
Android Udacity Study group 1Android Udacity Study group 1
Android Udacity Study group 1
 
Fundamental of android
Fundamental of androidFundamental of android
Fundamental of android
 
Working better together designers &amp; developers
Working better together   designers &amp; developersWorking better together   designers &amp; developers
Working better together designers &amp; developers
 
Management Innovation
Management Innovation Management Innovation
Management Innovation
 
Workshop Android for Java Developers
Workshop Android for Java DevelopersWorkshop Android for Java Developers
Workshop Android for Java Developers
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your app
 
Lecture 06. iOS Programming. Основи Objective-C
Lecture 06. iOS Programming. Основи Objective-CLecture 06. iOS Programming. Основи Objective-C
Lecture 06. iOS Programming. Основи Objective-C
 
Workshop on How to crack interview
Workshop on How to crack interviewWorkshop on How to crack interview
Workshop on How to crack interview
 
Android Development Workshop
Android Development WorkshopAndroid Development Workshop
Android Development Workshop
 

Ähnlich wie Overview of DroidCon UK 2015

EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...
EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...
EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...Pietro F. Maggi
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkImam Raza
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionDuckMa
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi androidsusijanny
 
Android app development
Android app developmentAndroid app development
Android app developmentAbhishek Saini
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013DuckMa
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the EnterpriseJames Williams
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1drudolph11
 
Wearable Development Ecosystem
Wearable Development EcosystemWearable Development Ecosystem
Wearable Development EcosystemAmish Gandhi
 
Android Introduction
Android IntroductionAndroid Introduction
Android IntroductionPamil Gurung
 
Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA NITIN GUPTA
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator PresentationAaron Saunders
 
Introduction to android mobile app development.pptx
Introduction to android mobile app development.pptxIntroduction to android mobile app development.pptx
Introduction to android mobile app development.pptxridzah12
 
Android Scripting
Android ScriptingAndroid Scripting
Android ScriptingJuan Gomez
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and SecurityKelwin Yang
 

Ähnlich wie Overview of DroidCon UK 2015 (20)

EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...
EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...
EMEA AppForum 2015 Android KitKat & Lollipop - new features for enterprise de...
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talk
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
 
Android app development
Android app developmentAndroid app development
Android app development
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the Enterprise
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1Windows 8 DevUnleashed - Session 1
Windows 8 DevUnleashed - Session 1
 
Wearable Development Ecosystem
Wearable Development EcosystemWearable Development Ecosystem
Wearable Development Ecosystem
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA Android Application Development Training by NITIN GUPTA
Android Application Development Training by NITIN GUPTA
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator Presentation
 
Introduction to android mobile app development.pptx
Introduction to android mobile app development.pptxIntroduction to android mobile app development.pptx
Introduction to android mobile app development.pptx
 
Android Scripting
Android ScriptingAndroid Scripting
Android Scripting
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
 

Overview of DroidCon UK 2015

  • 1. DROIDCON UK 2015 London, England Elif BONCUK Date (09/12/2015)
  • 2. DroidCon 2 • To 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
  • 3. DroidCon UK 2015 2 • Hosted in Business Design Center London for the 6th year • Europe’s 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
  • 4. Agenda • Android for Java Developers • Meaningful Motion • Mobile Services From Google • Gradle - Gradle Performance • Jack and Jill Build System • RxJava, RxAndroid • Kotlin Language
  • 5. 4 Android For Java Developers The lead of the Android UI Toolkit team at Google Developing for Android: Contents Introduction I: Understanding the Mobile Context II: The Rules: Memory III: The Rules: Performance IV: The Rules: Networking V: The Rules: Language & Libraries VI: The Rules: Storage VII: The Rules: Framework VIII: The Rules: User Interface IX: Tools https://medium.com/google-developers/developing-for-android-introduction-5345b451567c#.nbwgkioul
  • 6. 4 Android For Java Developers… Java Programming Language Runtime Hardware Language != Platform Server - Runtime Server Java Programming Language Dalvik Server-Land Android Moving, compacting collector CPU: very very fast Memory: Basically ∞ ART CPU: wayyyy slower Idle Compaction No Compaction Java Programming Language
  • 7. 4 Android For Java Developers… Memory • Limited • Shared • Memory = Performance
  • 8. 4 Android For Java Developers…
  • 9. 4 Android For Java Developers…
  • 10. 4 Android For Java Developers…
  • 11. 4 Android For Java Developers… Fewer allocations lead to: • Smaller heap • Faster allocation times • Faster collection times • Fewer pauses • Less CPU usage • Happier users!
  • 12. 4 Android For Java Developers… Host tools • Systrace • Allocation Tracker • Traceview • Hierarchyviewer • MAT • Memory monitor
  • 13. 4 Android For Java Developers… Device tools • StrictMode • GPU profiling • GPU overdraw • Screenrecord • Hardware layer updates
  • 15. 4 Making Your App Better… Animation APIs • ViewPropertyAnimator • ObjectAnimators • Interpolators • Circular reveals • Transitions • Window content transitions • Shared element transitions • AnimatedVectorDrawables
  • 16. 4 Making Your App Better… ViewPropertyAnimator Simple View Animations - 4.1+
  • 17. 4 Making Your App Better… Object Animator Animate all the things - 3.0+
  • 18. 4 Making Your App Better… Interpolars Easing in and out
  • 19. 4 Making Your App Better… Circular Reveals
  • 20. 4 Making Your App Better… Transitions
  • 21. 4 Making Your App Better… Transitions
  • 22. 4 Making Your App Better… Transitions
  • 23. 4 Making Your App Better… Window content transitions
  • 24. 4 Making Your App Better… Shared element transitions
  • 25. 4 Making Your App Better… AnimatedVectorDrawables
  • 27. 4 Mobile Services From Google Tip One: New Android Studio Template
  • 28. 4 Mobile Services From Google Tip Two: Use Lite Mode Maps https://developers.google.com/maps/documentation/android-api/lite?hl=en
  • 29. 4 Mobile Services From Google Tip Three: Consider GeoJSON or KML • Standard formats for encoding geo data (GeoJSON) or outlines KML • Android Map Utils library includes parsers for these • Can save you a lot of coding in some scenarios, and provides an optimized experience
  • 30. 4 Mobile Services From Google Tip Four: Cluster is not a bad word!
  • 31. 4 Mobile Services From Google Tip 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.
  • 32. 4 Mobile Services From Google Tip Six: Curated Locations • The Places API is awesome Don’t just call it blindly • Consider Curation Local DB Backed up with Places • Be careful of TOS Don’t cache places Use their IDs
  • 33. 4 Mobile Services From Google Tip Seven: Location Sensor Optimisation • Know when to start and stop listening • getLastKnownLocation • if you need a location quickly • Maintain a best estimate • Compare update with previous ones and remove bad data • Adjust the Fused Location Provider as needed • Remember, the most sensitive, the higher the cost
  • 34. 4 Mobile Services From Google Tip Eight: Map Overlays • Be careful when using overlays • Good example: trafic • Bad example: different coloured pins on different overlays! • Always give the users to turn them on and off.
  • 35. 4 Mobile Services From Google Tip Nine: Using Beacons • Consider Beacon Virtualisation • Track the Beacon namespace / id in your own DB • Assign these to real world locations
  • 36. 4 Mobile Services From Google Tip Ten: API Utility Library • GeoJSON / KML • Heatmaps • Customized Markers • Clusters • Polyline Encoding • Distance, Area, Heading Calculation • Open Source!
  • 40. 4 Gradle… Why Gradle? • Conciseness • Polyglot • Multiple teams • Multiple languages • Coordinated releases • Product Delivery • more than just building APKS • documentation with tested code examples • auto-provisioned dev environments • automated release process
  • 41. 4 Gradle… • How to force Gradle to rerun the tasks even if they are up to date? (without clean) ./gradlew build - -rerun-tasks
  • 42. 4 Gradle… Building with Gradle 2-phase build: • Configuration phase —> build task graph • Execution phase —> execute task graph
  • 43. 4 Gradle… Execution Phase • Incremental Build Feature Inputs —> Task —> Output Define Inputs and Outputs on your custom tasks.
  • 45. 4 Gradle… Execution Phase • Continuous Build Feature gradlew test -t
  • 46. 4 Gradle… • How to force Gradle to always run a given task Y after task X? taskY.mustRunAfter taskX
  • 47. 4 Gradle… Building with Gradle - Experimental • Know all things, build some things • Know some things, build some things.
  • 49. 4 Jack And Jill Build System
  • 50. 4 The Jack and Jill Build System ASSETS ASSETS XML resources (.xml) Compiled XML resources (.xml) Source code (.java) Libraries (.class) Runtime (.class) Java bytecode (.class) Libraries (.class) Dalvik bytecode (classes.dex) Javac Dx Aapt Android Build System Aapt: Android Asset Packaging Tool
  • 51. 4 The Jack and Jill Build System ASSETS ASSETS XML resources (.xml) Compiled XML resources (.xml) Source code (.java) Libraries (.class) Runtime (.class) Java bytecode (.class) Libraries (.class) Dalvik bytecode (classes.dex) Javac Dx Aapt Proguard Proguard Optimized Java bytecode (.class) ProGuard config (.txt) ProGuard mapping (.txt)
  • 52. 4 The Jack and Jill Build System ASSETS ASSETS XML resources (.xml) Compiled XML resources (.xml) Source code (.java) Libraries (.class) Runtime (.class) Libraries (.jayce) Dalvik bytecode (classes.dex) Jack Aapt Jack and Jill ProGuard config (.txt) ProGuard mapping (.txt) Runtime (.jayce) Jill Jill
  • 53. 4 The Jack and Jill Build System… How to use Jack using Gradle Build Tools 21.1.1 Android Stuid 1.0.0+ android { ... buildToolsRevision ‘21.1.2’ defaultConfig { // Enable the experimental Jack build tools. useJack = true } ... }
  • 54. 4 The Jack and Jill Build System… Using command lines Jack usage: java -jar <SDK>/build-tools/21.1.1/jack.jar --help Jill usage: java -jar <SDK>/build-tools/21.1.1/jill.jar --help
  • 55. 4 The Jack and Jill Build System… Implications of Jack and Jill • Java Annotation processors - supported in Jack E.g. Dagger, Butterknife • Bytecode processors - only supported via Jill E.g. JaCoCo, Retrolambda • Other JVM languages - only supported via Jill E.g. Scala, Groovy, art
  • 56. 4 The Jack and Jill Build System… Shrinking 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
  • 57. 4 The Jack and Jill Build System… Shrinking and Obfuscation support Obfuscation options: -dontobfuscate -printmapping -applymapping -obfuscationdictionary -classobfuscationdictionary -packageobfuscationdictionary -useuniqueclassmembernames -dontusemixedcaseclassnames -keeppackagenames -flattenpackagehierarchy -repackageclasses -keepattributes -adaptclassstrings
  • 58. 4 The Jack and Jill Build System… 56 sn 11 sn 9 sn 8 sn 32 sn 53 sn 29 sn 2m50sn 1m48sn 20sn 9sn 9sn 11sn
  • 59. 4 The Jack and Jill Build System…
  • 60. 4 The Jack and Jill Build System…
  • 62. 4 RxJava, RxAndroid ReactiveX • created by Microsoft a library for composing asynchronous and event-based programs by using observable sequences RxJava • a Java VM implementation of ReactiveX • Lightweight • Polygot Implementation • Java6+ • JVM-based languages Groovy, Clojure, JRuby, Kotlin, Scala • RxJava Libraries : Hystrix, Camel RX, rxjava-http-tail, mod-rxvertx - Extension for VertX, rxjava-jdbc, rtree
  • 63. 4 RxJava, RxAndroid… RxJava Simple Observable Observable<String> 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<String>(){ @Override public void onCompleted(){ } @Override public void onError(Throwable e){ } @Override public void onNext(String s){ Log.d("get reactive!", s); } });
  • 64. 4 RxJava, RxAndroid… RxJava Processing Chain • Transformers • map, flattop, scan • Filters • filter, trottle, take, ship • Conditions • amb, skipWhile, takeWhile • Combinations • concat, zip, combineLatest • Aggregate • count, reduce, toList, toMap
  • 65. 4 RxJava, RxAndroid… RxAndroid: 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
  • 67. 4 RxJava, RxAndroid… RxAndroid Making Listeners Reactive: final Observable<Void> 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());
  • 68. 4 RxJava, RxAndroid… RxAndroid 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.0 rxbinding-appcompat-v7:0.3.0 rxbinding-design:0.3.0 rxbinding-recyclerview-v7:0.3.0 rxbinding-leanback-v17:0.3.0
  • 70. 4 Kotlin 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.
  • 80. 64 References • http://droidcon.com/ • https://skillsmatter.com/conferences/6712-droidcon-2015 • https://medium.com/google-developers/developing-for-android-introduction- 5345b451567c#.nbwgkioul • https://photos.google.com/share/AF1QipMRnZL6gNbS06fnBNtKffRm9HBaxW8iP6w0L1T4nZYLI6 s3wi_l8daT6mq4nwPf-w?key=LThZNmFXUUtmNi04bWlEYmVfcWdPenlvaDdCRU13 • http://tools.android.com/tech-docs/jackandjill • http://reactivex.io/intro.html • https://github.com/ReactiveX/RxJava/wiki • https://github.com/ReactiveX/RxAndroid • https://github.com/JakeWharton/RxBinding • https://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=en • http://gradle.org/feature-spotlight-incremental-builds/ • http://gradle.org/feature-spotlight-continuous-build/