星期一, 9月 28, 2015

Android Studio引入OsmAnd (Check out OsmAnd in AndroidStudio)

Android官方的IDE已經從Eclipse轉移到Android Studio了, OsmAnd官方建議的IDE還是在Eclipse, 看來要在 Android Studio下編譯OsmAnd要花點時間研究一下了, 況且官方文件非常缺乏=.=

經過我整理和簡化之後, 照以下步驟就可以編譯出apk了:
You can check out OsmAnd in AndroidStudio with step-by-step :

1. Check out project from Version Control

In Android Studio's "Welcome to Android Studio" page, select "Check out project from Version Control" .



2. 我是從自己fork出來的github上做clone, 改回官方的github當然也可以.
接著花點時間clone

In "Clone Repository" page, clone from github's OsmAnd : https://github.com/osmandapp/Osmand



3. clone完, gradle的部分照預設值就好不用動

In "Import Project from Gradle" page, select "Use default gradle wrapper (recommended) "



4. 可以看到clone這麼多project回來

After import project, in "Project Window" should have 11 projects clone from github.



5. 接著要去OsmAnd-resources下載resources, 記得目錄要更名為 "resources" 並且跟Osmand放在同一層目錄

Download OsmAnd-resources, and rename directory  to "resources", place with OsmAnd Project directory.



6. 如果要在x86架構的Genymotion下執行, 要改一下Build Variant

Open Build Variant window: Build->Select Builder Variant



7. 原本是預設在Armv5下, 要改成X86才可以在Genymotion上面運作

Set OsmAnd module's Build Variant with x86 or Fat. (Fat means include all cpu's library)



8.最後按下Run就可以在Genymotion上執行了.

Run and execute on Genymotion. (or your android mobile phone)

5 則留言:

LughUy 提到...

Your can you help me, you said from another application geographies send latitude and longitude coordinates OsmAnd mind and activate automatic route wizard.
You can help me indicating what is the procedure that enables the assistant route.

skyforce 提到...

I don't remember ever said that, can you guide me?

匿名 提到...

你好! 我按照您的步驟進行操作(用的是您的克隆版本),可是在運行的時候出錯了(編譯沒有錯誤),錯誤如下:
Error:Execution failed for task ':OsmAnd:preDexFreeLegacyArmv5Debug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\JAVA\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 1
這個困擾我好幾天了,也有在stackoverflow上查找解決方法,但是沒有成功。 請問您知道怎麼解決不?
我的系統內容是:64位windows10,androidstudio1.2.1.1,java8,gradle:1.1.0
這是我的郵箱 wanganwhu@outlook.com
非常感謝!

skyforce 提到...

您好

看到您的錯誤是出在gradle, 可能是配置上的錯誤, 但是資訊不足我無法判斷.

不知道您是在模擬器還是手機運行呢?
能否提供一下出錯的畫面.

skyforce

Daniel 提到...

Hi Skyforce,

I've been following your instructions above but I keep encountering this problem:

Error:A problem occurred configuring project ':OsmAnd'.
> Could not resolve all dependencies for configuration ':OsmAnd:_freeQtcoreArmv5DebugCompile'.
> Could not find net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT.
Searched in the following locations:
https://repo1.maven.org/maven2/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/maven-metadata.xml
https://repo1.maven.org/maven2/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/OsmAndCore_androidNativeRelease-0.1-SNAPSHOT.pom
https://repo1.maven.org/maven2/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/OsmAndCore_androidNativeRelease-0.1-SNAPSHOT.aar
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/android/m2repository/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/maven-metadata.xml
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/android/m2repository/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/OsmAndCore_androidNativeRelease-0.1-SNAPSHOT.pom
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/android/m2repository/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/OsmAndCore_androidNativeRelease-0.1-SNAPSHOT.aar
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/google/m2repository/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/maven-metadata.xml
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/google/m2repository/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/OsmAndCore_androidNativeRelease-0.1-SNAPSHOT.pom
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/google/m2repository/net/osmand/OsmAndCore_androidNativeRelease/0.1-SNAPSHOT/OsmAndCore_androidNativeRelease-0.1-SNAPSHOT.aar
Required by:
Osmand-master:OsmAnd:unspecified
> Could not find net.osmand:OsmAndCore_android:0.1-SNAPSHOT.
Searched in the following locations:
https://repo1.maven.org/maven2/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/maven-metadata.xml
https://repo1.maven.org/maven2/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/OsmAndCore_android-0.1-SNAPSHOT.pom
https://repo1.maven.org/maven2/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/OsmAndCore_android-0.1-SNAPSHOT.aar
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/android/m2repository/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/maven-metadata.xml
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/android/m2repository/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/OsmAndCore_android-0.1-SNAPSHOT.pom
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/android/m2repository/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/OsmAndCore_android-0.1-SNAPSHOT.aar
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/google/m2repository/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/maven-metadata.xml
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/google/m2repository/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/OsmAndCore_android-0.1-SNAPSHOT.pom
file:/C:/Users/bioengsu/AppData/Local/Android/sdk/extras/google/m2repository/net/osmand/OsmAndCore_android/0.1-SNAPSHOT/OsmAndCore_android-0.1-SNAPSHOT.aar
Required by:
Osmand-master:OsmAnd:unspecified


Do you have any ideas?

Thanks,
Daniel

Mr.Color飛機模型用Color 與 水性AQUEOUS HobbyColor 對照表

          最近跟兒子一起研究長谷川的飛機模型, 其中說明書中採用的模型漆色號以Mr.Color硝基漆為主, 水性漆AQUEOUS 為輔. 很多Mr.Color有的顏色, AQUEOUS 都沒有, 前100的色號大致上都有對應到, 但Mr.Color 300號以後的都是特...