Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

What if I want to use on device that below API level 21 because Camera2 can't?

What if I want to use on device that below API level 21 because Camera2 can't?

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

You can still use the older API, even though it's deprecated. Here's a good discussion on StackOverflow.

You can use the older API to make things compatible across all versions of the API and still have just one code base. Alternatively, you can create separate blocks of code based on checking the API of the system the app is running on. I generally prefer to use one way and update my code when I stop supporting devices that require the older stuff.