Greendroid or ActionbarSherlock - setup - android

do you guys know any tutorial on how to use one of the above frameworks in eclipse on windows?
I've downloaded both of them and followed the instructions - but I still get errors in both cases. Frustratin.

I just tried these instructions on ActionBarSherlock, but I'm pretty sure the process was the same when I was using GreenDroid.
Download the .zip/.tgz and extract it somewhere
Go to eclipse and choose File->New->Project
Choose Android Project
Select Create project from existing source and then browse to the library folder inside the folder you just extracted the .zip/.tgz into
Build Target should be 3.2 as of this time
Finish the wizard, then right click on the newly created project and go to properties
Under the Android heading, you should see a section for Library with a checkbox IsLibrary. Make sure that's checked.
Now go to the properties for your Android project, then under the Android heading and the Library section choose Add...
You should see the actionbarsherlock library, add this to your project
Lastly, if you were using the compatibility support you need to delete that jar since it's included in ActionBarSherlock

I had errors on #Override methods because I was using Java 1.5. Switching to 1.6 solved them.
To do this : right click on your project > Properties > Java Compiler > Enable project specific settings > Compiler compliance level > 1.6
It is related to this issue in the project's bug tracker : https://github.com/JakeWharton/ActionBarSherlock/issues/28

Related

Can’t link Android projects in Eclipse

I can’t link Android projects in Eclipse.
I get a VerifyError, and some can’t find class warnings, which I assume means that it’s not getting the library.
I’m using project properties > Java Build Path > Projects.
I can get it to work by referencing the other projects jar. Then setting the source attach so that I can step through the code, but this is a much uglier way of setting the projects up because linking to source and linking to the jar doesn’t allow the use of path variables. So the next person to pick up this project is going to be really confused when the project doesn’t work for them.
Is it possible to directly link projects?
Is it possible to use path variables to reference jars and source
attachments?
It’s so easy to do in Flash Builder…
Also, when I change anything in properties > Android then hit okay, when I open properties > Android the changes have been reverted, what's that about?
If you are asking if an android project can reference a "library" project, the answer is yes; open the properties for the main android project and select Android menu and then at the bottom half of the screen, you can Add your library project to your main project. Note that the "library" project should be set as a library project (same UI allows you to set a project as library)
HTH,
Ali.
assuming you're talking about a library project that you have in your eclipse workspace.
go to properties -> Android
on the bottom half of the screen you should see a "Library" pane.
click add and point it to your library that's in your workspace that you want to add.
click apply afterwards.
i'd remove what you added in that library pane that you're talking about. that's for jar libraries that you've added to your project's libs folder.

R File missing on library dependent project

I am trying to use jfeinstein10 / SlidingMenu http://goo.gl/PEZ9M in my android application.First I have added library project of Sliding Menu, then I added ActionBarSherlock too.Sliding Menu library is dependent to ActionBarSherlock.
Also my app is dependent to SlidingMenu app.
My question is that when I add a library project as a dependency to my main project, the R file of the main project disappears and all my R references in main project cannot be resolved.
does anyone know that R file disappearance issue after adding a library project as a dependency?
Use the Project Properties and clicking on the Android section, change the Project Build Target to Android 4.0.3 (API 15). Clean the project after changing the API Level.
Ok I just struggled through this issue for quite some time now I finally resolved it here are the steps I took.
First of all I updated the android SDK for eclipse to the latest version.
Then I updated eclipse itself by going to Help --> Check for updates
next downloaded the latest version of SlidingMenu and ActionBarSherlock and unzipped them to a folder
Then in eclipse import ActionBarSherlock by creating "New Android Project from existing source" and selecting the "library" folder in the unzipped directory
Repeat the above step for SlidingMenu
Very important at this point to make sure you don't have any errors in your both imported library projects
If you have errors in the ActionBarSherlock then right click the project goto "Android Tools" --> "Add Support libraries". This should resolve any issues you have if not then goto project --> clean and clean up the project
The sliding menu will have a target of 2.2 or 2.1 by default (sorry cant remember which one...its really late and my head feels foggy :z)
Right click on the SlidingMenu project and select properties in the window that opens select target build of Google APIs 4.0.3 select ok and do a CTRL + SHIFT + O and any issues or warnings you had should go away.
With that out of the way then once again right click on the SlidingMenu project and select properties. In the window under Android scroll all the way down and add reference to the ActionBarSherlock library. Also make sure the "Is Library" checkbox is checked. Apply and ok.
Next you have to do the same for your project. Right click on it --> Properties under Android Scroll all the way down and add SlidingMenu as a library. Make sure the "Is Library" checkbox is NOT checked.
At this point I encountered Dependency errors. The problem is that in your projects "libs: folder you will have the files: "android-support-v13.jar" and "android-support-v4.jar" causing a conflict.
What I did was delete the v4 and copy pasted the v13.jar file into the libs folder of all 3 projects, my project, SlidingMeny and ActionBarSherlock.
This resolved the above issue and it worked!
Hope this helps someone so they can go to sleep at sane hours of the night! :)
I just ran into this problem and I didn't need to change my build target. What I had to do it make sure my app and any library that implemented the support Library was using the same support Library version. The easiest way to do this:
Right click on each project and library that is in question and select Android Tools -> Add Support Library... *

