How to switch Wifi On and Off automatically or remotely in your Android App? - Complete Source Code
Автор: Programmer World
Загружено: 2019-11-01
Просмотров: 575
Описание:
This video shows the steps to create an Android App which can be used to control the state of your Wifi between ON and OFF. The concept shown in this video is very simple. However, the use cases to control the state of the wifi could be many which has been briefly discussed in this video. Some of the use cases could be to control the wifi remotely by sending the command over channels such as SMS, firebase database update, etc. It can also be controlled at a pre-set time using some kind of timer or alarm clock concept.
We hope you like this video. For any query, suggestions or appreciations we will be glad to hear from you at: [email protected]
Source Code at:
https://programmerworld.co/android/ho...
package com.example.mywificontrolapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
private WifiManager wifiManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
}
public void WifiOnButton(View view){
wifiManager.setWifiEnabled(true);
}
public void WifiOffButton(View view){
wifiManager.setWifiEnabled(false);
}
}
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: