nicolas2k / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
1 stars 0 forks source link

NetworkInfo on glass connected by bluetooth is always returning the same values either mobile connected to wifi or mobile connected to data. #413

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to get connection type (mobile or wifi) on glass.
ConnectivityManager cm = (ConnectivityManager) 
getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
networkInfo.getType();

What is the expected output? 
ConnectivityManager.TYPE_MOBILE for mobile data connection
ConnectivityManager.TYPE_WIFI for mobile wifi connection

What do you see instead?
COMPANION_PROXY

A NetworkInfo objet output (networkInfo.toString()) shows:
COMPANION_PROXY[], state: CONNECTED/CONNECTED, reason: enabled, extra: (none), 
roaming: false, failover: false, isAvailable: true

What version of the product are you using? On what operating system?
XE12

Please provide any additional information below.

Original issue reported on code.google.com by anderm...@gmail.com on 16 Feb 2014 at 9:37

GoogleCodeExporter commented 8 years ago
Hello,

Thanks for the report! Could you confirm that your Glass device is indeed 
connected to an Android device?

If this is the case, is the report about being able to retrieve the companion 
device's connection state? Could you give us some details about how you would 
use such information?

Thanks!
Alain

Original comment by ala...@google.com on 18 Feb 2014 at 5:37

GoogleCodeExporter commented 8 years ago
Sure.

Testing the Mobile data connectivity I can asure the the device is connected to 
an Android Device.

About the companion device's connection state, I'm able to get 
NetworkInfo.getType() with value 14. I have not found documentation about that 
value inside Android ConnectivityManager doc page, so I have got as reference 
the value gotten from TelephonyManager, in that case 14 means: 
NETWORK_TYPE_EHRPD

Original comment by anderm...@gmail.com on 18 Feb 2014 at 6:01

GoogleCodeExporter commented 8 years ago
Please let me rephrase my question:
  1. On which device does the issue occur? Is it on Glass or the companion device?
  2. If it is on Glass, what would you use this information for?

Thanks!
Alain

Original comment by ala...@google.com on 18 Feb 2014 at 6:58

GoogleCodeExporter commented 8 years ago
Hi Alain...

1. The issue occur on Glass paired via bluetooth with mobile

2. I'm developing a live streaming app, so I'm using this information to 
establish live streaming bitrates,fps,etc.. depending on the conectiont 
type/quality.

Regards.

Original comment by anderm...@gmail.com on 19 Feb 2014 at 8:08

GoogleCodeExporter commented 8 years ago
Thanks for the clarification, this helps a lot!

Original comment by ala...@google.com on 19 Feb 2014 at 10:01