Livewallpaper hangs in the wallpaper selector

NeoTechni

Well-Known Member
Licensed User
Longtime User
It just shows "loading live wallpaper..."

I put log texts in, Service_Create runs fine,

I am initializing the lwmanager
B4X:
lwm.Initialize("lwm", False)

LWM_OffsetChanged, LWM_SizeChanged, LWM_Tick dont get called

I even tried lwm.StartTicking(1000)
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
I only thought of reading what I send with the log command
Where are the logs?
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
ah, I uncheck filter

set_light_buttons: brightness=0


GC_EXPLICIT freed 17K, 53% free 2577K/5379K, external 1685K/2133K, paused 136ms
Starting: Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview (has extras) } from pid 22883
Start proc com.omnicorp.lcarui.test for service com.omnicorp.lcarui.test/.wallpaperservice: pid=22891 uid=10151 gids={3003, 1015}
No configuration file: /system/etc/customization/settings/com/sonyericsson/textinput/uxp/custom_settings.xml
No configuration file: /system/etc/customization/settings/com/sonyericsson/textinput/uxp/custom_settings.xml
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x2aac8560)
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to create service com.omnicorp.lcarui.test.wallpaperservice: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:1976)
at android.app.ActivityThread.access$2500(ActivityThread.java:121)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:997)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at com.omnicorp.lcarui.test.main.initializeProcessGlobals(main.java:1911)
at com.omnicorp.lcarui.test.wallpaperservice.onCreate(wallpaperservice.java:30)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:1966)
... 10 more
Caused by: java.lang.NullPointerException
at com.omnicorp.lcarui.test.main._process_globals(main.java:4723)
at com.omnicorp.lcarui.test.main.initializeProcessGlobals(main.java:1897)
... 12 more
Displayed com.android.wallpaper.livepicker/.LiveWallpaperPreview: +314ms

Could it be the manifest setting?
AddServiceText(WallpaperService,
android:label="LCARS UI LWP"
android:name="anywheresoftware.b4a.objects.WallpaperInternalService"
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" />
)
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
*whistles*

B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules. as 
   Type Sensor(Device As PhoneSensors, Name As String, SensorType As Int, ThreeValues As Boolean, IsPresent As Boolean,X As Int, Y As Int, Z As Int,  MaxValue As Float )
   Dim SensorList As List, SensorEnabled As Boolean , Pi As Double,SelectedSetting As Double,LastURL As String ,LCARSpeed As Int:LCARSpeed=10
   Dim A As AudioRecorder, myWifi As ABWifi,waitingforwifi As Boolean,turnedwifion As Boolean ,CurrSensor As Int,GPSitems As Int,StarshipID As String ,SettingIndex As Int  'virtual sensors
   Dim serverIP As IPaddress :serverIP=API.ParseIP("192.168.0.1:8080"):serverIP.SelectedOctet=1
   
   Pi = 3.14159265358979
   SensorEnabled=False'if = true then randomizes sensor data
   
   Dim Hotspots As List ,WifiIsOn As Boolean,LoadingWifi As Boolean,WifiSearching As Boolean,WifiSearchCycles As Int,WifiSuccess As Int  ,TechnisMAC As String ,DOSITEM As Int
   Type Hotspot(Name As String,MAC As String, Checked As Boolean , isCurrent As Boolean)' ,  Data As ABWifiInfo)
   
   Dim Settings As Map, MicEnabled As Boolean ,micrunning As Boolean ,BackToQuit As Boolean ,cTimer As Int ,TimerCount As Int,needsreloading As Boolean ,AprilFools As Boolean 
   Dim CurrentSection As Int,UMRsection As Int'-3=stardate, -2=settings, -1=mode select
   
    Dim Server As ServerSocket,SelectedSection As Int 
   Dim Socket1 As Socket,AStreams As AsyncStreams, GPS1 As GPS, GPSenabled As Boolean ,SocketConnected As Boolean ,Keytones As Boolean , UMRURL As String ,UMRDOWNLOADING As Boolean ,HasShown As Boolean 
   Dim MagicURL As String, MyURL As String , VR As VoiceRecognition,VRisInitialized As Boolean,IsVoiceCommand As Boolean   ', TTS1 As TTS

   MyURL="http://sites.google.com/site/neotechni/Home/"
   MagicURL=MyURL & "lcars/magic"
   UMRURL=MyURL & "programs/UltraMobileRemote.zip?attredirects=0&d=1"
   
   Dim BorgColor As Int, BorgPic As Int, BorgFont As Typeface, BorgSound As Int, BorgMode As Int, BorgFontSize As Int,needsborgswap As Boolean ,BorgElement As Int 'rgb 0,120,0
   Dim OkudaMode As Int ,MouseStage As Int ,DefaultPort As Int,Screenshots As Boolean ,MultiCore As Boolean ,SkipIntro As Boolean  ,UID As String  ,Starshipname As String ,DOS As Int
   Dim Password As String , CustomLevel As Int ,CMD() As String, RepeatMode As Boolean ,RAWmode As Boolean , LastVersion As String , WarpCoreRumble As Boolean 
   
   Dim GameMode As Boolean , Buttons(15) As Byte , ButtonsChanged As Boolean ,CurrentSensor As Int,PlusID As String ,PageToken As String ,WebMode As Int,MaxSearchCycles As Int ,CurrentSettingsSection As Int 
   DefaultPort= 8080
   CurrentSensor=-1
   SelectedSection=-1
   PlusID="113296486298236709829"
   MaxSearchCycles=50
   CustomLevel=5
   
   Dim AR As AudioRecord, BufferSize As Int, SampleRate As Int, ChannelConfig As Int, AudioFormat As Int, AudioSource As Int, NoChnls,BitsPerSample,DataSize As Int,  StartTime As Long
