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

How to use screenrecordex with Android app? #3

Open
ghost opened this issue Mar 8, 2016 · 0 comments
Open

How to use screenrecordex with Android app? #3

ghost opened this issue Mar 8, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 8, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants