Giter VIP home page Giter VIP logo

glwallpaperservice's Introduction

#GLWallpaperService - Version 0.9.2

Google Group

Repository

A library for making OpenGL Live Wallpapers for Android.

Provided as free open source software under the Apache License version 2.0. Parts of this software are derived from code provided by the Android Open Source Project.

##Getting started making your wallpaper

###Get the library The easiest way to use this project is by downloading the latest Jar file

Once you have GLWallpaperService.jar, you can add it to your workspace:

  • If needed, setup the Android SDK and/or create a new Android workspace as you would normally
  • Create a new Android project using API level 7 or higher
  • You don't need an Activity in your project if you don't want one, but it can be nice to give users an icon to access your wallpaper settings

###Add the library to your project Now that you have your Android project, you will need to add GLWallpaperService.jar to your classpath. Here is one way you can do that if you are using Eclipse. These steps were tested in Eclipse Galileo.

  1. Create a new folder directly under your project folder called libs/
  2. Put GLWallpaperService.jar into the ProjectFolder/libs/ folder.
  3. If Eclipse doesn't see the jar, refresh your project.
  4. Right-click on your Android project. Choose Properties from the menu.
  5. Under "Java Build Path", choose the "Libraries" tab.
  6. Click on the "Add JARs...". Select GLWallpaperService.jar under ProjectFolder/libs/ and click ok. Click ok to get out of the Properties window.
  7. This will automatically add a line to your .classpath file that reads something like this:

###Configure AndroidManifest.xml The next step would be to tell the Android system that you are making a Live Wallpaper. Place the following code inside your AndroidManifest.xml between the <Application> and </Application> tags

<service android:label="@string/service_label" android:name=".MyWallpaperService"
    android:permission="android.permission.BIND_WALLPAPER">
    <intent-filter>
        <action android:name="android.service.wallpaper.WallpaperService" />
    </intent-filter>
    <meta-data android:name="android.service.wallpaper"
        android:resource="@xml/myglwallpaper" />
</service>
  • android:name=".MyWallpaperService" corresponds to the name of a class you will create later on. You can name it what you want, but be consistent.
  • android:resource="@xml/myglwallpaper" corresponds to an xml file that you will also create. Likewise, be consistent in your naming here too.

Also, add the following line to AndroidManifest.xml outside of the <Application> tag, but inside the <Manifest> tag:

<uses-feature android:name="android.software.live_wallpaper" android:required="true" />

Next, create a folder and call it ProjectFolder/res/xml. Create a new file in there and call it myglwallpaper.xml. Place the following content inside.

<?xml version="1.0" encoding="utf-8"?>
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
    android:description="@string/description"
/>

Add the following lines to res/values/strings.xml. Use whatever values you like.

<string name="service_label">Name of your Wallpaper</string>
<string name="description">Description of your wallpaper</string>

###Renderer Implementation Now it is time to make your two main classes, the Service class and the Renderer class. To create the Renderer class, create a new class that we'll call MyRenderer. It implements the interface GLWallpaperService.Renderer and also has a method called release(). Here is an example.

import net.rbgrn.android.glwallpaperservice.*;

public class MyRenderer implements GLWallpaperService.Renderer {
    public void onDrawFrame(GL10 gl) {
        // Your rendering code goes here
        
        gl.glClearColor(0.2f, 0.4f, 0.2f, 1f);
        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    }
    
    public void onSurfaceChanged(GL10 gl, int width, int height) {
    }
    
    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
    }
    
    /**
     * Called when the engine is destroyed. Do any necessary clean up because
     * at this point your renderer instance is now done for.
     */
    public void release() {
    }
}

###Service Implementation Finally, create a class that extends GLWallpaperService. It behaves essentially the same as the Android class WallpaperService. We'll call it MyWallpaperService. Here is an example.

import net.rbgrn.android.glwallpaperservice.*;

// Original code provided by Robert Green
// http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers
public class MyWallpaperService extends GLWallpaperService {
    public MyWallpaperService() {
        super();
    }
    