Adding ActionBarSherlock in Eclipse Juno

I´m new to Android World but I really like it, I programmed some apps and now I would like to try the ActionBarSherlock specially for the tabs menu.
I have Eclipse Juno version 4.2, I use jdk-7u5 and the latest version of SDK (v.20)
I want to install ActionBarSherlock version 4.1
As in Eclipse Juno there is no "Select Create project from existing source" option I imported Sherlock library as a existing project on Eclipse and a red cross appears in almost all packages in src.
Then, I added it as library on my own project. Now a red exclamation mark appears on my Android Aplication Project.
I´m using android:minSdkVersion="7" android:targetSdkVersion="14"
I read a lot about different problems with the library ActionBarSherlock and I tried everything they say in the forum, even install Eclipse Helios to use
the option "Select Create project from existing source", but I had an Installation Problem with ADT.
Thank you in advance everybody.
I found this tutorial wich solve the problem I had with ActionBarSherlock.
Here it is http://androiddevelopmenttutorial.co/actionbarsherlock-getting-started/
From this web http://www.grokkingandroid.com/adding-actionbarsherlock-to-your-project/
Getting ActionBarSherlock and adding it to Eclipse
The first thing you have to do, is to download the library from actionbarsherlock.com. After this unzip/untar it. The download contains three folders: library, samples and website. The samples folder contains four sample projects to showcase what you can do and to show you how to do it. You should have a look at them. The website folder contains the code of the project website. The library folder finally contains ActionBarSherlock’s source code.
Now go to Eclipse and add the ABS-library as an Android project. Do not use Eclipse’s import tool to import the ActionBarSherlock library – it would not work immediately and you would have to fix some settings. Instead use the project creation wizard of the Android Developer Tools.
Open File -> New -> Project -> Android Project From Existing Code.
Creating an Android project from existing source
In the next screen select the folder, which Eclipse then uses to search for projects. If you select the ActionBarSherlock root folder, Eclipse suggests a list of projects to create. Leave the “library” project checked and uncheck all others:
Select the library project
Click “Finish” to create the project.
Eclipse will now create a new project named “library”. I prefer a more useful name, so select the project called “library” and hit F2 to rename the project. I have renamed the project in Eclipse to “ActionBarSherlock”, so all following screens will refer to this name.
Adding the library to your project
Now that ABS is a library project you have to tell your own project to use it. I will use the project of my last post for this. Go to FragmentStarter’s project settings and switch to the Android tab.
If necessary scroll down until you see the Library panel. Click “Add”:
Adding libraries to an Android project
In the next window all available library projects will be listed. Select ActionBarSherlock and click “Ok”.
Select ActionBarSherlock from the list of libraries
When the window disappears the library should be listed in the library panel of the Android properties tab:
Check if the library has been added succesfully
Then appears an error: Jar mismatch! fix your dependencies, to solve it there is to copy the file android-support-v4.jar from your_project/libs and paste it on library/libs.
Before you can use ActionBarSherlock you have to extends your Activity like this: public class MainActivity extends SherlockActivity and change the theme in Manifest: android:theme="#style/Theme.Sherlock.Light.DarkActionBar"
This is the way to add ABS to your project. Hope it works for all

ActionbarSherlock not working

