I am totally new to android, i am trying to implement Sliding Menu having ListView with, by some searching i found that https://github.com/jfeinstein10/SlidingMenu
Swipe Gesture
is exactly what i want,
There are many questions related to this which are guiding how integrate this library with project, but none of them are for new person like me. also procedure given on github is not detailed, all i know is how to add .jar file but this .zip and other things are totally new for me
This is what i have done till yet;
- downloaded zip from above link
- Extracted that link to folder
- in Eclipse File->import->existing project into work-space..
Now it is showing me many error in package library.src.com.slidingmenu.lib.app
e.g
The declared package "com.slidingmenu.lib.app" does not match the expected package "library.src.com.slidingmenu.lib.app"
now i don’t know what to do…
please somebody guide me with proper detailed procedure of how to integrate and use this library in project.
Thanks !
Well, spending 3 days with same problem I found the exact procedure for this thing. The guide on github is of-course not for entry level guys like us, also there is no such a “step-by-step tutorial” for this, so it took time.
Important: I didn’t include “
Sherlock ActionBar” library, because I want to keep it simpleFirst up all update your eclipse to latest
ADTor best way you can download thisADT Bundle, and confirm that everything is running fine in newADTBundle.Download latest “zip for jfeinstein10 / SlidingMenu” from “gitHub“, And extract it anywhere you want. After extraction it must have these files and folders inside.
File -> Import -> Android -> Existing Android Code Into Workspace, Browse to your folder most probably “SlidingMenu-master” and you should see followingHit
Finish, If eclipse shows some error likeUnable to resolve targetthen change your target throughRight Click on project -> Properties -> Androidand check any latestgoogle APIyour SDK have.Add
Dependency, by right clicking onproject -> properties -> android -> library -> add -> SlidingMenuActivity, and clear both projects.Add new XML layout named as
menu_framein yourres -> layoutand put following in itPut
Frame Layoutandlist viewin it.Also add a
ListViewin yourmainActivityXML file.Now it is time to create “Menu” write following code in your
onCreate()aftersetContentView(R.layout.activity_main).At the lines it is showing error press
ctrl+1and importcom.slidingmenu.lib.SlidingMenu;“Run your project and you should see menu coming out from left side
Now the next task is to add
adapterandlistenerfor both of your ListViews (i.e for Main-screen and Menu).For information about function used while creating Menu you can refer to example apps provided with library or google them, there is lot of info available.
Also thanks to “Jeremy Feinstein” for such a great library