Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8664885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:20:53+00:00 2026-06-12T17:20:53+00:00

My Android App has a products table in an SQLite database that comes pre-populated

  • 0

My Android App has a products table in an SQLite database that comes pre-populated when the user installs it. The table can be updated from an Azure web service.

Instead of returning only the updated records from the web service and populating the SQLite table with the updated records, I want to simply return the 2900 records to the App. This is because most of the products will have changed. On opening the App, the products table is deleted using an SQL query and the ksoap2 response is sent to Product objects which are inserted into the database.

While this update to the products table is happening, I would like the user to be able to use the App without disruption. If the Products table has been deleted, then they cannot operate the App properly.

What are my options? Could I populate a temporary Product table and when the service has finished populating it, I could copy it to the ‘live’ Product table. Or could I completely delete the Product table and rename the temporary table to “Product”?

Or am I going about this completely wrong. Any advice would be most appreciated.
Code extract below:

 try {

          productDatasource.open();
          productDatasource.deleteProductTable();
          productDatasource.close();
          ArrayList<Product> arrProduct = new ArrayList<Product>();
          SoapObject request = new SoapObject(NAMESPACE, PRODUCT_METHOD_NAME); 

         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
         envelope.dotNet = true;
         envelope.setOutputSoapObject(request);
         System.out.println("startit");
         HttpTransportSE ht = new HttpTransportSE(URL);
         ht.debug = true;
         ht.call(SOAP_ACTION_PRODUCT, envelope);

         SoapObject response = (SoapObject) envelope.getResponse();

         productDatasource.open();
         productDatasource.deleteProductTable();
         Product[] products = new Product[response.getPropertyCount()];

         for (int i = 0; i < products.length; i++) {

             SoapObject prodObj = (SoapObject)response.getProperty(i);
             Product product = new Product();

             product.setProductID(Integer.parseInt(prodObj.getProperty(10).toString()));
             product.setProductName(prodObj.getProperty(11).toString());
             product.setFKCategoryID(Integer.parseInt(prodObj.getProperty(5).toString()));
             product.setFKSubCategoryID(Integer.parseInt(prodObj.getProperty(13).toString()));
             product.setFKBrandID(Integer.parseInt(prodObj.getProperty(2).toString()));      

             productDatasource.createProduct(product);
         }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:20:54+00:00Added an answer on June 12, 2026 at 5:20 pm

    Use a ContentProvider together with a CursorLoader so that your UI remains fluid while the content is updating. Use BulkInsert to add rows faster. If you can just update records instead of replacing them, then add a column that lets you mark the record as needing update. For information on getting started with SQL databases on Android, see http://developer.android.com/guide/topics/data/data-storage.html#db and http://developer.android.com/training/basics/data-storage/databases.html.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Android app has an SQLite database table with entries as follows: USER_ID |
I am working on an android app that has a database in which one
My android app has an EditText field where user can give input. But now
My android app has a drop down List,From where user can change language like
We're designing an Android app that has a lot of data (customers, products, orders...),
I have an Android app that has an Application class and I have another
I've an android app that has multiple views. I've disabled the automatic orientation switching
I am trying to create an android app that has the following: Theme set
My Android app has a button that executes this code in order to open
My Android app has a tab bar that uses an Intent to launch the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.