live-wallpaper

onOffsetsChanged: move Bitmap

时光毁灭记忆、已成空白 提交于 2019-12-01 11:25:23
i want my Bitmap that has the height of the screen and has a bigger width than the screen to be moved a little bit to the right or left if the user changes the desktop so he can see the entire image. Here is my code that just works partially: int x = -1*(int)((xOffset*bmp.getWidth())); canvas.drawBitmap(bmp, x, 0, null); thank you! George Freeman You get exact pixel values via the variables xPixels and yPixels in onOffsetsChanged(). See my answer here: android live wallpaper rescaling For example, in onOffsetsChanged(), you can set a private class variable mPixels = xPixels; Then, in your draw

onOffsetsChanged: move Bitmap

拈花ヽ惹草 提交于 2019-12-01 07:57:04
问题 i want my Bitmap that has the height of the screen and has a bigger width than the screen to be moved a little bit to the right or left if the user changes the desktop so he can see the entire image. Here is my code that just works partially: int x = -1*(int)((xOffset*bmp.getWidth())); canvas.drawBitmap(bmp, x, 0, null); thank you! 回答1: You get exact pixel values via the variables xPixels and yPixels in onOffsetsChanged(). See my answer here: android live wallpaper rescaling For example, in

Android - cam.setPreviewDisplay(holder) running into IOError

流过昼夜 提交于 2019-11-30 16:38:10
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.setPreviewCallback(null); cam.release(); cam = null; } super.onDestroy(); } @Override public void

Hardware accelerated FFmpeg on android?

亡梦爱人 提交于 2019-11-30 08:45:10
I compiled an older version of FFmpeg for Android (if I recall correctly it was 0.6.X). FFmpeg decodes a video frame, scales it, then I'm using OpenGL to draw it on the screen. As far as I can tell, the problem is the decoding and scaling---they're not hardware accelerated. My question is: Is the latest version of FFmpeg hardware accelerated for ARM (Android) processors? Am I going about this the wrong way? i.e., is there a better way of doing this? Where "this" is playing a h264 HD video as a video live wallpaper---the framerate needs to be high, so hardware acceleration is desirable whenever

Live Wallpaper Tutorial

点点圈 提交于 2019-11-30 07:44:23
I am trying to do the following from a live wallpaper tutorial I found here . /** * Do the actual drawing stuff */ private void doDraw(Canvas canvas) { Bitmap b = BitmapFactory.decodeResource(context.getResources(), IMAGES[current]); canvas.drawColor(Color.BLACK); canvas.drawBitmap(b, 0, 0, null); Log.d(TAG, "Drawing finished."); } /** * Update the animation, sprites or whatever. * If there is nothing to animate set the wait * attribute of the thread to true */ private void updatePhysics() { // if nothing was updated : // this.wait = true; if(previousTime - System.currentTimeMillis() >= 41) {

Simplest example of an Android live wallpaper [closed]

本秂侑毒 提交于 2019-11-29 23:08:42
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 been using the android emulator with version 2.1 sdk 7. It runs the cube live wallpaper that comes in the

Weird Exception when Livewallpaper is set in Android

拟墨画扇 提交于 2019-11-29 15:30:18
04-24 13:30:59.312: VERBOSE/RenderScript(6044): RS Thread exited 04-24 13:30:59.320: ERROR/libEGL(6044): call to OpenGL ES API with no current context (logged once per thread) 04-24 13:30:59.335: WARN/WallpaperService(6044): Ignoring updateSurface: destroyed 04-24 13:30:59.335: WARN/WindowManager(108): Window android.view.IWindow$Stub$Proxy@408968d0 is already added 04-24 13:30:59.355: DEBUG/dalvikvm(6083): GC_EXTERNAL_ALLOC freed 23K, 52% free 2598K/5379K, external 1625K/2137K, paused 55ms 04-24 13:30:59.425: DEBUG/GLWallpaperService(6083): onSurfaceDestroyed() 04-24 13:30:59.496: WARN

Hardware accelerated FFmpeg on android?

廉价感情. 提交于 2019-11-29 12:20:06
问题 I compiled an older version of FFmpeg for Android (if I recall correctly it was 0.6.X). FFmpeg decodes a video frame, scales it, then I'm using OpenGL to draw it on the screen. As far as I can tell, the problem is the decoding and scaling---they're not hardware accelerated. My question is: Is the latest version of FFmpeg hardware accelerated for ARM (Android) processors? Am I going about this the wrong way? i.e., is there a better way of doing this? Where "this" is playing a h264 HD video as

Android 'set As Wallpaper' functionality

跟風遠走 提交于 2019-11-29 08:47:28
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? You can launch Crop intent by start activity for result and retrieve it in result and then use wallpaper manager

onOffsetsChanged not called by Touchwiz

回眸只為那壹抹淺笑 提交于 2019-11-28 23:45:58
Note: since it is a question specific to Samsung, I also asked it on their developer board . I am currently implementing a Live Wallpaper in Android and I'm listening to the onOffsetsChanged() method in my wallpaper engine to change the wallpaper when the user swipes through his homescreens. This works great on my private Galaxy Tab with a CM9 custom rom. On my company device, a stock Galaxy S3, it does not work. Somehow Touchwiz doesn't call onOffsetsChanged when the homescreen is changed. Googling for the topic didn't yield any significant results besides the description of this app , where