Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Developing on the phone/tablet — Gideros Forum

Developing on the phone/tablet

ArtiomArtiom Member
edited March 2012 in Suggestions & requests
Hi!
I have an idea to develop games on my tablet (Acer a500 with Bluetooth keyboard) when I'm not at home.
I figured out that after running my game in Gideros player there is a folder gideros created on my sdcard.
It contains not compiled lua files that I can edit via DroidEdit (a nice Android text editor with lua highlighting).
But there is a problem: it's not possible to run edited code without Gideros studio and button "run".
Is it possible to make a button in Gideros player like "Run latest build" that take last sources from gideros folder and runs it?
It will be great feature developing on android phone/tablet. Thanks.

Comments

  • Hey, if this is right, can the iOS player have a button to do the same thing and an export/import file button? These aren't being put on the app store so it shouldn't matter I think. I have the source code so I suppose I could probably try to modify it myself. It's a cool idea. I really like being able to edit on my iOS device.
  • gorkemgorkem Maintainer
    @Artiom we discussed this today with Atilim, and these are the initial ideas:

    - Edit Lua files directly via an editor (DroidEdit)
    - Manage assets (graphics / sound)
    - See latest projects
    - See changed projects
    - Run a project
    - Download projects from internet and edit/run them

    Yes it's possible to run edited code with the Player - we just need some changes there.

    The pipeline is very full at the moment, due to Android plugins. But we're very interested with this idea. :) Thank you.
  • This would be a very cool option to have. +1
  • Good to hear gorkem!
    Your initial ideas are awesome and sounds like "all other engines killer" :)
    Will be great to do run button in the Player first, think it's quite easy.

    I will be hardly waiting..
  • Is it possible to create empty Gideros Android app that will run main.lua from sdcard when started?
  • atilimatilim Maintainer
    Maybe.. I haven't tried but most probably this line of code will work:
    loadfile("/sdcard/main.lua")()

    Likes: chipster123

    +1 -1 (+1 / -0 )Share on Facebook
  • Yes! It's working!

    You're awesome. Now I can develop on my tablet.
    +1 -1 (+2 / -0 )Share on Facebook
  • @Atilim, The next question will be, if some user makes that the feature of their app, will Apple (not worried about the Android) approve of it?
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Maybe.. I haven't tried but most probably this line of code will work:
    loadfile("/sdcard/main.lua")()
    If there is an option to export the lua files without encoded,the path of main.lua can also be changed to whatever.

  • MagnusviriMagnusviri Member
    edited March 2012
    Apps on iOS are sandboxed, meaning they can not read/write outside of their "sandbox" folder. So there is no way for another text editor app to edit anything that the Gideros player would be able to read.

    I'm trying to figure out how to develop on my iPad (without jailbreaking) with the least amount of work. I think I could modify the Gideros player to load the lua file from a webserver, and since Dropbox can serve your files to the web, I think this is the best option. Edit file in a Dropbox compatible editor, it uploads to Dropbox's servers, you go to the player and it loads the file from a url. I'm hoping that works. When I get time (maybe this weekend) I'll look into it if someone else doesn't figure it out first.

    And if you did this and submitted it to Apple's AppStore that would be breaking the terms of service and if it gets past review they will pull it the moment they realize what it is doing.
  • I think you can develop on the tablet (don't know about iPad) then just copy edited lua files back to your PC and build the game with Gideros + Eclipse.
    Little tutorial for those who wants to develop on the Android tablet:
    - copy all your original lua files, textures and fonts to sdcard/yourProject folder;
    - edit path to textures and fonts to "/sdcard/yourProject/..."
    - create new Gideros app with main.lua that contains loadfile functions that called in order to your compile order!
    For example: in your game you have 3 lua files that compiled in such order: "file1.lua", "file2.lua", "main.lua". In your new Gideros app you need to write:
    loadfile("/sdcard/yourProject/file1.lua")()
    loadfile("/sdcard/yourProject/file2.lua")()
    loadfile("/sdcard/yourProject/main.lua")()
    Also don't forget to set your scaling options to new project.
    Build this app with Eclipse and install on the tablet.
    Now you can edit your lua files in sdcard/yourProject with DroidEdit and just run your new installed app.
    Ta-da-m!

    Likes: atilim

    +1 -1 (+1 / -0 )Share on Facebook
  • atilimatilim Maintainer
    edited March 2012
    yay! :)

    Also I can recommend to reimplement the functions like Texture.new, Font.new, etc...
    local originalTextureNew = Texture.new
     
    function Texture.new(filename, ...)
      return originalTextureNew("/sdcard/yourProject/"..filename, ...)
    end
    So that you don't need to edit path to textures and fonts to "/sdcard/yourProject/..."
  • atilimatilim Maintainer
    edited March 2012
    @OZApps @Magnusviri if a programmer downloads Lua codes and executes like that, Apple will definitely reject it. But if you only execute your local Lua codes, then there is no risk.

  • atilimatilim Maintainer
    Maybe.. I haven't tried but most probably this line of code will work:
    loadfile("/sdcard/main.lua")()
    If there is an option to export the lua files without encoded,the path of main.lua can also be changed to whatever.

    If you want, you can read the path of main.lua from a text file. (Things are getting complicated :) )
  • I've almost got something like this on iOS that loads a file from a webserver, and saves it to the documents folder (in the application delegate). How do I find the path to the documents folder within lua so I can use loadfile. Do I need to make a plugin?

    I hard coded the path and it works, so this should be a lot of fun. :)
  • atilimatilim Maintainer
    edited March 2012
    Hi Magnusviri,

    You can use loadfile("|D|file.lua")

    btw, is there a dropbox compatible editor for iOS?

    Edit: After a search I found some :)
  • Did you try Textastic and Plain Text, both of them work with DropBox quite well. Textastic is a developers editor ( http://reviewme.oz-apps.com/2011/03/on-move-in-groove.html )
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • atilimatilim Maintainer
    @OZApps Textastic looks great. I've just purchased. Thank you for the recommendation.
  • @Atilim, loadfile("|D|file.lua") does not seem to work. I'm using v2012.2.1.

    I use both Textastic and Nebulous Notes (there is a free version with ads). Textastic has it's own text view with markup and stuff so that's really nice.

    I've lost text in Nebulous Notes though when doing cut and pasting and undo. Text will just disappear (I've gone to the dropbox website to get my previous version to recover the text, so...). But I really like how Nebulous Notes always syncs your files (so I always know it's current). So for some things I'll use Nebulous Notes.
  • atilimatilim Maintainer
    edited March 2012
    @Magnusviri thank you for Nebulous Notes. I'll install it also.

    Let me look at loadfile("|D|file.lua"). It should work, but I don't know why it doesn't.
  • By the way DroidEdit supports Dropbox to open files from there.
  • Oh my I feel silly. So I missed the subtlety of loadfile("|D|file.lua")(). I thought the empty parenthesis was an error and needless so I removed it when I tried "|D|". So I decide to look up the lua docs on loadfile and I realize it only returns a function and that the last () is how it was executing when called.

    So yeah, |D| works. And, in the documentation it seems that dofile is probably a better choice because it asserts that the file loaded correctly.

    http://www.lua.org/pil/8.html

    Likes: atilim

    +1 -1 (+1 / -0 )Share on Facebook
  • Textastic has lua highlighting. It's very nice. I use Nebulous to look at example files from Gideros Studio (stored in Dropbox) and I use Textastic to edit and upload the file on my iPad, then I run it on my iPhone.

    Likes: tetnic

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.