Reputation: 2275
I know that I need to import android.support.v4.app or import android.support.v7.app in order to make my app can run under low android SDK.
But sometimes android.support.v4.app and android.support.v7.app will cause some problems.
I will give up low android SDK in my new app.
1: In order not to import android.support.v4.app or import android.support.v7.app, what value will android:minSdkVersion be set?
2: What else things should I do in order not to import android.support.v4.app or import android.support .v7.app?
Upvotes: 3
Views: 43
Reputation: 3454
It depends on what you want to do, the support libraries have a few usage:
Backward Compatibility for newer APIs - A large amount of the support libraries provide backward compatibility for newer framework classes and methods. For example, the Fragment support class provides support for fragments on devices running versions earlier than Android 3.0 (API level 11).
Convenience and Helper Classes - The support libraries provides a number of helper classes, particularly for user interface development. For example the RecyclerView class provides an user interface widget for displaying and managing very long lists, useable on versions of Android from API level 7 and up.
Debugging and Utilities - There are a number of features that provide utility beyond code you incorporate into your app, including the support-annotations library for improved code lint checks on method inputs and Multidex support for configuring and distributing apps with over 65,536 methods.
So, for example if you want to use a feature introduced in recent platform on devices that running earlier versions of the platform, use the equivalent classes and methods from the support library.
If you use a library like Design
, RecyclerView
, FCM
that depends on support library to provide Compatibility for those library it's better to use support library (usually other com.android.support.* and com.goole.* libraries).
In other cases feel free to not import the support libraries!
P.S: Still I think the problem with support libs are easier to solve rather the ones you get when not using them.
Upvotes: 2