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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:06:01+00:00 2026-06-08T20:06:01+00:00

Have set up a storage adapter (Contextual) for help creating and managing a single

  • 0

Have set up a storage adapter (Contextual) for help creating and managing a single database and table. Trying to access the table from a new thread for reading records and transmitting them via HTTP in the background. Other access to the database is activity based and insert only. Although the data is small the thread may run a few seconds based on the number of possible records. There is not need to communicate back to the UI.

StorageAdapter Class (SQL Lite Set up)

private static SQLiteDatabase db;
private Context context;
private StorageOpenHelper dbHelper;

public StorageAdapter(Context _context) {
  this.context = _context;
  dbHelper = new StorageOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION);
}

The error message from the thread below is: “The constructor StorageAdapter(Worker) is undefined”

Here is the thread:

public void run () {
  // Does Storage Adapter need to be runnable           
  // Read DB ID's of committed (1) records into array
  **StorageAdapter storageAdapter = new StorageAdapter(this);**
  storageAdapter.open();
  cursor = storageAdapter.queueCommID();
  int i = 0;
  int currcnt = cursor.getCount();
  if (cursor.getPosition() == -1) cursor.moveToFirst();
  while (i < currcnt) {
    // Send single record to server
    sendrec(cursor);
i=i+1;
cursor.moveToNext();
  }
  storageAdapter.close();
  stop();
};

Sure hope I did not confuse everyone. Been chasing my tail for a few days and I am very confused.Thank yo for any assistance.

  • 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-08T20:06:03+00:00Added an answer on June 8, 2026 at 8:06 pm

    seems like you are creating your StorageAdapter instance from within a Worker instance. that means the this references a Worker instead of a Context. in case your Worker is an anonymous class, you could use something like MyActivity.this instead of just this.

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

Sidebar

Related Questions

I have set of flat files (114 files) each file is named with database
Each of my user's have a set number of slots for storage. They can
I have a set of classes that represent the storage of a font format
I have CodeIgniter set to store sessions in the database but still it insists
I have set up mysql database to run with java and eclipse on my
I have been trying to set up a back up on Symantec Back Up
I have a number of sites using Kohana's session handler set to use database
We have a set of views (quite a few) that we're trying to implement
You often see database fields set to have a magnitude of 255 characters, what
From everything I've seen on Stack Exchange and elsewhere, I have everything set up

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.