I'm using android 2.3.3(on eclipse), I would like to add action bar to my project.
I've tried to add android support library V7 and got many errors like this:
[2013-08-12 16:42:36 - app name_1_1_1] C:\Program
Files\Android\android-sdk\extras\android\support\v7\appcompat\res\values-v14\styles_base.xml:24:
error: Error retrieving parent for item: No resource found that
matches the given name 'android:Widget.Holo.ActionBar'.
Is it possible to add the support library or add different library for the action bar ?
Read this tutorial from Android's official site.
You just need to include android-support-v7-appcompat.jar support jar in your project from your android-sdk-windows\extras\android\support\v7\appcompat\libs path on your disk. Then you can use ActionBar below API 11 in Android.
Official Android Tutorial is here: Action Bar Android Official Sherlock bar was creating issues for me then I got this solution.
This may help you
Android actionbar how to add supporting library v7 appcompat for Eclipse
or try this one
There are two ways to go to do ActionBar for Android 2.3.3/API Level 10,
You can use ActionBarCombat which is the support library version
of Android; here is a detailed official tutorial
http://android-developers.blogspot.com/2013/08/actionbarcompat-and-io-2013-app-source.html
You can use 3rd party library which is ActionBarSherlock, also the
usage is here http://actionbarsherlock.com/usage.html
Try Action Bar Sherlock. From their website:
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.
its because you set project build target below 4.0
try to change ur build target above 4.0
and don;'t worry,, it can run on 2.3.3 too
Related
I need to use FAB (like compose button in gmail),
I searched the net and found lots of FAB library online, but the problem is they are all for Android Studio (aar files).
I also have problem updating AppCompat to its newer version so that I can use the Float Bar in it.
Isn't there any library (jar file) for FAB to use in Ecplise?
You can use almost any library available for Android Studio and adapt for Eclipse.
This is a library on github which does not require any modification: android-floating-button-eclipse
https://gist.github.com/Jogan/9def6110edf3247825c9 try this no need of any library or any additional jar files. works fine with eclipse.
I want to implement action bar in my android application. I have searched for that and I found out the I need to add some libraries in order to able to use action bar for android 2.X. I started following some online tutorials about adding sherlock actionbar. In every tutorial its mentioned that when I extract the library file which I downloaded from :here
I should get three folders samples, library, and website. But I didn't get them.
So I couldn't follow the rest of the tutorial. Here is the list of the files and folders I have got after extracting the folder :
actionbarsherlock build.gradle deploy_website.sh RELEASING.md
actionbarsherlock-fest CHANGELOG.md LICENSE.txt settings.gradle
actionbarsherlock-i18n checkstyle.xml pom.xml website
actionbarsherlock-samples CONTRIBUTING.md README.md
I'm using Linux mint and eclipse. Can anyone tell me how to add the sherlock library?
Why do you need to use actionbarsherlock ? Support for the action bar is added now in support library.
"From your activity, you can retrieve an instance of ActionBar by calling getSupportActionBar()."
see the link below for more info.
http://developer.android.com/tools/support-library/index.html
http://developer.android.com/reference/android/support/v7/app/ActionBar.html
Why don't you use use ActionBar Compat?
It's available in the support library v7, allows minSdk 7 and it's a library from Google.
Furthermore the development of ActionBarSherlock is stopped
1.First you need to import sherlock lib project to eclipse.
2.Now add this library project to your sample project(Right click on project ->Properties--->Android-->add library)
NOTE: your sample project path and library project path shall be same.
3.Now create a Sherlock Activity instead of simple activity by extending SherlockActivity class .
4.You also need to change theme also.
https://github.com/jfeinstein10/SlidingMenu is a good example for Sherlock download as zip and import it to you workspace i hope it help you
My Action Bar is not showing properly.
I used support library appcompact v7. Application is running well but
when I run it on Android lower version as 4 then
is my Action Bar outspread to full screen so it overlay of the
main view.
Do you have some suggestions to solve this problem?
Thanks
Illustrative pictures:
on Android 4
older versions
The Action bar doesn't show in devices running older versions of android. It doesn't matter that you are using the compatibility lib.
If you want the action bar on older android devices , I would recommend Action Bar Sherlock . Here is the link to it http://actionbarsherlock.com
Also I didn't quite follow you last sentence , are you saying that the action bar is expanding to full screen in older devices? That is very unusual , can you post your code pls.
ActionBarCompat is not supported in API level 4. It is only supported from API level 7. Have a look: http://android-developers.blogspot.in/2013/08/actionbarcompat-and-io-2013-app-source.html
Finally, after a couple of days I found a solution to this problem.
First, I had the following lines in my build.gradle file:
compile 'com.android.support:appcompat-v7:18.0.+'
compile 'com.android.support:support-v4:18.0.+'
This is okay, but I had also inserted this line
compile fileTree('libs')
in the gradle file to add adMob library to my application, and this caused the problem.
In the libs folder of my project, I had also added 'android-support-v7-appcompat.jar'. Action Bar used this first, without the dependencies that are contained in res folder of the appcompat library.
I deleted 'android-support-v7-appcompat.jar' from libs folder of my application project and my application is now fully functional on Android API 7-18 without using third party solutions, such as Sherlock.
I have implemented sliding menu with action bar using "ActionBar Sherlock and Sliding menu" libraries.Now i tried to use staggeredGridView. But i am getting error as "JAR MISMATCH present in StaggeredGridView-Android Support v4 library"
How can i use staggeredGridView along with actionBar sherlock?
Both ABS and StaggeredGridView come with the compatibility library, but probably with different versions of the JAR. You should replace one of the compatibility JAR's with the other, the Android SDK will ignore duplicate JAR's as long as they are exact matches.
As to which JAR you should copy, always copy the newest version (probably ABS version), alternatively you can grab the latest version from the SDK and overwrite them both.
Hope this helps..
I am using ActionBarSherlock to implement action bar on my Android 2.1 API 7 project. (With Eclipse IDE)
In order to use sherlock, after I imported sherlock library as a existing project on Eclipse. I did the following things on my own project:
mouse right click on my project, choose "properties"
in "Android" section, there is "Library" sub-section, I added sherlock project as library
Apply change
Then, I notice the FragmentActivity can not be resolved in my project source code.
I checked the project property again, the added sherlock project as library is not in "Library" section...weired!!! Why it suddenly disappeared even I have added sherlock as library? What am I missing?
I mean no matter how many times I added sherlock as library to my own project, the next time I check project property, the sherlock just disappear from library section...
First, after adding the project as a library, restart Eclipse - I believe this is a known bug with at least some versions of the plugin.
If that doesn't work, check that the 'default.properties' file in your project root is not read only.
Other known problems :
Your app should use the same "Uses-sdk" setting in AndroidManifest like your Sherlock addon
Minimum Java version for Sherlock: 1.6 !
In package with libraries, you also have a lot of samples with source code
ActionBar is not visible in Layouts
Few simple that i remember