In this video it shows the steps to connect Android TV from Android Studio environment over WIFI for debugging the App's code.
Two simple Steps which needs to be followed:
1. Android TV - Enabled Developer Options. Get IP Address.
2. Android Studio - Connect to the TV using IP Address
Command for connecting:
adb connect IP_Address
'ADB.exe' command is in the following path. Either change to the below path in the Terminal or add it in the PATH variable of your OS.
C:\\ where adb
C:\Users\USERNAME\AppData\Local\Android\Sdk\platform-tools\adb.exe
Kindly make sure that both Laptop (running Android Studio) and Android TV are on the same WIFI network and the IP address of the TV is accessible from the laptop.
In this video it uses MiTV for demonstration.
I hope you like this video. For any questions, suggestions or appreciation please contact us at: [ Ссылка ] or email at: programmerworld1990@gmail.com
Complete details/ steps of this video are posted in the below link:
[ Ссылка ]
However, the Java code of the App is copied below also for reference:
package com.programmerworld.connectiontoandroidtvapp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
}
public void buttonToggle(View view){
if (textView.getText().equals("Programmer World")){
textView.setText("Hello World");
} else {
textView.setText("Programmer World");
}
}
}
--
![](https://i.ytimg.com/vi/4dtq6asBZhw/maxresdefault.jpg)