live-wallpaper

android: GLWallpaperService causing green screen

南楼画角 提交于 2019-12-06 11:56:27
问题 I am trying to create a live wallpaper using opengl (<2.0). I imported and tried to run Robert Green's GLWallpaperService and Example here (using Eclipse SDK). My phone is a Huwei Ascend Android 2.1. I already know it can run other opengl LWPs. When I run the package, it just produces a solid green screen, and no shapes or anything. Ive researched it alot and still cant figure out why this is happening. I read a few times that the namespaces have to be changed to my package. But still no luck

3d cube using canvas. Need a little improvement

无人久伴 提交于 2019-12-06 06:24:45
问题 I made this 3d cube using the following code Matrix mMatrix = canvas.getMatrix(); canvas.save(); camera.save(); camera.rotateY(-angle); camera.getMatrix(mMatrix); mMatrix.preTranslate(-width, 0); mMatrix.postTranslate(width, 0); canvas.concat(mMatrix); canvas.drawBitmap(bmp1, 0, 0, null); camera.restore(); canvas.restore(); camera.rotateY(90 - angle); camera.getMatrix(mMatrix); mMatrix.preTranslate(-width, 0); mMatrix.postTranslate(width2, 0); canvas.concat(mMatrix); canvas.drawBitmap(bmp2,

How to implement double tap for Android live wallpapers?

强颜欢笑 提交于 2019-12-06 05:23:22
问题 I want to implement a double tap event for a Android live wallpaper. Sadly, I couldn´t find any specific code how to do that. At the moment I´ve found a workarround using the onTouchEvent-method of the Engine-class: public void onTouchEvent(MotionEvent event) { long time = android.os.SystemClock.currentThreadTimeMillis(); if(((time - mLastTouchTime) < 500) && ((time - mLastTouchTime) > 100)) { if(!mIsPlayed && mSound) { mIsPlayed = true; int sound = R.raw.hell; if(mTheme.equals("rose")) sound

Communicate with a WallpaperService

江枫思渺然 提交于 2019-12-06 05:14:06
Is there any way to directly communicate with a WallpaperService from an Activity ? It doesn't look like I can use the normal service communication classes because the onBind method is declared final in the WallpaperService class I'm extending. Worth noting that I'm referring to my WallpaperService not any . Any workarounds if this isn't possible? My solution was to use local sockets. I created an instance of a LocalServerSocket in the constructor of my wallpaper's Engine . Here's a quick implementation. Server runs on a separate thread and is directly tied to the lifecycle of MyEngine . The

How to use camera live feed as a activity background?

时光毁灭记忆、已成空白 提交于 2019-12-05 21:33:59
问题 I am trying to make an App in which I need to use camera live feed as a background. (I know its a stupid thing to do but can't help, its a client demand). I have tried doing it using SurfaceView but no success so far. So far whatever I found on Stack Overflow are more of a guesses or directions how to do it but no real time examples or code help is out there. It would be great if someone who has done this before share a piece of code with Stack Overflow users like me. 回答1: Take a look here:

Getting error at WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER

江枫思渺然 提交于 2019-12-05 09:25:23
I'm creating my fist Live wallpaper by following this tutorial. But i'm getting error can not be resolved or is not a field on these two lines WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT while trying to achive this Intent intent = new Intent( WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER); intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT, new ComponentName(this, LiveWallService.class)); And compiler provides these suggessions: WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER WallpaperManager.COMMAND_DROP WallpaperManager.COMMAND

Create alpha gradient on image to create fade effect

元气小坏坏 提交于 2019-12-05 05:29:22
问题 How can I apply an alpha gradient on an image so that it fades linearly? Right now, I'm creating rectangles of unit width and using it to draw the bitmap with a paint object with alpha value being changed in a loop. I only did it since I couldn't think of anything else. So a neater way would be better. Bitmap bitmap = BitmapFactory.decodeStream(is); Bitmap bmp = Bitmap.createScaledBitmap(bitmap, 100, 151, true)); bitmap.recycle(); Rect Rect1 = new Rect(0, 0, 100, 100); Rect Rect2 = new Rect

java.io.IOException: setDataSource failed.: status=0x80000000

白昼怎懂夜的黑 提交于 2019-12-04 23:51:18
I am trying to play url using media player in activity using: mediaPlayer = MediaPlayer.create(getApplicationContext(), Uri.parse("http://www.pocketjourney.com/downloads/pj/video/famous.3gp"), holder); It's working fine. Same code I use to set it as an live wallpaper in @onSurfaceCreated in WallpaperService , it's giving me following error log D/MediaPlayer( 4128): create failed: D/MediaPlayer( 4128): java.io.IOException: setDataSource failed.: status=0x80000000 D/MediaPlayer( 4128): at android.media.MediaPlayer._setDataSource(Native Method) D/MediaPlayer( 4128): at android.media.MediaPlayer

android: GLWallpaperService causing green screen

心不动则不痛 提交于 2019-12-04 17:20:32
I am trying to create a live wallpaper using opengl (<2.0). I imported and tried to run Robert Green's GLWallpaperService and Example here (using Eclipse SDK). My phone is a Huwei Ascend Android 2.1. I already know it can run other opengl LWPs. When I run the package, it just produces a solid green screen, and no shapes or anything. Ive researched it alot and still cant figure out why this is happening. I read a few times that the namespaces have to be changed to my package. But still no luck... I tried linking his GLWallpaperService JAR library to my package as per instructed. Nope. Any

How do I restart this wallpaper engine after settings have been updated?

南楼画角 提交于 2019-12-04 13:59:14
问题 I'm creating a live wallpaper and I'm using this tutorial as a starting point: http://code.tutsplus.com/tutorials/create-a-live-wallpaper-on-android-using-an-animated-gif--cms-23088 I'm trying to add a settings menu to let the user choose one of four backgrounds. I have everything working using SharedPreferences . The only problem is that the wallpaper does not update after the setting is changed in the settings menu. If you restart the app, the background will be updated with the last