Bug? The application was stopped

aviario

Active Member
Licensed User
Longtime User
Hi, my app I get the message that the application was stopped, I checked all code as in the forum I found that might be lost by the sub to call one below the other, so when I changed from a sub is vat to another and sige giving me the error, any suggestions

thanks
 

aviario

Active Member
Licensed User
Longtime User
All errors are logged, check the UNFILTERED logs (on the IDE, uncheck the FILTER checkbox).

Hello, could you tell me where I can see the errors without having the box checked at FILTER?

thanks
 

aviario

Active Member
Licensed User
Longtime User
He says all errors are recorded, unfiltered records check "and uncheck the checkbox FILTER All errors are logged, which keeps in a folder?
 

aviario

Active Member
Licensed User
Longtime User
Hi, the error is showing me the following

** Activity (menucobrosygastos) Resume **
Displayed flm.b4a.floatwindemo/.menucobrosygastos: +433ms
GC_FOR_ALLOC freed 725K, 16% free 10984K/12999K, paused 45ms
** Activity (menucobrosygastos) Pause, UserClosed = true **
START {flg=0x20000 cmp=flm.b4a.floatwindemo/.main} from pid 5418
** Activity (main) Create, isFirst = false **
setLightsOn(true)
false false
false false
GC_FOR_ALLOC freed 3905K, 17% free 39984K/48071K, paused 54ms
Forcing collection of SoftReferences for 3942416-byte allocation
GC_BEFORE_OOM freed 13K, 17% free 39971K/48071K, paused 62ms
Out of memory on a 3942416-byte allocation.
"main" prio=5 tid=1 RUNNABLE
| group="main" sCount=0 dsCount=0 obj=0x40a22460 self=0x1feb888
| sysTid=5418 nice=0 sched=0/0 cgrp=default handle=1074623624
| schedstat=( 0 0 0 ) utm=1300 stm=256 core=0
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
at android.graphics.Bitmap.createBitmap(Bitmap.java:585)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:76)
at flm.b4a.floatwindemo.clsfloatingwindow._setborder(clsfloatingwindow.java:2646)
at flm.b4a.floatwindemo.clsfloatingwindow._initialize(clsfloatingwindow.java:2128)
at flm.b4a.floatwindemo.main._configura_pantalla(main.java:1235)
at flm.b4a.floatwindemo.main._activity_create(main.java:885)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at flm.b4a.floatwindemo.main.afterFirstLayout(main.java:98)
at flm.b4a.floatwindemo.main.access$100(main.java:16)
at flm.b4a.floatwindemo.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4437)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x40a211f8)
clsfloatingwindow_setborder (B4A line: 27)
C.Initialize(wFrame)
java.lang.OutOfMemoryError
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
at android.graphics.Bitmap.createBitmap(Bitmap.java:585)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:76)
at flm.b4a.floatwindemo.clsfloatingwindow._setborder(clsfloatingwindow.java:2646)
at flm.b4a.floatwindemo.menucobrosygastos._configura_pantalla(menucobrosygastos.java:576)
at flm.b4a.floatwindemo.menucobrosygastos._activity_create(menucobrosygastos.java:353)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at flm.b4a.floatwindemo.menucobrosygastos.afterFirstLayout(menucobrosygastos.java:98)
at flm.b4a.floatwindemo.menucobrosygastos.access$100(menucobrosygastos.java:16)
at flm.b4a.floatwindemo.menucobrosygastos$WaitForLayout.run(menucobrosygastos.java:76)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4437)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
FATAL EXCEPTION: main
java.lang.OutOfMemoryError
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
at android.graphics.Bitmap.createBitmap(Bitmap.java:585)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:76)
at flm.b4a.floatwindemo.clsfloatingwindow._setborder(clsfloatingwindow.java:2646)
at flm.b4a.floatwindemo.menucobrosygastos._configura_pantalla(menucobrosygastos.java:576)
at flm.b4a.floatwindemo.menucobrosygastos._activity_create(menucobrosygastos.java:353)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at flm.b4a.floatwindemo.menucobrosygastos.afterFirstLayout(menucobrosygastos.java:98)
at flm.b4a.floatwindemo.menucobrosygastos.access$100(menucobrosygastos.java:16)
at flm.b4a.floatwindemo.menucobrosygastos$WaitForLayout.run(menucobrosygastos.java:76)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4437)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
Force finishing activity flm.b4a.floatwindemo/.menucobrosygastos
GC_FOR_ALLOC freed 987K, 15% free 10729K/12551K, paused 45ms
Force finishing activity flm.b4a.floatwindemo/.main
Activity pause timeout for ActivityRecord{414bd2c0 flm.b4a.floatwindemo/.menucobrosygastos}
No longer want com.android.packageinstaller (pid 2788): hidden #16
ACTION_BATTERY_CHANGED pluggedType: 0
**** Motion ****
ACTION_BATTERY_CHANGED pluggedType: 0
ACTION_BATTERY_CHANGED pluggedType: 0
Activity destroy timeout for ActivityRecord{41356e20 flm.b4a.floatwindemo/.main}
Activity destroy timeout for ActivityRecord{414bd2c0 flm.b4a.floatwindemo/.menucobrosygastos}
ACTION_BATTERY_CHANGED pluggedType: 0