    public Engine onCreateEngine() {
        MyEngine engine = new MyEngine();
        return engine;
    }
    
    class MyEngine extends GLEngine {
        MyRenderer renderer;
        public MyEngine() {
            super();
            // handle prefs, other initialization
            renderer = new MyRenderer();
            setRenderer(renderer);
            setRenderMode(RENDERMODE_CONTINUOUSLY);
        }
        
        public void onDestroy() {
            super.onDestroy();
            if (renderer != null) {
                renderer.release();
            }
            renderer = null;
        }
    }
}

###Running the app All that remains is to run the project on your phone or Emulator. In Eclipse, create a new run configuration of type "Android Application". Set the Project to the project you created, and click on the "Run" button. This will install the wallpaper on the phone or emulator.

To view the wallpaper, use the Android Live Wallpaper picker screen, and select your Wallpaper. If successful, the code above will display a green screen.

Congratulations, you're all ready to go! Now go forth and build an awesome OpenGL wallpaper.

glwallpaperservice's People

Contributors

cedroux avatar error454 avatar jayschwa avatar markfguerra avatar timogriese avatar walterreid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glwallpaperservice's Issues

WaitForCondition (mytouch4g) issue and fix

Hi,

First of all thanks for hosting this code, it is extremely helpful.

I have found one small issue that affects at least the mytouch4g. If you switch between screens quickly (i.e browser and home screen), the wallpaper stops updating and logcat gets flooded with WaitForCondition. If you put a short Thread.sleep (e.g Thread.sleep(10)) after mEglHelper.swap(), it fixes the issue. Other than that, everything has worked for me so far...I've actually downloaded and modified min3d to work with your code for fun.

Thanks again,
Trevor

Occasional error in createContext with code BAD_CONFIG

Some of my users have this crash and 1. I can't reproduce it myself and 2. can't imagine how this is even possible - we're choosing from available configs and returning the closest one.

Here's the stack trace even though not really helpful (i slightly modified sources hoping to get better insight):
java.lang.RuntimeException: java.lang.RuntimeException: createContext failed: 12293
at net.rbgrn.android.glwallpaperservice.GLThread.run(GLWallpaperService.java:498)
Caused by: java.lang.RuntimeException: createContext failed: 12293
at net.rbgrn.android.glwallpaperservice.EglHelper.throwEglException(GLWallpaperService.java:422)
at net.rbgrn.android.glwallpaperservice.EglHelper.start(GLWallpaperService.java:327)
at net.rbgrn.android.glwallpaperservice.GLThread.guardedRun(GLWallpaperService.java:564)
at net.rbgrn.android.glwallpaperservice.GLThread.run(GLWallpaperService.java:489)

ideas?

Write instructions to set up project without using eclipse

As of now the readme.txt file contains instructions for users to create a new wallpaper project using Eclipse.
https://github.com/markfguerra/GLWallpaperService/blob/e88eda8f665c34da544a460b3b1c41d481c98bb4/readme.txt

The task is to write clear step by step instructions on how to set up a new wallpaper project using the command line. It should have no dependancy on Eclipse.

You can leave out any standard sdk setup instructions. Google publishes that document at http://developer.android.com/sdk/installing.html

Bitmaps loaded via Resource does not work

I had an opengl project that worked fine prior to integrating it as a wallpaper service. Now it will not load textures from R. I verified I am able to texture in 3d by creating a bitmap and drawing to it randomly then using that bitmap instead and it works fine.

It is possible its related to something like wallpaper apps do not have the same bit depth or are not allowed to have alpha textures or something, but I've hit a wall.

ClassNotFoundException on WallpaperService at run time

"To view the wallpaper, use the Android Live Wallpaper picker screen, and select your Wallpaper"

is error on emulator and device: The application .... has stopped unexpectedly.Please try again.

Please help me.

logcat from Eclipse emulator:

