Results 1 to 3 of 3

Thread: [ANDROID] Drop_caches by android app doesn't work

  1. #1
    Join Date
    Apr 2013
    Beans
    4

    Unhappy [ANDROID] Drop_caches by android app doesn't work

    Hi, I've made this script but doesn't work:
    Code:
    package com.mkyong.android;
     
    import android.annotation.SuppressLint;
    import android.app.Activity;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    import android.widget.Toast;
    import java.io.IOException;
    import com.example.toast.R;
     
    public class MainActivity extends Activity {
     
    	private Button button;
     
    	public void onCreate(Bundle savedInstanceState) {
    		final Runtime runtime = Runtime.getRuntime();
    		try {
    			runtime.exec("su");
    		}
    		catch (IOException e) {
    			e.printStackTrace();
    		}
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.tab1);
    	
    		
    		button = (Button) findViewById(R.id.button1);
            button.setOnClickListener(new OnClickListener() {
                @SuppressLint("SdCardPath")
    			@Override
                public void onClick(View arg0) {
                	final Runtime runtime = Runtime.getRuntime();
            		try {
            			runtime.exec("echo 3 > /proc/sys/vm/drop_caches");
            			Toast.makeText(MainActivity.this, "Script lanciato con successo, memoria svuotata.", Toast.LENGTH_LONG).show();
            		}
            		catch (IOException e) {
            			e.printStackTrace();
            		}
                }
            });
    	}
    }
    Doesn't free the RAM memory but via terminal emulator goes.. what's wrong?

  2. #2
    Join Date
    Apr 2013
    Beans
    4

    Re: [ANDROID] Drop_caches by android app doesn't work

    Nobody?

  3. #3
    Join Date
    Oct 2009
    Location
    Reykjavík, Ísland
    Beans
    12,239
    Distro
    Lubuntu 17.04 Zesty Zapus

    Re: [ANDROID] Drop_caches by android app doesn't work

    Please don't bump a thread.
    Bringing old hardware back to life. About problems due to upgrading.
    Please visit Quick Links -> Unanswered Posts
    Don't use this space for a list of your hardware. It only creates false hits in the search engines.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •