Android-Slidingmenu-example的配置

Slidingmenu目前比較流行,今天本身也從網上找了一些開源的 Slidingmenu實現,主要有項目有:
https://github.com/jfeinstein10/SlidingMenu/
https://github.com/JakeWharton/ActionBarSherlock

由於jfeinstein10的這個SlidingMenu信賴ActionBarSherlock,全部先得下載ActionBarSherlock,
1.下載ActionBarSherlock,並完成配置.
  Setp 1:下載ActionBarSherlock源代碼 java

git clone git://github.com/JakeWharton/ActionBarSherlock.git
  Setp 2:將ActionBarSherlock的Lib導入Eclipse
  下載下來的源代碼有好幾個目錄,使用ActionBarSherlock/actionbarsherlock的項目就行,將一個目錄導入Eclipse,導入後這個項目還不是一個android項目,還要修改一下.projectt 和.classpath這兩個文件:
將.project修改成:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>actionbarsherlock</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
                <buildCommand>
                        <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.jdt.core.javabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>com.android.ide.eclipse.adt.ApkBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
                <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
</projectDescription>
再修改.classpath文件:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="gen"/>
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
	<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
	<classpathentry kind="output" path="bin/classes"/>
</classpath>
回到Eclipse裏,Clean一下項目actionbarsherlock就能夠了...

2.下載SlidingMenu,並完成配置:
Setp 1:下載SlidingMenu源代碼 android

git clone git://github.com/jfeinstein10/SlidingMenu.git


Setp 1:配置SlidingMenu
和ActionBarSherlock的配置同樣,只不過要注意的是在使用android-support-v4.jar要引用ActionBarSherlock項目下的Libs裏的這個jar包,要導入的項目是SlidingMenu/library
.project與ActionBarSherlock同樣,.classpath有一點點不一樣:
.classpath詳細以下:
git

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
	<classpathentry combineaccessrules="false" kind="src" path="/actionbarsherlock"/>
	<classpathentry kind="src" path="gen"/>
	<classpathentry kind="lib" path="/actionbarsherlock/libs/android-support-v4.jar"/>
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
	<classpathentry kind="output" path="bin/classes"/>
</classpath>

3.導入SlidingMenu/example項目
修改.project與上兩個項目同樣,配置.classpath:
github

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="gen"/>
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
	<classpathentry combineaccessrules="false" kind="src" path="/actionbarsherlock"/>
	<classpathentry combineaccessrules="false" kind="src" path="/library"/>
	<classpathentry kind="output" path="bin/classes"/>
</classpath>
這個下來項目就能夠運行了...
相關文章
相關標籤/搜索