You can use the Wi-Fi Manager to enable or disable your Wi-Fi hardware dịch - You can use the Wi-Fi Manager to enable or disable your Wi-Fi hardware Việt làm thế nào để nói

You can use the Wi-Fi Manager to en

You can use the Wi-Fi Manager to enable or disable your Wi-Fi hardware using the setwifiEnabled method, or to request the current Wi-Fi state using the getWifiState or isWifiEnabled methods, as shown in Listing 16-15.
The following sections begin with tracking the current Wi-Fi connection status and monitoring changes in signal strength. Later you’ll also learn how to scan for and connect to specific access points.
Monitoring Wi-Fi Connectivity
In most cases it’s best practice to use the Connectivity Manager to monitor changes in Wi-Fi connectivity; however, the Wifi Manager does broadcast Intents whenever the connectivity status of the Wi-Fi network changes, using an action from one of the following constants defined in the
WifiManager class:
► WIFI_STATE_CHANGED_ACTION — Indicates that the Wi-Fi hardware status has changed, moving between enabling, enabled, disabling, disabled, and unknown. It includes two extra values keyed on EXTRA_WIFI_STATE and EXTRA_PREVIOUS_STATE that provide the new and previous Wi-Fi states, respectively.
► SUPPLICANT_CONNECTION_CHANGE_ACTION — This Intent is broadcast whenever the connection state with the active supplicant (access point) changes. It is fired when a new connection is established or an existing connection is lost, using the EXTRA_NEW_STATE Boolean extra, which returns true in the former case.
► NETWORK_STATE_CHANGED_ACTION — Fired whenever the Wi-Fi connectivity state changes. This Intent includes two extras: the first, EXTRA_NETWORK_iNFO, includes a Networkinfo object that details the current network state, whereas the second, EXTRA_BSSID, includes the BSSID of the access point you’re connected to.
► RSSI_CHANGED_ACTION — You can monitor the current signal strength of the connected Wi-Fi network by listening for the RSSI_CHANGED_ACTION Intent. This Broadcast Intent includes an integer extra, EXTRA_NEW_RSSI, that holds the current signal strength. To use this signal strength, you should use the calculateSignalLevel static method on the Wi-Fi Manager to convert it to an integer value on a scale you specify.
Monitoring Active Wi-Fi Connection Details
When an active Wi-Fi connection has been established, you can use the getConnectioninfo method on the Wi-Fi Manager to find information on the connection’s status. The returned Wifiinfo object includes the SSID, BSSID, MAC address, and IP address of the current access point, as well as the current link speed and signal strength, as shown in Listing 16-16.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
You can use the Wi-Fi Manager to enable or disable your Wi-Fi hardware using the setwifiEnabled method, or to request the current Wi-Fi state using the getWifiState or isWifiEnabled methods, as shown in Listing 16-15.The following sections begin with tracking the current Wi-Fi connection status and monitoring changes in signal strength. Later you’ll also learn how to scan for and connect to specific access points.Monitoring Wi-Fi ConnectivityIn most cases it’s best practice to use the Connectivity Manager to monitor changes in Wi-Fi connectivity; however, the Wifi Manager does broadcast Intents whenever the connectivity status of the Wi-Fi network changes, using an action from one of the following constants defined in the WifiManager class:► WIFI_STATE_CHANGED_ACTION — Indicates that the Wi-Fi hardware status has changed, moving between enabling, enabled, disabling, disabled, and unknown. It includes two extra values keyed on EXTRA_WIFI_STATE and EXTRA_PREVIOUS_STATE that provide the new and previous Wi-Fi states, respectively.► SUPPLICANT_CONNECTION_CHANGE_ACTION — This Intent is broadcast whenever the connection state with the active supplicant (access point) changes. It is fired when a new connection is established or an existing connection is lost, using the EXTRA_NEW_STATE Boolean extra, which returns true in the former case.► NETWORK_STATE_CHANGED_ACTION — Fired whenever the Wi-Fi connectivity state changes. This Intent includes two extras: the first, EXTRA_NETWORK_iNFO, includes a Networkinfo object that details the current network state, whereas the second, EXTRA_BSSID, includes the BSSID of the access point you’re connected to.► RSSI_CHANGED_ACTION — You can monitor the current signal strength of the connected Wi-Fi network by listening for the RSSI_CHANGED_ACTION Intent. This Broadcast Intent includes an integer extra, EXTRA_NEW_RSSI, that holds the current signal strength. To use this signal strength, you should use the calculateSignalLevel static method on the Wi-Fi Manager to convert it to an integer value on a scale you specify. Monitoring Active Wi-Fi Connection DetailsWhen an active Wi-Fi connection has been established, you can use the getConnectioninfo method on the Wi-Fi Manager to find information on the connection’s status. The returned Wifiinfo object includes the SSID, BSSID, MAC address, and IP address of the current access point, as well as the current link speed and signal strength, as shown in Listing 16-16.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Bạn có thể sử dụng Quản lý Wi-Fi để kích hoạt hoặc vô hiệu hóa phần cứng Wi-Fi của bạn bằng cách sử dụng phương pháp setwifiEnabled, hoặc yêu cầu các trạng thái Wi-Fi hiện tại bằng cách sử dụng getWifiState hoặc các phương pháp isWifiEnabled, như thể hiện trong Liệt kê 16-15.
Các phần sau đây bắt đầu với theo dõi tình trạng kết nối Wi-Fi hiện tại và theo dõi những thay đổi về cường độ tín hiệu. Sau đó bạn cũng sẽ tìm hiểu làm thế nào để quét và kết nối với các điểm truy cập cụ thể.
Giám sát Wi-Fi kết nối
Trong hầu hết các trường hợp, nó là thực hành tốt nhất để sử dụng Quản lý kết nối để giám sát những thay đổi trong kết nối Wi-Fi; Tuy nhiên, các Wifi Manager không phát sóng Intents bất cứ khi nào trạng thái kết nối của các thay đổi của mạng Wi-Fi, sử dụng một hành động từ một trong các hằng số sau đây được định nghĩa trong
WifiManager lớp:
► WIFI_STATE_CHANGED_ACTION - Chỉ ra rằng tình trạng phần cứng Wi-Fi đã thay đổi, di chuyển giữa cho phép, kích hoạt, vô hiệu hóa, người tàn tật, và chưa biết. Nó bao gồm hai giá trị thêm keyed trên EXTRA_WIFI_STATE và EXTRA_PREVIOUS_STATE cung cấp các trạng thái Wi-Fi mới và trước đó, tương ứng.
► SUPPLICANT_CONNECTION_CHANGE_ACTION - Ý định này được phát sóng bất cứ khi nào trạng thái kết nối với những thay đổi tích cực supplicant (điểm truy cập). Nó phát sinh khi một kết nối mới được thành lập hoặc kết nối hiện bị mất, bằng cách sử dụng EXTRA_NEW_STATE Boolean thêm, mà trả đúng trong trường hợp cựu.
► NETWORK_STATE_CHANGED_ACTION - Fired bất cứ khi nào các Wi-Fi thay đổi trạng thái kết nối. Ý định này bao gồm hai tính năng bổ sung: đầu tiên, EXTRA_NETWORK_iNFO, bao gồm một đối tượng Networkinfo rằng các chi tiết trạng thái mạng hiện tại, trong khi thứ hai, EXTRA_BSSID, bao gồm BSSID của các điểm truy cập bạn đang kết nối đến.
► RSSI_CHANGED_ACTION - Bạn có thể theo dõi các tín hiệu hiện tại sức mạnh của kết nối mạng Wi-Fi bằng cách lắng nghe các ý định RSSI_CHANGED_ACTION. Ý định phát sóng này bao gồm một số nguyên phụ, EXTRA_NEW_RSSI, người nắm giữ sức mạnh tín hiệu hiện tại. Để sử dụng sức mạnh của tín hiệu này, bạn nên sử dụng calculateSignalLevel phương pháp tĩnh trên quản lý Wi-Fi để chuyển đổi nó sang một số nguyên trên thang điểm bạn chỉ định.
Giám sát hoạt Wi-Fi Connection Chi tiết
Khi một kết nối Wi-Fi hoạt động đã được thành lập, bạn có thể sử dụng phương pháp getConnectioninfo trên Wi-Fi Manager để tìm thông tin về trạng thái của kết nối. Các đối tượng Wifiinfo trở lại bao gồm các SSID, BSSID, địa chỉ MAC và địa chỉ IP của điểm truy cập hiện tại, cũng như tốc độ kết nối hiện tại và cường độ tín hiệu, như trong Liệt kê 16-16.
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2024 I Love Translation. All reserved.

E-mail: