Android Tutorial Android Live Wallpaper tutorial

shashkiranr

Active Member
Licensed User
Longtime User
Erel i downloaded the Library 2 days ago. Could you kindly provide the URL for the newer version.
 

hasexxl1988

Active Member
Licensed User
Longtime User
Problems mit Multipictures

Hello,
is there a possibility that will play automatically DirAssent 10 images from the directory in a loop as LWP?

Thanks

EDIT: Okay, problem solved itself. I simply modified the example ball: D
 
Last edited:

tuhatinhvn

Active Member
Licensed User
Longtime User
With exam livewallpaperball Live Wallpaper APi>16

I want to use this function to change LW

But put extra i dont know value of android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT??

I tested below but nothing run (

B4X:
Dim i As Intent
i.Initialize("android.service.wallpaper.CHANGE_LIVE_WALLPAPER", "")
i.PutExtra("android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT", "anywheresoftware.b4a.samples.livewallpaperball/.WallpaperService")
StartActivity(i)


Anyone help me how to config value of android.service.wallpaper.extra
 

tuhatinhvn

Active Member
Licensed User
Longtime User
B4X:
Sub Activity_Create(FirstTime As Boolean)
    ToastMessageShow("Please go to the home screen and add the Live Wallpaper.", True)
Dim Intent1 As Intent
Intent1.Initialize("android.service.wallpaper.CHANGE_LIVE_WALLPAPER","")
Intent1.PutExtra("android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT","anywheresoftware.b4a.samples.livewallpaperball/anywheresoftware.b4a.objects.WallpaperInternalService")

StartActivity(Intent1)

Activity.Finish
End Sub

But dont work ((

my device is 4.1.2 JB
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here:
B4X:
Dim Intent1 As Intent
   Intent1.Initialize("android.service.wallpaper.CHANGE_LIVE_WALLPAPER","")
   Dim cn As JavaObject
   cn.InitializeNewInstance("android.content.ComponentName", _
     Array As Object("anywheresoftware.b4a.samples.livewallpaperball", "anywheresoftware.b4a.objects.WallpaperInternalService"))
   Intent1.PutExtra("android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT",cn)
   StartActivity(Intent1)
   Activity.Finish

http://www.b4x.com/search?query=JavaObject
 

shashkiranr

Active Member
Licensed User
Longtime User
Hi Erel,

I wanted a settings button in the live wallpaper selection. I went through the posts in the Page 1 and got it working. After i updated my phone Note 2 to 4.3 if i click on the settings button it gives a toast message " Application is not installed on phone" . I dint change anything.

I have the Live Wallpaper installed and it is working fine in my phone.

Regards,
SK
 

shashkiranr

Active Member
Licensed User
Longtime User
Yes Erel i tried Multiple times but it is not working. The Livewallpaper works fine but settings is not opening. I think it is a bug in Samsung 4.3 update since many issues are coming up for this but i am not sure.
 

shashkiranr

Active Member
Licensed User
Longtime User
Hi Erel,

I found this difference since i am using LibGDX Wallpaper template, the manifest Editor XML is different as mentioned in LibGDX tutorial . The android name is different.

B4X:
AddApplicationText(
<!-- ******** Add the internal service declaration - you can change android:label  ******* -->
<service
        android:label="Time"
        android:name="anywheresoftware.b4a.libgdx.lgLiveWallpaper"
        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/wallpaper" />
</service>
<!-- End of internal service declaration -->
)

Am i doing something wrong or is the problem exists in the declaration itself??

Regards,
SK
 

holdemadvantage

Active Member
Licensed User
Longtime User
Hi all, my problem now is to add a settings activity to my app.

I've read the solution and add this line into wallpaper.xml file

B4X:
<?xml version="1.0" encoding="utf-8"?><wallpaper xmlns:android="http://schemas.android.com/apk/res/android"  android:thumbnail="@drawable/icon"  android:settingsActivity="anywheresoftware.b4a.samples.livewallpaperimage.main2"/>

mian 2 is an activity that load a layout
When i open LWP in my galaxy note 3 and click on livewallpaper image icon i see a settings button, clicking on it i receive a warning message, something like "the software select live wallpaer has been stopped"
I upload the zip file http://www.omahabrain.com/b4a/testlwi.zip

Thanks in advance for your help
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…