[FREE] Wallpaper Changer

the extension don't work in the companion...you need to compile the app

2 Likes

This extension is working fine. Whenever I use image-picker to set an image as a wallpaper then it's working. But whenever I get the image using the phone image path then I'm not able the set that image as a wallpaper. Getting runtime null error.
My AIA File
wallpaper2.aia (293.2 KB)
Please use your package name.
Thank You

2 Likes

Hi there,

The problem is probably within these blocks.

The socket is meant to be a string, not a list. I think you need to ask each permission one at a time.

4 Likes

Or you can use this extension to ask permissions using list:

2 Likes

separated the permission block still not working. I think the problem is with file location or something...

1 Like

What Android version are you using and are you using the Companion? The companion does not work, and Android 11 - 12 does not have the write permission.

2 Likes

what exactly is the "phone image path"? any example?

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

Did you declare the SET_WALLPAPER permission under @UsesPermissions in your extension? If you did, I don't think this block is necessary because the permission would be directly declared in the Manifest.

1 Like

Good Idea😁
Thanks

1 Like

Also, let me give you some new ideas...

Import this:

import androidx.annotation.RequiresApi;
import android.content.Context;

In public class WallPaperChanger extends AndroidNonvisibleComponent, add this:

private Context context;

And add this:

    @RequiresApi(api = 28)
    @SimpleFunction(description = "Sets the wallpaper back to the default wallpaper. Only works on Android versions larger or 9.0.")
    public void ClearWallpaper() {
        WallpaperManager myWallpaperManager = WallpaperManager.getInstance(context);
        myWallpaperManager.clearWallpaper();
    }

But this only works on versions > or = Android 9.

Also, this only works in the built APK, since relevant permissions don't exist in the Companion.

AIX: com.gordonlu.clearwallpaper.aix (5.8 KB)

1 Like

Thanks for improving the extension !

1 Like

sono un principiante, sto tentando di fare questa applicazione ad uso personale ma ricevo questo errore:
attempt to invoke virtual method boolean android.graphics.bitmap.compress(android.graphics.bitmap$compresformat,int ,java.io.outputstream)' on a null object reference.
Questo Γ¨ quello che ho fatto, cosa manca o dove sbaglio ?

just provide the image paths

grazie per la risposta, ho provato con questa soluzione ma mi da lo stesso errore.

What android version are you using, you probably have no access to files stored in
/storage/emulated/0

put them (the files) in a shared directory or in your application specific directory (ASD)

Sto usando android 12