• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How do you write this simple app?

zaza

Member
I'm trying to use an app from the playstore called DroidScript, it helps write simple apps.

I want to make a simple app that makes a tiny edit in a system file. I just want it to print a word into the below file, but I still have no idea how

/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor

(Naturally this app should also request superuser priveleges, which I also have no idea how to write)
 
Runtime.getRuntime().exec("su -c \" echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor \"");

for native java code

it says that DroidScript can import java package... so try to import the Runtime java class
 
Last edited:
Sorry I'm completely clueless, I'm still new to programming.

This is the sample code I want to use:
Code:
//Called when application is started.
function OnStart()
{


    //Force app to Portrait mode.
    app.SetOrientation("Portrait");

    //Create a layout with objects vertically centered.
    lay = app.CreateLayout("linear","VCenter,FillXY");

    //Create a toggle button.
    tgl = app.CreateToggle("Toggle Button",0.4);
    tgl.SetMargins(0,0.02,0,0);
    tgl.SetOnTouch(tgl_OnTouch);
    lay.AddChild(tgl);

    //Add layout to app.
    app.AddLayout(lay);
}


//Called when user touches our toggle button.
function tgl_OnTouch(isChecked)
{
    app.ShowPopup("Checked = " + isChecked);
}

So, what do I do here to get superuser permission for the app?
 
Last edited:
Back
Top