Skip to content

kunal52/AndroidTvRemote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AndroidTvRemote

Note: This is a prereleased version.

AndroidTvRemote is an open-source java library to control android tv.

Usage

 AndroidRemoteTv androidRemoteTv = new AndroidRemoteTv();
        androidRemoteTv.connect("192.168.1.8", new AndroidRemoteTv.AndroidTvListener() {
            @Override
            public void onSessionCreated() {

            }

            @Override
            public void onSecretRequested() {
                BufferedReader reader = new BufferedReader(
                        new InputStreamReader(System.in));

                try {
                    String name = reader.readLine();
                    androidRemoteTv.sendSecret(name);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            @Override
            public void onPaired() {

            }

            @Override
            public void onConnectingToRemote() {

            }

            @Override
            public void onConnected() {
                System.out.println("Connected");
                
                androidRemoteTv.sendCommand(Remotemessage.RemoteKeyCode.KEYCODE_POWER, Remotemessage.RemoteDirection.SHORT);

            }

            @Override
            public void onDisconnect() {

            }

            @Override
            public void onError(String error) {

            }
        });

Refer this Android Page for more commands - https://developer.android.com/reference/android/view/KeyEvent

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages