live-wallpaper

Android Live wallpaper doesn't show

橙三吉。 提交于 2019-12-23 04:05:51
问题 i have just started learning live wallpapers and i made this little thing. the thing is my app compiles with out any problems. as i open it in the phone it shows the wallpaper in the preview but when i click "set as wallpaper" it somehow crashes, and returns the front screen, and my wallpaper turns black, but it doesn't run it. my guess is the problem is some where along the onDestory() .. public class Strips extends WallpaperService { private StripsEngine engine; @Override public void

Moving Circle on Live Wallpaper

杀马特。学长 韩版系。学妹 提交于 2019-12-23 01:41:37
问题 I have to draw a circle in live wallpaper when it touches the boundary the direction of drawing gets reversed (something like in zigzag format). The problem is i am able to draw circle in this format. But: How to remove the previously drawn circle so that only single circle (dot) is visible at a time. When i redraw the bitmap it starts flickering why this happens? Code is as follows: Thread to draw circle: {animRunnable = new Runnable() { public void run() { if (!isRightEndReached &&

Communicate with a WallpaperService

╄→尐↘猪︶ㄣ 提交于 2019-12-22 19:15:39
问题 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? 回答1: 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

Communicate with a WallpaperService

依然范特西╮ 提交于 2019-12-22 19:14:57
问题 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? 回答1: 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

Start a live wallpaper service from activity

百般思念 提交于 2019-12-22 11:33:41
问题 public class ShortCurActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Button button = (Button)findViewById(R.id.b_start); if(button != null){ button.setOnClickListener(new View.OnClickListener() { public void onClick(View paramView) { Intent i = new Intent(ShortCurActivity.this, ServiceWallpaper.class); startService(i); } }); } } I just want to know if I can start a live wallpaper

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

那年仲夏 提交于 2019-12-22 01:25:12
问题 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 live wallpapers parallax-scrolling effect

大憨熊 提交于 2019-12-20 05:41:41
问题 when we scroll, the foreground of the home screen (icons, widgets, etc.) moves to the left or right by the full screen width, but the background image (or live wallpaper) only moves by a fraction of that width. My question is how get this effect. till now have done this. SurfaceHolder holder = getSurfaceHolder(); Canvas canvas = null; try { canvas = holder.lockCanvas(); if (canvas != null) { drawCircles(canvas); } } finally { if (canvas != null) holder.unlockCanvasAndPost(canvas); } the draw

Live Wallpaper Tutorial

妖精的绣舞 提交于 2019-12-18 12:42:10
问题 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() { /

Weird Exception when Livewallpaper is set in Android

余生长醉 提交于 2019-12-18 09:01:19
问题 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

onOffsetsChanged not called by Touchwiz

馋奶兔 提交于 2019-12-18 02:48:59
问题 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.