Internet connection in android wear watch? - android

Can you share the ways the android wear watch can connect to internet while it is not pared with mobile device.( Eg: is it possible to connect via wifi, or data connection).

It cannot and there are no Android Wear devices supporting Wi-Fi, at this time (On March 2015).
Update: Some devices (not all) should see Wi-Fi support incoming according to http://googleblog.blogspot.fr/2015/04/android-wear-wear-what-you-want-get.html

Related

Securely connect Bluetooth device to Android

I am developing a device that needs to communicate securely to an Android app via Bluetooth. I need that only a predefined phone to be able to communicate with my device for security reason. And I also need to assure that this is not an intruder device that is trying to communicate falsified data to the app.
Looking at Bluetooth specs, I had the impression the only way to do that is with out of band (OOB) authentication with a pre-provisioning temporary key (TK). This looked very promising but after trying to find how to use OOB on an Android app, it seems like it is not supported.
Is it still possible to use OOB authentification on Android ?
If no, is there another alternative to solve my issue ?
This is doable but it depends on the BLE peripheral that you are developing and the features that it supports. Namely, your device needs to support Whitelisting and bonding. This is how it should work.
Upon first connection to the BLE device, the BLE device should accept the connection regardless.
Once the connection is made, the central device (Android phone) needs to initiate bonding. This doesn't need to be Out of Band (OOB) bonding, and the standard Just Works bonding should do.
Once bonding is succesful, the BLE peripheral should add the Android device's IRK to the list of whitelisted devices.
From this point onwards, the BLE peripheral will activate the whitelist, and therefore only devices in the whitelist will be able to connect to your BLE peripheral, and in your case it will be the Android phone that you used to make the very first connection.
It is not straight-forward and requires an initial secure-less connection with the target phone, but if that is not an issue then this should work.
You can find more information about this in the links below:-
Set and activate whitelist with Android phone
Android BLE server - allow only previously connected device to connect
Whitelisting with resolvable random addresses

HTTPS connection on wi-fi enabled Android Wear without phone tethering

I can't find any documentation on Android Wear that shows how to create an app that leverages the fact that some watches (like my Samsung Galaxy Gear) can now connect directly to the internet via wi-fi when the phone is not around.
I have a few apps that generate https requests to access a REST service and I would like to know if these can be directly called from a Wear app connected to wi-fi (no phone).
Similar questions don't seem to answer this:
Direct internet connection on Android Wear?
https://stackoverflow.com/questions/26062487/android-wi-fi-direct-persistent-connection
Android: Establish "Wi-Fi Direct" connection with networked devices
My tests on a Wear emulator tethered to an internet enabled Phone emulator show:
java.net.UnknownHostException: Unable to resolve host "api.xxx.com": No address associated with hostname
But of course there's no direct wi-fi connection on the watch emulator so my next step is to try on a real watch and phone.
My suspicion is that Android Wear's data API handles this transparently so direct http requests seem impossible.
Best, thanks in advance for your help.
Even if Android 5.1.1 support Wi-Fi Feature. Android Wear on Wi-Fi: Using a smartwatch without a phone nearby
You should stick to the Data Layer API, you cannot send http request directly from watch. Fetch internet data from the phone, then transfer it to watch with Data Layer API.
You can see this Does Android Wear support directly access the Internet?
And this document Always-on and Wi-Fi with the latest Android Wear update
From the last update its possible to make http requests over wifi using android wear. You can even connect a bluetooth headphone to it to use with some streaming app.
While on wifi, if your mobile phone is connected to the internet too (dont need to be the same wifi, can be even 3g) it will act the same way it would when bluetooth connected yo our phone, but with its own internet access.
This dont mean apps will change their behavior, because most of them are coded to make the requests from your phone, but if you have an app that make direct networks requests, it will send them from your watch without advising or needing your phone.
How to do networks requests on android wear
Just use the same network requests libraries you would use on a normal Android mobile application, like volley, retrofit, okhttp. The code is exactally the same, and by the way, any Android Mobile library works with Android Wear too.

How to create a bluetooth connection between Android device and Google Glass?

I am interested in using my Android phone (running my application) to do all the heavy computing/data storage for an accompanying app running on Glass. Is there a way to make a connection over wifi or bluetooth to send/receive data between the two?
For Bluetooth, you can check out this library.
I tested it before and I'm able to connect between my phone and Glass.
Also, Google Glass GDK: How to Communicate with Android Device is helpful.
I haven't tried connecting over WiFi.

Android WiFi Peer-to-peer (P2P): how to mock the second device using a computer?

Suppose you only have one android device, but you would like to experiment with the Wi-Fi P2P API. Is it possible to use a computer to mock the other wifi device running whatever OS and application that is necessary to play the other part in the P2P communication?
I know the android emulator doesn't support wifi.

Can I emulate a wi-fi connection to test Wi-fi Direct?

In API 14 or higher (ICS), ad-hoc wi-fi networks are possible. I currently possess the following, and I'm trying to figure out how I might test the wi-fi direct functionality, or if I need to get another device with Android 4.0.
Computer, connected via a wired network to a wi-fi router.
A Galaxy Nexus, fully update.
The problem is that from a User Experience prospective, Wi-Fi Direct functionality in Android is quite crappy. Yes, it does have an API for negotiating and controlling Wi-Fi Direct connections, but "vanilla" Android doesn't have any user applications for negotiation this connection if user need it.
If yo are software developer and developing multi player game Android game, you have everything you need:
API to enable Wi-Fi Direct
to receive list of all devices nearby with enabled Wi-Fi Direct
to send connect request to another device
to accept this request and establish connection
But if you are just a user who has two devices and multi player games which can't negotiate about establishing Wi-Fi Direct connection, and and just want to connect two devices without Access Point, we are sorry.
So, if you just want to test Wi-Fi Direct functionality on your device, there are two ways to do this:
Buy / borrow device which has appropriate software "from the box", like Sony Xperia T, Samsung Galaxy SII or Samsung Galaxy SIII.
Install third party application from Android Market, like WiFi Shoot!, WiFi Direct, etc.
Hope I answered your question.

Categories

Resources