android marshmallow demos

45
Android Marshmallow +YossiElkrief MaTriXy Tikal Knowledge +NirHartmann nirhart Drippler

Upload: yossi-elkrief

Post on 27-Jan-2017

596 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Android Marshmallow demos

Android Marshmallow

+YossiElkriefMaTriXyTikal Knowledge

+NirHartmannnirhartDrippler

Page 2: Android Marshmallow demos

Android Marshmallow

+YossiElkriefMaTriXyTikal Knowledge

+NirHartmannnirhartDrippler

Page 3: Android Marshmallow demos

Android Marshmallow

+YossiElkriefMaTriXyTikal Knowledge

+NirHartmannnirhartDrippler

Page 4: Android Marshmallow demos

DemosSeeing is just the beginning

Page 5: Android Marshmallow demos

App Permissions

Page 6: Android Marshmallow demos

Visit The Permission Lab

Runtime permissions

Page 7: Android Marshmallow demos

Voice Interactions

Page 8: Android Marshmallow demos

Getting follow-up user input• Music App

• “play some music”

• “what genre?”

• Home Automation App

• “OK Google, turn on the lights”

• “which room?”

• Verifying that an activity should complete

• “Are you sure?”

Page 9: Android Marshmallow demos

Voice InteractionsVoiceInteractor used for response prompting and confirmation

<activity android:name=“com.demoapps.activities.DemoVoice”> <intent-filter> <action android:name=“com.demoapps.DEMO_ACTION_INTENT” /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.VOICE" /> </intent-filter> </activity>

Page 10: Android Marshmallow demos

Voice Interactions

