How to set an image as a wallpaper of the phone/

How can I save an image from a url as a wallpaper
Also, How can I save/downlaod an image from a url

I would be glad if I can be assisted with this ---- it’s of utmost importance

Any update or module could use – will be glad —

I have no knowledge of UNo

I didn’t tried but I think that you could download an image using fetch and blob, and then use writeBufferToFile to save it. Something like this:

 var FileSystem = require("FuseJS/FileSystem");

 var buffer = new ArrayBuffer(4);

 fetch('http://www.mydomain/myimage.png')
 .then(function(response) {
       return response.blob();
 })
 .then(function(myBlob) {
     buffer = myBlob;
     FileSystem.writeBufferToFile(FileSystem.dataDirectory + "/" + "myimage.png", buffer)
     .then(function() {
         console.log("Successful write");
     }, function(error) {
         console.log(error);
     });
 });

About the wallpaper the Fuse tutorial has a section that could help you. For example it explains this:

<Image Layer="Background" File="../Assets/background.jpg" StretchMode="Fill" />

You should really study the tutorial and the many examples provided.

Setting a specific image as a background/wallpaper will require some Uno custom low-level logic, as there’s no such high-level built in function in Fuse (because honestly, it’s quite esoteric and specific behavior).

thanks for the update @Enrico

@Bent Stamnes thanks for the update … It’s a very important feature for my APP. The App depends on it. Setting images as wallpaper.

How can I go about it… Like do the Uno — Even a most basic android setting…

Regards

Sorry to hear that, but you cannot rely on others to build your app for you. As I mentioned above, the only way to do custom work like this is through Uno.

If your app relied on this feature, you should probably have researched how to do it before you started coding your app.

@quincykwende: You’re probably going to want to write some foreign Java code in order to set a wallpaper. Here’s our guide for writing foreign-code. WallpaperManager is probably going to be the Java class you’re going to have to interface the most with.

Thanks a million.

Erik Faye-Lund wrote:

@quincykwende: You’re probably going to want to write some foreign Java code in order to set a wallpaper. Here’s our guide for writing foreign-code. WallpaperManager is probably going to be the Java class you’re going to have to interface the most with.