Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Can you run native json on Gideros player on a device? — Gideros Forum

Can you run native json on Gideros player on a device?

petecpetec Member
edited August 2013 in General questions
I've just been playing with the native json implementation from the Labs. I got it working OK when I use Gideros player on my desktop (and it is so much quicker :) ), but I have no idea if or how to use it with the Gideros player on my phone. Is it possible and, if so, how do you do it?
Thanks,
Pete

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    @petec sure, I think there are installation for both Android and IOS apps provided with the package. This is how you would install plugin for your apps, but to your app project a player, on Android you simply need to delete assets folder inside assets folder.
    on iOS you need to change gdr_initialize(..., false) to gdr_initialize(..., true) inside AppDelegate.m
    you can check more about player with custom plugins here:
    http://docs.giderosmobile.com/deployment.html
  • @ar2rsawseen Thanks - most of that makes no sense to me at the moment as I've never used plugins. I'll give it a go and see how I get on . :)
  • petecpetec Member
    edited August 2013
    @ar2rsawseen - I got it sorted for Android, which is all I need at the moment while I'm working on the app. I'll battle Apple when I have to...

    It seemed to need the jni folder contents copying across as well as the libs contents. This isn't mentioned in the labs instructions and, if it does need to be copied, it might be a good idea to add it.

    The bit I got stuck on was where to add System.loadLibrary("json"); to the main activity - I wasn't sure what main activity that was referring to and pretty quickly found out it wasn't anything to do with main.lua! Once I'd found where it went then it all worked fine, both the player and a build of the app.

    Thanks for your help.
  • @ar2rsawseen :
    What exactly is that true at gdr_initialize(..., true) ?

    I didn't change it, and it seems working for me, so i wonder what is that.
  • @petex I think there is no need for jni folder, it's just a source code.
    @tkhnoman it is a gideros initialization function on iOS.
    if you pass false, it will read the assets and behave like your exported app,
    if you pass true, it will ignore the assets and behave like player (with all the installed plugins)
    ;)

    Likes: ianchia

    +1 -1 (+1 / -0 )Share on Facebook
  • @ar2rsawseen Oh, i see.
    I always add all the plugin into Gideros iOS player that already exist, since we can do that way.

    But i think this would be useful when developing with GameCenter and such.
    Thanks.
  • @ar2rsawseen OK - I'll give it another go without the jni folder. Thanks.
  • ... and of course you are right, the jni folder is not needed. It must have been a coincidence that it worked when I included it, it must have been something else that I did that made it work. All good now and jsoning at high speed :) .
  • Hi Petec... don't keep it to yourself... where or what is this mysterious "main activity"? I can't find anything like that (trying to install IAB with minimal Android/Eclipse expertise, so please speak slowly ;-) )
  • Disregard... thankfully I found it on the forum elsewhere and did not have to rely on my over-stretched psychic powers...
    @rikolous it means to add this line just after default libraries in your main java file in com.giderosmobile.android container like this:
    public class StreetPoolActivity extends Activity implements OnTouchListener
    {
    	static
    	{
    		System.loadLibrary("gideros");
    		System.loadLibrary("luasocket");
    		System.loadLibrary("lfs");
    		System.loadLibrary("ggooglebilling");
    		System.loadLibrary("microphone");
     
    	}
    the full example with lua script is also there:
    https://github.com/gideros/Microphone/tree/master/example
    :)
  • petecpetec Member
    @Skyrocket - Glad you're sorted as I really couldn't remember where I'd found it!
Sign In or Register to comment.