
How we built Facebook Lite for every Android phone and network - obliviscence
https://code.facebook.com/posts/1365439333482197/how-we-built-facebook-lite-for-every-android-phone-and-network
======
irremediable
Anyone else find that they love FB engineering and FB research, but don't like
the product much?

FB does so much awesome technical stuff, and often shares/open-sources it. But
the actual FB site -- for me, at least -- is lacklustre. The only thing it
really shines for is event management.

This said, I guess anyone who reads HN is likely to be an outlier; and the
site's success evidently means a lot of people like it.

~~~
amelius
The Facebook site itself has lots of bugs also. For example, basic navigation
was broken for months (perhaps it still is). The back-button was completely
useless.

I really don't understand why they don't fix the problems on their own website
first.

~~~
donatj
I have been too well trained by the modern internet not to use the back button
to have noticed.

~~~
JangoSteve
I don't think I understand. I use and develop for the modern web all day every
day, and I use the back button all the time. I was thinking maybe you're
referring to highly interactive interfaces that use e.g. Angular, React, et.
al., but even those generally use push-state to maintain back-button
functionality by synchronizing the state of the app with the browser.

~~~
sbarre
I think he is jokingly referring to the fact that so many "modern" sites break
the back button without a second thought that many of us have simply stopped
using the back button as a result of this.

------
bencoder
I use this because the main facebook app had bloated to taking over 300mb of
my android phone.

Unfortunately I can't get it through google play (not available in the UK) so
I have to manually download and keep the apk updated. I wish they'd enable it
for all countries.

The separate messenger app is also going that way, hopefully they'll
eventually create a Messenger Lite app too.