I am having problems getting start with the ActionBarSherlock. I downloaded the 4.1.0 version and followed the following tutorial for installing it.
http://www.youtube.com/watch?v=4GJ6yY1lNNY
The Problem I am facing is whenever I make a new project and add the library project of ActionbarSherlock to it. I get the following error.
Description Resource Path Location Type
The container 'Android Dependencies' references non existing library 'C:\Work\JakeWharton-ActionBarSherlock-4.1.0-0-g9598f2b\JakeWharton-ActionBarSherlock-88fc341\library\bin\com_actionbarsherlock.jar' myapp Build path Build Path Problem
Please anybody help me with it.
I just had the same problem: A .jar file is requested, but non-existing. Also, it is okay that the file doesn't exist, because we want to use a Android-Library Project and not an included jar-library.
The steps described by Aqif Hamid are perfectly fine, if the missing import (.jar or library project) would be the root of the problem. But i figured out that the reason for this error is that you have to set both projects (AndroidBar Sherlock and your own Android project) to Java Compliance Level 1.6
To do so go into Project Properties => Java Compiler and set the level to 1.6
Of course, you have to install JDK 1.6 on your computer...
Hope this helps you too!
The only thing that it works for me was selecting at Properties at Java Compiler Tab Compilance Level --> 1.7 (It was 1.6).
After that Android Tools, Fix Project Properties
DO the followings:
just like you have bin, res folders. right click on your project and
add a folder named 'libs' (if libs folder is not already there).
Then copy paste your com_actionbarsherlock.jar file in this libs folder.
Right-click on your com_actionbarsherlock.jar file and click Add to Build Path.
Now clean and build your project. You should be good to go.
Edit:
To add project as a library do this:
Make sure you have your library project in your projects list and it
is open.
Right click on your project in which you want to add your library
project and select Porperties.
Click Android in properties windows, now scroll down, you will see
library section at the bottom. There press Add button.
Now a window will open in which you will see list of library
porjects. Select your required project and press Ok. Now that library
project must be there with a green tick mark.
Press Apply and Ok button.
You should be good to go now.
regards,
Aqif Hamid
I am of the understanding that you cannot include ActionBarSherlock into your project by adding a jar to your lib directory (or just including the jar at all). You will have to create an android project for ActionBarSherlock then link to it as a library:
Create ActionBarSherlock project in Eclipse
Right-click your project and go to Properties
Select Android in the left pane
Then in the right pane, towards the bottom you can Add... the ActionBarSherlock project you created in step 1.
If you are curious why the jar approach doesn't work, I give you Jake's reply in this thread
(although that's a month and a half old at this point).
1 - create a libs folder (parallel to manifest) and put the jar in that
Your Project -> right click -> Properties -> Java Build Path -> Libraries -> Add Jar ->
yourjar.jar
This video might be useful in case you are having some issues.
http://mobile.tutsplus.com/tutorials/android/jar-for-android/
Clean your actionbarsherlock project. It will generate the .jar file for you when it re-builds.
Using the Android Tools option to Add compatible libraries fixed the problem for me.

Eclipse will not recognize project as library (ActionBarSherlock/ViewPagerIndicator)

I'm trying to get ActionBarSherlock and the ViewPagerIndicator libraries set up for my projects, but I seem to be running into a few issues. I sent Jake Wharton (The developer) a few messages earlier about it, and got a few replies but couldn't get anywhere - and I think he got busy with a few other things.
What my issue is, For both VPI and ABS
Both libraries open up without any errors, and I'm using compiler version 1.6 for all as is required.
The funny thing is, if I load in the samples that are provided - they work fine and link to his library; but when I go to add the library to my project - the above happens.
Where to store the actual library project does not matter, as long as you use a relative link to reference it. Check out the Library Projects - Development considerations:
Library project storage location
There are no specific requirements on where you should store a library project, relative to a dependent application project, as long as the application project can reference the library project by a relative link. What is important is that the main project can reference the library project through a relative link.
You should always use the Eclipse ADT plugin to select and set up Library Project Reference, i.e. right-click project -> Properties -> Android -> Add, then in the opened Project Selection window, select the Library Project list here (of cause you should import them in the same Eclipse workspace as your Main Project). This will add a android.library.reference using relative path into project.properties as well as show relative path in the Android preference window:
android.library.reference.2=../../../../../Documents and Settings/yorkw/Desktop/JakeWharton-Android-ViewPagerIndicator-f09acb0/library
If you directly alter it using absolute path from project.properties as below:
android.library.reference.1=C:\\Documents and Settings\\yorkw\\Desktop\\JakeWharton-Android-ViewPagerIndicator-f09acb0\\library
Then after Eclipse refresh your project, you get the exact error described in your question, see my screenshot below:
Hope this helps.
While importing the libraries, make sure that you tick the "Copy projects int workspace" check box. The library projects need to be in the same workspace for them to work.
delete and import the project and lib again. build the lib project , add lib to project, still error shows.. rename the lib project. this worked for me ....

Categories

Resources