I am developing an Android application with Target SDK version 14 and minSdk version 10.
In SDK version we have support for Action Bars where as in API 10 we dont j=have support action bar.
Does android support library latest revision (android-support-v4 rev 12) has the support for Action bar and Popup menus ?
As i have written our application on API 14 and now we want to support API 10 aswell , Do we have another way to support action bars and popup menus in API 10?
Thanks, Vamsi
Good news. Google has added action bar in their support library in revision 18.
http://developer.android.com/tools/support-library/index.html
Android doesn't support ActionBar on earlier versions (before honeycomb), but there is a wonderful library you can make use of. Check out ActionBarSherlock. Even inside google guys do encourage developers to use this.
If you want to get HOLO theme for your app that is running on older versions of Android then checkout HoloEverwhere.
What do you mean this by popup menu? then you can do it too.
Related
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
I have an old Android app that was target at API level 8 (2.2). I'm planning to update it to targetSDK 4.4.2. Main change will be using the Action Bar on pretty much every Activity. Right now it uses the old menu.
I know I have to use android.support.v7.app.ActionBar to support Action Bar for older phones.
Is it recommended to implement the "regular" android.app.ActionBar for APIs 11 and greater alongside android.support.v7.app.ActionBar?
Will they look any different?
No, you can use android.support.v7.app.ActionBar for all API levels.
Your ActionBar wont look different at all for APIs 11 or greater.
You can keep using android.support.v7.app.ActionBar.
In Android Studio if I select min sdk above the options for GridLayout, Fragments, Navigation Drawer and Action Bar disappears:
Min SDK 2.3.3:
Min SDK 4.0:
Why there is no option for using fragments when min sdk is above 2.3?
Three of those checkboxes are for adding the backports of GridLayout, fragments, and the action bar. You do not need the backports of GridLayout and the action bar when your minimum SDK version is set to 11 or higher.
There are two issues, though:
There are legitimate reasons for using the backport of fragments even on an API Level 14+ app, notably to support nested fragments
"Navigation Drawer" should be an option regardless of API level
IMHO, those are bugs in Android Studio. Bugs like this are why I do not recommend Android Studio to newcomers to Android -- it is still an "early-access preview" and will have more than its fair share of issues.
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 recently read about the action bar implementation in android in the dev site.But i found that it requires a minimum api level of 11.Can someone tell me whether it is possible to implement action bar in Api levels less than 11 such as 8 or 9.If yes how can i do this?
ActionBarSherlock at http://actionbarsherlock.com is an Android library for implementing the action bar design pattern using the native ActionBar on 3.0+ and a third-party library on pre-3.0.
There is now also ActionBarCompat - part of the Android Support Library: http://android-developers.blogspot.co.uk/2013/08/actionbarcompat-and-io-2013-app-source.html
There are third-party implementations of the action bar available. See this library project at github: android-actionbar. The manifest says the minimum API level is 3, target API is 8.
If you are looking for a simplistic Actionbar solution you might want to give a look to ActionBarCompat from the Google Official examples