End Sub

I'm trying to check that line, but I've recompiled many times since so I'm trying to get a fresh crash log, but now it won't give me one.
But of course, it still hangs.
 
Last edited:

NeoTechni

Well-Known Member
Licensed User
Longtime User
I moved all variable settings to Activity_Create first time
Still hangs, unfiltered log:

set_light_buttons: brightness=0
Starting: Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview (has extras) } from pid 3649
No configuration file: /system/etc/customization/settings/com/sonyericsson/textinput/uxp/custom_settings.xml
** Service (wallpaperservice) Create **
CREATING = Start of WallpaperService.Service_Create
No configuration file: /system/etc/customization/settings/com/sonyericsson/textinput/uxp/custom_settings.xml
GC_CONCURRENT freed 1724K, 58% free 3756K/8839K, external 7535K/9410K, paused 2ms+20ms
Displayed com.android.wallpaper.livepicker/.LiveWallpaperPreview: +368ms
SIZED = End of WallpaperService.Service_Create
[313906.990844] max17040 0-0036: batt: 84%, 4092 mV
orientation: vertical
orientation: horizontal
GC_EXPLICIT freed 51K, 52% free 2605K/5379K, external 1685K/2133K, paused 86ms
GC_EXPLICIT freed 90K, 53% free 2592K/5447K, external 1685K/2133K, paused 84ms
GC_EXPLICIT freed 665K, 55% free 8211K/18055K, external 4540K/5655K, paused 88ms
GC_EXPLICIT freed 12K, 53% free 2572K/5379K, external 1685K/2133K, paused 93ms
GC_EXPLICIT freed 476K, 53% free 2827K/5959K, external 1785K/2133K, paused 95ms
GC_EXPLICIT freed 213K, 53% free 2601K/5447K, external 1685K/2133K, paused 91ms
GC_EXPLICIT freed 142K, 51% free 3555K/7175K, external 1685K/2133K, paused 122ms

This popped up a bit later, which implies it was from the program itself rather than the livewallpaper service

