Android Question Emulator Failure with an explanation

Shelby

Active Member
Licensed User
My App Code:
    #ApplicationLabel: AreaCalc
    #VersionCode:24
    #VersionName:  
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: True
    #IncludeTitle: True
    #BridgeLogger: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules. Public by default.SSS
    Public TotalArea As Double
    Type Rooms(Width As Double, Length As Double, Area As Double)
    Public lstRooms As List
    Public RoomIndex = 1 As Int
End Sub

Sub Globals
    'Variables always Private in this sub SSS
 
    Private lblRoom, lblFind, lblArea, lblTotalArea, lblRoomNumber As Label
    Private edtLen, edtWidth As EditText
    Private btnCalc As Button
    'Private pnlBitmap As Panel
     
    Private ltvRooms As ListView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Room1_")
 
    lstRooms.Initialize
    ltvRooms.SingleLineLayout.Label.TextSize = 18
    ltvRooms.SingleLineLayout.ItemHeight = 30dip
 
    NewRoom
 
 

'    pnlBitmap.Initialize ("")
'    Activity.AddView (pnlBitmap, 0%x, 270dip, 72%y, 190dip)
'    Private bdwBitmap As BitmapDrawable
'    bdwBitmap.Initialize(LoadBitmap(File.DirAssets, "Framing.jpg"))
'    bdwBitmap.Gravity = Gravity.FILL
'    pnlBitmap.Background = bdwBitmap
 
    Log($"Today's Date  $date{DateTime.Now}"$)
    'Above is  smart string (using $ symbols)
 
    'Not smart
    Log("Also today is " & DateUtils.GetDayOfWeekName(DateTime.Now))
    '***
 
 
    'Below is smart string time
    Log ($"The Time $Time{DateTime.Now}"$)
         
End Sub

Sub Activity_Resume
 
End Sub

Sub Activity_Pause (UserClosed As Boolean)
 
End Sub

Private Sub NewRoom
    Private Room As Rooms
    Room.Area = 0
    Room.Length = 0
    Room.Width = 0
    lstRooms.Add(Room)
    ltvRooms.AddSingleLine("Room #" & RoomIndex & "  W = " & Room.Width  & "   L = " & Room.Length& " Area = " & NumberFormat(Room.Area, 1, 2))
    RoomIndex = lstRooms.Size
 
    lblArea.Text = " Will Display Here"
End Sub

Sub btnCalc_Click
    Private Room As Rooms
    Room.Width = edtWidth.Text
    Room.Length = edtLen.Text
    Room.Area = Room.Width * Room.Length
    TotalArea = TotalArea + Room.Area
    lblArea.Text = NumberFormat(Room.Area, 1, 0)  & "  Square Feet"
    lstRooms.Set(RoomIndex - 1, Room)
    UpdateRoomList
    CalculateTotalArea
    lblTotalArea.Text = NumberFormat(TotalArea, 1, 2) & "   s.f."
End Sub

Private Sub btnNewRoom_Click
    NewRoom
    UpdateNewRoomScreen
    UpdateRoomList
End Sub

Sub ltvRooms_ItemClick (Position As Int, Value As Object)
    RoomIndex = Position  + 1
    UpdateRoomScreen
End Sub

Private Sub UpdateRoomScreen
    Private Room As Rooms
 
    Room = lstRooms.Get(RoomIndex - 1)
    lblRoomNumber.Text = RoomIndex
    If Room.Width = 0 Then
        edtWidth.Text = ""
    Else
        edtWidth.Text = Room.Width
    End If
    If Room.Length = 0 Then
        edtLen.Text = ""
    Else
        edtLen.Text = Room.Length
    End If
    lblArea.Text =  NumberFormat(Room.Area, 1, 0) & " Square Feet"
    lblTotalArea.Text = NumberFormat(TotalArea, 1, 2)
End Sub

