live-wallpaper

Wallpaper crashes with error - queueBuffer: error queuing buffer to SurfaceTexture

落爺英雄遲暮 提交于 2021-02-07 11:52:32
问题 Live Wallpaper crashes, code below public void render(){ Canvas canvas = null; try{ canvas = this._surfaceHolder.lockCanvas(null); synchronized (this._surfaceHolder) { this.onDraw(canvas); } }catch(Exception e){ Log.w("Surface holder ", e.toString());} finally{ if(canvas != null){ this._surfaceHolder.unlockCanvasAndPost(canvas); } } } protected void onDraw(Canvas canvas) { this.renderBackGround(canvas); for (Renderable renderable : this._fishes) { renderable.render(canvas); } }; Crashes with

Use a HTML page as Live Wallpaper in Android

落花浮王杯 提交于 2021-01-27 04:57:08
问题 Can I use a HTML page as a Live Wallpaper? Or is it possible to capture a web page as an image and set it as a wallpaper? Any help would be greatly appreciated. 回答1: There is an app on the market called WebLiveWallpaper that does this. There is an option in it for how often to refresh the view of the web page, which leads me to believe that it is simply taking a snapsnot of the page and presenting it as an image some how. Unfortunately I wouldn't know how to go about setting that up. But I

Use a HTML page as Live Wallpaper in Android

♀尐吖头ヾ 提交于 2021-01-27 04:56:32
问题 Can I use a HTML page as a Live Wallpaper? Or is it possible to capture a web page as an image and set it as a wallpaper? Any help would be greatly appreciated. 回答1: There is an app on the market called WebLiveWallpaper that does this. There is an option in it for how often to refresh the view of the web page, which leads me to believe that it is simply taking a snapsnot of the page and presenting it as an image some how. Unfortunately I wouldn't know how to go about setting that up. But I

Calling accelerometer from WallpaperService

旧时模样 提交于 2020-02-06 08:07:00
问题 I got this Accelerometer class that holds values of accelerometer and I can acces them from any other class whenever I want. Normally I would create new object Accelerometer accelerometer = new Accelerometer(this); but when I am inside WallpaperService it doesn't let me use this as parameter. Here is the Acclerometer class: import android.app.Activity; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware

How to set size of webview in WallpaperService?

雨燕双飞 提交于 2020-01-14 04:33:06
问题 I'm trying to set webview as a live wallpaper, but I have a problem with sizing it. In the Engine I create a webview with WallpaperService's Context: public WallpaperEngine(Context context) { webView = new WebView(context); ... } And I draw it to wallpaper's canvas: SurfaceHolder holder = getSurfaceHolder(); Canvas canvas = null; try { canvas = holder.lockCanvas(); if (canvas != null) { webView.draw(canvas); } } finally { if (canvas != null) holder.unlockCanvasAndPost(canvas); } But the

Android - cam.setPreviewDisplay(holder) running into IOError

故事扮演 提交于 2020-01-10 20:17:09
问题 I am trying to use the camera's image as part of live wallpaper. In the Engine that I declared, I have this code: public class Class extends WallpaperService { Camera cam; @Override public void onCreate() { super.onCreate(); cam = Camera.open(); } //... @Override public Engine onCreateEngine() { return new CubeEngine(cam); } class CubeEngine extends Engine { Camera cam; CubeEngine(Camera cam) { this.cam=cam; } //... @Override public void onDestroy() { if (cam != null) { cam.stopPreview(); cam