class DemoVoice extends Activity { @Override public void onResume() { if (isVoiceInteraction()) { // do our voice stuff here } finish(); }}

Page 11: Android Marshmallow demos

Voice Interactions

class VoiceConfirm extends VoiceInteraction.ConfirmationRequest { public VoiceConfirm(String prompt) { super(prompt, null); } @Override public void onConfirmationResult( boolean confirmed, Bundle null) { if (confirmed) { // do voice stuff } finish(); }};

class DemoVoice extends Activity { @Override public void onResume() { if (isVoiceInteraction()) { getVoiceInteractor(). sendRequest(new

VoiceConfirm(userPromptString));} else { finish();}

} }

Page 12: Android Marshmallow demos

Now On Tap

Page 13: Android Marshmallow demos

“Google's 'Now on Tap' is Android's next killer feature” (CNET)

“Google Now on Tap is the coolest Android feature” (ANDROIDPIT)

“The next evolution of the digital concierge” (Tech Republic)

Page 14: Android Marshmallow demos
Page 15: Android Marshmallow demos
Page 16: Android Marshmallow demos
Page 17: Android Marshmallow demos

• Scans your screen only when you press and hold

the Home button

• Fully opt-in feature

• Work out of the box with any app

Page 18: Android Marshmallow demos

FLAG_SECURE

AssistContent

Activity.onProvideAssistData(Bundle)

Application.OnProvideAssistDataListener

Page 19: Android Marshmallow demos

Android BackupRESTORATION SOFTWARE

Page 20: Android Marshmallow demos

Presented in Google IO 2015 by Christiaan Prins and Mike Procopio

Page 21: Android Marshmallow demos

Presented in Google IO 2015 by Christiaan Prins and Mike Procopio

Page 22: Android Marshmallow demos

Presented in Google IO 2015 by Christiaan Prins and Mike Procopio

Page 23: Android Marshmallow demos

Presented in Google IO 2015 by Christiaan Prins and Mike Procopio

Page 24: Android Marshmallow demos

Presented in Google IO 2015 by Christiaan Prins and Mike Procopio

Page 25: Android Marshmallow demos

Presented in Google IO 2015 by Christiaan Prins and Mike Procopio

Page 26: Android Marshmallow demos

NotificationsLook ma, We got an update

Page 27: Android Marshmallow demos

Icons in Notifications

Presented in Google IO 2015

Notification myNotification = new Notification.Builder(context) .setSmallIcon(noti_icon).build();

Icon noti_icon = Icon.createWithResource(context, R.drawable.app_ic_notification);

Page 28: Android Marshmallow demos

Icons in Notifications

Presented in Google IO 2015

Notification myNotification = new Notification.Builder(context) .setSmallIcon(noti_icon).build();

Icon noti_icon = Icon.createWithResource(context, R.drawable.app_ic_notification);

Icon noti_icon = Icon.createWithBitmap(myIconBitmap);

Page 29: Android Marshmallow demos

Icons in Notifications

Presented in Google IO 2015

Notification myNotification = new Notification.Builder(context) .setSmallIcon(noti_icon).build();

Icon noti_icon = Icon.createWithResource(context, R.drawable.app_ic_notification);

Icon noti_icon = Icon.createWithBitmap(myIconBitmap);

72°

Page 30: Android Marshmallow demos

android.graphics.drawable.Icon

Presented in Google IO 2015

Can be either:

Drawable resource id

Bitmap

PNG or JPEG represented by a byte[]

Page 31: Android Marshmallow demos

android.graphics.drawable.Icon

Presented in Google IO 2015

Pay Attention to guidelines

https://www.google.com/design/spec/style/icons.html

Page 32: Android Marshmallow demos

TextNow you can float

Page 33: Android Marshmallow demos

Text SelectionEasier selection Floating palette with action items

Default for TextView Other views

set ActionMode.TYPE_FLOATING

Presented in Google IO 2015

Page 34: Android Marshmallow demos

Higher Quality Text FormattingTextView.setBreakStrategy(int);TextView.setHyphenationFrequency(int); TextView.setIndents(int[] left, int[] right);

Presented in Google IO 2015

Page 35: Android Marshmallow demos

Higher Quality Text FormattingTextView.setBreakStrategy(int);TextView.setHyphenationFrequency(int); TextView.setIndents(int[] left, int[] right);

Presented in Google IO 2015

Page 36: Android Marshmallow demos

App LinkingSEAMLESS HANDOFF FROM WEB TO APP

Page 37: Android Marshmallow demos

[{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.example.myapp", "sha256_cert_fingerprints": ["01:23:45:67:89:AB:CD:..."] }}]

https://example.com/.well-known/statements.json

Presented in Google IO 2015

Page 38: Android Marshmallow demos

[{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.example.myapp", "sha256_cert_fingerprints": ["01:23:45:67:89:AB:CD:..."] }}]

https://example.com/.well-known/statements.json

keytool -list -v -keystore release.keystore

Presented in Google IO 2015

Page 39: Android Marshmallow demos

Direct ShareBECAUSE SHARING IS CARING

Page 40: Android Marshmallow demos

Direct Share<activity ... > <intent-filter> <action android:name="android.intent.action.SEND" /> </intent-filter> <meta-data android:name="android.service.chooser.chooser_target_service" android:value=".MyService" /> </activity>

Page 41: Android Marshmallow demos

Direct Share<activity ... > <intent-filter> <action android:name="android.intent.action.SEND" /> </intent-filter> <meta-data android:name="android.service.chooser.chooser_target_service" android:value=".MyService" /> </activity>

Page 42: Android Marshmallow demos

Direct Share<activity ... > <intent-filter> <action android:name="android.intent.action.SEND" /> </intent-filter> <meta-data android:name="android.service.chooser.chooser_target_service" android:value=".MyService" /> </activity>

<service android:name=".MyService" android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"> <intent-filter> <action android:name="android.service.chooser.ChooserTargetService" /> </intent-filter> </service>

Page 43: Android Marshmallow demos

Direct Share<activity ... > <intent-filter> <action android:name="android.intent.action.SEND" /> </intent-filter> <meta-data android:name="android.service.chooser.chooser_target_service" android:value=".MyService" /> </activity>

<service android:name=".MyService" android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"> <intent-filter> <action android:name="android.service.chooser.ChooserTargetService" /> </intent-filter> </service>

public class MyService extends ChooserTargetService { @Override public List<ChooserTarget> onGetChooserTargets(ComponentName name, IntentFilter filter); { // ... }}

Page 44: Android Marshmallow demos

Direct Share<activity ... > <intent-filter> <action android:name="android.intent.action.SEND" /> </intent-filter> <meta-data android:name="android.service.chooser.chooser_target_service" android:value=".MyService" /> </activity>

<service android:name=".MyService" android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"> <intent-filter> <action android:name="android.service.chooser.ChooserTargetService" /> </intent-filter> </service>

public class MyService extends ChooserTargetService { @Override public List<ChooserTarget> onGetChooserTargets(ComponentName name, IntentFilter filter); { // ... }}

Page 45: Android Marshmallow demos

Thank You!

+YossiElkrief MaTriXy

+NirHartmann nirhart

some slides were presented in Google IO 2015