silent_coder
silent_coder

Reputation: 6522

Could I use apps developed with android N platform on previous versions of android OS

Seems google introduce quite a lot of interesting features in android N platform, for example Java 8 partial support. I want to use it for my first android application. However I have a question - if my app will be implemented using Android N tools using Java 8 features, but with settings minimal sdk = 4.1 will my application work on Android 4, 5, 6?

Upvotes: 0

Views: 91

Answers (1)

Joel Nieman
Joel Nieman

Reputation: 746

Yes, your app will work on previous versions of Android if you use the Support Libraries. These are updated with new versions of Android to provide backwards compatibility to new features. This is a common practice.

https://developer.android.com/topic/libraries/support-library/index.html

For Java 8, it sounds like you will need to be selective in what you use.

From the documentation: https://developer.android.com/preview/j8-jack.html

Supported Java 8 Language Features and APIs Android does not currently support all Java 8 language features. However, the following features are now available when developing apps targeting the Android N Preview:

Default and static interface methods

Lambda expressions (also available on API level 23 and lower)

Repeatable annotations

Method References (also available on API level 23 and lower)

Note: To test lambda expressions and method references on earlier versions of Android, go to your build.gradle file, and set compileSdkVersion and targetSdkVersion to 23 or lower. You will still need to enable the Jack toolchain to use these Java 8 features.

Upvotes: 3

Related Questions