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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:54:08+00:00 2026-06-13T07:54:08+00:00

I have an application in which the user can edit/add records offline and they

  • 0

I have an application in which the user can edit/add records offline and they should be sent to the server as soon as the Internet connection is established. It seems to be the exact behavior of the GMail application:

You can write an email offline, click “Send”, close the application/process, and when the Internet connection is back, a sync is performed which sends the email to the server.

The problem is that I already have a SyncAccount with a SyncAdapter running a daily sync. If I were to add a second sync using ContentResolver.addPeriodicSync, I would have to create another authority and thus would have to use different database tables?

Can I schedule two sync operations independent from each other, accessing the same database?

  • 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-13T07:54:09+00:00Added an answer on June 13, 2026 at 7:54 am

    Problem solved. Apparently, you can request a one-time sync immediately, rather than scheduling one. You can also supply a list of extras to this one-time sync.

    My solution is thus to put a parameter in that bundle and just do my magic accordingly in the adapter’s onPerformSync method.

        final String ACCOUNT_NAME = "dummyAcc";
        final String ACCOUNT_TYPE = "dummyAccType";
        final String PROVIDER = "dummyProvider";
    
        Account appAccount = new Account(ACCOUNT_NAME, ACCOUNT_TYPE);
        AccountManager accountManager = AccountManager.get(this);
        Bundle extras = new Bundle();
        extras.putBoolean("magicParam", true);
        extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
        ContentResolver.requestSync(appAccount, PROVIDER, extras);
    
    ...
    
    @Override
    public void onPerformSync(Account account, Bundle extras, String authority,
            ContentProviderClient provider, SyncResult syncResult) {
        if (extras.getBoolean("magicParam")) {
           // do magic;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone application, which lets the user add and and modify Assignments.
Let's say that I have an application which manages users. You can add new
I am creating application in which I would have database which users can´t edit.
I have the application in which user select the particular folder and all the
I have developed a application in which user select the particular folder and it
I have developed a application in which user select the particular folder and it
I have a web application in which a user has to upload images to
I have a simple web application which lets the user upload local user data
i have created an application which show data from user current location. I want
I have an application in which I want to authenticate a user from a

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.