----------------------------------------------------------------------------------------------------------
Public Sub SetBorder(Color As Int, Width As Int)
Dim C As Canvas, wRect As Rect
C.Initialize(wFrame)
C.DrawColor(Colors.Transparent)
wRect.Initialize(0 + (Width/2), 0 + (Width/2), getWidth - (Width/2), getHeight - (Width/2))
C.DrawRect(wRect, Color, False, Width)
End Sub


Gracias
 

aviario

Active Member
Licensed User
Longtime User
First of all sorry for my bad english
Thanks for reply. Our code is to big to post it. Here we send you a example.
We are testing our application on a table and 2 phones. The tablet we always run out of memory and when we move from one screen to another passes through activity_create while phones only does the first time you enter the screen.

bitmaps on buttons we put them through the designer. Other icons we loaded with LoadBitmap remove them to try.

Thanks
 

Attachments

  • pueba.zip
    44.3 KB · Views: 195

eps

Expert
Licensed User
Longtime User
Ideally you should use BitmapSample and ensure that the bitmaps themselves aren't large in terms of pixels, as these take up a lot of memory, when used. 4 bytes per pixel or something along those lines.
 

aviario

Active Member
Licensed User
Longtime User
Thanks for reply.

We did the following test:
We tried loading the bitmaps with LoadBitmapSample and tried without bitmaps. The result was it consumed the same memory as the examples we send.

coniconos1.txt file is the result of the bitmaps loaded from the designer

coniconos.txt file is the result with LoadBitmapsSample
siniconos.txt file is the result of not putting any icons

We do not know why the memory consumption so similar.

We hope we help us

Thanks
 

Attachments

  • coniconos.txt
    4.2 KB · Views: 285
  • coniconos1.txt
    3.1 KB · Views: 200
  • siniconos.txt
    3.3 KB · Views: 192

aviario

Active Member
Licensed User
Longtime User
Hi Erel, first thank you for the interest in the problem that I have, I attached the test project code so that you look

thanks
 

Attachments

  • prueba.zip
    27.7 KB · Views: 218

aviario

Active Member
Licensed User
Longtime User
Erel thanks to reply.

We don't undestand. We haven't got any code to canvas. The diferents screens of our aplications are create with designer.
The example tha we posted prueba.zip is the way how we create the screens.

The bitmaps are loaded in buttons. And buttons, actionbars, labels etc are create in activity.

Can you explain the use of canvas?

thanks again
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The canvas is created here:
This is where the OOM error happens.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…