Screen Recording kitkat with button

北战南征 提交于 2020-01-23 19:01:25

问题


i want create a button that starts the new screenrecording feature in Android 4.4 Kit Kat.. I create a button and i tryied to do in this way:

start.setOnClickListener(new OnClickListener() {         
            public void onClick(View v){
                String record ="su screenrecord — bit rate 8000000 --time-limit 30 "+recordfolder+"Record.mp4";
                recordfolder.mkdir();
                try {
                    Process screenrecording = Runtime.getRuntime().exec(record);
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } 

            }
        });

It creates the dir when i click but the recording not starts. My question are two right now;

1) Why i can't start the recording?

2) Which is the "stop" command? I see that you have to click CTRL+C but i can't do it in android phone.. I need an adb command possibly.

3) If possible create a countdown before start the record.

About the 3 point, i created a counter: int i=0, second = 5; but i don't know how proceed. Thanks

来源:https://stackoverflow.com/questions/20326522/screen-recording-kitkat-with-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!