SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Android N - Multi-Window
Eric Chuang
About Me
Eric Chuang
@ddsakura
@Yahoo
What is Multi-Window
Android N adds support for displaying more than one app at the same time.
● Split-Screen Mode (分割畫面模式)
● Picture-in-picture Mode (子母畫面模式)
● Freeform mode (自由形式模式)
Switch into multi-window mode
● If the user opens the Overview screen and performs a long press on an
activity title, they can drag that activity to a highlighted portion of the
screen to put the activity in multi-window mode.
● If the user performs a long press on the Overview button, the device puts
the current activity in multi-window mode, and opens the Overview screen
to let the user choose another activity to share the screen.
Split-Screen Mode
Picture-in-picture(子母畫面) Mode
In Android N, Android TV users can now watch a video in a pinned window in a
corner of the screen when navigating within apps.
Picture-in-picture (PIP) mode lets apps run a video activity in the pinned
window while another activity continues in the background. The PIP window
lets users multitask while using your app, which helps users be more
productive.
Picture-in-picture Mode
The PIP window is 240 x 135 dp and is shown at the top-
most layer in one of the four corners of the screen,
chosen by the system.
The user can bring up a PIP menu that lets them toggle
the PIP window to fullscreen, or close the PIP window, by
holding down the Home button on the remote.
https://youtu.be/K4eUZsgp06U?t=28s
Freeform Mode
1. adb shell
2. su
3. setenforce 0
4. settings put global enable_freeform_support 1
5. cd /data/local/tmp
6. mkdir permissions
7. cd permissions
8. cp -a /system/etc/permissions/* ./
9. sed -e “s/live_wallpaper/freeform_window_management/” android.software.live_wallpaper.xml
>freeform.xml
10. mount --bind . /system/etc/permissions
11. stop
12. start
How to enable freeform on emulator
Ref : http://lifehacker.com/heres-
what-freeform-windows-in-
android-n-look-like-and-
1766353465
Multi-Window Lifecycle
Multi-window mode does not change the activity lifecycle.
Only one resume activity in the system (the currently focused activity); all other
visible activities are in the pause state, even they are visible.
Multi-Window Lifecycle handle
In multi-window mode, an app can be in the paused state and still be visible to
the user.
An app might need to continue its activities even while paused.
For example, a video-playing app that is in paused mode but is visible should
continue showing its video.
For this reason, we recommend that activities that play video not pause the
video in their onPause() handlers. Instead, they should pause video in onStop(),
and resume playback in onStart().
Configuration Changes
When the user puts an app into multi-window mode, the system notifies the
activity of a configuration change, as specified in Handling Runtime Changes -
screenSize, smallestScreenSize, screenLayout, orientation.
@Override
public void onConfigurationChanged(Configuration newConfig) {
...
}
<activity
android:name=".MyActivity"
android:configChanges="screenSize|smallestScreenSize |screenLayout|orientation"
...
/>
Configuring App for Multi-Window Mode
android:resizeableActivity=["true" | "false"]
If this attribute is set to true, the activity can be launched in split-screen and
freeform modes.
If the attribute is set to false, the activity does not support multi-window mode.
If this value is false, and the user attempts to launch the activity in multi-
window mode, the activity takes over the full screen.
If your app targets Android N, but you do not specify a value for this attribute,
the attribute's value defaults to true.
Layout styleable
With Android N, the <layout> manifest element supports several attributes that
affect how an activity behaves in multi-window mode:
● android:defaultWidth
○ Default width of the activity when launched in freeform mode.
● android:defaultHeight
○ Default height of the activity when launched in freeform mode.
● Android:gravity
● android:minimalHeight, android:minimalWidth
Resizing background drawable
Launch New Activities in Multi-Window Mode
Split-Screen Mode Only
android.content.Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT
Intent intent = new Intent(this, AdjacentActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.
FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Start activity at specific location & size
If a device is in freeform mode and you are launching a new activity, you can
specify the new activity's dimensions and screen location by calling
ActivityOptions.setLaunchBounds().
This method has no effect if the device is not in multi-window mode.
Activity multi-windowing/PiP mode change
notification & querying
Drag and drop
Users can drag and drop data from one activity to
another while the two activities are sharing the
screen.
1. Detect the gesture
2. Prepare the data
3. Start the drag
4. Monitor the progress
5. Handle the drop
Drag and drop
android.view.DropPermissions android.view.DragAndDropPermissions
Activity.requestDropPermissions() Activity.requestDragAndDropPermissions()
View.startDragAndDrop()
View.DRAG_FLAG_GLOBAL
View.DRAG_FLAG_GLOBAL_URI_READ
View.DRAG_FLAG_GLOBAL_URI_WRITE
View.cancelDragAndDrop()
View.updateDragShadow()
Tablet and phone layouts in split-screen
Apps may use the same or different layouts for mobile and tablet:
● Apps with similar layouts for mobile and tablet may switch between the tablet and
mobile UIs when the app is resized, as the transition will not be jarring.
● Apps with completely different layouts for mobile and tablet should avoid using
the mobile UI on tablet in split-screen mode. Instead, the existing tablet UI should be
adapted to fit the smaller size to ensure that users have a consistent experience on
both devices.
Design for condensed sizes first
● Design for the smallest size first
● Start with a 220dp wide or tall layout, condensing and removing non-
essential elements.
5 tips for preparing for Multi-Window in
Android N
1. Best to keep your UI stuff with the Activity Context.
2. Handle configuration changes correctly
3. Handle all orientations
a. For apps not targeting Android N, adding android:screenOrientation means you will not
support multi-window at all 
4. Build a responsive UI for all screen sizes
5. Activities started by other apps must always support multi-window
Ref: https://medium.com/google-developers/5-tips-for-preparing-for-multi-window-in-android-n-
7bed803dda64
Reference
● Documentation:
○ https://developer.android.com/preview/features/multi-window.html
● Design:
○ https://www.google.com/design/spec/layout/split-screen.html
● Sample App:
○ https://github.com/googlesamples/android-MultiWindowPlayground
Thank you

Contenu connexe

Tendances

I/O Rewind 2015 : Android Design Support Library
I/O Rewind 2015 : Android Design Support LibraryI/O Rewind 2015 : Android Design Support Library
I/O Rewind 2015 : Android Design Support LibrarySittiphol Phanvilai
 
12. Android Basic Google Map
12. Android Basic Google Map12. Android Basic Google Map
12. Android Basic Google MapOum Saokosal
 
FOWA2013: The rise of single page applications
FOWA2013: The rise of single page applicationsFOWA2013: The rise of single page applications
FOWA2013: The rise of single page applicationsCaridy Patino
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycleAhsanul Karim
 
Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentReto Meier
 
Desenvolver para Chromecast
Desenvolver para ChromecastDesenvolver para Chromecast
Desenvolver para ChromecastPedro Veloso
 
Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cyclemssaman
 
Google Glasses Integration with SAP
Google Glasses Integration with SAPGoogle Glasses Integration with SAP
Google Glasses Integration with SAPGh14Cc10
 
Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5Oswald Campesato
 
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Ted Liang
 
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Ted Liang
 
Introduction to State Restoration in Flutter
Introduction to State Restoration in FlutterIntroduction to State Restoration in Flutter
Introduction to State Restoration in FlutterDave Chao
 
Android Wear Presentation
Android Wear PresentationAndroid Wear Presentation
Android Wear PresentationZi Yong Chua
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QATed Drake
 

Tendances (20)

I/O Rewind 2015 : Android Design Support Library
I/O Rewind 2015 : Android Design Support LibraryI/O Rewind 2015 : Android Design Support Library
I/O Rewind 2015 : Android Design Support Library
 
How to create android push notifications with custom view
How to create android push notifications with custom viewHow to create android push notifications with custom view
How to create android push notifications with custom view
 
12. Android Basic Google Map
12. Android Basic Google Map12. Android Basic Google Map
12. Android Basic Google Map
 
Hierarchy viewer
Hierarchy viewerHierarchy viewer
Hierarchy viewer
 
FOWA2013: The rise of single page applications
FOWA2013: The rise of single page applicationsFOWA2013: The rise of single page applications
FOWA2013: The rise of single page applications
 
Day 4: Activity lifecycle
Day 4: Activity lifecycleDay 4: Activity lifecycle
Day 4: Activity lifecycle
 
Being Epic: Best Practices for Android Development
Being Epic: Best Practices for Android DevelopmentBeing Epic: Best Practices for Android Development
Being Epic: Best Practices for Android Development
 
PhotoFlipCardView
PhotoFlipCardViewPhotoFlipCardView
PhotoFlipCardView
 
Introduction to Samsung Gear SDK
Introduction to Samsung Gear SDKIntroduction to Samsung Gear SDK
Introduction to Samsung Gear SDK
 
Desenvolver para Chromecast
Desenvolver para ChromecastDesenvolver para Chromecast
Desenvolver para Chromecast
 
Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
 
Google Glasses Integration with SAP
Google Glasses Integration with SAPGoogle Glasses Integration with SAP
Google Glasses Integration with SAP
 
Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5
 
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
 
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
 
Android Basics
Android BasicsAndroid Basics
Android Basics
 
Introduction to State Restoration in Flutter
Introduction to State Restoration in FlutterIntroduction to State Restoration in Flutter
Introduction to State Restoration in Flutter
 
Ch2 first app
Ch2 first appCh2 first app
Ch2 first app
 
Android Wear Presentation
Android Wear PresentationAndroid Wear Presentation
Android Wear Presentation
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QA
 

En vedette

안드로이드 M의 주요 변경 사항
안드로이드 M의 주요 변경 사항안드로이드 M의 주요 변경 사항
안드로이드 M의 주요 변경 사항Chansuk Yang
 
心態的力量
心態的力量心態的力量
心態的力量陳郁程
 
Doing More With Less: How Restaurant Chains Can Cut Telecom Costs
Doing More With Less: How Restaurant Chains Can Cut Telecom CostsDoing More With Less: How Restaurant Chains Can Cut Telecom Costs
Doing More With Less: How Restaurant Chains Can Cut Telecom CostsScott Shelton
 
Mojito 開發 mobile web 實戰經驗談
Mojito 開發 mobile web 實戰經驗談Mojito 開發 mobile web 實戰經驗談
Mojito 開發 mobile web 實戰經驗談Yu-Wei Chuang
 
About Mobile Web Development Thing
About Mobile Web Development ThingAbout Mobile Web Development Thing
About Mobile Web Development ThingYu-Wei Chuang
 
The what, why and how of Service Design
The what, why and how of Service DesignThe what, why and how of Service Design
The what, why and how of Service DesignSpotless
 
ExoPlayer for Application developers
ExoPlayer for Application developersExoPlayer for Application developers
ExoPlayer for Application developersHassan Abid
 
Cocktails – Shaken, Not Stirred @osdc.tw
Cocktails – Shaken, Not Stirred @osdc.twCocktails – Shaken, Not Stirred @osdc.tw
Cocktails – Shaken, Not Stirred @osdc.twYu-Wei Chuang
 
Managing Activity Backstack
Managing Activity BackstackManaging Activity Backstack
Managing Activity Backstackrajdeep
 
8 Tips for Conducting UX Testing for Multi-device eLearning
8 Tips for Conducting UX Testing for Multi-device eLearning8 Tips for Conducting UX Testing for Multi-device eLearning
8 Tips for Conducting UX Testing for Multi-device eLearningUpside Learning Solutions
 
When Web meet Native App
When Web meet Native AppWhen Web meet Native App
When Web meet Native AppYu-Wei Chuang
 
Wisdom From A Laugh 57, 58
Wisdom From A Laugh 57, 58Wisdom From A Laugh 57, 58
Wisdom From A Laugh 57, 58OH TEIK BIN
 
Words Associated with Questions about Macros in Tex
Words Associated with Questions about Macros in TexWords Associated with Questions about Macros in Tex
Words Associated with Questions about Macros in TexAngela Lozano
 
Summary of first term
Summary of first termSummary of first term
Summary of first termanaiktak
 
Unit 4 Saving and Investing PPT
Unit 4 Saving and Investing PPTUnit 4 Saving and Investing PPT
Unit 4 Saving and Investing PPTJenny Hubbard
 
Reward week 1 bus681
Reward week 1   bus681Reward week 1   bus681
Reward week 1 bus681E Alden
 
Capturing Science: Doing Lecture Capture Differently
Capturing Science: Doing Lecture Capture DifferentlyCapturing Science: Doing Lecture Capture Differently
Capturing Science: Doing Lecture Capture DifferentlyGemma Witton
 
Strategic Management Ch05
Strategic Management Ch05Strategic Management Ch05
Strategic Management Ch05Chuong Nguyen
 

En vedette (20)

안드로이드 M의 주요 변경 사항
안드로이드 M의 주요 변경 사항안드로이드 M의 주요 변경 사항
안드로이드 M의 주요 변경 사항
 
心態的力量
心態的力量心態的力量
心態的力量
 
Doing More With Less: How Restaurant Chains Can Cut Telecom Costs
Doing More With Less: How Restaurant Chains Can Cut Telecom CostsDoing More With Less: How Restaurant Chains Can Cut Telecom Costs
Doing More With Less: How Restaurant Chains Can Cut Telecom Costs
 
Mojito 開發 mobile web 實戰經驗談
Mojito 開發 mobile web 實戰經驗談Mojito 開發 mobile web 實戰經驗談
Mojito 開發 mobile web 實戰經驗談
 
Mojito@nodejstw
Mojito@nodejstwMojito@nodejstw
Mojito@nodejstw
 
About Mobile Web Development Thing
About Mobile Web Development ThingAbout Mobile Web Development Thing
About Mobile Web Development Thing
 
The what, why and how of Service Design
The what, why and how of Service DesignThe what, why and how of Service Design
The what, why and how of Service Design
 
ExoPlayer for Application developers
ExoPlayer for Application developersExoPlayer for Application developers
ExoPlayer for Application developers
 
Cocktails – Shaken, Not Stirred @osdc.tw
Cocktails – Shaken, Not Stirred @osdc.twCocktails – Shaken, Not Stirred @osdc.tw
Cocktails – Shaken, Not Stirred @osdc.tw
 
Managing Activity Backstack
Managing Activity BackstackManaging Activity Backstack
Managing Activity Backstack
 
8 Tips for Conducting UX Testing for Multi-device eLearning
8 Tips for Conducting UX Testing for Multi-device eLearning8 Tips for Conducting UX Testing for Multi-device eLearning
8 Tips for Conducting UX Testing for Multi-device eLearning
 
When Web meet Native App
When Web meet Native AppWhen Web meet Native App
When Web meet Native App
 
Wisdom From A Laugh 57, 58
Wisdom From A Laugh 57, 58Wisdom From A Laugh 57, 58
Wisdom From A Laugh 57, 58
 
Words Associated with Questions about Macros in Tex
Words Associated with Questions about Macros in TexWords Associated with Questions about Macros in Tex
Words Associated with Questions about Macros in Tex
 
Summary of first term
Summary of first termSummary of first term
Summary of first term
 
Unit 4 Saving and Investing PPT
Unit 4 Saving and Investing PPTUnit 4 Saving and Investing PPT
Unit 4 Saving and Investing PPT
 
Megapolis i
Megapolis i Megapolis i
Megapolis i
 
Reward week 1 bus681
Reward week 1   bus681Reward week 1   bus681
Reward week 1 bus681
 
Capturing Science: Doing Lecture Capture Differently
Capturing Science: Doing Lecture Capture DifferentlyCapturing Science: Doing Lecture Capture Differently
Capturing Science: Doing Lecture Capture Differently
 
Strategic Management Ch05
Strategic Management Ch05Strategic Management Ch05
Strategic Management Ch05
 

Similaire à Android N multi window

FXOS Window management 101
FXOS Window management 101FXOS Window management 101
FXOS Window management 101Alive Kuo
 
Ugnius vaznys tesonet
Ugnius vaznys   tesonetUgnius vaznys   tesonet
Ugnius vaznys tesonetUgniusVaznys
 
Google I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackGoogle I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackSunita Singh
 
Guidelines for Android application design.pptx
Guidelines for Android application design.pptxGuidelines for Android application design.pptx
Guidelines for Android application design.pptxdebasish duarah
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsVIA Embedded
 
An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)rudigrobler
 
Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intentsVitali Pekelis
 
Developing For Android Wear - Part 2
Developing For Android Wear - Part 2Developing For Android Wear - Part 2
Developing For Android Wear - Part 2Justin Munger
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestateOsahon Gino Ediagbonya
 
Serenity for Android: Design Tips for Android TV
Serenity for Android: Design Tips for Android TVSerenity for Android: Design Tips for Android TV
Serenity for Android: Design Tips for Android TVDavid Carver
 
Android platform activity
Android platform activityAndroid platform activity
Android platform activityHoang Vy Nguyen
 
Everything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesEverything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesPerfecto by Perforce
 
Android design patterns
Android design patternsAndroid design patterns
Android design patternsPlatty Soft
 
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...Paul Della-Nebbia
 
Bcsf13a019_mcqs_ead
Bcsf13a019_mcqs_eadBcsf13a019_mcqs_ead
Bcsf13a019_mcqs_eadMarYam IqBal
 
FirefoxOS Window Management
FirefoxOS Window ManagementFirefoxOS Window Management
FirefoxOS Window ManagementAlive Kuo
 

Similaire à Android N multi window (20)

FXOS Window management 101
FXOS Window management 101FXOS Window management 101
FXOS Window management 101
 
Ugnius vaznys tesonet
Ugnius vaznys   tesonetUgnius vaznys   tesonet
Ugnius vaznys tesonet
 
Google I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and JetpackGoogle I/O 2019 - what's new in Android Q and Jetpack
Google I/O 2019 - what's new in Android Q and Jetpack
 
Guidelines for Android application design.pptx
Guidelines for Android application design.pptxGuidelines for Android application design.pptx
Guidelines for Android application design.pptx
 
Android session 2
Android session 2Android session 2
Android session 2
 
Skinning Android for Embedded Applications
Skinning Android for Embedded ApplicationsSkinning Android for Embedded Applications
Skinning Android for Embedded Applications
 
Working with Multiple Android Screens
Working with Multiple Android ScreensWorking with Multiple Android Screens
Working with Multiple Android Screens
 
An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)
 
Lecture #3 activities and intents
Lecture #3  activities and intentsLecture #3  activities and intents
Lecture #3 activities and intents
 
Developing For Android Wear - Part 2
Developing For Android Wear - Part 2Developing For Android Wear - Part 2
Developing For Android Wear - Part 2
 
Android Wearable App
Android Wearable AppAndroid Wearable App
Android Wearable App
 
Presentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestatePresentation on Android application life cycle and saved instancestate
Presentation on Android application life cycle and saved instancestate
 
Serenity for Android: Design Tips for Android TV
Serenity for Android: Design Tips for Android TVSerenity for Android: Design Tips for Android TV
Serenity for Android: Design Tips for Android TV
 
Android
AndroidAndroid
Android
 
Android platform activity
Android platform activityAndroid platform activity
Android platform activity
 
Everything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesEverything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable Phones
 
Android design patterns
Android design patternsAndroid design patterns
Android design patterns
 
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...Get the Jump on Mobilizing your Notes and Domino Applications Today!  (JMP103...
Get the Jump on Mobilizing your Notes and Domino Applications Today! (JMP103...
 
Bcsf13a019_mcqs_ead
Bcsf13a019_mcqs_eadBcsf13a019_mcqs_ead
Bcsf13a019_mcqs_ead
 
FirefoxOS Window Management
FirefoxOS Window ManagementFirefoxOS Window Management
FirefoxOS Window Management
 

Dernier

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Dernier (20)

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 

Android N multi window

  • 1. Android N - Multi-Window Eric Chuang
  • 3. What is Multi-Window Android N adds support for displaying more than one app at the same time. ● Split-Screen Mode (分割畫面模式) ● Picture-in-picture Mode (子母畫面模式) ● Freeform mode (自由形式模式)
  • 4. Switch into multi-window mode ● If the user opens the Overview screen and performs a long press on an activity title, they can drag that activity to a highlighted portion of the screen to put the activity in multi-window mode. ● If the user performs a long press on the Overview button, the device puts the current activity in multi-window mode, and opens the Overview screen to let the user choose another activity to share the screen.
  • 6. Picture-in-picture(子母畫面) Mode In Android N, Android TV users can now watch a video in a pinned window in a corner of the screen when navigating within apps. Picture-in-picture (PIP) mode lets apps run a video activity in the pinned window while another activity continues in the background. The PIP window lets users multitask while using your app, which helps users be more productive.
  • 7. Picture-in-picture Mode The PIP window is 240 x 135 dp and is shown at the top- most layer in one of the four corners of the screen, chosen by the system. The user can bring up a PIP menu that lets them toggle the PIP window to fullscreen, or close the PIP window, by holding down the Home button on the remote.
  • 10.
  • 11. 1. adb shell 2. su 3. setenforce 0 4. settings put global enable_freeform_support 1 5. cd /data/local/tmp 6. mkdir permissions 7. cd permissions 8. cp -a /system/etc/permissions/* ./ 9. sed -e “s/live_wallpaper/freeform_window_management/” android.software.live_wallpaper.xml >freeform.xml 10. mount --bind . /system/etc/permissions 11. stop 12. start How to enable freeform on emulator Ref : http://lifehacker.com/heres- what-freeform-windows-in- android-n-look-like-and- 1766353465
  • 12. Multi-Window Lifecycle Multi-window mode does not change the activity lifecycle. Only one resume activity in the system (the currently focused activity); all other visible activities are in the pause state, even they are visible.
  • 13.
  • 14. Multi-Window Lifecycle handle In multi-window mode, an app can be in the paused state and still be visible to the user. An app might need to continue its activities even while paused. For example, a video-playing app that is in paused mode but is visible should continue showing its video. For this reason, we recommend that activities that play video not pause the video in their onPause() handlers. Instead, they should pause video in onStop(), and resume playback in onStart().
  • 15. Configuration Changes When the user puts an app into multi-window mode, the system notifies the activity of a configuration change, as specified in Handling Runtime Changes - screenSize, smallestScreenSize, screenLayout, orientation. @Override public void onConfigurationChanged(Configuration newConfig) { ... } <activity android:name=".MyActivity" android:configChanges="screenSize|smallestScreenSize |screenLayout|orientation" ... />
  • 16. Configuring App for Multi-Window Mode android:resizeableActivity=["true" | "false"] If this attribute is set to true, the activity can be launched in split-screen and freeform modes. If the attribute is set to false, the activity does not support multi-window mode. If this value is false, and the user attempts to launch the activity in multi- window mode, the activity takes over the full screen. If your app targets Android N, but you do not specify a value for this attribute, the attribute's value defaults to true.
  • 17. Layout styleable With Android N, the <layout> manifest element supports several attributes that affect how an activity behaves in multi-window mode: ● android:defaultWidth ○ Default width of the activity when launched in freeform mode. ● android:defaultHeight ○ Default height of the activity when launched in freeform mode. ● Android:gravity ● android:minimalHeight, android:minimalWidth
  • 19. Launch New Activities in Multi-Window Mode Split-Screen Mode Only android.content.Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT Intent intent = new Intent(this, AdjacentActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent. FLAG_ACTIVITY_NEW_TASK); startActivity(intent);
  • 20. Start activity at specific location & size If a device is in freeform mode and you are launching a new activity, you can specify the new activity's dimensions and screen location by calling ActivityOptions.setLaunchBounds(). This method has no effect if the device is not in multi-window mode.
  • 21. Activity multi-windowing/PiP mode change notification & querying
  • 22. Drag and drop Users can drag and drop data from one activity to another while the two activities are sharing the screen. 1. Detect the gesture 2. Prepare the data 3. Start the drag 4. Monitor the progress 5. Handle the drop
  • 23. Drag and drop android.view.DropPermissions android.view.DragAndDropPermissions Activity.requestDropPermissions() Activity.requestDragAndDropPermissions() View.startDragAndDrop() View.DRAG_FLAG_GLOBAL View.DRAG_FLAG_GLOBAL_URI_READ View.DRAG_FLAG_GLOBAL_URI_WRITE View.cancelDragAndDrop() View.updateDragShadow()
  • 24. Tablet and phone layouts in split-screen Apps may use the same or different layouts for mobile and tablet: ● Apps with similar layouts for mobile and tablet may switch between the tablet and mobile UIs when the app is resized, as the transition will not be jarring. ● Apps with completely different layouts for mobile and tablet should avoid using the mobile UI on tablet in split-screen mode. Instead, the existing tablet UI should be adapted to fit the smaller size to ensure that users have a consistent experience on both devices.
  • 25.
  • 26.
  • 27. Design for condensed sizes first ● Design for the smallest size first ● Start with a 220dp wide or tall layout, condensing and removing non- essential elements.
  • 28. 5 tips for preparing for Multi-Window in Android N 1. Best to keep your UI stuff with the Activity Context. 2. Handle configuration changes correctly 3. Handle all orientations a. For apps not targeting Android N, adding android:screenOrientation means you will not support multi-window at all  4. Build a responsive UI for all screen sizes 5. Activities started by other apps must always support multi-window Ref: https://medium.com/google-developers/5-tips-for-preparing-for-multi-window-in-android-n- 7bed803dda64
  • 29. Reference ● Documentation: ○ https://developer.android.com/preview/features/multi-window.html ● Design: ○ https://www.google.com/design/spec/layout/split-screen.html ● Sample App: ○ https://github.com/googlesamples/android-MultiWindowPlayground