I am using sql lite and i am usually querying 1 table. Is it bad if I do the querying from the main ui thread?
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends. If your table is really big, it could take time to execute the query, and possible cause a noticeable lag in your app. Also, you say that you usually query only one table, so that’s leaves the possibility of more queries on additional tables.
As a general rule, I do a lot of work like querying and downloading in background threads using AsyncTasks, as even if they do not take very long now, it gives me extra freedom later on to expand the app without extensive rewriting.