I am trying to develop an Android live wallpaper using OpenGL
wallpaper service , I am able to create live wallpaper as in this example by Mark F Guerra But I want to add some sprite animation to my wallpaper.
I have already created a OpenGL ES
sprite animation in another project. I just want to recreate my animation in the live wallpaper project.
But in my live wallpaper project i am not able to get Context
and load my images from assets or resources
Any suggestions or sample codes or link about loading resourses or asset files while using glwallpaper
service will be very helpfull.
All suggestions and/or sample codes are welcome.
We can use the context as shown below..
in wallpaper service class:
-------------------
renderer = new GlRenderer(this);
in renderer class:
----------------
private Context context;
public GlRenderer(Context context) {
this.context = context;
Instead of this
we can use getAssets()
or getResources()
as parameter to renderer .
On using getAssets()
you can get the files saved in assets folder and by using getResources()
you can get the files placed inside the resources folder in your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With