I'm new to android and I'm trying to use ActionBar.I've read the documentation where it simply states that if you use android greater that 3.0 (i think) you use it by default.I've also downloaded some sample code and built it,and while it runs as it should run (meaning that the actionBar appears).In order to run it i had to import another project so that it could compile correctly.Do you know how i can effectively use the actionBar API ?
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.
If you want example check this
Related
I have an Android library that helps implement and add various GUI components the Android navigation drawer.
Currently the library will only support the full APIs from the supported API, i.e. from Honeycomb onwards.
I want to change the library so it can also work with AppCompat, that shouldn't be a problem as it is likely to always to be installed and available.
The problem I have, a couple of users who use the library have requested that my library can support the use of the ActionBarSherlock library as well.
I don't want to do to separate navigation drawer management libraryies, and app compat and then a separate library for ActionBarSherlock so what I am wondering is if there is a way I can make a class that uses ActionBarSherlock libraries but will only attempt to compile/use the classes(s) if ActionBarSherlock is available.
Therefore the user can use my one library and be able to use all 3 different types of navigation drawer without needing multiple different libraries to support them.
My library is used within Android Studio not Eclipse
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
I'm very new to greendroid and I had a quick look on its functionalities. If I want to develop with the android 4 sdk does it still make sense to use greendroid? Is that gonna work?
For example let's take the ActionBar. There's one in greendroid but android 4 has now that functionality too so what? Of course it's only one element but is there still an advantage to use greendroid when the base sdk is android 4?
isn't this library intended to support older versions (like 2.x and below) ?
if so (and my guess is that it is ) : if you don't wish to allow such devices to be able to run your app , then you don't need this library .
otherwise , if you wish to have the action bar functionality , you should consider using it (or any other solution for the action bar , like the action bar sherlock or the android library that google gives.) .
most devices today do not have a new version of android . currently , most of them run version 2.x .
here's the current statistics:
http://developer.android.com/resources/dashboard/platform-versions.html