Unsplash wallpaper
Moderator: Martin
Unsplash wallpaper
Here is flow to grab wallpaper from unsplash. It contains 2 flows.
1) First flow is to change wallpaper and excluding photo using tags. This flow will trigger hourly using Global Variable Date/Time. If screen off then 2nd flow will enable with User present trigger.
2) I have added cache option to change wallpaper when no network or battery is lower than 30%.
3) There is wallpaper_scrolling boolean available to enable/disable scrolling wallpapers.
Download
http://automagic4android.com/forum/down ... hp?id=1928
1) First flow is to change wallpaper and excluding photo using tags. This flow will trigger hourly using Global Variable Date/Time. If screen off then 2nd flow will enable with User present trigger.
2) I have added cache option to change wallpaper when no network or battery is lower than 30%.
3) There is wallpaper_scrolling boolean available to enable/disable scrolling wallpapers.
Download
http://automagic4android.com/forum/down ... hp?id=1928
Last edited by anuraag on 02 Apr 2020 07:24, edited 4 times in total.
Re: Unsplash wallpaper
Updated flow to fix issue with display size wallpaper url.
Re: Unsplash wallpaper
Hi anuraag
Good. Working fine. Are the images stored in internal memory? If yes. Where can I find them?
Thanks for making a good and amazing flow. Keep it up.
From record4
Good. Working fine. Are the images stored in internal memory? If yes. Where can I find them?
Thanks for making a good and amazing flow. Keep it up.
From record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: Unsplash wallpaper
Files are stored at
/storage/emulated/0/Android/data/ch.gridvision.ppam.androidautomagic/files/unsplash
/storage/emulated/0/Android/data/ch.gridvision.ppam.androidautomagic/files/unsplash
Re: Unsplash wallpaper
Hi anuraag,
Can you please explain how your flow work as I want to make some change.
1. Change only lock screen wallpaper
2. Add file extension (.jpg) in image saved, possibly change image save location as well.
I want flow to change only lockscreen wallpaper as I am using klwp as home screen wallpaper and it is not able to set wallpaper without image extension.
Thanks
Can you please explain how your flow work as I want to make some change.
1. Change only lock screen wallpaper
2. Add file extension (.jpg) in image saved, possibly change image save location as well.
I want flow to change only lockscreen wallpaper as I am using klwp as home screen wallpaper and it is not able to set wallpaper without image extension.
Thanks
Re: Unsplash wallpaper
1) To change image save path modify action Init Variable Text File:. Change File path to something like this
2) To change only lockscreen wallpaper replace action Script: change wall with action Set Wallpaper. Set type lockscreen. Set path to
3) To add jpg extension modify action HTTP Request: GET {url} store in {cachedir+"/"+photoid}. Change File to
Also change in Set Wallpaper action.
If you don't want to store images and directly apply images there is simple api available at source.unsplash.com.
example: get random wallpaper from a collection of 1065976 with specified size
Code: Select all
{cachedir = callJavaConstructor("java.io.File", "File(java.lang.String)", "/storage/emulated/0/Pictures/unsplash")}/.cache
Code: Select all
{cachedir+"/"+photoid}
Code: Select all
{cachedir+"/"+photoid}.jpg
If you don't want to store images and directly apply images there is simple api available at source.unsplash.com.
example: get random wallpaper from a collection of 1065976 with specified size
Code: Select all
https://source.unsplash.com/collection/1065976/1960x1080
Last edited by anuraag on 09 Mar 2020 12:49, edited 1 time in total.
Re: Unsplash wallpaper
Am I suppose to make any changes in Expression: if (length(unsplash["cache"]) > 0 ...
It gives error when network is not connected
Error:
Also Script: for (i in fromJSON(response)) ... gives error.
Error:
It gives error when network is not connected
Error:
Code: Select all
ch.gridvision.ppam.androidautomagic.simplelang.a.d: No method with name listFiles found in class java.lang.String (Expression: callJavaMethod(cachedir, "java.io.File", "listFiles()")[line 0], Cause: java.lang.String.listFiles []).
Error:
Code: Select all
ch.gridvision.ppam.androidautomagic.simplelang.a.d: Expression must return a collection but returned null (Expression: for (i in fromJSON(response)) {
id = i['id'];
if (!containsElement(unsplash["wall"], id) and !containsElement(unsplash["old_wall"], id)) { addElement(unsplash["wall"], id)
}
}[line 0])
Re: Unsplash wallpaper
Change Init variable text file to
Make sure path exits in your phone. Else create it.
/storage/emulated/0/Pictures/unsplash
Code: Select all
{cachedir = callJavaConstructor("java.io.File", "File(java.lang.String)", "/storage/emulated/0/Pictures/unsplash")}/.cache
/storage/emulated/0/Pictures/unsplash
Re: Unsplash wallpaper
Here is flow.
Modify first action to change path. Make sure it exits.
Modify first action to change path. Make sure it exits.
- Attachments
-
- flow_Unsplash_copy_20200309_182338.xml
- (32.81 KiB) Downloaded 1219 times
Re: Unsplash wallpaper
Error using-unsplash copy
With network connection, lockscreen updates successful
Code: Select all
Index: 0, Size: 0 (Expression: unsplash["cache"][index][line 8])