Facebook code projects for Android 簡介與紀錄

https://code.facebook.com/projects/android/
Open source from Facebook

Framework

React Native: A framework for building native apps using React

使用 JavaScript(ES6+)和 React 打造跨平台原生應用程式
在 JavaScript 和 Native 之間的操作為非同步(Asynchronous)執行,並可用 Chrome 開發者工具除錯,支援 Hot Reloading

Facebook 已使用 React Native 於自家 Production App 且將持續維護,另外也有持續蓬勃發展的技術社群
red: http://blog.techbridge.cc/2016/09/10/react-native-redux-android-firebase/



Optimization

redex: A bytecode optimizer for Android apps

基於.dex檔對app進行優化
ref: http://www.jianshu.com/p/78ad578251ef


buck: a build system that encourages the creation of small, reusable modules consisting of code and resources.

Buck受到了Google Blaze的启发,创建它是为了处理与多个Android库有复杂关联的应用程序,从而减少构建时间。
Buck是用Java编写的,而构建规则最初是用Python定义的,后来为了更快的规则评估而采用了Jython。工具现在被用于构建Android Java代码,但是团队正在努力使其支持构建纯粹的Java代码,而与Android无关,它可能会扩展到构建Python项目,可能还会支持其他类型的项目。
ref: http://www.infoq.com/cn/news/2013/05/Facebook-buck-xctool-build/


UI


rebound: a Java library that models spring dynamics. Rebound spring models can be used to create animations that feel natural by introducing real world physics to your application.

Rebound spring models can be used to create animations that feel natural by introducing real world physics to your application.
ref: https://www.uplabs.com/posts/springy_facebook_rebound
ref: http://facebook.github.io/rebound/


Shimmer for Android: An easy, flexible way to add a shimmering effect to any view in an Android app.

shimmer-android是Facebook出品的给任意视图添加微光效果的第三方库
ref:http://www.jianshu.com/p/373851a0f1f4


Android SDK

conceal: Conceal provides a set of Java APIs to perform cryptography on Android.

It was designed to be able to encrypt large files on disk in a fast and memory efficient manner. The major target for this project is typical Android devices which run old Android versions, have low memory and slower processors.
提供了加密的Java API接口,这些简单易用的接口可以让应用程序以最优的方式加密数据。
Conceal的加密算法基于OpenSSL,但是在arm7下的OpenSSL库大小有1MB,我们缩减了OpenSLL库的内容,经过编译现在他只有85KB。一个更小的库,有益于兼容更多的android版本,以及减少后期的维护成本。
Conceal比目前的任何一个java加密库都轻巧快捷,同时它使用AES-GCM算法,来防止对数据进行的恶意篡改。ref: https://segmentfault.com/a/1190000000432304


Network Connection Class: Listen to current network traffic in the app and categorize the quality of the network.

an Android library that allows you to figure out the quality of the current user's internet connection.
ref: https://github.com/facebook/network-connection-class
ref: http://www.lai18.com/content/1420515.html


Device Year Class: A library that analyzes an Android device's specifications and calculates which year the device would be considered "high end”

Device Year Class is an Android library that implements a simple algorithm that maps a device's RAM, CPU cores, and clock speed to the year where those combination of specs were considered high end. This allows a developer to easily modify application behavior based on the capabilities of the phone's hardware.
ref:https://github.com/facebook/device-year-class


Fresco: managing images and the memory

Fresco takes care of image loading and display, so you don't have to. It will load images from the network, local storage, or local resources, and display a placeholder until the image has arrived. It has two levels of cache; one in memory and another in internal storage.

In Android 4.x and lower, Fresco puts images in a special region of Android memory. This lets your application run faster - and suffer the dreaded OutOfMemoryError much less often.

Fresco also supports:
streaming of progressive JPEGs
display of animated GIFs and WebPs
extensive customization of image loading and display
ref: https://github.com/facebook/fresco
ref: https://www.fresco-cn.org/docs/index.html


bolts-android: a collection of low-level libraries designed to make developing mobile apps easier.

多线程编程变得和iOS一样简单好用
ref: http://www.jianshu.com/p/fcfb541568af


Facebook SDK for Android: Use the Facebook SDK for Android to integrate with Facebook, help build engaging social apps, and get more installs.

ref: https://developers.facebook.com/docs/android


Tools

Infer: A static analyzer in deployment at Facebook, where it is used as part of the development process for mobile apps.

Infer targets critical bugs such as null pointer exceptions, resource leaks and memory leaks — problems which lead to crashes or performance degradation in apps.
ref: https://infer.liaohuqiu.net


Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.

用Chrome调试Android App
ref: http://stormzhang.com/android/2015/03/05/android-debug-use-chrome/


PathPicker:simple command-line tool to select the files out of bash output. Using the magic of regexes and curses, never have to fuss with complicated pipes again

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything.

After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands.
Besides opening files in your editor, PathPicker also allows you to execute arbitrary commands with the selected files.

You can use your selection to add files to version control, change permissions, scp, delete
ref: http://facebook.github.io/PathPicker/


screenshot-tests-for-android: screenshot-test-for-android is a library that can generate fast deterministic screenshots while running instrumentation tests in android.

ref: http://facebook.github.io/screenshot-tests-for-android/#getting-started


Other

makeitopen: a learning portal that begins with the F8 App tutorial series, and will hopefully expand to encompass lots of additional tutorials designed to connect our FB Open Source projects.

ref: http://makeitopen.com

留言