Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
App Properties — Gideros Forum

App Properties

BBurgess66BBurgess66 Member
edited March 2013 in General questions
Is there any way to access the data in the 'Settings' App in iOS and the 'Preferences' screen in android?

Comments

  • ar2rsawseenar2rsawseen Maintainer
    If you need it for persistent storage, you may use something like this:
    http://appcodingeasy.com/Gideros-Mobile/Save-and-load-data-module-for-Gideros-Mobile

    But if you need to retrieve data from it, well then you'd need a plugin.

    I was just actually thinking about it this night. Is it a better alternative for persistent storage? Is it more efficient then saving to |D| folder?

    What do you guys think?
  • I saved hundreds of level data wihout any problem. :))
  • If we want to access the data in Settings/Preferences obviously we need plugins. Well, it's easier to create save files on your app's Document dir :P
    have fun with our games~
    http://www.nightspade.com
  • Actually we must be able to have the app read/write settings in the Settings App for iOS .. as well as an app Preferences screen in Android
    ... AND have access to the data stored in these facilities from the Gideros app

    @ar2rsawseen, I've already seen your link to the load and save data module .. but two things:
    1) the link to the JSON dependency says the server cannot be found.
    2) for iOS an entry for the app in the Settings App is a must, and a way to open app 'Preferences' in Android is also a must

    So is there an existing plugin for these things somewhere? And if so, where?


    Thx to all for all the comments tho .. they are confirming what I had found as well.
  • ar2rsawseenar2rsawseen Maintainer
    @BBurgess66 I've fixed the link:
    https://github.com/ar2rsawseen/Json

    @BBurgess66 but is there any specific reason it is a must?
    There is no such plugin right now, because up till this time every dev prefered using internal file system for storing data. So why the preferences are better?
  • Because it is the way the users expect the devices to work. This is the standard, whether we developers like it, or not. :-S
  • ar2rsawseenar2rsawseen Maintainer
    @BBurgess66 I'm sorry, but seem not to get it, what the end user has to do anything with what happens underlay the app?
  • @ar2rsawseen, yes it is not really an underlay to the app, but a part of the OS that is needed to be used by the users. How these properties are stored doesn't matter to me either, but still need access to these intrinsic facilities built into the OSes. As an example, Titanium provides access to these thru 'App.Properties' as long as a 'preferences.xml' for android or a proper 'Settings.bundle' for iOS is provided.

    But I think the question has been answered. A plugin is needed for this. And, as yet at least, this type of plugin is not available now.
  • ar2rsawseenar2rsawseen Maintainer
    @BBurgess66 yes sorry again, I did not want to be rude or anything, I just don't want to miss something important I might not be aware of.

    A plugin is needed for that and is not available yet, as I've said before, no one ever requested it :)

    But that could actually be a pretty easy and straightforward plugin to implement.
  • BBurgess66BBurgess66 Member
    edited March 2013
    @ar2rsawseen, cool .. could you point me down the right path for making such plug-ins then? If implemented, I'll make it freely available/accessible here(in the forums).
    Even if (as you said) no-one will use it. ;-)

    thx
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    @BBurgess66 I actually finally understood what you have meant and I completely misinterpreted it (I told you I might have missing something important here :) ).
    I thought you meant using it only for persistent storage, but as I've found out, it seems that it is possible to define settings, that in the end can be changed by the user (and in the case of IOS even outside the app).
    I how ever did not find if on Android these settings can also be changed outside the app or only inside it?

    So how good are you with Android or IOS?

    Here is some starting tutorial for plugins for Android:
    http://appcodingeasy.com/Gideros-Mobile/Creating-plugins-for-Android-in-Gideros

    For IOS it will be even easier, because you could mix C++ code with Objective-C right away and don't need any additional layer (as JNI for Android).

    And as it will be cross platform app, you should probably better separate lua binding to reuse the code on both platforms.

    Basically if you can have static classes in Java or/and Objective-C to cover needed functionality I can provide proper binding for them.

    On the other hand, this seems kind of cool thing, so even if you won't get into, I might try it myself, once I finish all the things with current plugins under development :)

    Likes: BBurgess66

    +1 -1 (+1 / -0 )Share on Facebook
  • @ar2rsawseen, to answer individually .....

    "how ever did not find if on Android these settings can also be changed outside the app or only inside it?"
    Correct. Android only has a 'Preferences' screen that pops upon tapping the 'menu' button on the device. And this leads to another question .. Is there a way to handle these 'menu' and 'back' buttons on Android?

    "So how good are you with Android or IOS?"
    I'm quite fine with native work on both platforms (and others), including the NDK, JNI layer on Android

    "Here is some starting tutorial for plugins for Android:
    http://appcodingeasy.com/Gideros-Mobile/Creating-plugins-for-Android-in-Gideros"
    Ya I found this yesterday .. thx ;-)
  • ar2rsawseenar2rsawseen Maintainer
    edited March 2013
    @BBurgess66 oh yes you can control those buttons on Android. You just add an event listener to the stage or scene and listen for specific keycode as in:
    self:addEventListener(Event.KEY_DOWN, function(event)
    	if event.keyCode == KeyCode.BACK then
    		--go back a scene
    	elseif event.keyCode == KeyCode.MENU then
    		--pop up the menu
    	end
    end)
    List of possible keycodes:
    KeyCode.BACK Back key on Android
    KeyCode.SEARCH Search key on Android
    KeyCode.MENU Menu key on Android
    KeyCode.CENTER Center key on Android
    KeyCode.SELECT Select key on Android
    KeyCode.START Start key on Android
    KeyCode.L1 L1 key on Android
    KeyCode.R1 R1 key on Android
    KeyCode.LEFT Left arrow key
    KeyCode.UP Up arrow key
    KeyCode.RIGHT Right arrow key
    KeyCode.DOWN Down arrow key
    KeyCode.X X key
    KeyCode.Y Y key

    And about tutorial:
    I will prepare more thorough tutorial on using Gideros plugin API, creating Gideros classes, handling multiple instances and using events in C, once I finish current plugins and get the right hand of it myself :)
  • @ar2rsawseen wohoo a new blog post, will it available on Gideros official blog or on you AppCodingEasy?
    have fun with our games~
    http://www.nightspade.com
  • ar2rsawseenar2rsawseen Maintainer
    We decided it would be ok to put posts on both blogs :)

    Likes: BBurgess66

    +1 -1 (+1 / -0 )Share on Facebook
  • .. ah great! ... thx abunch!
Sign In or Register to comment.