Hello,
I would like to ask why the query operations with this driver cause NetworkOnMainThread exceptions.
I have already tried calling subs from the Main activity using the Threading library and the CSE (CallSubExtended) library and they both cause the same issue.
I have ready the article about disabling Strict mode, but it doesnt serve my purposes.
I show in pseudo code the structure of my code, so that hopefully someone can help me identify what I'm doing wrong:
Main activity start
irrelevant code...
Main activity resume
irrelevant code..'
Button click:
code checks if there is network connectivity
if yes, it async calls a sub that runs the SQL stuff, let's call it "Sub SQLroutine"
Sub SQLroutine:
Runs on main thread a sub that updates a label saying that procedure started
async calls a sub (firstSub) that runs the first SQL stuff
firstSub:
checks if mssql is initialized otherwise initializes it
waits for mssql_ready
runs a query using waitfor so that it returns the results
puts the results of the JdbcResultSet in a list
reads the content of the list one by one and inserts them one by one in sqlite table included in the application
while inserting in runs on main thread a sub that updates a label showing the progress of records inserting.
I would like to ask why the query operations with this driver cause NetworkOnMainThread exceptions.
I have already tried calling subs from the Main activity using the Threading library and the CSE (CallSubExtended) library and they both cause the same issue.
I have ready the article about disabling Strict mode, but it doesnt serve my purposes.
I show in pseudo code the structure of my code, so that hopefully someone can help me identify what I'm doing wrong:
Main activity start
irrelevant code...
Main activity resume
irrelevant code..'
Button click:
code checks if there is network connectivity
if yes, it async calls a sub that runs the SQL stuff, let's call it "Sub SQLroutine"
Sub SQLroutine:
Runs on main thread a sub that updates a label saying that procedure started
async calls a sub (firstSub) that runs the first SQL stuff
firstSub:
checks if mssql is initialized otherwise initializes it
waits for mssql_ready
runs a query using waitfor so that it returns the results
puts the results of the JdbcResultSet in a list
reads the content of the list one by one and inserts them one by one in sqlite table included in the application
while inserting in runs on main thread a sub that updates a label showing the progress of records inserting.