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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:50:13+00:00 2026-06-04T10:50:13+00:00

I have a simple SQLite database on my PC containing one table. I have

  • 0

I have a simple SQLite database on my PC containing one table. I have the same SQLite database in my Android app. The data changes on the PC version of the database from time to time. How do I go about syncing the data from the SQLite database on the PC to the SQLite database on the Android device?

  • 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-04T10:50:15+00:00Added an answer on June 4, 2026 at 10:50 am

    This is a simple solution with sockets:

    1. Server side :

      ServerSocket servsock = new ServerSocket(2004);
      while (true) {
        System.out.println("Waiting...");
        Socket sock = servsock.accept();
        System.out.println("Accepted connection : " + sock);
        BufferedReader input = new BufferedReader(
                  new InputStreamReader(sock.getInputStream()));
        String serverResponse = input.readLine(); 
        // sendfile
        File   myFile = new File("C://XXXX/XXXX/XXXXX.db");
        byte [] mybytearray  = new byte [(int)myFile.length()];
        FileInputStream fis = new FileInputStream(myFile);
        BufferedInputStream bis = new BufferedInputStream(fis);
        bis.read(mybytearray,0,mybytearray.length);
        OutputStream os = sock.getOutputStream();
        System.out.println("Sending...");
        os.write(mybytearray,0,mybytearray.length);
        os.flush();
        sock.close();
        }
      
    2. Client side :

          private String serverIpAddress = "xxx.xxx.xxx.xxx";
      private static final int REDIRECTED_SERVERPORT = 2004;
      InetAddress serverAddr = InetAddress.getByName(serverIpAddress);
      socket = new Socket(serverAddr, REDIRECTED_SERVERPORT);
      int filesize = 6022386;
      int bytesRead;
      int current = 0;
      byte[] mybytearray = new byte[filesize];
      
      InputStream is = socket.getInputStream();
      
      BufferedReader input = new BufferedReader(new InputStreamReader(is));
      FileOutputStream fos = new FileOutputStream(
              "/data/data/XXXXX/databases/XXXXX.db");
      BufferedOutputStream bos = new BufferedOutputStream(fos);
      
      bytesRead = is.read(mybytearray, 0, mybytearray.length);
      current = bytesRead;
      
      do {
          bytesRead = is.read(mybytearray, current,
                  (mybytearray.length - current));
          if (bytesRead >= 0)
              current += bytesRead;
      } while (bytesRead > -1);
      
      bos.write(mybytearray, 0, current);
      bos.flush();
      bos.close();
      socket.close();
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My iphone app uses a SQLite database to store data. I have a table
I have written a simple Android application that uses a sqlite database which is
I have made the following code to retrive data from SQLite database. public Cursor
I have an SQLite database with a simple table of Persons. Each row represents
I have a listview which loads its data from sqlite database. Each row in
I have some simple code which should create a database. package com.webfoo.android.databaseExample; import android.app.Activity;
I have a little problem with getting all data from SQLite database and showing
I have simple SSIS package which reads data from flat file and insert into
I have simple SSIS package where I import data from flat file into SQL
I have a simple SQLite database I use to track invoices. I recently decided

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.