
How Android knows it's on an expensive connection - sadiq
http://www.lorier.net/docs/android-metered
======
PeterisP
Why should my phone send out strange flags (that disable sync features) just
because it's used as a hotspot?

At least for me, phone traffic is free, and if some device needs to sync some
photos the software shouldn't disturb it because somewhere (USA?) has
nonfunctioning competition in mobile connectivity.

For example, for my Android tablet the usual network connection is my phone
hotspot - how would I even know if some feature is waiting for "nonexpensive
connection" that is not going to come any time soon?

~~~
kllrnohj
> At least for me, phone traffic is free

What magical land do you live in that has truly unlimited cell data? And how
much does it cost?

> how would I even know if some feature is waiting for "nonexpensive
> connection" that is not going to come any time soon?

The feature is typical used for things like when you enable "only do this on
WiFi" type options, it knows that although it is connected to a wifi hotspot,
that hotspot itself is using cell data so don't do that expensive thing that
you said to only do on wifi.

Typically the worst thing that'll happen is you will get a few "are you sure?"
style dialogs when you go to install a large game or similar.

~~~
tadfisher
T-Mobile (US) has never gotten rid of their unlimited data option. Up until
recently, they had a 5GB cap whereafter they would throttle the connection to
EDGE speeds; they have since replaced this with a generic "don't abuse the
network" policy, which I have yet to trigger (some months I have gone over
10GB of usage).

~~~
MacsHeadroom
This unlimited LTE and HSPDA+ 4G plan by T-Mobile is $30/month, for those
interested. But only if you buy the start up kit from Walmart. The plan is
$70/month otherwise.

------
lukashed
I love it how simple the tethering works. I thought it would be some kind of
rocket science, but in fact Android is simply enabling IP forwarding by
writing a 1 into _/ proc/sys/net/ipv4/ip_forward_ and running a dhcp server.
Sometimes it's the simple solution that works best.

~~~
rca
It should also have to add some iptables rules no? At least one for the
natting and one for the filtering.

------
Tichy
Couldn't Android just ask for the DHCP option? It sounds to me as if this is a
case of Android as a DHCP client talking to Android as a DHCP host, so making
Android ask as a client seems feasible.

~~~
remosi
Yeah, it could. It doesn't tho. So you have to remember to force it if you
want android to listen to you setting the attribute.

~~~
Tichy
Ah, is the article written for other platforms who want to emulate Android in
automatically limiting Hotspots on mobile plans? Then it makes sense.

~~~
remosi
That was why I wrote it yes. I wanted to know how I could ask android phones
politely to avoid slamming the bandwidth on an AP that really didn't have the
backhaul for everyone's photos and kept these notes in case I needed to do it
again (or someone asked me how to do it.) I wasn't expecting it to be read by
more than about 3 people who were trying to figure this out :)

------
sehugg
I'd love to see this sort of thing standardized -- a "how much does this
connection cost?" function. I get twitchy whenever I hook up my laptop to any
sort of metered hotspot. And when using a gateway with wifi-over-wan there is
no way to communicate the metered connection status to the client (well, I
guess you could reverse DNS lookup your IP and guess based on the name)

Alternatively, I'd just like unmetered bandwidth everywhere...

~~~
remosi
Well, this scheme at least lets you announce "This is an (relatively)
expensive connection, please avoid doing things you don't need to.".

