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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:35:52+00:00 2026-06-05T08:35:52+00:00

i have test code using : $ adb -s emulator-5554 shell # df df

  • 0

i have test code using :

  $ adb -s emulator-5554 shell

   # df
   df
 /dev: 47084K total, 0K used, 47084K available (block size 4096)
/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size  4096)
/system: 73600K total, 73600K used, 0K available (block size 4096)
/data: 65536K total, 18464K used, 47072K available (block size 4096)
/cache: 65536K total, 1156K used, 64380K available (block size 4096)

you see the data have total 65536k and so on,my question is how to get the size by coding?if i need root right?can you give me some advice?

  • 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-05T08:35:55+00:00Added an answer on June 5, 2026 at 8:35 am
    try {
     Runtime rt = Runtime.getRuntime();
     Process pcs = rt.exec("df /data");
     BufferedReader br = new BufferedReader(new InputStreamReader(pcs
           .getInputStream()));
     String line = null;
     while ((line = br.readLine()) != null) {
        Log.e("line","line="+line);
     }
     br.close();
     pcs.waitFor();
    

    or

        File path = Environment.getDataDirectory();
        android.os.StatFs stat = new android.os.StatFs(path.getPath());
        long blockSize = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks()*blockSize;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to unit test some code using NUnit. I have a method: public
I have written some test code for comparing the performance of using direct property
I have a test code using simple_dom_html: <?php include 'simple_html_dom.php'; $content = '<img src=name1.jpg
Look at the test code I have written below. Using pure java I set
I have the following code: using System.Configuration; namespace test { public partial class MyService
I have the following code : using System.Collections.Generic; public class Test { static void
I have a bit of code using a simple tcp socket setup to test
I have test code like this: public class A : CriticalFinalizerObject { ~A() {
i have this test code to handle exceptions in constructors. function f() create an
I have this test code that just saves an XML file to a folder.

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.