{"id":3725,"date":"2019-07-04T09:32:53","date_gmt":"2019-07-04T09:32:53","guid":{"rendered":"https:\/\/www.beaconzone.co.uk\/blog\/?p=3725"},"modified":"2019-06-21T17:34:49","modified_gmt":"2019-06-21T17:34:49","slug":"android-wifi-direct-via-bluetooth","status":"publish","type":"post","link":"https:\/\/www.beaconzone.co.uk\/blog\/android-wifi-direct-via-bluetooth\/","title":{"rendered":"Android WiFi Direct via Bluetooth"},"content":{"rendered":"\n<p>A problem with many IoT projects is the need to connect the device to WiFi. It&#8217;s a &#8216;<a rel=\"noreferrer noopener\" aria-label=\"chicken and egg (opens in a new tab)\" href=\"https:\/\/en.wikipedia.org\/wiki\/Chicken_or_the_egg\" target=\"_blank\">chicken and egg<\/a>&#8216; situation in that you need to connect to the device in order to set the WiFi settings but you can&#8217;t connect because you aren&#8217;t WiFi connected. This is usually solved in one of two ways. The first relies on a <a rel=\"noreferrer noopener\" aria-label=\"WPS button (opens in a new tab)\" href=\"https:\/\/en.wikipedia.org\/wiki\/Wi-Fi_Protected_Setup\" target=\"_blank\">WPS button<\/a> on the WiFi router which sets it into a mode where it will accept a new device without the user having to enter or select anything. Security flaws in WPS and the possibility of anyone pressing the WPS button mean this isn&#8217;t a great solution for IoT applications. The second method involves the IoT device itself acting as a WiFi router in &#8216;station mode&#8217; while the user on a phone, laptop or other device connects and uses a http web interface to set the WiFi settings and reboot. Upon reboot, it&#8217;s no longer in station mode and connects to the assigned access point. However, users need simpler mechanisms.<\/p>\n\n\n\n<p>Android used to support WPS but this has been deprecated in favour Wi-Fi Easy Connect. The <a rel=\"noreferrer noopener\" aria-label=\"latest Android Q documentation (opens in a new tab)\" href=\"https:\/\/developer.android.com\/preview\/features#wifi-easy\" target=\"_blank\">latest Android Q documentation<\/a> explains that the Wi-Fi Direct connection information (a URI) needs to reach the device somehow such as through a QR Code scan NFC receipt or a Bluetooth scan. Hence, it&#8217;s possible for an unprovisioned device to be scanning for a particular beacon that provides a connection URI that&#8217;s used for provisioning the WiFi. This allows retailers&#8217; Android apps or Android IoT devices to easily connect to location-specific WiFi.<\/p>\n\n\n\n<p>The API mentions that Easy Connect does not require Location or Wi-Fi permissions which is a bit misleading. It will need the Location permission if you use a Bluetooth scan to provision.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A problem with many IoT projects is the need to connect the device to WiFi. It&#8217;s a &#8216;chicken and egg&#8216; situation in that you need to connect to the device in order to set the WiFi settings but you can&#8217;t connect because you aren&#8217;t WiFi connected. This is usually solved in one of two ways. &hellip; <a href=\"https:\/\/www.beaconzone.co.uk\/blog\/android-wifi-direct-via-bluetooth\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Android WiFi Direct via Bluetooth&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"_links":{"self":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/3725"}],"collection":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=3725"}],"version-history":[{"count":3,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/3725\/revisions"}],"predecessor-version":[{"id":3728,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/3725\/revisions\/3728"}],"wp:attachment":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=3725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=3725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=3725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}