[PLUGIN] Dropbox

Post your completed addons to share with the community

Post » Sun Feb 03, 2013 6:52 pm

@Septeven i was thinking exactly the same :-)

@Savvy001
That sounds great. I will see if i can make it work. But as septeven said. If you have the time, an example capx would be very much appreciated.

B
19
S
6
G
4
Posts: 342
Reputation: 4,392

Post » Sun Feb 03, 2013 7:50 pm

@cvp @septeven

Here u go.
Dropbox Image Example

All the logic is in the capx.
If there are any questions i'l help gladly.

Ps: In the Capx The Sprite has a variable called Name.
That is important if u want to save images under different names for different sprites or sprite instances.
This way u get a nice list in the webstorage easy to retrieve.
The image variable in the webstorage is always saved as "custom image".
But saved under the name of the sprite.
So u could have;

Sprite name = John
Webstorage = John & "custom Image"

Sprite name = Pete
Webstorage = Pete & "Custom Image"
Etc

In the end your dropbox will have a .txt file with the complete webstorage in it, including the images.
This makes it super for games with user content.
The nice thing about the dropbox plugin, is that when your app is approved by dropbox.
The player of the game uses their own dropbox to save the data!
The plugin just uses your dropbox secrect, letting dropbox know its your app that has connected with the players own dropbox.

Kind Regards.
Savvy001 Savvy0012013-02-03 20:03:31
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Mon Feb 04, 2013 6:02 pm

@Savvy001
I will take a look soon - Thanks for this.
@Kyatric should stick this one in the FAQ.
B
44
S
12
G
13
Posts: 628
Reputation: 10,471

Post » Mon Feb 04, 2013 7:23 pm

Thanks for the example Savvy

Very well commented and easy to understand I might add :-)

One question though. I might have misunderstood it, so feel free to correct me if I am wrong :-)

The example you are giving here stores a text file in the dropbox folder.

And the image comes from the client side.

Is it possible to load an image which is already in the dropbox. One which is not necessarily "created" by the client, but one which already resides in the dropbox.

So basically what i am asking, if i have a picture in the dropbox folder already. Can I display it in my app? (maybe I should just have started with that question :-)

Something like extracting the base64 from the dropbox image. or whatever would make it work.cvp2013-02-04 19:35:55
B
19
S
6
G
4
Posts: 342
Reputation: 4,392

Post » Mon Feb 04, 2013 9:15 pm

@cvp

The thing is that any normal image that is in the dropbox can't be displayed in your app.
Construct2 gives u the possibility to load an image from a URL or URI.
That being said: Dropbox needs permission from the user side to enable u to download.
So just pointing the "Load from URL" (which is build in action in the event editor) to dropbox will not work.
Correct me if im wrong on this matter.

So if u want any image to be loaded into your game.
Then u have to A: Put a premade .txt AsJSON with all your images in it in your dropbox.
Or B: Go with the method i presented in the .capx

Method B: is in short, load image into game/then upload webstorage to dropbox.
Then later on u can download it again from dropbox back into the game.
Thats 1-up for multi platform gaming ;-)
But this method is based on user content for games.
However u could also use it to build your base64 image collection.
Which u can then download in other games.

Hope this clarifies it a bit ;-)

Kind Regards.
Savvy001Savvy0012013-02-04 21:18:58
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Tue Feb 05, 2013 7:49 am

@Savvy001

yeah... that was what i was afraid of.

I was hoping to build an app which used the images which is already present in dropbox.

And since its supposed to be a mobile app the drag and drop zone thing is not a valid option. Then again it would not be my intention that the user would have to drag all the images into the app to be able to use them.
B
19
S
6
G
4
Posts: 342
Reputation: 4,392

Post » Tue Feb 05, 2013 10:59 am

@cvp

Could u explain what the exact thing is u want to do.
"using the images already in the dropbox" is a bit vague.
To speak clearly: is it your intention to enable user content.
Or do u, as the developer want to store all images in a dropbox yourself?

Kind Regards.
Savvy001
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Tue Feb 05, 2013 2:04 pm

Sorry if i did not make myself clear.

I want to e.g. display 4 random fotos from my dropbox photo folder inside my app (a photo i took with my camera and uploaded to dropbox).

I do not need to manipulate them(maybe in size though when displaying) but just to display them.cvp2013-02-05 14:05:53
B
19
S
6
G
4
Posts: 342
Reputation: 4,392

Post » Tue Feb 05, 2013 4:54 pm

@cvp

By my own experience if you only want to show your pictures, you do not need this dropbox plugin. You can use the "Load URL" action of a Sprite object, PROVIDED THAT, your C2 exported webapp stay located in the same folder of the pictures in Dropbox, AND, this folder is in the public folder of your Dropbox.
B
90
S
5
G
8
Posts: 164
Reputation: 7,646

Post » Tue Feb 05, 2013 5:04 pm

@Savvy001

By the way, in the usage do you suggest for this Dropbox Plugin, for a user send a picture, it already needs to have an account in Dropbox and be logged in that account?

I am talking for the first time he use your app!
B
90
S
5
G
8
Posts: 164
Reputation: 7,646

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests