Home | History | Annotate | Download | only in wearhighbandwidthnetworking

Lines Matching refs:Network

22 import android.net.Network;
37 * This sample demonstrates how to determine if a high-bandwidth network is available for use cases
38 * that require a minimum network bandwidth, such as streaming media or downloading large files.
39 * In addition, the sample demonstrates best practices for asking a user to add a new Wi-Fi network
40 * for high-bandwidth network operations, if currently available networks are inadequate.
45 // Intent action for sending the user directly to the add Wi-Fi network activity.
49 // Message to notify the network request timout handler that too much time has passed.
52 // How long the app should wait trying to connect to a sufficient high-bandwidth network before
53 // asking the user to add a new Wi-Fi network.
56 // The minimum network bandwidth required by the app for high-bandwidth operations.
62 // Handler for dealing with network connection timeouts.
83 // the state of the network.
115 Log.d(LOG_TAG, "Network connection timeout");
143 Log.d(LOG_TAG, "Unregistering network callback");
149 // Determine if there is a high-bandwidth network exists. Checks both the active
150 // and bound networks. Returns false if no network is available (low or high-bandwidth).
152 Network network = mConnectivityManager.getBoundNetworkForProcess();
153 network = network == null ? mConnectivityManager.getActiveNetwork() : network;
154 if (network == null) {
160 .getNetworkCapabilities(network).getLinkDownstreamBandwidthKbps();
170 // Before requesting a high-bandwidth network, ensure prior requests are invalidated.
173 Log.d(LOG_TAG, "Requesting high-bandwidth network");
175 // Requesting an unmetered network may prevent you from connecting to the cellular
176 // network on the user's watch or phone; however, unless you explicitly ask for permission
177 // to a access the user's cellular network, you should request an unmetered network.
187 public void onAvailable(final Network network) {
194 if (!mConnectivityManager.bindProcessToNetwork(network)) {
199 Log.d(LOG_TAG, "Network available");
207 public void onCapabilitiesChanged(Network network,
212 Log.d(LOG_TAG, "Network capabilities changed");
218 public void onLost(Network network) {
219 Log.d(LOG_TAG, "Network lost");
273 // which are all reused for the various states of the app and network connectivity. Also,
274 // will show/hide a progress bar, which is dependent on the state of the network connectivity