In what API level was introduced Navigation Drawer? I tried to search and find what was introduced in API 14 but I am not sure.
DrawerLayout is included in the v4 support library, so it can be used on any platform version starting from API level 4.
The support library was specifically designed to bring newer features and ui patterns also to older device and provide a consistent user experience throughout the whole platform.
As I know 14 is correct, but to make sure, try to implement a NavigationDrawer and set your APILevel lower than 14. Normally e.g. claims that at least lvl 14 is needed
The Navigational Drawer is part of the suport library v4.
From the Android doc:
Support android.app classes to assist with development of applications for android API level 4 or later.
So you can use the navigation lib from api 4 onwards.
you can check in this link
As google announced a new navigation pattern called Android navigation drawer. Along with guideline and sample which requires latest version of android support library v13
Related
I'm using RecyclerView and SearchView.
but I'don't know what to use.
In Android Devloper,
android.support.v7.widget.SearchView
https://developer.android.com/reference/android/support/v7/widget/SearchView
there are
Note: This class is included in the support library for compatibility with API level 7 and higher. If you're developing your app for API level 11 and higher only, you should instead use the framework SearchView class.
so I thought I have to use another SearchView.
android.widget.SearchView
https://developer.android.com/reference/android/widget/SearchView.html
However, android.support.v7.widget.SearchView is added in version 25.1.0 and android.widget.SearchView is added in API level 11.
Which SearchView is suitable for recent API?
I'm using API 26 emulator. (I will update my app for higher API later ex.API27,API28...)
Thank you :)
Use android.widget.SearchView which has more flexibility than the support version.
The delay in upgrades combined with regular new releases makes compatibility an important issue in Android programming.
Support library is quickly updated when new features are added to the API but still lacks many features that are not backwards compatible.
If google explicitly says to use android.widget.SearchView, then you should use it.
Whereas some APIs like the RecyclerView still uses v7 support version because Google choose to provide new as well as backward compatible features in the support version.
Therefore, you should check the lint warnings and consider the official Developer guides in case any API gets depreciated.
I need to know what api version support the fab element in android.
The blog post for the Design Support Library release, of which FloatingActionButton is a part of, states the following:
With a little help from the new Android Design Support Library, we’re bringing a number of important material design components to all developers and to all Android 2.1 or higher devices.
Android 2.1 is API level 7, so apps targeting 7 and above can use FloatingActionButton
The FloatingActionButton is available to API 7 (android 2.1), as it was added to the Android Support library in 2015: http://android-developers.blogspot.ca/2015/05/android-design-support-library.html
To use the fab using the support library you can use the answer provided here: https://stackoverflow.com/a/31753179/6543020
And analogue from shamanland - FAB Library also works from the Android 2.1, API level 7.
mine api it support is 7+. if i am not wrong.
In Android support library docs about android.support.v4.os:
Support android.os classes to assist with development of applications for android API level 4 or later.
"Or later" means API 5,6,7 etc.? But a device running API 22(latest at the moment)
will automatically support older devices?
I don't quite understand it - it means, I should use this class to make old API 4 devices use my modern API 22 app? Or should I use it to make new phones support old devices
When should I use this numerous support.v17, support.v13 packages?
What is backward compatible?
Can you explain typical situation?
"Or later" means api5,6,7 etc?
It means that this code can be used in devices with a old version of Android (api7= Android 2.1, api=8 Android 2.2.... api14 = Android 4.0)
but a device running api22(latest at the moment) will already automatically support older devices?
A device can run only a version of Android. If it is running api22, it means that it has Android 5.1
I dont' quite understand it - it means, i should use this class to make old api 4 devices use my modern api22 app? or should I use it to make new phones support old devices
It means that you can use this library to backport some features introduced with the last api (for example 21) to old devices running a previous api level.
1.When should i use this numerous support.v17, support.v13 packages? 2. what is backward compatible?
You can use them, when you need them... If you would like to use the Google cards you can use the v7 cardview library for example.
As described in the official link:
Each Support Library is backward-compatible to a specific Android API level.
For example the
support v4 : minSdk=4
v7 appcompat library: minSdk=7
v7 recyclerview library: minSdk = 7
v7 CardView library: minSdk = 7
can you explain typical situation?
API21 introduced a new widget, the Toolbar. This widget can be used only in device with API >=21.
With the appcompat rel.21 (a v7 Support Libraries) you can use the Toolbar (pay attention to the package) to implement your Toolbar in old devices running API>=7.
Why should we choose using the Sherlock Action Bar in Android rather than the Support Libraries ? Is there a solid reason for using one above the other ?
Sherlock Action Bar purpose is to add the ActionBar visual concept implementation for API level below 11 (since ActionBar was added in API level 11). Taken from ActionBar javadoc: "A window feature at the top of the activity that may display the activity title, navigation modes, and other interactive items."
Support library (as the name describes) is a jar that provides APIs added in newer versions of Android to older ones. The best example I can think of is the Fragment implementation: Added in API level 11 made it so easy to integrate different parts of UI accross the application. But that was only for API level 11 above. So when the support library was released it provided this feature for API levels below 11.
So these 2 are separate concepts (one is for UI only, while the other is for supporting newer APIs in older Android versions). To add more, Sherlock AB uses support library.
The Support Libraries did not have compatibility for the Action Bar pre Support Library revision 18 and therefore the natural choice was the ActionBarSherlock library.
However as of revision 18 release in July sometime it is now supported, how good it is I am unsure as I have not used it but in future projects I will be leaning towards the Support Library as its supported by Google.
The link to the Support Library revision notes is here.
If I'm not mistaken, the ActionBar is only available in API 11+ and the support library do not include the an ActionBar Library for API < 11. ActionBarSherlock is a library that let's you support an ActionBar in API 7+.
PS: I believe google is gonna include a ActionBar API in the support library soon. So they said in Google I/O this year.
Update:
Google added ActionBar (for API 7+) in the support library.
I'm starting a new android project, and want to support api 8 onwards. I'm looking at the ActionBar class, which is only available in api 11 onwards. The compatibility library has classes like "ActionBarDrawerToggle" as of the May 2013 release - but is there a standalone ActionBar compatibility class for us to use now?:
http://developer.android.com/tools/extras/support-library.html
or do we still have to use ActionBarSherlock?
Thanks
You have to use ActionBarSherlok. Which more easy to use, and works on all platforms.