Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Dropbox - iOS only Plugin (for now) — Gideros Forum

Dropbox - iOS only Plugin (for now)

OZAppsOZApps Guru
edited November 2013 in Plugins
Working on a couple of things the past few days and here is another plug-in I was working on, Dropbox. It is still work in progress and it can do the basic few things

1. Connect to a Dropbox Account
2. Upload a file
3. Download a file
4. List all files in the (dropbox) folder

It still needs to have the notifications in place to notify the user the result of an action uploading or downloading.


Here's what the code in Lua would look like for the user
local dropbox = require "dropbox"
 
dropbox.init(APPKEY, SECRETKEY, true)  -- the boolean specifies the entire contents (false) or just the sandbox of the app
 
dropbox.uploadFile("image_01.jpg")      -- an image from the resources of the application
 
dropbox.downloadFile("testfile.txt", "temp_text.txt")  -- downloads and saves to the temp directory
 
local ret = dropbox.getAllFilesInFolder("/")  -- lists all files and folders as a table.
I could make a video but the video would only show the file appearing in a dropbox folder when uploaded.
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

Comments


  • I could make a video but the video would only show the file appearing in a dropbox folder when uploaded.
    Lol. so true. any plans to support Android?
  • @Chipster123,
    Majority of the folks on Gideros work with Android, and that is my Kryptonite :(

    However I would have a look at that and maybe it might not be so difficult after all, it's just that testing/debugging with xCode is like a BMW/Rolls Royce, and debugging with Eclipse is like ... you get the point, a bumpy ride.

    Let's see...
    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
  • Ok, here's a video to show how easy it is to use the plug-in from Gideros

    all downloads are to the temp directory
    all uploads can be from any directory so you can use
    dropbox.uploadFile(filename) --> this filename is taken from the resources and 
    uploaded and uploaded to the root of the dropbox app directory
     
    dropbox.uploadFile(fileName, dropbox.tempDir) --> this filename is taken from the temp directory and uploaded to the root of the dropbox app directory
     
    dropbox.uploadFile(fileName, dropbox.tempDir, "/mydir") --> this filename is taken from the temp directory and uploaded to the mydir directory in the dropbox app directory
    There are callbacks, not events
    so to handle the callbacks, you can write the functions for
    -- the callback to inform the success/failure of the dropbox.uploadFile()
    function dropbox.onUpload(event)
    end
     
    -- the callback to inform the success/failure of the dropbox.downloadFile()
    function dropbox.onDownload(event)
    end
     
    -- The callback to inform success/failure of the dropbox.getAllFilesInFolder()
    function dropbox.onListing(event)
    end
     
    -- Each file/directory returned when using the dropbox.getAllFilesInFolder()
    function dropbox.onFile(event)
    end

    The video can be seen here

    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
  • Is this plugin available for download?
  • @Falcon, it is not available anywhere (from me) however if you are interested I could package them up and provide you a Plug-in for a cost.
    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
Sign In or Register to comment.