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 8531213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:25:56+00:00 2026-06-11T09:25:56+00:00

I am creating a test application whose purpose is to import a large amount

  • 0

I am creating a test application whose purpose is to import a large amount of text messages into the sms inbox. I have a few thousand messages in two columns “address” and “body”. I can have them in a csv, sqlite, or string array format. I’m unsure how to approach this problem so as to make this while loop efficient and what way I might want to parse the data.

Please instruct as to the best approach to accomplish this.

For simplicity sake I’ve tried it as an array here but there are some syntax errors.What is the correct way to use an array to add values into the database?

Here is what I have so far:

        private void importSms(final String[] addressvariable, final String[] bodyvariable) {
    Thread queue = new Thread(new Runnable() {
        public void run() {
             while(true) { //will have to define this boolean
                 ContentValues values = new ContentValues{);
                 values.put("address", [addressvariable]);
                 values.put("body", [bodyvariable]);
                 getContentResolver().insert(Uri.parse("content://sms/inbox"), values);
             }
         }
       }); 
       queue.start();
  • 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-11T09:25:57+00:00Added an answer on June 11, 2026 at 9:25 am

    Long operation like this one should be done using an AsyncTask. This will make sure you don’t block the UI thread, and allow you to easily show a progress dialog while processing, keeping the user informed.

    As for the format, I’d go with a database as it can be easily upgraded later on and modified to newer needs. Using a String array for this would be rather complicated, especially if your messages are formatted. CSV parsing isn’t natively supported, so I’d not pick it over a database.

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

Sidebar

Related Questions

I have a large acceptance test suite that runs the source application many thousands
I'm creating a test application with Yii and have created my first migration. <?php
I have a test application coded in Java for creating an indexed and non
I'm creating a test application, trying to use MVC, for Mac. I have created
I am creating one android test application , in which i have one button.
I am creating a simple application in Silverlight 5 to test another application's ability
I have the following couple of C pre-processor macros for creating test functions: //
When creating a test project for a Silverlight MVVM application, should I create a
Hi I'm creating test application that has a user control with a Button that
I have successfully set up a quick test of creating a REST-like service that

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.