LiveWallpaper Library

XverhelstX

Well-Known Member
Licensed User
Longtime User
Hey everyone,

Releasing a new library that took me about approx. 1 hour to make.
With this library you are able to create/specify your own (live) wallpaper from your app.
So you can:

- remove the current wallpaper
- get information about the current wallpaper
- get the desired height and width.
- Setting the x- and y offset.
- specify a new wallpaper from a bitmap or a stream
- and a little bit more functions.

and so you can create your own dynamical wallpaper.

B4X:
Dim lw As LiveWallpaper
Dim btmp As Bitmap
lw.Initialize
btmp.Initialize(File.DirAssets,"rs2.png")

lw.clearWallpaper

Msgbox(lw.WallpaperInfo,"Information")
Msgbox(lw.DesiredMinimumHeight,lw.DesiredMinimumWidth)
lw.WallpaperBitmap(btmp)

Cheers,

XverhelstX
 
Last edited:

susu

Well-Known Member
Licensed User
Longtime User
Woah, that's so great. I just don't know how to create animated/dynamic wallpaper. Can I use .gif file?
 

bluedude

Well-Known Member
Licensed User
Longtime User
You are getting better and faster :) Pretty cute!

Still struggling with some of your other libs like Audiorecorder and Advanced Camera.

Audiorecorder
Not sure how to record and store files, no sample available.

Advanced Camera
Saves images taken in portrait mode not in portrait mode.

Anyway, good stuff!
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
You are getting better and faster :) Pretty cute!

Thanks! I just want to help the B4A community and 'expand' B4A with more functions.

Audiorecorder
Not sure how to record and store files, no sample available.

Well, It did worked for me.
When you saved your file to the directory, you can use AudioRecorder.mSampleFile as the name of the latest record.
Then you can use file.copy to save it as a new name in your directory.


Advanced Camera
Saves images taken in portrait mode not in portrait mode.

Somewhere at the last posts, Erel wrote some codes for rotating your bitmap.

But don't worry, I will update both versions this weekend.

XverhelstX
 

bluedude

Well-Known Member
Licensed User
Longtime User
A good sample of the audiorecorder would help, couldn't find a nice sample on how to capture file etc.

If you could add saving the picture rotated it would be awesome!

Cheers,
 

Mikie

Member
Licensed User
Longtime User
HI,

Did get the library to work. It installed a wallpaper. How do I remove the wallpaper. I have deleted the image and the app, yet the wallpager stays.
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
With clearWallpaper.

B4X:
dim lw as LiveWallpaper
lw.clearWallpaper

Here is some sample code:

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim lw As LiveWallpaper
   Dim imgbox As ImageView
   Dim btmp As Bitmap
   btmp.Initialize(File.DirAssets,"rs2.png")

End Sub

Sub Activity_Create(FirstTime As Boolean)

lw.Initialize
imgbox.Initialize("image")

Activity.AddMenuItem("setBitmap","mnusetBitmap")
Activity.AddMenuItem("clear","mnuClear")
Activity.AddMenuItem("Info","mnuInfo")

Activity.AddView(imgbox,0,0,75,100)



End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub mnuClear_Click
lw.clearWallpaper
End Sub

Sub mnuInfo_Click
Msgbox(lw.WallpaperInfo,"info")
Msgbox(lw.DesiredMinimumHeight,lw.DesiredMinimumWidth)
End Sub

Sub mnusetBitmap_Click
lw.WallpaperBitmap(btmp)
End Sub
 

Highwinder

Active Member
Licensed User
Longtime User
you can use a timer and set a new bitmap, but I will look for a more efficient, alternative way.
However, It will be a lot easier if I could use the source code of Agraham's GifDecoder Library.

XverhelstX

XverhelstX,

First, thank yu very much for providing at least some way to change or even cycle some images as live wallpaper.

I'm wanting very much to write a live wallpaper using animated GIFs or even video clips. Can this be done? Better yet, can a full B4A app with a layout be used as a live wallpaper? Or are we stuck with static images only?

Thanks,

Highwinder
 

Highwinder

Active Member
Licensed User
Longtime User
Crickets...

"...you can use a timer and set a new bitmap, but I will look for a more efficient, alternative way.However, It will be a lot easier if I could use the source code of Agraham's GifDecoder Library. XverhelstX"

Any updates on this? Animated gifs are being used out there in Java land, so I know it's possible for some library guru to bring that capability into a library for B4A. I want to write an app along the lines of the app called "AnimGIF", which allows the use of animated GIFs as LWP.

Example:
AnimGIF

I have posted a grovelling request to Agraham (here) to provide a way for both your LiveWallpaper library and his GIFDecoder library to be able to be combined to produce Live Wallpaper that is capable of animated GIF looping.


Highwinder


:sign0163:

Highwinder
 
Last edited:

susu

Well-Known Member
Licensed User
Longtime User
XverhelstX, do you plan to implement WallpaperService into your library? Thank you in advance.
 

Highwinder

Active Member
Licensed User
Longtime User
Ditto

I too would like to ask if there is any plan to implement/include the Android wallpaper service into your wonderfully "almost there" library. There are tremendous opportunities being missed here.

In general, I'm still trying to figure out how complex things like GPS, sensors, widgets, OpenGL, voice recognition, camera, web, etc can be a part of B4A but live wallpaper continues to be so elusive. This just strikes me as being, well, backwards...

:confused:

- Highwinder
 
Last edited:

NeoTechni

Well-Known Member
Licensed User
Longtime User
The best solution I could think of, is if we could get a livewallpaper to act as exactly like a canvas. So we could actually pass it around as one, and call the same methods.

I just want to make a LW that draws some stuff
 

Gigatron

Member
Licensed User
Longtime User
Hi all

I have analyzed how to make live wallpaper. At the moment it's hard to me for making simple repeat 50 png files like gif and set the background of my phone.

With my bad english when i read google doc how to make a live wallpaper , my first impression is very hard !

It's start service engine, modify manifest file etc...
But i found something on xda developpers, this little tool repeat png picture
and set the background like GIF anims. Max 100 png file.

I have not tested , here is the link of live wallpapers maker.

Download for free on Filesonic.com
Free File Hosting, Online Storage &amp File Upload with FileServe
Hotfile.com: One click file hosting
Download Custom LiveWallpapers.2.6.zip for free on uploading.com
MEGAUPLOAD - The leading online storage and file delivery service

Live wallpaper is working since android version 2.1 update.

Good luck...
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that I started developing a LiveWallpaper library.
LiveWallpapers are indeed pretty complicated.
In general, I'm still trying to figure out how complex things like GPS, sensors, widgets, OpenGL, voice recognition, camera, web, etc can be a part of B4A but live wallpaper continues to be so elusive.
Livewallpapers are actually much more complicated than most of the above mentioned features and are probably less useful for most developers / users than most of them.

I don't know why some members expect LiveWallpapers to be simple. It involves an interaction between two separate processes in a performance critical area.
 
Top