Google can read the writing on the wall: foldable phones and devices with selfie cameras that pop up from the body are set to pick up steam in 2019, and Android has to be ready. On Tuesday at I/O 2019, Google officially confirmed that it's including tools in Android Q that will help keep the OS humming along on phones with moving parts. Google had already declared last November that it would support foldable designs like Samsung's Galaxy Fold.

Foldable phones are especially timely, promising to shake up the phone industry with new designs that can expand your screen space without making devices larger. Although early problems with the Galaxy Fold caused a delay in releasing the phone, which Samsung is scrambling to fix, other devices like the Huawei Mate X, rumored foldable Motorola Razr and designs that bend around your wrist like a watch could potentially tangle up Android apps without Google's guidance.

"We're seeing perhaps the reinvention of the mobile form factor," Sameer Samat, VP of product management for Android and Play, said of foldable phones during an interview. "While it's very early, we may look back on this and understand how profound it was."

For example, they can turn a phone into a tablet, as with the Fold and Huawei Mate X. We could also see narrow phones that open vertically, as with the throwback flip phone style of the rumored foldable Motorola Razr, and even designs that bend around your wrist like a watch.

"Historically, a mobile phone and a tablet have been two devices. If you think about them being the same device … it can be quite delightful," said Samat, who has used the Galaxy Fold.

Google's support for foldable centers on App Continuity, which helps you switch apps between foldable phones' smaller and larger screens without skipping a beat. This software is especially critical because, while device-makers have internally prototyped foldable phones for years, most developers are brand new to the design.

Now playing: Watch this: Our Galaxy Fold didn't break. Here's what's good and...

"Developers don't plan their apps … with the idea that there would be two different screens with two different aspect ratios," said Samat. "We wanted to make that as easy as possible to code for. If you make it easy and people can start experimenting and seeing what's possible; it can accelerate the entire category."

Google's tools for app developers stems from its close collaboration on the Galaxy Fold. After working with Samsung and other, undisclosed phone brands, Google is opening up its code and tools to other OEMs (original equipment manufacturers).

Google's interest in Android for foldable phones doesn't stop with its partner OEMs. The company is also working on its own foldable Pixel, at least for internal testing.

"We're definitely prototyping the technology. We've been doing it for a long time," Mario Queiroz, Pixel's development lead, said in an interview last week at Google's headquarters. "I don't think there's a clear use case yet."

Oppo

What about pop-up selfie cameras?

Phones with front-facing cameras are also getting a makeover. There are now several models that pop up or slide out of the body, and Samsung Galaxy A80 has three cameras that swivel to take photos in either direction. The One Plus 7 is rumored to have a pop-up camera, too, when it launches on May 14.

Cameras that live in the phone's body aren't just for show. As with foldable screens, pop-up cameras exist to give you more screen space -- in this case, by removing the front-facing sensors from the phone's face. This design is a way around having to add a screen notch.

Slashleaks

"I think there'll be many interesting different form factors in the way people innovate with the front-facing sensors," said Samat. "We're starting to see this form factors come to life.

Google is working with OEM partners to make sure that the different phone-makers don't need to worry about the camera's exact location in order to use Android's camera software. Every phone has a slightly different camera array, which means developers have to add code to optimize their apps.

To that end, Google is building out a library called CameraX , which gives developers "a layer of abstraction" so they don't have to code for each new configuration a phone might take. The CameraX library comes shipped as a developer library on top of Android.

The benefit of CameraX doesn't stop at pop-up cameras. It has the potential to help third-party camera apps faster, more stable and more consistent, too.

Now playing: Watch this: Android Q beta: What's new?

Originally published at 4 a.m. PT.