Private Sub UpdateNewRoomScreen
    lblRoomNumber.Text = RoomIndex
    edtWidth.Text = ""
    edtLen.Text = ""
End Sub

Private Sub UpdateRoomList
    Private i As Int
 
    ltvRooms.Clear
    For i = 0 To lstRooms.Size - 1
        Private Room As Rooms
        Room = lstRooms.Get(i)
        ltvRooms.AddSingleLine("Room #" & (i + 1) & "  W = " & Room.Width  & "   L = " & Room.Length & " Area = " & NumberFormat(Room.Area, 1, 2))
    Next
End Sub

Private Sub CalculateTotalArea
    Private i As Int
 
    TotalArea = 0
    For i = 0 To lstRooms.Size - 1
        Private Room As Rooms
        Room = lstRooms.Get(i)
        TotalArea = TotalArea + Room.Area
     
        Log (TotalArea)
     
    Next
End Sub
Since I published my app a couple of months ago, I have had no problem with my continued work preparing for my next project's publishing. A week or two ago I decided to get the latest sdk version for my continued feeling of competence at using the IDE platform, etc. Immediately I had problems with displaying my emulator correctly and I started searching the forum for old questions about emulator malfunctions and so on. I have reinstalled the IDE, the sdk and its manager , the Haxm file and I of course made sure the paths are proper to the best of my ability.
Here's the problem with the emulator, using my published app:

It should display like this: App_shot2c.png
but there is no text, and some buttons and labels don't show.



It displays like this: My App failure_cropped.png

Can some generous individual out there help me by running my app to see if it will display normally? Here's my zipped app. Thanks people!
Well, I can't seem to send the zip so the code is displayed.
P.S. The app displays properly on my Samsung S9.
 

Attachments

Last edited:

Sagenut

Well-Known Member
Licensed User
You could try to delete and create again the emulator.
After deleting it from AVD Manager take care even to delete manually the remaining of the folder where it was contained to be sure to create a completely clean new one.
 

Shelby

Active Member
Licensed User
So I can delete the emulator without deleting the AVD Manager. Let me look to see what the emulator's folder is called. Or are you suggesting that I bring up the AVD Manager and delete from there?
Thanks
Ah...I just found: https://www.b4x.com/android/forum/threads/solved-android-emulator-factory-reset.104643/

Another question is: Which of the 10 platforms should I use when I go to create an AVD ? I'll try each one after the second which worked before but with no improvement in the emulator display.

Also, when I try to build configurations the Configuration is default (no other option). Configuration Name also default. Are those two correct? Should I create new? Nope that didn't help either.
 
Last edited:

Sagenut

Well-Known Member
Licensed User
My suggestion is:
- Delete the problematic emulator from AVD Manager, remember the name
- Go to the SDK Folder, enter the B4AEMULATOR Folder and delete the folder with the name of the AVD that you deleted from the AVD Manager
- Create a New emulator from AVD Manager
If you already tried this with no success.......... I am sorry.
For Android 10 AVD I use this system image:
GOOGLE PLAY INTEL X86 ATOM_64 SYSTEM IMAGE (ANDROID 29)
You can upload your ZIP to your Google Drive (or similar service) and share the link here if it's size is too much big for the forum upload.
 

Shelby

Active Member
Licensed User
Erel,
With this new platform, it won't recognize my zip file when I use attach files.
I see no icon for entering zip file. I also tried copy and paste the zip file with no success. Maybe email to your support address. Yes, I just emailed it to support.
Thanks
 
Last edited:

Shelby

Active Member
Licensed User
Thanks Sage,
I'll try the suggestions. Ten minutes later: Unfortunately no improvement. The emulator pops up OK but with same lack of text, buttons, edtText and labels, etc.
B4A bridge still working properly on Samsung S9.
 
Last edited:

Sagenut

Well-Known Member
Licensed User
Another user on the Italian Forum got the same problem and I think it's still unsolved.
 
Top