Build OsmAnd on Windows - What if I don't want to compile native code?

474 views
Skip to first unread message

Zsolt Bertalan

unread,
Jan 17, 2014, 12:12:05 PM1/17/14
to osm...@googlegroups.com
I try to build OsmAnd on Windows. I checked out and tried to build the master branch, then r1.6 branch. I'm an Android developer, but never tried the NDK. I checked out only the Scherlock, OsmAnd and OsmAnd-java projects, but not the core for now. I don't want to change the core, I want to make UI changes.

As I understood the native build results should be under the obj library. But what if I don't want to build the native code? How do I get the obj folder or how do I get the project work? This information is missing from the wiki.

Anyway, it seems to me, that the Andriod.mk file is broken, the core/targets folder doesn't exist.

Harry van der Wolf

unread,
Jan 17, 2014, 2:21:52 PM1/17/14
to osmand
On the command line where you compile with ant set "-Dnativeoff=true".

Note that it is an "inverted" switch. If you want native off you need to set it to true.

Harry


2014/1/17 Zsolt Bertalan <herrb...@gmail.com>
I try to build OsmAnd on Windows. I checked out and tried to build the master branch, then r1.6 branch. I'm an Android developer, but never tried the NDK. I checked out only the Scherlock, OsmAnd and OsmAnd-java projects, but not the core for now. I don't want to change the core, I want to make UI changes.

As I understood the native build results should be under the obj library. But what if I don't want to build the native code? How do I get the obj folder or how do I get the project work? This information is missing from the wiki.

Anyway, it seems to me, that the Andriod.mk file is broken, the core/targets folder doesn't exist.

--
You received this message because you are subscribed to the Google Groups "Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Zsolt Bertalan

unread,
Jan 19, 2014, 6:21:05 AM1/19/14
to osm...@googlegroups.com
Thanks, but what if I want to run the app from Eclipse? And what does this switch do? Turns off the native stuff altogether? So I won't be able to use routing? Documentation is unclear.

Harry van der Wolf

unread,
Jan 19, 2014, 6:26:11 AM1/19/14
to osmand



2014/1/19 Zsolt Bertalan <herrb...@gmail.com>

Thanks, but what if I want to run the app from Eclipse?

I don't know. I compile directly with ant from the command line. Hopefully someone else will react. I once had to compile something from Eclipse and I think there was something with parameters where you could set it.
 
And what does this switch do? Turns off the native stuff altogether? So I won't be able to use routing? Documentation is unclear.


OsmAnd comes with 2 modules for routing. A native C++ module and a (slow and limited in distance) java module. If you switch off the native part you still have routing.

Harry
 

Charalambos Xinaris

unread,
Jan 19, 2014, 10:04:54 AM1/19/14
to osm...@googlegroups.com
You can use eclipse to run OsmAnd and have the core native libraries. 

- You can download for example OsmAnd-default.apk from http://download.osmand.net/latest-night-build/, rename the .apk file downloaded to .zip and un-compress. 
- Copy the four folders that are Inside the /lib folder (armeabi,armeabi-v7a, mips, x86) into your development project under OsmAnd/libs/.
- Refresh and clean the project in Eclipse and run. Eclipse will automatically include the native libraries into the app.
- Important don't forget to run ant copy_resources before. You can run ant commmand in Windows under cygwin. This command is copying the resources files from OsmAnd-resources project.

Just to make it clearer, to make it work in Windows I suggest the following:
- Download cygwin (unix shell command for windows).
- Use repo instead of git in eclipse.(step 8 in https://code.google.com/p/osmand/wiki/InstallDevelopmentEnvironment)
- Try to run ant in cygwin and after everything compiles fine, then try to import the project in Eclpise.

Harry van der Wolf

unread,
Jan 19, 2014, 10:29:44 AM1/19/14
to osmand



2014/1/19 Charalambos Xinaris <xin...@gmail.com>

You can use eclipse to run OsmAnd and have the core native libraries. 

He does NOT want the native libraries.

Harry

Charalambos Xinaris

unread,
Jan 19, 2014, 3:29:21 PM1/19/14
to osm...@googlegroups.com
In the initial post he mentioned that he does not need to "build" the native code. So I assumed that he might need just to run the app with the pre-build libraries. 

Sorry if I made things complicated.

Zsolt Bertalan

unread,
Jan 20, 2014, 4:18:54 AM1/20/14
to osm...@googlegroups.com
Thanks Charalambos,

you are right. I don't want to build the native libraries, but I still need them, because obviously I want to build a fully functional fork. I will try to build it and I ask if I have further problems.

Zsolt Bertalan

unread,
Jan 20, 2014, 10:12:41 AM1/20/14
to osm...@googlegroups.com
That worked, thanks. I can move to my next question.

Fabien Nicollet

unread,
Feb 24, 2015, 7:22:29 PM2/24/15
to osm...@googlegroups.com
Hello,

Sorry for digging up this old thread but you might have some answers about this thread "Buildable Osmand Android Project":
Basically, the 4 folders containing the .so files are in /libs/ but Eclipse still complains about not being able to import anything like net.osmand.core.jni.*

Tried refreshing / rebuilding with no luck

Do you have an idea?

Thanks,
Fabien
Reply all
Reply to author
Forward
Message has been deleted
0 new messages