live-wallpaper

Simplest example of an Android live wallpaper [closed]

空扰寡人 提交于 2019-11-28 20:22:11
问题 I'm trying to make an android live wallpaper. I am looking for just a simple example that just displays a solid background and does nothing else to get me started. I've looked up quite a few tutorials but they all have preference activities and I can't get any of them to work. I've even tried removing everything that it does not need other than the required override functions. Can anyone post the code for just a simple live wallpaper or post a link to an example that definitely works. I've

Android Live Wallpapers — OpenGL vs Canvas

自作多情 提交于 2019-11-28 19:35:23
I am a fairly "newb" Android developer, and I would like one of my first projects to be a live wallpaper, however I am conflicted on whether I should be focusing on Canvas or OpenGL for it. Being new to this I know I should master Canvas first since it is easier to use, but I prefer to learn from real world projects that I have an interest in, even if it's a little backwards at times. I have used both before in very basic ways, and I understand the general concepts to them, but I am not sure how they transfer over to the realm of live wallpapers. I figure that the full blown speed of OpenGL

Android video as a live wallpaper

房东的猫 提交于 2019-11-28 19:00:47
i am trying to put video as a live wallpaper. I am using media player for that. i can get SurfaceHolder and i can give that holder to the media player. But its not working for me, its giving me following exception LogCat Exception Detail ERROR/AndroidRuntime(302): java.lang.UnsupportedOperationException: Wallpapers do not support keep screen on if i dont give holder to the media player it works, but i can hear only audio. I saw one application VideoLiveWallpaper , which set video as a live wallpaper, so it can be possible, may be i am missing something . I am pasting the code, any help on this

How to fit video in Live wallpaper, by center-crop and by fitting to width/height?

做~自己de王妃 提交于 2019-11-28 18:31:26
Background I'm making a live wallpaper that can show a video. In the beginning I thought this is going to be very hard, so some people suggested using OpenGL solutions or other, very complex solutions (such as this one ). Anyway, for this, I've found various places talking about it, and based on this github library (which has some bugs), I finally got it to work. The problem While I've succeeded showing a video, I can't find the way to control how it's shown compared to the screen resolution. Currently it always gets to be stretched to the screen size, meaning that this (video taken from here

How do I move to Live Wallpaper preview from app?

混江龙づ霸主 提交于 2019-11-28 09:12:27
I've been looking all over for a specific example of this and couldn't find it online anywhere. What I want to do is: From my app click a button and move to the Live Wallpaper preview of my apps live wallpaper, so the user can choose to activate it. Now of what I've read online, I'm to use WallpaperManager's ACTION_CHANGE_LIVE_WALLPAPER with EXTRA_LIVE_WALLPAPER_COMPONENT pointing to my LiveWallpapers ComponentName. Here's my code of what I have so far. Anybody know what I'm doing wrong? As of now I click the button and nothing happens... (I logged it and it's actually reaching this code).

Android 'set As Wallpaper' functionality

旧城冷巷雨未停 提交于 2019-11-28 01:58:24
问题 I am developing an application in which I have an image gallery and when I click on any image, it opens in full mode. But I want the set As Wallpaper functionality like android default gallery: I know it can be done by custom code (setting wallpaper and cropping image). But I want to pass that image to android default wallpaper setter so that android will manage the cropping and setting wallpaper task. How can I do that? How can I pass that image to android default walpaper setter? 回答1: You

using onOffsetsChanged() to get home screen swipe direction

一世执手 提交于 2019-11-28 00:34:46
I'm working on my Live Wallpaper and I want it to scroll with the screen like a normal wallpaper does. I know I need to use onOffsetsChanged() but which parameter will tell me the direction that the home screen is being swiped? It seems like xOffset always returns a positive value no matter which way the screen slides. Thank you. George Freeman The direction alone will not help you: you need to know the exact offset, because the user may have jumped several screens at once (e.g. by using a pop-up that displays mini-versions of all the home screens). Generally speaking, you want to save the

How to fit video in Live wallpaper, by center-crop and by fitting to width/height?

这一生的挚爱 提交于 2019-11-27 20:23:43
问题 Background I'm making a live wallpaper that can show a video. In the beginning I thought this is going to be very hard, so some people suggested using OpenGL solutions or other, very complex solutions (such as this one). Anyway, for this, I've found various places talking about it, and based on this github library (which has some bugs), I finally got it to work. The problem While I've succeeded showing a video, I can't find the way to control how it's shown compared to the screen resolution.

Choosing background for Live Wallpaper

拟墨画扇 提交于 2019-11-27 18:13:33
I'm writing a live wallpaper that creates an effect over a background. I want the user to be able to choose the background from any of the system wallpapers and camera photos. What I would like is for the user to be able to press a button in the Settings menu, have the list of options show up just like setting the wallpaper from the home screen, minus the Live Wallpapers options. Once the user navigates the choices and picks an actually image I would load it to my canvas. How do I do this? I can't find an API anywhere for getting a list of wallpapers. I've been able to come up with a list of

Setting live wallpaper programmatically

半城伤御伤魂 提交于 2019-11-27 17:44:34
Is it possible to set a live wallpaper using some lines of code. For example, i want to tell my users that a live wallpaper is available "click here to set it". Alright, just so I stop getting downvotes for an outdated answer. Please see Error 454's answer below for a more robust solution which will send the user directly to the wallpaper preview screen on Jelly Bean and up devices. ======================================== Here's how to start the wallpaper chooser, from which the user can select your wallpaper. The toast is just a way to explain to the user what's going on. Toast toast = Toast