03-12 10:12:15.662: E/AndroidRuntime(558): FATAL EXCEPTION: main
03-12 10:12:15.662: E/AndroidRuntime(558): java.lang.RuntimeException: Unable to instantiate service ru.my.glwalpapper.MyWallpaperService: java.lang.ClassNotFoundException: ru.my.glwalpapper.MyWallpaperService in loader dalvik.system.PathClassLoader[/data/app/ru.my.glwalpapper-1.apk]
03-12 10:12:15.662: E/AndroidRuntime(558): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2943)
03-12 10:12:15.662: E/AndroidRuntime(558): at android.app.ActivityThread.access$3300(ActivityThread.java:125)
03-12 10:12:15.662: E/AndroidRuntime(558): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
03-12 10:12:15.662: E/AndroidRuntime(558): at android.os.Handler.dispatchMessage(Handler.java:99)
03-12 10:12:15.662: E/AndroidRuntime(558): at android.os.Looper.loop(Looper.java:123)
03-12 10:12:15.662: E/AndroidRuntime(558): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-12 10:12:15.662: E/AndroidRuntime(558): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 10:12:15.662: E/AndroidRuntime(558): at java.lang.reflect.Method.invoke(Method.java:521)
03-12 10:12:15.662: E/AndroidRuntime(558): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-12 10:12:15.662: E/AndroidRuntime(558): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-12 10:12:15.662: E/AndroidRuntime(558): at dalvik.system.NativeStart.main(Native Method)
03-12 10:12:15.662: E/AndroidRuntime(558): Caused by: java.lang.ClassNotFoundException: ru.my.glwalpapper.MyWallpaperService in loader dalvik.system.PathClassLoader[/data/app/ru.my.glwalpapper-1.apk]
03-12 10:12:15.662: E/AndroidRuntime(558): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
03-12 10:12:15.662: E/AndroidRuntime(558): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
03-12 10:12:15.662: E/AndroidRuntime(558): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
03-12 10:12:15.662: E/AndroidRuntime(558): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2940)
03-12 10:12:15.662: E/AndroidRuntime(558): ... 10 more

Textures show on emulator, not on phone

Hi,

Great work, by the way. I'm quite willing to contribute.

I have a wallpaper that maps some textures onto simple squares and rotates them. Textures are loaded from .png images using BitmapFactory. On any emulator I try, it renders correctly. On my phone, the textures don't show up. It's very odd. I based my code on the Deep wallpaper example which also uses GLWallpaperService. His app seems to have the same problem.

Any ideas? I find it odd that it works on Froyo and Gingerbread AVD, but on phone... everything is fine except the textures. Thanks
Dirk

Animation stops rendering - CPU may be pegged

There are times where the animation of the wallpaper will stop sometimes when the screen is turned on and off. This occurs sporadically and is not consistent to reproduce. You must turn the screen on-off-on-off repeatedly until the issue occurs. Sometimes it occurs on its own.

This has been seen on an HTC Vision (G2) and probably affects other phones as well.

This debug message occurs repeatedly after the image stops animating:
01-15 12:25:37.467: WARN/SharedBufferStack(6984): waitForCondition(LockCondition) timed out (identity=252, status=0). CPU may be pegged. trying again.

After the user selects another wallpaper and some time passes, the wallpaper gets an ANR.

Sig 3 gets sent to the process.

01-15 12:28:44.770: INFO/Process(1299): Sending signal. PID: 6984 SIG: 3
01-15 12:28:44.770: INFO/dalvikvm(6984): threadid=3: reacting to signal 3
01-15 12:28:44.770: INFO/dalvikvm(6984): Wrote stack traces to '/data/anr/traces.txt'

Then it gets Sig 9. In this case net.markguerra.android.glwallpapertest is the particular wallpaper running when the problem occured.

