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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:30:31+00:00 2026-05-30T10:30:31+00:00

I have rooted phone. I want to copy data/data/com.android.providers.telephony/databases/mmssms.db file to sd card programatically.

  • 0

I have rooted phone.
I want to copy data/data/com.android.providers.telephony/databases/mmssms.db
file to sd card programatically.

I am getting error like
java.io.FileNotFoundException: /data/data/com.android.providers.telephony/databases/mmssms.db (Permission denied)

Please help me….

Thanking you in advance…

I am using below code to copy database in sd card
‘
try {

            File sd = Environment.getExternalStorageDirectory();
            String path = Environment.getDataDirectory().getAbsolutePath();
            File data = Environment.getDataDirectory();
            String currentDBPath = "/data/com.android.providers.telephony/databases/mmssms.db";
            String backupDBPath = "/bkup/mmssms.db";
            File currentDB = new File(data, currentDBPath);
            File backupDB = new File(sd, backupDBPath);
            // Local database
            InputStream input = new FileInputStream(currentDB);

            // Path to the external backup
            OutputStream output = new FileOutputStream(backupDB);

            // transfer bytes from the Input File to the Output File
            byte[] buffer = new byte[1024];
            int length;
            while ((length = input.read(buffer))>0) {
                output.write(buffer, 0, length);
            }

            output.flush();
            output.close();
            input.close();
    } catch (Exception e) {
        // TODO: handle exception
        Toast.makeText(this, e.getMessage().toString(), Toast.LENGTH_LONG).show();
    }`
  • 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-05-30T10:30:32+00:00Added an answer on May 30, 2026 at 10:30 am

    You’re trying to copy the database from other application. It’s not allowed. Even your phone is rooted, your application is not granted the root permission yet.

    String currentDBPath = "/data/com.android.providers.telephony/databases/mmssms.db";
    

    You need to grant the root permission first, and use the shell commands to copy file, like this (cp /data/…./xxx.db /sdcard/xxx.db)

    Read command output inside su process

    Just use the method in this post and change the shell command to …

    stdin.writeBytes("cp /data/data/com.android.providers.telephony/databases/mmssms.db /sdcard/\n"); // \n executes the command
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to test my android app on a phone. I do not have
I have rooted android phone and I am getting the # when I use
I have a MyTouch 3G running Android, which has been rooted. I was wondering
I have the following situation, I want to monitor the system calls on Android
I know of four ways to install an Android application on a rooted phone:
I have a phone that was rooted for me by one of the cleverest
I have HTC magic (rooted and flashed to android 2.3.4-ginger yoshi1.5). As it is
I have successfully rooted my Samsung Galaxy Mini (android 2.2.1) and thought, that I
I have been trying to port Node.js on Android phone by following the link
I have created a namespace extension that is rooted under Desktop. The main purpose

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.