Skip to content
This repository was archived by the owner on Nov 12, 2017. It is now read-only.
This repository was archived by the owner on Nov 12, 2017. It is now read-only.

How to use screenrecordex with Android app? #3

@ghost

Description

I tried to use screenrecordex to record screen using my app (not command prompt). I pushed this file to /data/data/tmp folder and set the specified permission (755) through code. Now when I execute process to record screen, it shows that process has started but after then my app hangs and nothing goes well. I terminated my app and saw that a video file is created on my sd card with size 0 bytes. I debugged my code and I found issue while running this file through code. Below is sample of my code to execute this and record video:

try {
final Process process = Runtime.getRuntime.exec(recordxFile + " /sdcard/demo.mp4");
// BufferedReader bufferedReader = new BufferedReader(
// new InputStreamReader(process.getInputStream()));
LogUtils.LogD("Recording...");
// String line;
// while ((line = bufferedReader.readLine()) != null) {
// LogUtils.LogD("Output", line);
// }
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}

It app hangs at bufferedReader.readLine() while reading the output of process. I also tried to run --help and --verbose but got no output but in that case app does not hang.

So, can you please tell me what I am doing wrong or suggest a way to record video by executing this file from Android app.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions