help with app on smaller screen

dougc

Member
Licensed User
Longtime User
I have a bible sql app that I cannot seem to figure out a issue I am having with running the app on smaller devices. On my galaxy note and a friends phone the app works just fine but on my mom's htc inspire the scrollview is blank (no error and looking at the log files the view is populated from the DB just fine) but nothing shows (sorry its kinda hard to explain) attached are 2 screenshots showing the scrollview populated on my note and not populated (or showing) on the emulator (same thing happens on the htc) There are no errors loading the data, I am totally stumped and was hoping someone on here would take a look at my code and see if they can tell what I am doing wrong.

its too big to attach but I am willing to send it to anyone willing try and help me figure out my issue, I have attached 2 screen shots one of my galaxy note and the other of the emulator (same as my htc inspire)

here is the create activity

B4X:
Sub Activity_Create(firstTime As Boolean)

Dim i As Int
   
   'Activity.Title = "Bible verse lookup"
   hasNote = 0
   
   If firstTime Then 
   
        If File.Exists(File.DirDefaultExternal,"bibles.sqlite") = False Then
           File.Copy(File.DirAssets,"bibles.sqlite",File.DirDefaultExternal,"bibles.sqlite")     
           Log("Copying DB to device .....")
       Else
          Log("DB already exists on phone .....")
       End If
      
   End If

    SQL.Initialize(File.DirDefaultExternal, "bibles.sqlite", True)
   Log("DB initialized .....")
   
    Activity.LoadLayout("mainscreen")

   ScrollView1.Initialize(0)
   ScrollView2.Initialize(0)
   ScrollView3.Initialize(0)

   ScrollView1.Panel.Color = Colors.Black
   ScrollView2.Panel.Color = Colors.Black
   ScrollView3.Panel.Color = Colors.Black
   
   Table = ScrollView1.Panel
   Table.Color = LineColor

    ' left,top,width,height
   Activity.AddView(ScrollView1, 0%x, 7%y, 100%x, 34%y)
   Log("addview scrollview1 .....")
   
   Table2 = ScrollView2.Panel
   Table2.Color = LineColor
   
   Activity.AddView(ScrollView2, 1%x, 44%y, 18%x,25%y)
   Log("addview scrollview2 .....")
   
   Table3 = ScrollView3.Panel
   Table3.Color = LineColor
   
   Activity.AddView(ScrollView3, 80%x, 44%y, 18%x,25%y)
   Log("addview scrollview3 .....")
   
   ColumnWidth(0) = 1

   For i=0 To NumberOfColumns-1
      ColumnWidth_1(i) = ColumnWidth(i)-ColLineWidth
   Next
   
   SelectedRow = -1
   SelectedItems.Initialize

    whichScrollView = 1
   ReadSQLTable
   
   SelectedRow = -1
   SelectedItems.Initialize

End Sub
 

Attachments

  • notworking.png
    notworking.png
    68.6 KB · Views: 154
Last edited:

JonPM

Well-Known Member
Licensed User
Longtime User
ahh crap, I had this problem some months ago, but I can't remember how i fixed it. Do a log on each Scrollview's height and width. I think the answer is there. You'll have to do it with an emulator with a small screen

BTW this post is in the wrong forum...
 
Last edited:
Upvote 0

dougc

Member
Licensed User
Longtime User
sorry about posting to the wrong forum. I changed the height and still nothing but even if it worked, why would it work on my huge galaxy note and my friends phone (which also has a slightly bigger screen than other androids devices) but not on the smaller ones (with the height of zero on the first scrollview) just curious.

sadly it did not work when I changed the height (below is a snapshot of my log file)

whats wierd is that I can scroll down (on the far right is a small "line" that scrolls down) but nothing shows or is clickable

** Activity (main) Pause, UserClosed = true **
activity_pause called .....
** Activity (main) Create, isFirst = true **
DB already exists on phone .....
DB initialized .....


addview scrollview1 .....
scrollview1.heigth = 246
scrollview1.width = 480
addview scrollview2 .....
scrollview1.heigth = 246
scrollview1.width = 480
addview scrollview3 .....
scrollview1.heigth = 246
scrollview1.width = 480
readsqltable called ..... 1
sql cmd was : SELECT name FROM books
addrow called ..... 1


numberofrows called ..... 1
numberofrows called ..... 1
addrow called ..... 1
numberofrows called ..... 1
numberofrows called ..... 1


addrow called ..... 1
numberofrows called ..... 1
numberofrows called ..... 1
addrow called ..... 1

thanks in advance for any assistance

dougc
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Where do you set your columnWidth() values and what values do you use?
 
Upvote 0

dougc

Member
Licensed User
Longtime User
B4X:
ColumnWidth(0) = 1

in this case there is just one column and this is done right after adding the scrollviews

whats really weird is that it works fine when I run it on my galaxy note and bigger android devices, on "regular sized" sized ones the scrollviews appear blank BUT the data from sql loaded with no issues into the scrollview, it just doesn't seem to show

thanks

dougc
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Try setting your column width to something like for example, 50%x or 100%x, perhaps it will do the trick.
 
Upvote 0

dougc

Member
Licensed User
Longtime User
thanks for the suggestion sadly it did not work, this is really confusing me and any other suggestions/ideas are appreciated

dougc
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
Can you do a log on each scroll views dimensions? You posted scroll view 1's dimension three times
 
Upvote 0

dougc

Member
Licensed User
Longtime User
I would be happy to upload my code to any free file sharing host, do you know of any I can use?

below is the log

** Activity (main) Create, isFirst = true **
DB already exists on phone .....
DB initialized .....
addview scrollview1 .....
scrollview1.heigth = 246
scrollview1.width = 480
addview scrollview2 .....
scrollview2.heigth = 181
scrollview2.width = 86
addview scrollview3 .....
scrollview3.heigth = 181
scrollview3.width = 86
readsqltable called ..... 1
sql cmd was : SELECT name FROM books
addrow called ..... 1
numberofrows called ..... 1
numberofrows called ..... 1
addrow called ..... 1

thanks to everyone who is trying to help me, its really appreciated

dougc
 
Upvote 0

dougc

Member
Licensed User
Longtime User
below is the log, if you know of a file sharing service that I can use I would be happy to post the code. thanks to everyone for their help in trying to figure this out

dougc


** Activity (main) Create, isFirst = true **
DB already exists on phone .....
DB initialized .....
addview scrollview1 .....
scrollview1.heigth = 246
scrollview1.width = 480
addview scrollview2 .....
scrollview2.heigth = 181
scrollview2.width = 86
addview scrollview3 .....
scrollview3.heigth = 181
scrollview3.width = 86
readsqltable called ..... 1
sql cmd was : SELECT name FROM books
addrow called ..... 1
numberofrows called ..... 1
numberofrows called ..... 1
addrow called ..... 1
 
Upvote 0

dougc

Member
Licensed User
Longtime User
sorry I thought I replied to this but apparently not ..... below is the log

** Activity (main) Create, isFirst = true **


DB already exists on phone .....


DB initialized .....
addview scrollview1 .....
scrollview1.heigth = 246
scrollview1.width = 480
addview scrollview2 .....
scrollview1.heigth = 246
scrollview1.width = 480
addview scrollview3 .....
scrollview1.heigth = 246
scrollview1.width = 480
readsqltable called ..... 1
sql cmd was : SELECT name FROM books
addrow called ..... 1
numberofrows called ..... 1
numberofrows called ..... 1
addrow called ..... 1

I would be happy to post the code to a file sharing site, does anyone have any recommandations on which site to use?

once again thanks to everyone for trying to help

dougc
 
Upvote 0
Top