Slide 1

Slide 1 text

What’s new in Android (Development)? Google I/O Extended Yangon June 2015

Slide 2

Slide 2 text

Swan Htet Aung Software Engineer @ nex Product Manager Lead Android Engineer Lead Android Engineer .com

Slide 3

Slide 3 text

What’s new in Android (Development)?

Slide 4

Slide 4 text

M-Developer Preview

Slide 5

Slide 5 text

M Stands for…

Slide 6

Slide 6 text

So… what is new?

Slide 7

Slide 7 text

app permissions App links Battery Android Pay Fingerprint AutoBackup Adoptable External Storage Devices Improved USB flash drive support Launcher and App drawer Dark Mode Quick Settings Notifications Doze and App Standby (power improvements) Direct Share Hotspot 2.0 Bluetooth Stylus support Text Selection Split keyboard for tablets Multi-window mode

Slide 8

Slide 8 text

For development?

Slide 9

Slide 9 text

Icon with Bitmap Icon ic = Icon.createWithResource(context, R.drawable.ic_notification); 
 new Notification.Builder(context) .setSmallIcon(ic) … … … .build();

Slide 10

Slide 10 text

Icon with Bitmap Icon ic = Icon.createWithBitmap(iconBitmap); 
 new Notification.Builder(context) .setSmallIcon(ic) … … … .build();

Slide 11

Slide 11 text

Vector Images Bitmap Vector

Slide 12

Slide 12 text

Text Processing 
 


Slide 13

Slide 13 text

App Link 
 
 http://developer.android.com/preview/features/app-linking.html

Slide 14

Slide 14 text

Voice Interaction

Slide 15

Slide 15 text

Our dream (2014) Hackathon app “Poh”

Slide 16

Slide 16 text

Our dream (2014) • 5 hours • “OK Buddy” • used Pocketsphinx • had to develop custom Dictionary • hard to train • SpeechRecognizer is not good enough (may be I am dumb)

Slide 17

Slide 17 text

Voice Interaction (2015) • add Voice Intents • add Activity to handle those intents

Slide 18

Slide 18 text

Voice Interaction Dependency compile 'com.google.android.gms:play-services:7.5.0' build.gradle compileSdkVersion "android-MNC"
 buildToolsVersion "21.1.2"
 
 defaultConfig {
 minSdkVersion "android-MNC"
 targetSdkVersion "android-MNC"
 }

Slide 19

Slide 19 text


 
 
 
 
 
 
 
 
 AndroidManifest.xml

Slide 20

Slide 20 text

VoiceReceiveActivity.java Intent intent = getIntent(); 
 if (intent == null) {
 finish();
 } else {
 if (SearchIntents.ACTION_SEARCH.equals(intent.getAction())) {
 String query = intent.getStringExtra(SearchManager.QUERY);
 tvResult.setText(query);
 }
 }

Slide 21

Slide 21 text

Voice Interaction • Check out System Actions reference https://developers.google.com/voice-actions/system/#system_actions_reference • Not enough? • Submit your Custom Actions https://developers.google.com/voice-actions/custom-actions What’s Next?

Slide 22

Slide 22 text

Data Binding

Slide 23

Slide 23 text

Data Binding • Still in Beta • Depends on “DataBinding” plugin

Slide 24

Slide 24 text

Data Binding (Beta) • declare POJO types • listen directly in layout XML files

Slide 25

Slide 25 text

buildscript {
 repositories {
 jcenter()
 }
 dependencies {
 classpath 'com.android.tools.build:gradle:1.2.3'
 classpath "com.android.databinding:dataBinder:1.0-rc0"
 }
 } build.grade

Slide 26

Slide 26 text

build.grade /*[ ... ]*/
 
 apply plugin: 'com.android.application'
 apply plugin: 'com.android.databinding'
 
 /*[ ... ]*/

Slide 27

Slide 27 text

activity_data_binding.xml 
 
 
 
 
 
 
 
 
 
 
 


Slide 28

Slide 28 text

DataBindingActivity.java ActivityDataBindingBinding sampleBinding =
 DataBindingUtil.setContentView(this, R.layout.activity_data_binding);
 
 Movie movie = new Movie("Fast & Furious");
 sampleBinding.setMovie(movie);

Slide 29

Slide 29 text

Data Binding • Check out Data Binding Guide http://developer.android.com/tools/data-binding/guide.html • Play with Recycler/List views • Play with other Observable Objects What’s Next?

Slide 30

Slide 30 text

Design Support Library

Slide 31

Slide 31 text

Design Support Library • TextInputLayout • FAB • Snackbar • TabLayout • NavigationView • CoordinatorLayout • AppBarLayout • CollapsingToolbarLayout

Slide 32

Slide 32 text

DataBindingActivity.java dependencies {
 
 compile ‘com.android.support:design:22.2.0' 
 }

Slide 33

Slide 33 text

NavigationView • say Goodbye to Navigation Fragments with ListView • becomes part of MENU • place inside DrawerLayout

Slide 34

Slide 34 text

activity_main.xml 
 
 
 
 
 
 


Slide 35

Slide 35 text

activity_new_drawer.xml 
 
 
 
 
 
 


Slide 36

Slide 36 text

drawer_view.xml 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


Slide 37

Slide 37 text

NewDrawer.java NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(
 new NavigationView.OnNavigationItemSelectedListener() {
 @Override public boolean onNavigationItemSelected(MenuItem menuItem) {
 menuItem.setChecked(true);
 mDrawerLayout.closeDrawers();
 return true;
 }
 });

Slide 38

Slide 38 text

Design Support Lib • Check out ChrisBanes’ https://github.com/chrisbanes/cheesesquare • Start using design support libs in your projects • Support Material Design What’s Next?

Slide 39

Slide 39 text

New upcoming Feature in Android Studio

Slide 40

Slide 40 text

Visual Design Editors

Slide 41

Slide 41 text

Thank You

Slide 42

Slide 42 text

@swanhtet1992 twitter, github, etc…