01-15 12:28:45.010: INFO/Process(1299): Sending signal. PID: 6984 SIG: 9
01-15 12:28:45.010: ERROR/ActivityManager(1299): ANR in net.markguerra.android.glwallpapertest
01-15 12:28:45.010: ERROR/ActivityManager(1299): Reason: Executing service net.markguerra.android.glwallpapertest/.MyWallpaperService
01-15 12:28:45.010: ERROR/ActivityManager(1299): Load: 2.18 / 2.68 / 2.76
01-15 12:28:45.010: ERROR/ActivityManager(1299): CPU usage from 464237ms to 33ms ago:
01-15 12:28:45.010: ERROR/ActivityManager(1299):   system_server: 10% = 7% user + 2% kernel / faults: 16275 minor 3 major
01-15 12:28:45.010: ERROR/ActivityManager(1299):   dle.bamboo_free: 6% = 6% user + 0% kernel / faults: 20521 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   ndroid.launcher: 2% = 1% user + 0% kernel / faults: 25498 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   suspend: 1% = 0% user + 1% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   aper.livepicker: 0% = 0% user + 0% kernel / faults: 14687 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   akmd: 0% = 0% user + 0% kernel / faults: 1384 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   mmcqd: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   d.process.acore: 0% = 0% user + 0% kernel / faults: 783 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   m.android.phone: 0% = 0% user + 0% kernel / faults: 415 minor 2 major
01-15 12:28:45.010: ERROR/ActivityManager(1299):   rild: 0% = 0% user + 0% kernel / faults: 6 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   oid.inputmethod: 0% = 0% user + 0% kernel / faults: 316 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   onFriendService: 0% = 0% user + 0% kernel / faults: 455 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   e.process.gapps: 0% = 0% user + 0% kernel / faults: 356 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   events/0: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   : 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   logcat2: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   kjournald: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   viders.calendar: 0% = 0% user + 0% kernel / faults: 325 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   zygote: 0% = 0% user + 0% kernel / faults: 231 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   s.gesturesearch: 0% = 0% user + 0% kernel / faults: 375 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   panel_on/0: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   curcial_wq: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   smd_tty: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   kjournald: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   adbd: 0% = 0% user + 0% kernel / faults: 10 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   microp_work_q: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   .cooliris.media: 0% = 0% user + 0% kernel / faults: 18 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   kswapd0: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   usb_mass_storag: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   flush-179:0: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   rpcrouter: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   atmel_wq: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   ls_wq/0: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   servicemanager: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):   mediaserver: 0% = 0% user + 0% kernel / faults: 97 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   .android.kineto: 0% = 0% user + 0% kernel / faults: 413 minor 1 major
01-15 12:28:45.010: ERROR/ActivityManager(1299):   om.timsu.astrid: 0% = 0% user + 0% kernel / faults: 34 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   init: 0% = 0% user + 0% kernel / faults: 2 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   nie.geniewidget: 0% = 0% user + 0% kernel / faults: 166 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   android.browser: 0% = 0% user + 0% kernel / faults: 81 minor 1 major
01-15 12:28:45.010: ERROR/ActivityManager(1299):   com.layar: 0% = 0% user + 0% kernel / faults: 12 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):   s:FriendService: 0% = 0% user + 0% kernel / faults: 33 minor
01-15 12:28:45.010: ERROR/ActivityManager(1299):  +glwallpapertest: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  +twitter.android: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  +facebook.katana: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  +flush-179:32: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  +sh: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  +logcat: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  +box.flurry.free: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  -flush-179:32: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  -sh: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  -logcat: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  -android.vending: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  -glwallpapertest: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  -com.svox.pico: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299):  -equicksearchbox: 0% = 0% user + 0% kernel
01-15 12:28:45.010: ERROR/ActivityManager(1299): TOTAL: 35% = 24% user + 8% kernel + 2% iowait

Here is the relevant part of traces.txt

----- pid 6984 at 2011-01-15 12:28:44 -----
Cmd line: net.markguerra.android.glwallpapertest

