Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Tutorial on creating Gideros plugin for Android — Gideros Forum

Tutorial on creating Gideros plugin for Android

ar2rsawseenar2rsawseen Maintainer
edited September 2012 in Step by step tutorials
Hello all,
here is a little tutorial on creating Android plugins for Gideros using new extended plugin system.
Provided with plugin template for Android make file, plugin C++ code and Java class.
http://appcodingeasy.com/Gideros-Mobile/Creating-plugins-for-Android-in-Gideros

Now go and make those plugins you always wanted, just don't forget to share them ;)

@alexzheng if you have problems, PM me I'll email you files and details. ;)
+1 -1 (+10 / -0 )Share on Facebook

Comments

  • thanks @ar2rsawseen you are a master as always!
    :)>-
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • Great stuff!


    Cheers

    evs
  • Thanks for that, most appreciated
  • Thanks for this great tutorial @ar2rsawseen. The Gideros website says that "A plugin consists of a C, C++, Obj-C or Java code compiled for the target platform." Why these particular languages? Is there something special about them...? And would the process of writing a function in C++ be very similar to this explanation for Java...?
  • ar2rsawseenar2rsawseen Maintainer
    edited February 2013
    @BJG Java and Objective-C are based on their platform. Basically Java is used if you want to wrap something from additional Android functionalities, and Objective-C is same for IOS plugins.

    But you could also create plugins in plain C or C++ as TNT Collision engine, that does something inside their own environment and has nothing to do with platform specifics. And this C or C++ code can be compiled as both Android and IOS plugins (additionally also as Desktop plugins).

    So basically:
    Java + C = to wrap something from Android SDK
    Objective-C + C = to wrap something from IOS SDK
    plain C to usually perform some huge calculations and can work on both platforms.
  • dominikusdpdominikusdp Member
    edited August 2014
    Hi Artur, nice tutorial, you can explain the complex thing in a simple way, I don't have any experience in Android / C++ development before :)

    I am following your example with my own simple library, but, i still get errors when building .so :

    error: undefined reference to 'luaL_register'
    error: undefined reference to 'lua_getfield'
    error: undefined reference to 'lua_pushcclosure'

    and so on as if i haven't included the lua/luasocket library.

    have been trying for hours and I still don't have any clue, please help me. any clue ?

    Thanks :)
  • ar2rsawseenar2rsawseen Maintainer
    edited August 2014
    Hello @dominikusdp
    for latest version, you need to link couple more binaries, not only libgideros.so

    including zlib also depends on the version, I think the latest one did not need to include it separately ;)

    ;)
    #
    # Gideros Shared Library
    # 
     
    ###
     
    include $(CLEAR_VARS)
     
    LOCAL_MODULE            := lua
    LOCAL_SRC_FILES         := ../../libs/$(TARGET_ARCH_ABI)/liblua.so
     
    include $(PREBUILT_SHARED_LIBRARY)
     
    ###
     
    include $(CLEAR_VARS)
     
    LOCAL_MODULE            := gideros
    LOCAL_SRC_FILES         := ../../libs/$(TARGET_ARCH_ABI)/libgideros.so
     
    include $(PREBUILT_SHARED_LIBRARY)
     
    ###
     
    include $(CLEAR_VARS)
     
    LOCAL_MODULE            := gvfs
    LOCAL_SRC_FILES         := ../../libs/$(TARGET_ARCH_ABI)/libgvfs.so
     
    include $(PREBUILT_SHARED_LIBRARY)
     
    ###
     
    include $(CLEAR_VARS)
     
    LOCAL_MODULE            := zlib
    LOCAL_SRC_FILES         := ../../libs/$(TARGET_ARCH_ABI)/libzlib.so
     
    include $(PREBUILT_SHARED_LIBRARY)
  • dominikusdpdominikusdp Member
    edited August 2014
    @ar2rsawseen ah got it,

    there is no

    #
    # Lua
    #
    include $(CLEAR_VARS)

    LOCAL_MODULE := lua
    LOCAL_SRC_FILES := ../../libs/$(TARGET_ARCH_ABI)/liblua.so

    include $(PREBUILT_SHARED_LIBRARY)

    In my Android.mk, no wonder it always miss reference to lua function, I am stupid didn't realize it earlier :|

    thanks Artur !

    note: it will be nice if you update your tutorial to the latest version, because it helps so much especially for beginner like me :)>-
Sign In or Register to comment.