Folks,
It's taken long enough, but I've finally gotten around to finishing a native mapping pluging. This plugin makes it possible to overlay a Google Map or Apple Map over a Gideros app, and to add location markers to the map.
The plugin with installation instructions, plus plugin source code, documentation and a sample Gideros project are here:
http://www.pishtech.com/gideros_map_plugin.zipIf anyone who works with the Gideros github repository is so inclined, feel free to add this wherever would be appropriate.
I built this plugin because I need it myself for an app I'm porting to Gideros. Hopefully it will be useful to others.
Paul
Comments
How long did it take you to make this plug-in? Could you share your approach and experience?
I'm very interested in building some simple asynchronous plugin-ins, but I don't know how to go about it. Which tools did you use to build the .so files?
Many thanks
It took a few days of troubleshooting to build the example plugin from http://appcodingeasy.com/Gideros-Mobile/Creating-plugins-for-Android-in-Gideros. I wasted a lot of time troubleshooting strange errors that turned out to be due to stray non-ASCII white space characters that I picked up by copying the sample code from the web page rather than from the downloaded zip file. Apart from that, that guide is still pretty accurate for the simplest case. That creates a plugin with only static functions, though. If you want your plugin to create a class from which you can create objects in Lua, it gets more complicated.
I tried months ago to build the plugin, but mapping out the functions called in IAB (the in-app billing) plugin was a tremendous headache. It's the kind of code where a function called do_it() calls a method called do_it() which calls a static function in another module called go_do_it() which calls a method called go_do_it() which... Etc. From the Lua call to the native Java function, it's 7 layers of code, and I only half understand why it's done that way. The IAB plugin might not have been the best example to work from, as its complicated further by defining an interface so many different frameworks can drop in to support different app stores. It's clever, but it's not the easiest code to follow. Eventually I had to set the project aside and get back to updates on other apps.
At this point I have very little experience with Android Studio, and I don't know that the impact of switching from Eclipse to that will have on all of this. I appreciate that the goal is to export an APK without needing either Eclipse or AS, though I imagine that will add some steps to the task of creating a new plugin.
Paul
Likes: SinisterSoft, talis
Many thanks for the speedy reply. I really appreciate the information. I was really under the impression that Gideros was easy to extend, but now I'm not so confident.
We need an expert to provide a guide that we can follow - a real world scenario, but not too complicated. Hopefully, we'll see some progress in this area this year.
Our team is dedicated to Gideros. We'd really like to get to the next level of Gideros development as well as help maintain some of the plug-ins.
Cheers
Simon
Likes: SinisterSoft
I'll push it to gideros repo if I get enough time to write an integration script for your plugin.
BTW, it is true that some plugins have too much layers, but they are probably needed. I try to separate plugins code into a few layers myself:
- A common Lua to C layer for all platforms
- A C to JNI layer and a Java layer for Android
- A C to ObjC layer for iOS
Likes: SinisterSoft
Unfortunately the android readme includes only Eclipse instructions: how would those change to use the plugin with Android Studio? is the short version from ar2rsawseen applicable? [edit: bonus question]
Is it possible to open a position/marker in GoogleMaps app to get the route to it?
Thank you, and thank you PaulH!
These are the steps I followed until now:
I am now stuck here:
In project properties, java build path, add android-sdk-windows\extras\android\support\v4\android-support-v4.jar android-sdk-windows\extras\google\google_play_services\libproject\google-play-services_lib\libs google-play-services.jar android-sdk-windows\add-ons\addon-google_apis-google-17\libs\maps.jar
I imported google play services as Library Dependecies in Project Structure, I don't know if that was enough though, because I get this error which seems to be unrelated:
After pressing Run on device, it builds the app, then installs it, and then the app ForceCloses with this error on first run.
(... excerpt from my manifest)
Hovering with mouse pointer on com.giderosmobile.android.testmapappActivity says "Unresolved Package"
Any help is appreciated... what did I do wrong?
Thank you