Is Android Picture-In-Picture Next Step to Innovation For The Edtech Industry?
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
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!
Flutter Global Summit 21 introduced several new and improved features, as well as some new tools. Flutter, originall...
Mobile apps are expected to generate over $935 billion in revenue by 2023. Take a moment and let that sink in! The p...
Designing mobile apps for large, content-rich websites comes with its own set of challenges. The alterations in view...
So you’ve got a great mobile app idea and you’ve done your research to understand the competitive landscape. And you...
Businesses must go mobile, especially since the vast majority of Americans – 85 percent – now own a smartphone. ...
You‘re done with the various stages of development of your app and now are getting ready for deployment and a flashy...
A majority of people conduct their business on their smartphones. Moving to mobile is thus a smart way to reach your...
Choosing the best technology to build a robust solution is a very crucial decision. This is the third step while pla...
You’re working happily on your app and all is well, then suddenly - POOF! - it crashes. Aaargh!! Apparently ‘Crashes...
No software is perfect, just like humans. But the pursuit of perfection is not futile. If you look around the web y...
Google Play set out many criteria in their app guidelines that you need to follow. These changes may cause some issue...
Apple in its annual WWDC made some game changing announcements like a new Mac Pro, an exclusive OS for iPad, iOS 13 r...