Problems using ViewPager Example - android

I'm an android newbie trying to use the ViewPager control which is part of the "Compatibility Package."
I first used the SDK manager to install the Extras Support Package.
I then went to https://github.com/commonsguy/cw-omnibus/tree/master/ViewPager/Fragments and got the ViewPager project and loaded it into Eclipse.
I then added a libs folder to the project and put "android-support-v4.jar" into that directory.
I did a Clean build and got all sorts of errors. The screenshot of my project is at http://dl.dropbox.com/u/39662979/viewpager.jpg.
What have I faild to do?
thanks,
Gary Blakely

I have seen that you are using part of SherlockActionBar but the missing themes had to be referred to a miss library. In particular you have to import as a library project the Jake Wharthon's work and then link to your project as android library.

Delete the Theme or add the theme to your styles.xml.
I do think you don't need the Theme if you only try to use ViewPager.
So delete it.

You might be looking for ActionBarSherlock - FAQs.
There is a video that will help You get started with the library
P.S. don't forget to delete import android.R; if You have it

Related

Newly created project on Eclipse with Android SDK does not recognize import statement

I created a sample HelloWorld app on Android using Eclipse! It's not importing a java package. What could be wrong?
Try rebuilding your project. This link explains: http://izvornikod.com/Blog/tabid/82/EntryId/12/How-to-force-Eclipse-to-rebuild-generated-resource-class-R-in-Android-project.aspx
First you have to remove error from res folder its might be a reason nd then clean your project
2.Check you add android support v7 appcompat library in your project if not then first you have to add it in your project and also clear android support v7 appcompat library. if library having error then never reslove in your project.
may this info. help to you :)

Sherlock Library is showing error

I am using Sherlock Library and for that I have download the library and used it as mentioned at this link http://actionbarsherlock.com/usage.html.
I have added the library code into Eclipse. Then I have created new Android Project named SharelockFragmentDemo and try to add the SherlockLibrary as follows,
It shows that library is added successfully,
But after clicking the OK button when I open this dialog again then it shows me import error as follows,
Am I missing something while importing the library ? Please help me to solve this error.
Try placing the library folder in the same location as your project. It may work.
Try to put your library and project into same drive and then import library from that drive and add it into your project
Hope it will help you.
Thanks.

Importing ActionBarSherlock - android

I am new to Android, and I am setting up a project which needs ActionBarSherlock. I imported the last one as module inside my project so that the error warning import com.actionbarsherlock.app.ActionBar; which was entirely red, is now getting red only on ActionBar. How can I manage this ? Do I have to put ActionBarSherlock in my project lib folder rather than imported it as a module
So you have ABS library module in hand. Now, I'll tell from starting
Start a new project. Make compile with latest (jelly bean) and Theme as None.
In project explorer, navigate to libs folder and delete supportv4 jar file.
Now, include your ABS library following properties-->Android-->library
finally, change theme as,
< application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Sherlock" >
a priori, I manage to do the trick, by importing ActionBarSherlock as module. Then, I stll got an error upon ActionBar in com.actionbarsherlock.app.ActionBar. In my code, I edited the help warning popup box showing optimizing imports and adding as dependecy module , and clicked on the latest, and it worked fine
Go to file-->import-->Android-existing code into workplace, Then select ActionBarSherlock's Library, After importing go to the properties of the project in which you wanna add actionBar.
Do this by right clicking on your project in package explorer -->properties--> under Android click add in the library section and choose the actionBarsherlock lilbrary listed there.
EDIT:
I would suggest you look here. Make sure that you have checked is library option. But what I think initially is that the library is added perfectly since its now recognising com.actionbarsherlock.app package. One common bug is that actionbarsherlock and your project both contains the android support package library, try deleting the android support library from your project since your project should be using the support library from actionbarsherlock. Remember to backup your code.
EDIT 2: You should be extending sherlockActivity instead of normal activity, same stands for Fragments, A fragment would be changed to sherlockFragment. These are the widgets that will come from sherlock library.
Refer this link also

Adding source files to android

Ok, i've wasted an hour trying to figure it out, even though it's something really simple.
I've downloaded some code from github. I'd like to use this in my android application. How do I go about adding it? It's not a jar file, and i tried drag dropping it and linking the files, and it didn't work. Importing and refreshing / cleaning the project didn't work.
I'm not sure where I'm going wrong. Any help is greatly appreciated!
If this is a project you want to import in eclipse, right click on eclipse left pane (the project list), import, android project from files, select the repository folder.
If this is a library you want to use in you app, there is another step : go to the properties of your project, android tab and in the library section click on add, then select the library project.
By design, android code that contains layout resources (for example ActionBar Sherlock) can not be embedded in a jar. So you have to use it as a library project. It is very convenient though, since it allows you to look at or modify the library code very quickly.
You may also need to let Eclipse know that your library project is a library and not an app. To do so, in the same Properties/Android screen you just have to check the "is a library" checkbox.
Reference on that topic : official documentation
In Eclipse:
File->New->Other->"Android Project from exiting Code"

Action Bar for android < 3.0

I want use ActionBar for my application but i found it can't use for android < 3.0.
I found this https://github.com/johannilsson/android-actionbar to solved my problem but I get error at
import com.markupartist.android.widget.ActionBar;
import com.markupartist.android.widget.ActionBar.Action;
import com.markupartist.android.widget.ActionBar.IntentAction;
Give ActionBarSherlock a try. I use it for one of my projects and after some reading of the docs and the samples it just worked. The samples are easy and straight forward, you should be able to extract what you need from them.
To see what it's able of just download the sample app from the market: Sample App (requires at least Android 1.6)
You should add the code to a library, and add the library to your project.
To do this in Eclipse create a new project, using the same package name as the github project (so com.markupartist.android.widget). In the properties select the project to be a library under the Java Build Path tab. Then, in your project, go to its properties, and select the library.
I think your including files are missing (JAR libs) , Click on error icon and then select fix project setup.
I spent around 10 hours trying to fix this problem. All the above ans does not work. Actually what is missing is android support library. To fix this, right click on project, >Android Tool> Add Support Library. Hope this save alot of time for other who came across this. just add support library both on your ActionBar library and the current project.

Categories

Resources