01-24-2013 07:33 PM
Trying to set wallpaper with a Base64 image.
Doesn't seem to working has anyone gotten this to work? Or know a reason why it wouldn't?
Solved! Go to Solution.
01-25-2013 03:22 PM
01-25-2013 03:49 PM
I was thinking about this as well when I made my original reply
There are two paths I can see..
1) Write to system (requires a server so pointless)
2) Get them to rewrite a tiny bit of WebWorks so we can use a data URL
Looking at option (2) - it makes a lot of sense without hurting existing code
You could just make the 2nd var optional so it's be ...
setWallpaper(filename, [optonal] coding)
If coding is not supplied you get filename
If you think about it this is damned useful cos you can optionally JSON in Philipk's idea
How do we un-solve?
This is a really good API Q
01-30-2013 05:32 PM
I've had a little more change to look at this today as I've been working on a similar issue myself
It is possible to take a Base64 via AJAX and write to FS
Yes - I know it's not ideal but it works
You need to look at the Playbook file and dir APIs to get a handle on this
It don't work in Ripple for me (so I keep signing and installing)
Also this is PB only for now
What you, basically, need to do is translate some code you insert into [whatever] into a file location as far as I see it
I have not worked all the issues out yet but I'm gonna nag them @ Amsterdam over these issues
01-31-2013 09:02 AM
Will do - PM me to set up a meet - I've got a full schedule but can always skip one of the less important ones
I can see how to do it but it's rather messy
There appears to be a bit of a problem with what is addressable from an app
These things are get-around-able
In your particular case things should be easier
As I see it you need some Server JSON delivery of the base64 encoded image, you then store that in app data-space so you've got a physical file you can load back in
There are a few techie issues in this area as well - but again I need a chat with a techie
02-09-2013 04:10 AM
I've worked out the messy workaround
1) First off you want to get the home property from https://developer.blackberry.com/html5/apis/blackb
2) Next you want to download an image file from a server https://developer.blackberry.com/html5/apis/blackb
3) Finally you can use setWallPaper to load the file you saved in (2)
That's the basics and in no way whatsoever involved base64
There are HTML5 directory finctions that would allow you to select which wallpaper to load but personally I'd use localStorage or something to keep a list of images available on the device
Not the answer to the Q, just another way to do it
02-09-2013 04:17 PM
02-12-2013 01:20 PM
blackberry.io.filetransfer.download() doesn't work - or at least not with image files (files are always too small)
JSON it is then
It's going to need mod_rewrite to be seamless
Think I'll play with that tomorrow...
My thing is the reverse of yours - I wanna store in my data area then drag it out and show the image (not possible without work-arounds owing to FS Security)
I'm trying to get an image from [somewhere] to app data then convert it to base64 to circumvent FS restrictions