Home | History | Annotate | Download | only in WearHighBandwidthNetworking
      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <!--
      3  Copyright 2013 The Android Open Source Project
      4 
      5  Licensed under the Apache License, Version 2.0 (the "License");
      6  you may not use this file except in compliance with the License.
      7  You may obtain a copy of the License at
      8 
      9      http://www.apache.org/licenses/LICENSE-2.0
     10 
     11  Unless required by applicable law or agreed to in writing, software
     12  distributed under the License is distributed on an "AS IS" BASIS,
     13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  See the License for the specific language governing permissions and
     15  limitations under the License.
     16 -->
     17 
     18 <sample>
     19     <name>WearHighBandwidthNetworking</name>
     20     <group>Wearable</group>  <!-- This field will be deprecated in the future
     21                             and replaced with the "categories" tags below. -->
     22     <package>com.example.android.wearable.wear.wearhighbandwidthnetworking</package>
     23 
     24     <!-- change minSdk if needed-->
     25     <minSdk>24</minSdk>
     26     <minSdkVersionWear>24</minSdkVersionWear>
     27     <targetSdkVersion>25</targetSdkVersion>
     28     <targetSdkVersionWear>25</targetSdkVersionWear>
     29 
     30     <!-- Include additional dependencies here.-->
     31     <!-- dependency>com.google.android.gms:play-services:5.0.+</dependency -->
     32 
     33     <strings>
     34         <intro>
     35 <![CDATA[
     36 Sample demonstrates how to determine if a high-bandwidth network is available for use cases that
     37 require a minimum network bandwidth, such as streaming media or downloading large files. In
     38 addition, the sample demonstrates best practices for asking a user to add a new Wi-Fi network for
     39 high-bandwidth network operations if the bandwidth of currently available networks is inadequate.
     40 ]]>
     41         </intro>
     42     </strings>
     43 
     44     <template src="base-build" />
     45     <template src="Wear" />
     46 
     47     <metadata>
     48         <!-- Values: {DRAFT | PUBLISHED | INTERNAL | DEPRECATED | SUPERCEDED} -->
     49         <status>PUBLISHED</status>
     50         <!-- See http://go/sample-categories for details on the next 4 fields. -->
     51         <!-- Most samples just need to udpate the Categories field. This is a comma-
     52              seperated list of topic tags. Unlike the old category system, samples
     53              may have multiple categories, so feel free to add extras. Try to avoid
     54              simply tagging everything with "UI". :)-->
     55         <categories>Wearable</categories>
     56         <technologies>Android</technologies>
     57         <languages>Java</languages>
     58         <solutions>Mobile</solutions>
     59         <!-- Values: {BEGINNER | INTERMEDIATE | ADVANCED | EXPERT} -->
     60         <!-- Beginner is for "getting started" type content, or essential content.
     61              (e.g. "Hello World", activities, intents)
     62 
     63              Intermediate is for content that covers material a beginner doesn't need
     64              to know, but that a skilled developer is expected to know.
     65              (e.g. services, basic styles and theming, sync adapters)
     66 
     67              Advanced is for highly technical content geared towards experienced developers.
     68              (e.g. performance optimizations, custom views, bluetooth)
     69 
     70              Expert is reserved for highly technical or specialized content, and should
     71              be used sparingly. (e.g. VPN clients, SELinux, custom instrumentation runners) -->
     72         <level>INTERMEDIATE</level>
     73         <!-- Dimensions: 512x512, PNG fomrat -->
     74         <icon>screenshots/icon-web.png</icon>
     75         <!-- Path to screenshots. Use <img> tags for each. -->
     76         <screenshots>
     77             <img>screenshots/wear-1.png</img>
     78             <img>screenshots/wear-2.png</img>
     79             <img>screenshots/wear-3.png</img>
     80         </screenshots>
     81         <!-- List of APIs that this sample should be cross-referenced under. Use <android>
     82         for fully-qualified Framework class names ("android:" namespace).
     83 
     84         Use <ext> for custom namespaces, if needed. See "Samples Index API" documentation
     85         for more details. -->
     86         <api_refs>
     87             <android>android.net.ConnectivityManager</android>
     88             <android>android.net.NetworkCapabilities</android>
     89             <android>android.net.NetworkRequest</android>
     90         </api_refs>
     91 
     92         <!-- 1-3 line description of the sample here.
     93 
     94             Avoid simply rearranging the sample's title. What does this sample actually
     95             accomplish, and how does it do it? -->
     96         <description>
     97 <![CDATA[
     98 Sample demonstrates how to determine if a high-bandwidth network is available for use cases that
     99 require a minimum network bandwidth, such as streaming media or downloading large files. In
    100 addition, the sample demonstrates best practices for asking a user to add a new Wi-Fi network for
    101 high-bandwidth network operations if the bandwidth of currently available networks is inadequate.
    102 ]]>
    103         </description>
    104 
    105         <!-- Multi-paragraph introduction to sample, from an educational point-of-view.
    106         Makrdown formatting allowed. This will be used to generate a mini-article for the
    107         sample on DAC. -->
    108         <intro>
    109 <![CDATA[
    110 On Android Wear, a high-bandwidth network is not always available, as the platform manages network
    111 connectivity with the goal of providing the best overall user experience, balancing network
    112 bandwidth and maximizing device battery life. For use cases that require high-bandwidth network
    113 access, such as transporting large files or streaming media, we recommend that apps:
    114 
    115 1. Check for an active network, and if there is one, check its bandwidth.
    116 2. If there isn't an active network, or its bandwidth is insufficient, request access to an
    117 unmetered Wi-Fi or cellular network.
    118 3. If a high-bandwidth network is still not avaiable, ask the user to connect to a new Wi-Fi
    119 network.
    120 
    121 You can use the [ConnectivityManager][1] class to check if an active network exists, if the active
    122 network has sufficient bandwidth for the desired network operation, and to request an appropriate
    123 high-bandwidth network.
    124 
    125 In addition to requesting a high-bandwidth network, you should also ensure that you are releasing
    126 bound networks and cancelling any ongoing network requests when they are no longer needed.
    127 
    128 This sample demonstrates all aspects of testing, requesting, and releasing network resources to
    129 ensure a high-bandwidth network is available. In addition, the sample demonstrates the ideal user
    130 experience for guiding the user through the process of acquiring a high-bandwidth network.
    131 
    132 To try all aspects of this sample, ensure that you have removed all saved Wi-Fi networks from your
    133 Wear device and that it is unplugged, as Wear devices may prefer high-bandwidth networks by default
    134 while plugged-in. Also, you may wish to put your phone in airplane mode or turn off Bluetooth to
    135 simulate the Wear device running standalone.
    136 
    137 [1]: https://developer.android.com/reference/android/net/ConnectivityManager.html
    138 ]]>
    139         </intro>
    140     </metadata>
    141 </sample>