DALVIK THREADS:
"main" prio=5 tid=1 WAIT
  | group="main" sCount=1 dsCount=0 s=N obj=0x4001d8c0 self=0xccc8
  | sysTid=6984 nice=0 sched=0/0 cgrp=default handle=-1345017816
  | schedstat=( 245239256 884918214 1241 )
  at java.lang.Object.wait(Native Method)
  - waiting on <0x44d22df8> (a net.rbgrn.android.glwallpaperservice.GLThread$GLThreadManager)
  at java.lang.Object.wait(Object.java:288)
  at net.rbgrn.android.glwallpaperservice.GLThread.surfaceDestroyed(GLWallpaperService.java:734)
  at net.rbgrn.android.glwallpaperservice.GLWallpaperService$GLEngine.onSurfaceDestroyed(GLWallpaperService.java:102)
  at android.service.wallpaper.WallpaperService$Engine.reportSurfaceDestroyed(WallpaperService.java:712)
  at android.service.wallpaper.WallpaperService$Engine.detach(WallpaperService.java:729)
  at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:822)
  at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4627)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  at dalvik.system.NativeStart.main(Native Method)

"GLThread 10" prio=5 tid=9 NATIVE
  | group="main" sCount=1 dsCount=0 s=N obj=0x44d29de0 self=0x274e58
  | sysTid=6993 nice=0 sched=0/0 cgrp=default handle=2610272
  | schedstat=( 15766326910 23059997632 36620 )
  at com.google.android.gles_jni.EGLImpl.eglSwapBuffers(Native Method)
  at net.rbgrn.android.glwallpaperservice.EglHelper.swap(GLWallpaperService.java:442)
  at net.rbgrn.android.glwallpaperservice.GLThread.guardedRun(GLWallpaperService.java:669)
  at net.rbgrn.android.glwallpaperservice.GLThread.run(GLWallpaperService.java:528)

"Binder Thread #2" prio=5 tid=7 NATIVE
  | group="main" sCount=1 dsCount=0 s=N obj=0x44d1cbe0 self=0x13db10
  | sysTid=6990 nice=0 sched=0/0 cgrp=default handle=1255432
  | schedstat=( 89508069 137329097 482 )
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=6 NATIVE
  | group="main" sCount=1 dsCount=0 s=N obj=0x44d18988 self=0x11f130
  | sysTid=6989 nice=0 sched=0/0 cgrp=default handle=1255368
  | schedstat=( 87677003 140106195 491 )
  at dalvik.system.NativeStart.run(Native Method)

"Compiler" daemon prio=5 tid=5 VMWAIT
  | group="system" sCount=1 dsCount=0 s=N obj=0x44d15348 self=0x127e50
  | sysTid=6988 nice=0 sched=0/0 cgrp=default handle=1207256
  | schedstat=( 217956547 340026868 1114 )
  at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=4 VMWAIT
  | group="system" sCount=1 dsCount=0 s=N obj=0x44d152a0 self=0x1228c8
  | sysTid=6987 nice=0 sched=0/0 cgrp=default handle=1179280
  | schedstat=( 2685547 2380370 14 )
  at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=3 RUNNABLE
  | group="system" sCount=0 dsCount=0 s=N obj=0x44d151e8 self=0x11fca0
  | sysTid=6986 nice=0 sched=0/0 cgrp=default handle=1207192
  | schedstat=( 2777099 7965087 5 )
  at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=2 VMWAIT
  | group="system" sCount=1 dsCount=0 s=N obj=0x4376a588 self=0x11fee0
  | sysTid=6985 nice=0 sched=0/0 cgrp=default handle=1207080
  | schedstat=( 47546391 56823725 32 )
  at dalvik.system.NativeStart.run(Native Method)

----- end 6984 -----

onSurfaceCreated() after onSurfaceDestroyed()

Where can I release/reupload my objects?

Tryed to destroy in: GLEngine onDestroy
Tryed to upload again in: Renderer onSurfaceCreated

when I am in live wallpaper picker and select my wallpaper only the "onSurfaceCreated()" function completed, but before it the "onSurfaceDestroyed" not.

the result when I am in live wallpaper's preview mode, and then SET WALLPAPER again:

LOG:
06-07 14:24:07.530: E/created--(10609): onSurfaceCreated() -->upload all things (meshes, textures)
06-07 14:24:07.955: E/destroyed--(10609): onSurfaceDestroyed -->destroy all things (meshes, textures)

