Android SlidingMenu library installation
Asked Answered
P

1

8

I am trying to follow this tutorial.

The aim is to integrate the SlidingMenu android library. As per the instructions in the tutorial:

For non-maven project : Copy library/target/slidingmenu-1.3-SNAPSHOT.jar into the libs directory of your project.

I don't know how to use Maven and I don't want to introduce another layer of complexity.

So, where can I locate the library/target/slidingmenu-1.3-SNAPSHOT.jar file?

Update

With the exception of the Maven section, I followed the tutorial completely but got the following single error:

slidingmenu cannot be resolved or is not a field

The error is caused by this line of code:

slidingMenu.setMenu(R.layout.slidingmenu);

I'm a beginner but I know that's an issue of a missing resource. What I don't know is if it's related to the Maven issue. How can I fix it?

Premaxilla answered 14/8, 2013 at 15:30 Comment(1)
Should it be R.menu.slidingmenu (instead of R.layout.slidingmenu)? it depends on which folder it is located in.Bunton
B
11

So without implementing maven, all you need to do is download that library from your link on github (here). It is only 4.4 MB.

On that github page, there should be a button that says "Download ZIP".

Once you save the zip file, open the zip file, and navigate the contents... inside the library folder, you can find the source files of the SlidingMenu solution.

The QUICKEST way to get this into your project is to copy the contents of the libs, res, and src folders into the respective folders in your project.

The SlidingMenu project on github cannot merely be a .jar file, since it contains visual assets as well (ie. items in the /res folder are needed).

Another approach is to create a separate project on your computer named SlidingMenu (create it as a "library" project) and then include this project into your own project as a dependency. The manner in which to do this varies by IDE (Eclipse, IntelliJ, AndroidStudio, etc). Hopefully you're using one of those IDEs.

Bunton answered 14/8, 2013 at 15:36 Comment(3)
Thank you so much for this detailed answer. I had used your second suggestion to import the library. It worked fine but I got a single error. I have updated my question with detailsPremaxilla
Try R.menu.slidingmenu (see comment above)Bunton
Thanks. You've been a total helpPremaxilla

© 2022 - 2024 — McMap. All rights reserved.