Android Question After loading the layouts and images in app I get Downsampling of image in logs and app crashes!

shank_devdroid

Member
Licensed User
Longtime User
Dear members,

I have loaded all layout and images with relevant panels to it. I am trying to run in debug(rapid) and release mode, the log shows downsampling of images- 2, 4, 16 and 32 and then the app crashes in debug(rapid) and in release mode I get a blank screen.

Please suggest what can be the error I am posting the code below-

B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Room_Change")
    Activity.LoadLayout("Main")
    Socket1.Initialize("Socket1")
    Socket1.Connect("192.168.1.125",8081,2000)
    pnlHome.LoadLayout("Home")
    pnlLighting.LoadLayout("Lighting")
    pnlTempControl.LoadLayout("Temperature_Control")
    pnlEntertainment.LoadLayout("Entertainment")
    pnlTelevision.LoadLayout("Television")
    pnlSTB.LoadLayout("STB")
    pnlSecurity.LoadLayout("Security")
    pnlDVD.LoadLayout("DVD")
    pnlChnlList.LoadLayout("chnllist")
    pnlSurveillance.LoadLayout("Surveillance")
    pnlSecurity_Control.LoadLayout("Security_Control")
   
    pnlChnlList.LoadLayout("ChnlList")
    pnlEngEnt.LoadLayout("EngEnt")
    pnlEngNews.LoadLayout("EngNews")
    pnlEngMovies.LoadLayout("EngMovies")
    pnlHinEnt.LoadLayout("HinEnt")
    pnlHinNews.LoadLayout("HinNews")
    pnlHinMovies.LoadLayout("HinMovies")
    pnlHD.LoadLayout("HD")
    pnlDoordarshan.LoadLayout("Doordarshan")
    pnlKannada.LoadLayout("Kanada")
    pnlKids.LoadLayout("Kids")
    pnlKnowledge.LoadLayout("Knowledge")
    pnlMalayalam.LoadLayout("Malyalam")
    pnlMarathi.LoadLayout("Marathi")
    pnlMusic.LoadLayout("Music")
    pnlActive.LoadLayout("Active")
    pnlPunjabi.LoadLayout("Punjabi")
    pnlOryBen.LoadLayout("OryBen")
    pnlSports.LoadLayout("Sports")
    pnlTamil.LoadLayout("Tamil")
    pnlTelugu.LoadLayout("Telugu")
   
    pnlMain.Visible=True   
    ImageView2.Visible=True
    pnlHome.Visible=False
    pnlLighting.Visible=False
    pnlTempControl.Visible=False
    pnlSTB.Visible=False
    pnlEntertainment.Visible=False
    pnlTelevision.Visible=False
    pnlSecurity.Visible=False
    pnlDVD.Visible=False
    pnlChnlList.Visible=False
    pnlSurveillance.Visible=False
    pnlSecurity_Control.Visible=False
   
    pnlChnlList.Visible = False
    pnlEngEnt.Visible = False
    pnlEngNews.Visible = False
    pnlEngMovies.Visible = False
    pnlHinEnt.Visible = False
    pnlHinNews.Visible = False
    pnlHinMovies.Visible = False
    pnlDoordarshan.Visible = False
    pnlKannada.Visible = False
    pnlKids.Visible = False
    pnlKnowledge.Visible = False
    pnlHD.Visible = False
    pnlMalayalam.Visible = False
    pnlMarathi.Visible = False
    pnlMusic.Visible = False
    pnlActive.Visible = False
    pnlPunjabi.Visible = False
    pnlOryBen.Visible = False
    pnlSports.Visible = False
    pnlTamil.Visible = False
    pnlTelugu.Visible = False

End Sub
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that the file size is not important. Only the image dimensions.

How many images are you loading? Are you loading the same image multiple times?

Why are you loading so many layout files when the app starts?

(Not related but your socket is not initialized in the correct place. You should only initialize it when FirstTime is true or better in Starter Service).
 
Upvote 0
Top