SQL works on phone but not on Galaxy Tab 10.2

jddiven

Member
Licensed User
Longtime User
I've been trying to revamp the SQLExample tutorial program to work with my data and on both my phone and Samsung Galaxy Tab 10. What I've got so far works fine on the phone but when I run it on the Tab it works in the orientation that I start it, but when I switch orientation I get the message "an error has occurred in sub:main_activity_create(java line:395) android.database.sqlit.SQLiteDiskIOException: disk I/O error Continue?" If I continue the scroll bars will appear on each orientation shift but I get the same error message each time I switch orientation.

I'm baffled! Any suggestions would be appreciated.

Doug
 

Attachments

  • HttpUtilsService.bas
    3 KB · Views: 196
  • HttpUtils.bas
    3.7 KB · Views: 168
  • DownloadService.bas
    2.4 KB · Views: 176

jddiven

Member
Licensed User
Longtime User
I've been trying to revamp the SQLExample tutorial program to work with my data and on both my phone and Samsung Galaxy Tab 10. What I've got so far works fine on the phone but when I run it on the Tab it works in the orientation that I start it, but when I switch orientation I get the message "an error has occurred in sub:main_activity_create(java line:395) android.database.sqlit.SQLiteDiskIOException: disk I/O error Continue?" If I continue the scroll bars will appear on each orientation shift but I get the same error message each time I switch orientation.

I'm baffled! Any suggestions would be appreciated.

Doug

Sorry but I left this file off of the first post.
 
Upvote 0

jddiven

Member
Licensed User
Longtime User
Sorry

Sorry,

I know better. Guess I was more frazzled than I thought.

I will post that file tomorrow. For what it's worth, however, I've attached an earlier example that is not too far removed from the original SQLExample that exhibits the same behavior -- it's just not as pretty!

Thanks for your help!

Doug
 

Attachments

  • SQLExample.zip
    17.8 KB · Views: 188
Upvote 0

jddiven

Member
Licensed User
Longtime User
Three's a charm

Sorry again.

This one is the original example without any changes whatsoever. It's database is persons.db and is in the file folder.

It still has the same problems with the Galaxy Tab.

I'm sorry for the false starts and appreciate your patience.

Thanks
 

Attachments

  • OriginalExample.zip
    14.5 KB · Views: 177
Upvote 0

NJDude

Expert
Licensed User
Longtime User
You should move these out of Activity_Resume
B4X:
Dim curs As Cursor
curs = SQL1.ExecQuery("SELECT name FROM sqlite_master WHERE Type='table'")
Log(curs.RowCount)
curs.Position = 0
Log(curs.GetString("name"))
DBTableName = curs.GetString("name")
' reads the database
SQLTableRead
 
Upvote 0

jddiven

Member
Licensed User
Longtime User
Problem Solved

The original SQLExample contains the following line in the Activity_Create sub.

File.Delete(DBFileDir, DBFileName) used for testing, deletes the existing database

When I comment that line the program runs on both my phone and Galaxy Tab.
 
Upvote 0
Top