Quick Links: Gideros Home | Download Gideros | Developer Guide
New plugin available: Native mapping for Android & iOS
  • PaulH +1 -1 (+10 / -0 )

    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.zip

    If 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.

  • @PaulH This is great!

    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
  • PaulH +1 -1 (+1 / -0 )
    It took about a week to work out the plugin itself (not counting the Lua design or native coding.) I used NDK to build the .so files, but I wasn't successful integrating that step into Eclipse. I just called ndk-build from the command line. I wrote a batch job to do that, piping the error output to a file, then copy the resulting .so files to my test project in Eclipse, and finally open the error file in notepad.

    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.


    Likes: SinisterSoft

  • simwhisimwhi +1 -1 (+1 / -0 )

    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.



    Likes: SinisterSoft

  • hgy29hgy29 +1 -1 (+1 / -0 )
    Nice work @PaulH,

    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

  • antixantix +1 -1
    Very awesome plug-in @PaulH!
    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor
  • @PaulH CongoRatz! Great plugin and a contribution.
  • pie +1 -1
    This one should be featured, I knew it was there but it took me a while to find it again :)

    Unfortunately the android readme includes only Eclipse instructions: how would those change to use the plugin with Android Studio?

    Adding mapplugin to an Android project:

    Go to https://developers.google.com/maps/documentation/android-api/start#step_1_download_android_studio to install the Play Services SDK and get a Maps API key for your app.

    Export Android project from Gideros.
    Copy the src and libs folders into your exported Gideros Android project folder.

    Import Android project into Eclipse.

    Import existing android project into workspace:

    Edit the project manifest in Eclipse and make the following changes:
    Change minSDK level to at least 11
    Add to end of Application:

    Add to permissions in manifest:

    In project properties, java build path, add
    android-sdk-windows\extras\google\google_play_services\libproject\google-play-services_lib\libs google-play-services.jar
    Under Order and Export, check the above 3 libraries for export.

    In src\com\giderosmobile\android\(your app)Activity.java:
    Add at end of imports: import android.support.v4.app.FragmentActivity;
    Change "extends Activity" to "extends Fragment Activity".

    is the short version from ar2rsawseen applicable?

    .jar files should go to app\libs
    .so files should go to respective app\src\main\jniLibs
    And all other .java files go to respective app\src\main\java
    Main activity is in app\src\main\java\com\giderosmobile\android
    And Android manifest is in app\src\main

    [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!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID

In this Discussion

Top Posters