This question already has answers here:
What is the equivalent of ActionBar in earlier sdk versions? [closed]
(4 answers)
Closed 9 years ago.
I'm currently trying to create an ActionBar for my Android application. But I need it to work in Android 2.2 and 2.3 too. Is there any way to implement ActionBar in Android 2.3/2.2?
Have a look at ActionBarSherlock. Just add the library to your Android project and overwrite Activity with SherlockActivity, so you have all the possibilities of an Actionbar.
ActionbarSherlock is a library that makes almost all features of the ActionBar available on Android 2.1 and up. When you use a API Level that supports the action bar natively it will automatically use the native action bar instead.
You can use the actionbar with ActionBarSherlock. It is simple to install and can do everything you need. For the beginning you can start here to read.
Related
This question already has answers here:
Material Design not styling alert dialogs
(8 answers)
Closed 7 years ago.
I want use alert dialog like this picture for API 15 and API 19
Use android support v7 appcompat library to achieve this.
The library is to maintain the backward compatibility. After adding this library to reference you can use AppCompatActivity instead of Activity.
To find this library import the library project from sdk/extras/android/support/v7/appcompat and then use it in reference of your current project
I'm trying to implement Sherlock ActionBar, but I'm not getting... Seems It's too old.
Does it have an equivalent ActionBar, or someone have a new tutorial ?
ActionBarSherlock was deprecated two years ago. Either use the native action bar that is part Android (from API Level 11 onwards), or use Google's appcompat-v7 action bar backport in the Android Support library. Both are covered in the documentation.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
i am newbie in Android and in this forum too. i don't know when to use Action bar and sherlockActionbar. i am using Api 16 . Can someone please explain here? Thanks in advance.
Updated :please tell me how to customize my Action bar. i don't wanna show my app icon in left side of action bar and also want s to change the color and put the image over there??
Action bar is build for API Level 11 or higher so that will not run below that API version.
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 ActionBar class.
ActionBar Support Lib / ActionBarCompat That has released by Google for older version also.
We released a new backward-compatible Action Bar implementation called ActionBarCompat that's part of the Support Library r18. The ActionBarCompat APIs let you build the essential Action Bar design pattern into your app, with broad compatibility back to Android 2.1.
ActionbarSherlock is library project which support in lower version. Minimum API level is 7
In your case,
If your android:minSDK="16" then you should go with ActionBar. but ,
If you want to set your android:minSDK="10" or below then that , in that case you should use ActionbarSherlock.
For sherlockActionbar, you should build your application with SDK version 14 or above.
Due to its use of the native action bar and its related classes on Ice
Cream Sandwich, the library requires that both it and your project are
compiled with Android 4.0 or newer. The project also requires that you
are compiling with JDK 1.6 in both your editor and any build systems
that you may be using.
And if you check out the support library at:
http://developer.android.com/tools/support-library/index.html
If you are using Support Library v7 or above:
New v7 appcompat library:
Added ActionBar to allow implementation of the action bar user interface design pattern back to Android 2.1 (API level 7) and higher. Use of this class requires that you implement your activity by extending the new ActionBarActivity class.
It is built in with Action Bar and you can use it safely without externally including SherlockActionBar.
Note: v7 appcompat library depends on the v4 Support Library. If you are using
Ant or Eclipse, make sure you include the v4 Support Library as part
of this library's classpath.
Of course you have to use Sherlock if you are still using v4 support library solely.
Answer for your updated question:
If you want to remove app icon from action bar then just remove this line from Manifest file in application tag
android:icon="#drawable/app_icon"
If you wanna change that image just put one image in drawable folder and replace app_icon with that image name which is present in the drawable folder
android:icon="#drawable/your_image_name"
To change color refer this link
Android Navigational Drawer is supported on minimum which version? Also can we make Custom Navigational Drawer in android? If we can then kindly tell me how to get started. I have read the documentation from Android Developer Site but many things I can't understand and want help
Thanks in Advance.
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.
Its available from API 2. I believe. So almost all device. I recollect seeing it in Google IO videos.
I am creating application which will support Android 2.2 to Android 4.1. The TabHost is deprecated in Android version 3.2. But the created application supported in all the versions. But I want to create the Tab bar application which will look like a tab bar in Android 4.1 while running the application in Android 4.2, If I am running the application in below android 3.2 version device, it must look like the tab bar in that device. How can I do this.?
There are many points to your question,
TabHost is not deprecated yet. Recently Google deprecated TabActivity and ActivityGroup.
Even if it deprecated, it doesn't mean it can't be used. If X is deprecated, it only means a better alternative named Y is there.
Now to answer your question, You have more than one options
You can use ActionBarSherlock as other answers suggests. (EDIT : ActionBarSherlock is now deprecated.)
You can use TabHost with fragments, See my answer here for a
good example. To use Fragment in pre 3.0 API's you need to use
Google's support library.
Try out ActionBarSherlock.
ActionBarSherlock is an extension of the support library designed to facilitate the use of the action bar design pattern across all versions of Android with a single API.
The library will automatically use the native action bar when appropriate or will automatically wrap a custom implementation around your layouts. This allows you to easily develop an application with an action bar for every version of Android from 2.x and up.
Tutorials:
tutorial 1 , tutorial 2 ,
tutorial 3
Just to add, Android has introduced ActionBarCompat to ensure ActionBar is compatible with OS below 3.0 down to 2.1. You can use ActionBarCompat in the support library instead of ActionBarSherlock
http://android-developers.blogspot.co.uk/2013/08/actionbarcompat-and-io-2013-app-source.html