how to integrate mapsforge in android studio

1,041 views
Skip to first unread message

Hicham Zouarhi

unread,
Apr 5, 2016, 6:22:26 AM4/5/16
to mapsforge-dev
Hi,
I am new to android Developing, I need to create an offline mapping app, I am using Android studio on ubuntu.
I downloaded the jars and put them all in my libs folder :
 


I added this line to the build.gradle file :



So I tried the example code in Getting started section and I get this error : Cannot resolve symbol 'mapsforge'


I understand that android studio couldn't find the jars and I guess I didn't import them well. please can you help me on how to set it up.
Thanks
Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3

Emux

unread,
Apr 5, 2016, 6:32:25 AM4/5/16
to mapsfo...@googlegroups.com
A simpler way to integrate libraries via Gradle in Android Studio is with name declarations in build.gradle file. We describe that way in our integration guide (accessible also from main page).

You can see there the needed libraries (even if you want to play with jars).
And you don't need them all, as Mapsforge provides libs besides Android, also for Java and it's writer components (you need only the "Core" and the "Android" ones).

Also the right place to declare your dependencies is not where your screenshot shows, but in 'app/build.gradle' file.
(see the Android note in your file about where to place the application dependencies)

--
Emux

Hicham Zouarhi

unread,
Apr 5, 2016, 7:47:29 AM4/5/16
to mapsforge-dev

Yes ! I can't believe that I couldn't see that note ! Thanks so much now it works perfectly. 
Reply all
Reply to author
Forward
0 new messages