Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
rlowe
Posts: 29
Registered: ‎06-17-2010
My Device: Bold 9700

Using PHP within PlayBook WebWorks app.

I've been using JavaScript to develop a PlayBook WebWorks app and am running into a lot of issues.  There are some things (like resizing / saving images) that I can't get JavaScript to do.

 

Is it possible to include PHP (or something similar) in my WebWorks app, that I'm able to post data to locally, without it needing to be sitting on a webserver in order to work-around these JS limitations?

Developer
interfaSys
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,

Re: Using PHP within PlayBook WebWorks app.

No, but you can send data to your servers for processing.

 

But there is nothing preventing you from resizing images in your app, using workers. The big bummer is that we're still not able to save any files, 2 months after the PlayBook's launch :smileysad:

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
praveen_rajan
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook

Re: Using PHP within PlayBook WebWorks app.

We could write our own custom javascript extension to write data into PlayBook. I was able to do this, but normal files only, like text files. I couldn't find a way to write blob data to playbook. Still working on it :smileyhappy:

Contributor
rlowe
Posts: 29
Registered: ‎06-17-2010
My Device: Bold 9700

Re: Using PHP within PlayBook WebWorks app.

[ Edited ]

Thanks for the reply guys,

 

I was able to resize my images using a Canvas, so that's all good.  Serverside is not an option due to possible bandwidth usage.

 

Now it's all down to a way to save the data, which seems impossible.

 

When they announced FileIO api's I was pretty excited that I'd be able to finish up this app.  I can't believe that fileSave isn't available, we need these tools if we're to make Super Apps.

 

I feel like I should just srap it all at this point and start learning a new language that's supported by the PB.  I don't even see a mention of any additional FileIO api's on the Road Map.

 

I was also hoping their would be some sort file File Picker, that I see other apps using.

 

 

Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Using PHP within PlayBook WebWorks app.

Hi rlowe,

 

For a file picker API, you should be able to use an <input> of type file. This will open a file picker dialog like you would find in the browser.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
rlowe
Posts: 29
Registered: ‎06-17-2010
My Device: Bold 9700

Re: Using PHP within PlayBook WebWorks app.

Ahh of course, can't believe I didn't think of that.

 

Thanks Tim.

 

 

Contributor
rlowe
Posts: 29
Registered: ‎06-17-2010
My Device: Bold 9700

Re: Using PHP within PlayBook WebWorks app.

Any idea how to get a handle on the selected file? Javascript/'browser' security kicks in, and delivers a fake path to the file.

ie: c:\fake_path\filename.ext
Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Using PHP within PlayBook WebWorks app.

I believe you will need to add the access_shared permissions to your config.xml file... 

 

http://docs.blackberry.com/en/developers/deliverables/30182/Widget_element_834671_11.jsp#RIM_permiss...

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
rlowe
Posts: 29
Registered: ‎06-17-2010
My Device: Bold 9700

Re: Using PHP within PlayBook WebWorks app.

I've set that permission already, this is a browser security issue i believe.

say user has picked a file, and a function is called with the files value for the input form.

function getPath (path) {
var fullPath = path;
alert (fullPath);
}

alert dialog would show 'c:\fake_path\filename'

Developer
shea08
Posts: 121
Registered: ‎03-25-2009
My Device: Z30

Re: Using PHP within PlayBook WebWorks app.

I have this issue too.  I have the permissions tag set to access_shared. But no luck. Is this a bug with Ripple?