how to use mapsforge-samples-awt with android studio?

125 views
Skip to first unread message

vklein

unread,
Oct 10, 2016, 8:02:58 AM10/10/16
to mapsforge-dev
Hi,

I have tried to build and execute the Samples class in mapsforge-samples-awt from the latest samples versioncode=61.
I made a new configuration samples-awt but when I execute "run" I get

 "C:\Program Files\Android\Android Studio\jre\bin\java" -Dfile.encoding=windows-1252 -jar ""
 
Error: Unable to access jarfile

 
Process finished with exit code 1

I have searched for the jar file, but in the directory build/generated there is only mockable-android-24.jar which does not work.

( mapsforge-samples-android works and deploys a working apk to my nexus 7)

help appreciated

regards
Victor

Emux

unread,
Oct 10, 2016, 8:11:07 AM10/10/16
to mapsfo...@googlegroups.com
Samples for desktop uses regular Java and the "main" expects as arguments the map files as multiple parameters.

So for running it inside AS you can modify its run configuration and fill in "Program arguments" the full path of a map file.

--
Emux

Emux

unread,
Oct 10, 2016, 8:23:58 AM10/10/16
to mapsfo...@googlegroups.com
On 10/10/2016 03:02 μμ, 'vklein' via mapsforge-dev wrote:
I made a new configuration samples-awt

The easiest way to run Samples.java is by right click on it and select 'Run Samples.main()'.

That way a run configuration will be created with correctly filled all fields, except the program argument for the map file path.

--
Emux

vklein

unread,
Oct 10, 2016, 8:39:08 AM10/10/16
to mapsforge-dev

thanks, it runs

regards
Victor
Reply all
Reply to author
Forward
0 new messages