1

I'm developing a simple utility to record the screen of device using the new function of kitkat 4.4. So, I've create a button with various edit text for the parameters such as bit rate, seconds and file name. I've this code.

StringBuilder builder;
builder = new StringBuilder("system/bin/screenrecorder");

When i retrieve the parameters do something like

builder.append(" --bit-rate ").append(editText.getText());

Finally I've the complete command to record, like

"system/bin/screenrecorder --size 720x1184 --bit-rate 5 --time-limit 5 /storage/emulated/0/MyVideos/example.mp4"

My question now is this:

How can i execute this command? In other words, what should I do now to start recording using the variable builder?

Vinay Veluri
  • 6,671
  • 5
  • 32
  • 56
user3103764
  • 87
  • 2
  • 10
  • 3
    A few notes: (1) screenrecord must run as `root` or `shell`, so this requires a rooted device with `su`; (2) use a full path for the command, i.e. start with `/system` rather than `system`; (3) it's `screenrecord` not `screenrecorder`; (4) bit rate is actually bps not Mbps, so specify 5000000; (5) see http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#exec(java.lang.String) – fadden Dec 31 '13 at 16:11

0 Answers0