I have been using actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); in my app but the target device is android 2.3.2 and does not support this code.
Is there any solution to have actionbar and tabview in android 2.3?
The solution for getting using the ActionBar in versions prior to 3.0 is called ActionBarSherlock, and enables you to give the user a unified experience across the Android versions.
Link to the website: ActionBarSherlock.com
There's actually also something called ActionBarCompat (read more here), but it's really inferior to ActionBarSherlock.
Edit: You'll find a lot of useful samples within the project hierarchy, but this should probably be the thing you're looking to accomplish: TabNavigation.java
Use ActionbarSherlock: http://actionbarsherlock.com/
Here is the tutorial for using tabs with ActionbarSherlock : http://www.androidbegin.com/tutorial/implementing-actionbarsherlock-fragment-tabs-in-android/
Yeah ActionbarSherlock is a best way to do it.
Here is how to add it link
Related
http://developer.android.com/design/patterns/navigation-drawer.html
I need this functionality, like gmail,linkedin,youtube app but that should support also older versions of android like 2.3
SherlockNavigationDrawer is probably the way to go, as I reckon you might want to combine it with ActionBarSherlock as well.
That said, SlidingMenu by Athulh works both with and without ActionBarSherlock, so that's another option. :)
I am working in an application in which I have to implement ActionBar with TabListener. I have got a sample code for this task lucazanini but this is working only for API 4.1 and Above and Its not working for any lower API's.
Aslo I got a sample for ActionBar with a library project but it does not include TabFragment in it.
Please suggest me with some sample so that I can work on ActionBar + ActionBar.TabListener in Lower API level in Android.
You should consider using ActionBarSherlock library which is almost a standard for doing such thing by now. Even Google suggests using it.
this will be helpful:
actionBar sherlock
it is working fine.,you can override the example for your requirement. it looks simple.
You can use ActionBarSherlock.
You can find it in http://actionbarsherlock.com/index.html.
This library uses native ActionBar for Android 4+, and makes a wrap for older release.
Google is using this library and encourages its use.
You can find source code here:
https://github.com/JakeWharton/ActionBarSherlock
In the same repository you can find a lot of examples.
If you want it in action, you can try this free app:Android UI Patterns:
https://play.google.com/store/apps/details?id=com.groidify.uipatterns&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5ncm9pZGlmeS51aXBhdHRlcm5zIl0.
I'm planning an Android app that should make use of lots of UI features that later SDK versions bring with them incl. ActionBar, ActionBar.Tabs, Swipe navigation and use of Fragments (with replace, add, FragmentTransaction etc). The app should support SDK 8 (2.2) and later.
I'm a 'bit' at a loss here on how to set this up: will I be able to use all these features with the official Android compatibility library? Or will I have to use ActionBarSherlock? Will ABS give me advantages/ be easier to implement compared to the official comp. library?
Can I use the Eclipse/ ADT navigation templates with those two librarys? Can I use them alongside each other or do I have to comit to one of them?
Lot's of questions, I know :)
will I be able to use all these features with the official Android compatibility library?
No.
Or will I have to use ActionBarSherlock?
Yes.
Will ABS give me advantages/ be easier to implement compared to the official comp. library?
It will give you a backwards-compatible action bar. The Android Support Library does not.
Can I use the Eclipse/ ADT navigation templates with those two librarys?
You can do whatever you want. You will need to replace some stuff generated by those templates.
I think using using ActionBarSherlock is the best.
Have a look at this link
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
Until now I was using TabActivity for Tabs layout.
Since this Activity is deprecated What will be the best way to form a tabs interface?
I saw many tutorials showing the use of TabFragments but this is good only for high sdk version (15 and higher).
So what objects can I use for tabs layout considering it should work with API 10 and above and of course not deprecated?
An example will be great!
As Commonsware said here ::
"Deprecated" in Android means "we think there is a better solution that you should investigate". Rarely does "deprecated" mean "it is unusable". TabHost, AFAIK, works fine on Android 4.0.
There are also project named ActionBarSherlock which demos have all the capability of the compatibility library. Source code is also available on github.
There is also this tutorial which helps you how to use TabFragement.
I faced the same question while ago too and the best solution is use ActionBarSherlock with Fragments and there is a really nice tutorial how to implement TabHost in your app which you can find here :
ActionBarSherlock:FragmentTabs.
It worked for me, hope it will work for you too : )
P.S. And one another thing, it is really good when you are building an application to look for design guidelines and the best ways you can build your app so you can take advantage of the latest news in Android App Development.