When you look at it for the first time, the Android PIP feature looks pretty dope. It is a classic example of taking ‘ease of use’ into account in the design process.
For me, the fact that you can play Youtube and still use everything else on phone was enough to rejoice. The feature alters your video watching experience and how. It lets you do so many things without obstructing with your audio/video experience.
PIP is not like split screen where you work on two exclusive apps, it’s a special multi-window mode that allows video playback in a small screen on the edge while users can navigate between rest of the apps.
Hey, we were doing fine before this happened
So, around the same time, one of our clients in the Edtech industry came up with an unusual request. They wanted to provide their users with editable notes which can be accessed while watching the video lectures. Their current process required the users to switch frequently between the apps and, let’s just say, it was not as fancy as it sounds.
The course is too much and there’s an issue, it’s not okay
As much as reasonable the problem was, the solution was not easy. We knew the PIP feature was godsent for this, but it was used by a few popular apps only. We talked to the client about it and they were pretty excited. In fact, the client said that if this works out, they will scale it up and add notes for all the sessions. Their users have asked for the same quite often and PIP might just be the answer to everything.
We researched around the feature and it was one of the projects where things looked easy from far. Excited and scared, we went ahead and planned the development process. It was about to be a fun ride, or so we hoped!
Hey, can you tell your friends we need it sooner
We began with the project and planned sprints. This was going to be one of those projects where things either worked or they tanked, no in-betweens. Even though Android launched a complete guide on how you can include the feature in your app, significant things had to be planned. The app’s primary service was to provide the lectures and under no circumstance, the efficiency of the same could be compromised.
And I hope it’s gonna be fine and working again
We started stepping up the ladder with basic functions including:
Declaring PIP Support: The system does not automatically support PIP for apps. We had to register the video activity by setting
android:resizeableActivity to true. We had to also include room for layout changes in the code so that the activity doesn’t relaunch when layout changes happen in PIP transitions.
Switching Activities: To enter the PIP mode we called a function
enterPictureInPictureMode() and further added a logic that switches an activity into PIP mode instead of running in the background.
UI during PIP Mode: When the function enters the PIP mode the system calls
Fragment.onPictureInPictureModeChanged(). We overrode these callbacks to redraw the UI elements in the activity.
Adding these basic functions got the PIP mode running. The client was not completely sure and hence, went ahead with initial testing. The application worked fine, at least prima facie. But there was a small problem. When the users tapped the back button to switch to the app from the pinned video, the app unexpectedly closed. In short, the user couldn’t restore the app.
So can we pull over and get rid of this once and for ever
It took a while for us to figure this out. The thing is, when you switch to the PIP mode, Android moves only the PIP activity into a new task. This causes a problem if the user stays within the app after restoring the PIP window back to full screen and tapping back. The app must re-create the back-stack to accomplish this.
We understood what was happening within the whole process and why the user can’t restore the app. Due to application’s current architecture, back-stack recreation was happening automatically. To resolve the problem we went through many tests to find out where we were losing the back-stack process. This was our gateway. We added a link after the notes which redirected the student to the video.
Another problem popped up when we were at our final stages of testing. The video playback in the PIP mode was causing audio intervention for other apps. To manage the video playback and other apps, we called a function
requestAudioFocus() and supplied a parameter AudioFocusRequest. Further, we used this parameter to request and abandon focus.
Within the span of five weeks we solved the problem and successfully implemented the software which helped the client get more students onboard.
Key Takeaways (feel free to use and learn):
> PIP is intended for applications and actions that play full-screen videos. So you should avoid anything except video content when switching your activity into PIP mode.
> As the PIP window is a floating screen, make it a point to avoid showing critical information on the areas that can be obscured by the PIP Window.
> When your app is in PIP mode, video playback in the PIP window can cause audio interference with another app, such as a music player app or voice search app. To avoid this, request audio focus when you start playing the video, and handle audio focus change notifications, as described in Managing Audio Focus.
> PIP only works in Android Oreo 8.0 and versions above.
Quickly make a move to upgrade your mobile applications. Get in touch with our development team and give your users an astonishing experience of learning.
By Evnisha Malani | Categories:Android,Galaxy Apps,Mobile,Others,Web | Tags: Android app development,Android O,Android oreo,AndroidDev,Picture in picture | Comments closed
About Galaxy WeblinksWe specialize in human-centric user experience design services to our clients across the globe. Our innovative ideas, creative designs, industry best practices, and processes help us improve user satisfaction and solve complex design problems. Contact us for a free consultation!
Developers use Text Editors, also known as code editors, for editing programming code. These editors basically contain features like quick navigation, syntax highlighting, automatic indenting,…App Developement Web
Your business is growing and your team is doing their best to meet the tight deadlines and increased workload. You may be exploring the idea…App Developement Web
Voice search is at its peak in popularity among millions of users. According to an OC&C Strategy Consultants market research, Voice Shopping is projected grow…Ecommerce Web
Hello (Inserts your First name), All of us have received emails/ sms notifications, social media ads, that are sharing offers and discounts on the products…Ecommerce Web
The recently released WordPress 5.4 ‘Adderley’ update has got a lot to look forward to! Since this highly popular CMS ditched its classic editor for…CMS Web
You’re working happily on your app and all is well, then suddenly – POOF! – it crashes. Aaargh!! Apparently ‘Crashes decrease with new session the…Mobile
No software is perfect, just like humans. But the pursuit of perfection is not futile. If you look around the web you’ll find thousands, maybe…Android Best Practices iOS Mobile
Modern technology has two problems: Devices have too many integrated features and everything is smaller. A good implementation of more-than-what’s-necessary features can give some users…App Developement Others Web
What is common between Pinterest, Tinder, Uber, Trivago, and Airbnb? All these companies experienced a surge in their product’s performance, user-engagement, and conversions by going…Mobile PWA Web
Kotlin has emerged as both substitute and supplement to C++ and Java. In 2018, the language had over 96,000 repositories on GitHub and had already…App Developement Galaxy Apps Others Web
When you think of hotspots for tech, don’t zero in on Silicon Valley just yet. According to Expert Market, Boston is one of the top…Galaxy Apps Internet Marketing Others Web
The experience of Disneyland is always an awe-inspiring one. No matter how many miles you have walked, you are always up for another Pirates of…Galaxy Apps Others Product Development Web
Google Play set out many criteria in their app guidelines that you need to follow. These changes may cause some issues as you try to…Galaxy Apps Mobile Others Web
Leading the AR revolution, industrial enterprises are experiencing improved ROI through AR-optimized supply chain. Enterprise sector is using AR across other functions such as product design…AR Galaxy Apps Others Web
Apple in its annual WWDC made some game changing announcements like a new Mac Pro, an exclusive OS for iPad, iOS 13 release, new Apple…Apple Galaxy Apps Others Web
At the time of an unsuccessful product deployment, you might ask yourself. “What went wrong with the product delivery?” The simple answer lies in configuration…Galaxy Apps Others Product Development Web
You might be familiar with Murphy’s law which says ‘Anything that can go wrong, will go wrong’. Software isn’t immune to that. But that’s often…Galaxy Apps Others QA Web
When you look at the respective market share of both the CMSs, WordPress has a clear edge over Craft CMS with 81.9% market share to a…CMS Galaxy Apps Others Web
Angular 6, released earlier in May 2018 didn’t offer much improvements on the performance part. It was mainly focused on making Angular migration-friendly. Google dropped…Frontend Galaxy Apps Others Web
Magento announced that it is pulling the plug on Magento 1 in April 2017 at the ‘Meet Magento’ conference in Prague. The announcement caused a…Ecommerce Galaxy Apps Others Web
Building a WordPress website? The WordPress community provides you with plenty of options. You can either make an easy one using WordPress themes or a…Galaxy Apps Others Web Website Development
Facebook has finally decided to monetize WhatsApp. Earlier this month, on August 1, Facebook rolled its long-in-development WhatsApp Business API for medium to large businesses.…Galaxy Apps Others Web
Craft CMS’s consistency can be seen in its regular updates & latest features. Matrix is one of those early features that helped Craft dominate the…CMS Galaxy Apps Others Web
Before introducing the Debug Tool in Craft 3, Craft CMS made you install a separate web-based application, Web-Console. You could run shell commands on your…CMS Galaxy Apps Others Web
Investors have the money, you have the idea, and the right pitch is the only thing that stands between you and them. But, pitches are…Galaxy Apps Others Product Development Web
“Personal data shall be processed in a manner that ensures appropriate security of the personal data, including protection against unauthorized or unlawful processing and against…Galaxy Apps Others Web
Google recently announced Mobile-First Indexing after a year and half of extensive experimenting and testing. The search engine giant will start migrating sites that follow…App Developement Galaxy Apps Others Web
Social media networks are mode of social interaction. It is a platform of sharing and discussing information among human beings. Social media can include text,…Internet Marketing Social Media Web