So I get an error. Because onSurfaceDestroyed called last...why?
Is it a bug?

Tesxtures not Rendering

Hi,
I am using cocos2d Android https://github.com/ZhouWeikuan/cocos2d/
and i am using your GLSurfaceView.java for Live wallpaper and what i have done that i called my scene.draw() in onDrawframe() i noticed that gl is drawing my textures(texture.draw is being called for each texture) but i cannot see any texture on screen.

Write a better test wallpaper

The current test wallpaper does its job, but it's about as ugly as it is green. More importantly, it doesn't really test very much. What we could use is a new wallpaper that uses more OpenGL features, so that we can visually confirm that things are working reasonably well.

It would be hard to include every OpenGL feature, but here are some possibilities

  • Texture mapping
  • 2D imaging
  • Blending
  • Lighting

Bonus points for making it look cool.

Strange glitches on older device (G1)

I tried to run a LWP created from this class on my old G1 (Cynogenmod6 and Biffmod) and it behaved very strange:

  1. after opening the LWP in the picker a black screen is rendered
  2. open LWP settings, press back -> the wallpaper is rendered correctly now
  3. set the LWP -> either the LWP crashes or it again renders a black screen
  4. not always reproducable: if it did not crash, calling up the wallpaper picker, chosing the wallpaper and pressing home may lead to an apparently working LWP
  5. it crashes on screen off

I will try another ROM on my G1 now to rule out that it was just a ROM issue (already checked 2). Will provide logcat later...

mblaster

โ‚ฌ: No differnent behaviour on enomther's ROM

Here is a logcat for playing around with the settings dialogue:
http://pastebin.com/fbBCCLZb

And here it managed to boot into a working LWP (after crashing hard enough to cause a sudden reboot ...):
http://pastebin.com/YJkhVR8s

onSharedPreferenceChanged doesn't fire

It appears onSharedPreferenceChanged does not fire, has anyone else encountered this issue?

For example, with the standard WallpaperService, onSharedPreferenceChanged executes when the wallpaper is first loaded, and also whenever any preferences are changed. With GLWallpaperService however, it refuses to call, ever.

Bitmap into gl10

Sorry for my stupid question, but I am new in opengl. I would like to try your GLWallpaperService, and make myself wallpapers. First of all, I want to add picture like a background, and add some other animation funny things on picture. But I dont know how to add static bitmap on GL10. Can you help me?

Configurable FPS

Hello!

Just an improvement idea, it would be nice to be able to configure the FPS of the GL Live Wallpaper. This way, users may set the FPS count to lower levels in order to save up CPU and battery life. Don't know how easy it is to do it though...

Cheers,
Florin.

Error loading textures from resources - easy fix!

Hello,

Firstly, thank you to everyone involved in this project - amazing work!

I had a problem getting the lesson 08 example working, kept getting an NullPointerException on loading the resource:

(...)
public void loadGLTexture(GL10 gl, Context context) {
//Get the texture from the Android resource directory
InputStream is = context.getResources().openRawResource(l.werner.livewallpaper.hypnoclockgl.R.drawable.nehe_android);
Bitmap bitmap = null;
try {
//BitmapFactory is an Android graphics utility for images
bitmap = BitmapFactory.decodeStream(is);

        } finally {
                //Always clear and close
                try {
                        is.close();
                        is = null;
                } catch (IOException e) {
                }
        }

(...)

I found that the easiest way to fix this nullpointerexception is to modify the constructor in MyWallpaperService.MyEngine to include

renderer.setContext(getApplicationContext());

Full method:
public MyEngine()
{
super();
// handle prefs, other initialization
renderer = new MyRenderer();
setRenderer(renderer);
setRenderMode(RENDERMODE_CONTINUOUSLY);
renderer.setContext(getApplicationContext());
}

Anyways, hope this helps someone!

Thanks again to Mark F Guerra and Robert Green!

LW

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.