Leak found
java.lang.IllegalStateException: AndroidHttpClient created and never closed
at android.net.http.AndroidHttpClient.<init>(AndroidHttpClient.java:156)
at android.net.http.AndroidHttpClient.newInstance(AndroidHttpClient.java:142)
at wi.a(DefaultHttpIssuer.java:48)
at wi.initialValue(DefaultHttpIssuer.java:45)
at java.lang.ThreadLocal$Values.getAfterMiss(ThreadLocal.java:466)
at java.lang.ThreadLocal.get(ThreadLocal.java:71)
at wh.a(DefaultHttpIssuer.java:78)
at vV.b(DefaultAuthenticatedHttpIssuer.java:151)
at vV.a(DefaultAuthenticatedHttpIssuer.java:107)
at vV.a(DefaultAuthenticatedHttpIssuer.java:92)
at BR.a(AccountMetadataUpdater.java:87)
at CG.a(SyncManager.java:331)
at CG.a(SyncManager.java:215)
at Cd.a(DocsSyncAdapter.java:176)
at Cd.a(DocsSyncAdapter.java:52)
at Ce.c(DocsSyncAdapter.java:128)
at cc.run(RoboThread.java:37)
GC_EXPLICIT freed 258K, 51% free 2869K/5767K, external 1685K/2133K, paused 73ms
[313966.990783] max17040 0-0036: batt: 84%, 4092 mV
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
I keep trying but all I get from the logs is:

GC_CONCURRENT freed 10K, 52% free 2622K/5379K, external 3759K/4368K, paused 2ms+12ms


No configuration file: /system/etc/customization/settings/com/sonyericsson/textinput/uxp/custom_settings.xml


Displayed com.android.wallpaper.livepicker/.LiveWallpaperListActivity: +1s198ms
Starting: Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview (has extras) } from pid 4952
No configuration file: /system/etc/customization/settings/com/sonyericsson/textinput/uxp/custom_settings.xml

** Service (wallpaperservice) Create **
CREATING
No configuration file: /system/etc/customization/settings/com/sonyericsson/textinput/uxp/custom_settings.xml
GC_CONCURRENT freed 474K, 60% free 2957K/7367K, external 5557K/6940K, paused 2ms+16ms
Displayed com.android.wallpaper.livepicker/.LiveWallpaperPreview: +368ms
SIZED
[316246.990692] max17040 0-0036: batt: 96%, 4185 mV
GC_EXPLICIT freed 83K, 53% free 2572K/5379K, external 1685K/2133K, paused 94ms
set_light_buttons: brightness=0
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Would it be the manifest code?

I copy/pasted it into a working livewallpaper and now it hangs too

AddServiceText(WallpaperService,
android:label="LCARS LWP TEST" android:name="anywheresoftware.b4a.objects.WallpaperInternalService"
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" />
)
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
I removed the manifest code and manually edited the file myself, and now I get a crash log of:

Starting: Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview (has extras) } from pid 7132
Start proc com.omnicorp.lcarui.test for service com.omnicorp.lcarui.test/anywheresoftware.b4a.objects.WallpaperInternalService: pid=7174 uid=10151 gids={3003, 1015}
Unable to start service Intent { cmp=com.omnicorp.lcarui.test/.wallpaperservice }: not found Which is weird cause that IS what I named the service
surfacecreated
Displayed com.android.wallpaper.livepicker/.LiveWallpaperPreview: +265ms
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x2aac8560)
FATAL EXCEPTION: main
java.lang.NullPointerException
at android.app.WallpaperManager.getInstance(WallpaperManager.java:349)
at anywheresoftware.b4a.objects.WallpaperInternalService$B4AEngine.onSurfaceChanged(WallpaperInternalService.java:223)
at android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:594)
at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:658)
at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:882)
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:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
at dalvik.system.NativeStart.main(Native Method)
GC_CONCURRENT freed 101K, 52% free 2607K/5379K, external 3286K/4104K, paused 2ms+8ms
 
Last edited:

NeoTechni

Well-Known Member
Licensed User
Longtime User
Except I have it working it a separate program using identical manifest modifications. The new crash logs say the livewallpaper object is crashing
What could just being in my app cause it to behave differently?

Also, please still post a guide how to use the manifest editor for the livewallpaper object. Your guide only says how to do it manually.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
My problem is the smaller project doesnt encounter the issue. Once I add the same code to my larger one, the LWP library crashes
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
eeeeeeeeeee

I updated to B4A 2, used the manifest code you posted, and it no longer hangs! This makes what I want to do a LOT easier!

I was going to use 2 APKs, and update the LWP myself from my website. Now I don't have to!
 
Top