~~~
SixSigma
I use the http version at [http://m.facebook.com/](http://m.facebook.com/)

None of those pesky permissions like snooping through my contacts

~~~
DCKing
On Android 6.0, Facebook must ask you for accessing your contacts, location
and doing most sensitive stuff. You can deny it those things and the app will
keep on function normally. To their credit, Facebook is a lot quicker to
update their app to work with the more restrictive Android 6.0 permission
model than others.

Combine that with something like Greenify that will stop the app from doing
stuff in the background and killing your battery, and it's actually a better
experience than the mobile website. It's just insane on how much you must tame
the application to be acceptable to use. Wish Facebook engineers would take
note of how bloated and overreaching their app is by default.

~~~
Phlarp
Bloated, overreaching, battery killing and permission hoarding could be used
to describe 90% of apps on Play Market.

~~~
DCKing
I hold the Facebook engineers to a higher standard than the developers of
those 90%. In fact I hold them to a higher standard than most engineers.

~~~
Phlarp
The sad truth is that the 10% that _don't_ do this are the lone wolf / indie
devs or small shops focusing on a single app. It's the large corps that
_should_ be held to a higher standard but aren't, and take advantage of this
fact to data mine the shit out of their customers.

For some reason every bank on the planet needs to know my location,
send/receive text messages on my behalf and listen to my microphone in order
to display a damned account balance.

------
unicornporn
There's [https://www.facebook.com/lite/](https://www.facebook.com/lite/) and
[https://touch.facebook.com/](https://touch.facebook.com/) too. But I guess
that wont allow them to mine their users for phones for contacts and other
interesting data.

~~~
softawre
Did you RTFA? [https://www.facebook.com/lite/](https://www.facebook.com/lite/)
is what this article is about...

~~~
unicornporn
Yes, but this got a bit messy to me. Facebook Lite used to be was a regular
(but light) web page[1]. Now they seem to have converted the Lite web page
brand into an app. An app that requires access to your contacts[2], among
other things.

[1]
[https://web.archive.org/web/20130624002458/https://www.lite....](https://web.archive.org/web/20130624002458/https://www.lite.facebook.com)

[2]
[https://play.google.com/store/apps/details?id=com.facebook.l...](https://play.google.com/store/apps/details?id=com.facebook.lite)

~~~
howderek
There is still [https://mbasic.facebook.com/](https://mbasic.facebook.com/) so
it has just been renamed.

~~~
currysausage
Not just renamed. It used to look like this, a decent desktop UI:
[https://tctechcrunch2011.files.wordpress.com/2009/08/2ni4mjt...](https://tctechcrunch2011.files.wordpress.com/2009/08/2ni4mjt.jpg)

------
fs111
"for every Android phone"*

* in selected countries.

------
smadge
HTTPS and HTML were designed on a NeXT with 24MHz CPU and less than 64MB RAM
over a 56kbs connection. Yet these technologies are considered too heavy for a
Galaxy Y with 600MHz CPU, and 290MB RAM over a 500kbs connection. Instead
facebook needs to invent a proprietary wire protocol and layout engine.

~~~
toomanybeersies
I thought it was more to do with the latency of mobile networks that they
invented their own protocol.

~~~
smadge
I think you can use https keep alive to only require one tcp connection.

------
rjzzleep
If you're on Android consider using FaceSlim[1]

It wraps the http version in a very nice fashion gives you configurable
message notifications, offline browsing. Allows you to disable images and
other niceties.

There's an extensive changelog on the github page, and you're free to add new
features if you feel like it.

[1]
[https://github.com/indywidualny/FaceSlim](https://github.com/indywidualny/FaceSlim)

~~~
FlyingSnake
There's Tinfoil for Facebook and Metal too.

------
veli_joza
If APK is just a VM sitting on top of Android system, perhaps it could be used
for just about any project? Maybe even integrated into Android OS.

To "install" the app you would just provide link to your production server to
the Android OS and it would appear on homescreen.

~~~
underwater
This is close to the model that Chrome is moving towards (Google FlipKart Lite
to check out an example).

You might also be interested in exponentjs.com, they're building what you
describe using React Native.

------
TazeTSchnitzel
Sounds very much like Opera Mini, a thin client web browser for similar
markets. (I remember using Mini a ton at school over 2G, it was the only
browser usable on EDGE.)

------
Etheryte
What does "Over half the world’s population, at least 1.6 billion people..."
mean? Which is it? Google says the world population was over 7 billion in
2013, this sentence confuses me greatly.

~~~
ParadoxOryx
I think they're talking about the world's internet connected population, which
is about 3 billion[1].

[1] [http://www.internetlivestats.com/internet-
users/](http://www.internetlivestats.com/internet-users/)

------
cuchoi
Personally I need something in the middle. The original Facebook app is taking
over 300mb, and this one is going to stay under 1Mb. I would love a 10-20mb, I
am using Facebook Lite now but it does give much more value than visiting the
website directly.

~~~
softawre
Sure it does! Oh, you mean more value to you, not to Facebook? :D

------
JustSomeNobody
Facebook lite is really nice on Android. I leave it running all the time and
unless the app is in the foreground, it uses virtually no battery.

I wish there was an iOS version.

~~~
scope
As iOS devices are premium, having a Lite version wouldn't serve Facebook any
good. I'm pretty sure they get _most_ of their mobile revenue from iOS
devices.

~~~
ComteDeLaFere
Actually, Android users surpassed iPhone users on Facebook back at the end of
2012. I haven't heard that they're not displaying ads on the Lite version, so
that shouldn't have an impact. That said, I've noticed that the battery drain
doesn't seem to be as bad on an iPhone when compared to the drain in Android
(which is why I uninstalled that app a while ago).

------
prats226
Well whatsapp is pretty popular in these slow connection countries facebook is
talking about even if it has ~30MB apk size. Guess what, people are ok with
it. I think reducing apk size to <1 MB by creating a VM on android thereby
compromising on UX aspects of app is not a very good idea.

But this approach sounds like a new architecture of building android
application which gives more control on server side since have core logic
there.

------
barrkel
The thing being described is basically a custom web browser.

~~~
elbigbad
Is that a bad thing?

~~~
barrkel
It's not a bad thing. It's just a conceptual complexity reduction, folding it
into an already known concept.

I hear things like virtual machine on the client, sending a UI DOM over the
wire, executing most application code on the server - but it's a long-winded
description of a web browser. Using different technologies for the slots, but
basically an isomorphic thing.

------
samfisher83
Why is the standard Facebook apk so large?

~~~
coltonv
it's probably one of the most over engineered "enterprisey" piece of software
ever created. The was an article a couple months back about how the app had
more than 19000 Java Classes. A lot of them were auto generated i think. I
have no idea how a code base ends up that bloated.

~~~
TazeTSchnitzel
It's so bloated that the app has to hack into the Dalvik VM so that it won't
crash from the huge number of classes.

------
groys
Author of the blog here, happy to answer any questions.

------
sundvor
Sounds awesome, yet still not available in Play Store in Australia. Which is
why I'm using Metal, or just the web browser. The full app brings my S6 Edge
to its knees.

~~~
Splines
[http://www.apkmirror.com/apk/facebook-2/lite/](http://www.apkmirror.com/apk/facebook-2/lite/)

Keep in mind that this is not the official release location, so caveat emptor.

~~~
sundvor
Thanks!

------
lucb1e
> less than 1 MB in size, meaning people can download it in seconds on slow
> connections

No. 1 MB downloads in seconds on most connections; slow connections will be
closer to half a minute than to 'seconds'.

This is why the Facebook app is so bloated in the first place, assumptions
about connections and devices in the majority of the world.

~~~
Fargren
IMO, half a minute falls within "seconds". If I had to cut it somewhere, I'd
think it would be in 45 or 50 seconds, at which point I would call it almost a
minute. But then again, colloquial english.

Still. The point is that this does not take several minutes to download, and
thus is unlikely to fail. And that's a huge achievment on Android.
Applications that do very little can very easily get to 5 or 10MB. Facebook
does quite a lot, and the benefits of doing that with only 1MB are obvious.

------
akerro
Does it have less than 4000 classes?

~~~
Cthulhu_
4K classes is not much if you've included a few libraries.

------
minikomi
Sounds awesome. Here's hoping for more Lite apps!

------
roddux
"Samsung Galaxy Y comes with _very restrictive specs of 290 MB RAM, 600 MHz
processor, and 180 MB internal memory_."

In what universe is a 600MHz CPU and 290MB of RAM restrictive for a glorified
RSS reader?

------
tangue
"... like the Samsung Galaxy Y comes with very restrictive specs of 290 MB
RAM, 600 MHz processor, and 180 MB internal memory. " I'm feeling old when I'm
seeing that these are restrictive specs...

------
yomly
Wonder if they're employing a middle out data compression algorithm...

------
itgoon
Could they spend some of this time and effort on the website, itself? I don't
need yet another app trying to take over the world via my phone.

------
Splendor
Well, not "every Android phone". It's not compatible with my Nexus 5X
according to the Play store.

~~~
dublinben
Or presumably any of the millions of Android devices without the Google Play
Store.

------
novaleaf
... and just yesterday I deleted facebook messenger because it drained my
battery before 11am. (android)

------
Philipp__
iOS app is ridiculously bad! It's gigantic, monolithic battery drainer! In
combination with Messenger I think it is awesome how bad those products are.
Twitter is not much better with app. And their site for mobile looks like it
hasn't been updtated since creation.

------
eecc
Hmm, pushing a compressed ui tree sounds a bit like Xorg. Doesn't it?

------
tdkl
The main product is a social experiment, made possible by a sociopath and
exploits human social relationships and interactions for profit.

~~~
dang
Flinging around a term like "sociopath" about a specific person is a breach of
HN's civility rules. Please don't do that again.

We detached this subthread from
[https://news.ycombinator.com/item?id=11252782](https://news.ycombinator.com/item?id=11252782)
and marked it off-topic.

