Украина на Google I/O.
эмоции и впечатления с крупнейшего ежегодного события для всех Google Developerов, презентации с подробностями и фотоотчетами, и девайсы (новый Chromebook, колонку Google Home и Google Pixel).
43. #postiotour
What's New in Android O
Notifications
Autofill Framework
ShortCut Manager
Alert window overlay
Autofill Framework
Kotlin
Instant Apps
Architecture Components
Spring Animation
Picture in Picture
AnimationSet reverse()
ANDROID_ID unique
Background app behavior Adaptive icons
44. #postiotour
Architecture Components
Percictence and Offline
Room stores data in the SQL.
Solving the Lifecycle Problem
ViewModel contains LiveData.
Stored per Activity.
LiveData<T> - observable
Data Holder.
Lifecycle aware component
45. #postiotour
Android Instant Apps
Is the same app but used by demand. Same UI and
Navigation.
Works without installation
Modularization. Every instant app must have one (and
only one) base feature APK and can have a few feature
modules.
Design for multiple entry points. Use DeepLinking.
Sign in with SmartLock works with Instant Apps.
49. #postiotour
Kotlin
data class User(var name: String)
public class VideoGame {
private String name;
public VideoGame(String name) { this.name = name; }
public String getName() { return name; }
public void setName(String name) { this.name = name;}..
@Override
public boolean equals(Object o) {..}
@Override
public int hashCode() {..}
@Override
public String toString() {..}
}
50. #postiotour
Android Animations Spring to Life
Fling friction
Spring Animation
dependencies {
...
compile "com.android.support:support-dynamic-animation:26.0.0-beta2"
}
FlingAnimation fling = new FlingAnimation(view, DynamicAnimation.SCROLL_X);
final SpringAnimation springAnim = new SpringAnimation(view,
DynamicAnimation.TRANSLATION_Y, 0);
51. #postiotour
Android OS Framework
Throttle queries over time. No limits on AlarmManager, SyncAdapter, JobScheduler for periodic work (yet).
Background services stopped shortly after leaving foreground.
JobIntentService. Uses jobs in O+ and services in pre-O. Handles wakelocks for you.
Bg location updates will be provided a few times per hour, wi-fi results in 30min, geofencing 2-3min.
52. #postiotour
Android OS Framework
Alert window type
APPLICATION_OVERLAY
Autofill Framework
AutofillManager afm =
this.getSystemService(AutofillManager.class);
53. #postiotour
Android Support Library
VectorCompatDrawable svg android:fillType
fixed
<aapt:attr
name="android:drawable">
<vector ...>
Path Interpolator
<objectAnimator ..
android:interpolator="@interpolator/path_fastSlo
w"
../>
We can inline drawable
54. #postiotour
Android Support Library
Removed support for SDK < 14 (1400 methods)
Fonts in XML. Fonts are a new resource type
FontsContractCompat with FontProvider.
Provide entire Google Fonts catalog.
android:fontFamily="@font/myfont"
TextView autosize. app:autoSizeTextType="uniform"
56. #postiotour
Android Development Tools
Android Studio 3.0. Breaking Gradle API change. Kotlin. Code -> Convert Java file to Kotlin file.
xml new resource type tools:text="@tools:sample/lorem"
XML Fonts. In layout in the fontFamily option - browse available online fonts.
Profiler. CPU, Memory and Network state.
Instant Apps. Context menu -> Extract -> Modularize (in Canary 1)
Adaptive Icons. In the image asset wizard - option for adaptive icons.
Build Cache. Get output from the cache rather than re-run the task.
Java 8. Use {sourceCompativility JavaVersion.VERSION_1_8..}
Match attribute on build type on lib and app: "debug" lib with debug app.
57. #postiotour
Fragment Tricks
Fragments vs Views
Views display info and publish user interaction events (draw, clicks, scroll). Don't add external
dependencies to a View - service bind, network call.
Fragments integrate with lifecycle and may be aware of other app components. Bind to a service,
communicate with data model.
FragmentManager.beginTransaction()
.replace(R.id.container, fragment1)
.addToBackStack("state1")
.setReorderingAllowed(true)
.commit();
Optimisation
59. #postiotour
Contextual App Experiences
Nearby Messages exposes simple publish and subscribe methods.
Nearby Notifications Triggers an app intent from
beacon to launch an app
Awareness API:
Fence API (Callbacks), Snapshot API (Polling)
Require Google Play services 7.8.0 or higher.
Eddystone supported beacon hardware required. Rely on the phone
detecting a Bt Low Energy beacon nearby.
Fused Location Provider, Activity recognition, Geofencing,
Place detection, State of the device (Time, Headphones)
60. #postiotour
Android Fireside Chat
Q: How do you ensure that OEM actions does not break OS
A: Project Treble created a foundation layer for Android, vendor interface. Reduce the cost of updating
Android OS. New devices will have it.
Q: What's the difference between Systrace and Profiler
A: Systrace gets all of its data from the Linux kernel. Profiler sample the run-time of your app and its
functions.
Q: Are you still working on a data binding
A: Yes it one of our responsibilities
Q: How Kotlin related to Swift
A: We are independent. Kotlin was announced in 2011.
Q: Will Google Play Services will be open-source as Firebase SDK
A: Play Services extends some google apps, which are not open-sourced.
Q: Are you going to implement platform framework components using Kotlin
A: Java code for the near future because of millions of code lines. Main goal -make the Java and Kotlin API
interoperatable
Q: Is Volley still recommended
A: We recommend use Retrofit and OkHttp and Glide
101. #postiotour#dfua
Polymer Summit 2017
August 22-23
Copenhagen, Denmark
Two days of talks, codelabs, and
breakout sessions from the Polymer
team, Googlers, and major
companies using Polymer and Web
Components.
https://events.withgoogle.com/poly
mer-summit-2017/
105. #postiotour
Google Assistant Grows
New platforms: now on iPhone (but only in the US),
later — on Android Auto, on IoT etc.
New ways to build with Google Assistant:
Actions on Google
107. #postiotour
Google Assistant Grows
New platforms: now on iPhone (but only in the US),
later — on Android Auto, on IoT etc.
New ways to build with Google Assistant:
Actions on Google
Transactions API
109. #postiotour
Google Assistant Grows
New platforms: now on iPhone (but only in the US),
later — on Android Auto, on IoT etc.
New ways to build with Google Assistant:
Actions on Google
Transactions API
Google Assistant on Hardware
111. #postiotour#dfua
Actions on Google Developer
Challenge
Win 1 of more than 20 prizes,
including ticket to Google I/O 2018,
for creating an app with Actions on
Google.