# Flipboard

The official Flipboard engineering blog

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Detecting Trustworthy Domains

DevFeed: [Detecting Trustworthy Domains](<https://devfeed.tech/articles/detecting-trustworthy-domains-31895.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2017/04/domainranking>)

Author: https://www.linkedin.com/in/mikecora/ (Mike Vlad Cora)

Published: 2017-04-12T00:00:00Z

Content type: article

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [Python](<https://devfeed.tech/topics/python.md>), [scikit-learn](<https://devfeed.tech/topics/scikit-learn.md>), [AI Development](<https://devfeed.tech/topics/ai-development.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [data-pipeline](<https://devfeed.tech/tags/data-pipeline.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [ml](<https://devfeed.tech/tags/ml.md>), [python](<https://devfeed.tech/tags/python.md>), [quality](<https://devfeed.tech/tags/quality.md>)

### AI overview

Flipboard describes its Domain Ranker, a machine learning system that predicts how its editorial team would label domains. The article focuses on the engineering work behind the system, including live data pipelines, feature engineering, and classifier experiments using scikit-learn in Python.

### Source excerpt

High quality, truthful, diverse and informative content is Flipboard's #1 priority. Hand-picking trusted sources guarantees quality, but is very time consuming, and can potentially miss out on the multitude of excellent but smaller publishers. To address this problem, we've developed a machine learning (ML) system called the Domain Ranker. Its goal is to automatically distinguish authoritative domains from plagiarists, spammers and other low quality sources. It learns to predict how our editorial team would label a domain by analyzing the content and the signals generated by our users. The Domain Ranker scales our editorial thinking to a much larger amount of content than we could handle manually, ensuring high quality across all topics. Overview Flipboard has indexed hundreds of millions of articles in the last year alone. In addition to the constant stream of articles from our trusted partners, any user can add any web article into their personal magazines, further expanding Flipboard's pool to non-partner publishers. Our community support and editorial teams are constantly battling the endless churn of spam sites. Through their efforts, we have identified thousands of labeled spam domains, alongside thousands of partner and whitelisted publishers. The Domain Ranker is a machine learning system that uses this labeled data to learn and generalize our editorial thinking to unlabeled sources. In this blog post I do not delve into the theory behind any of the machine learning classifiers used. They are all well known, off-the-shelf implementations in the scikit-learn Python library. Instead I will focus on the engineering journey: managing the live data pipeline, exploring and engineering reasonable features, and experimenting with a multitude of classifiers to maximize accuracy. I compare an ML project to an open-ended "Choose Your Own Adventure" book: every path leads to an almost unlimited number of forks, fraught with perils and rewards. There are many paths that

## Clustering Similar Stories Using LDA

DevFeed: [Clustering Similar Stories Using LDA](<https://devfeed.tech/articles/clustering-similar-stories-using-lda-31894.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2017/02/storyclustering>)

Author: https://www.linkedin.com/in/arnab-bhadury-a6304768 (Arnab Bhadury)

Published: 2017-02-08T00:00:00Z

Content type: article

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [clustering](<https://devfeed.tech/topics/clustering.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [computational complexity](<https://devfeed.tech/topics/computational-complexity.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [scikit-learn](<https://devfeed.tech/topics/scikit-learn.md>), [monte carlo tree search](<https://devfeed.tech/topics/monte-carlo-tree-search.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [clustering](<https://devfeed.tech/tags/clustering.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [fast](<https://devfeed.tech/tags/fast.md>), [overview](<https://devfeed.tech/tags/overview.md>), [perspective](<https://devfeed.tech/tags/perspective.md>), [stories](<https://devfeed.tech/tags/stories.md>), [story](<https://devfeed.tech/tags/story.md>), [text](<https://devfeed.tech/tags/text.md>)

### AI overview

Flipboard's story roundups group articles about the same event by reducing high-dimensional text to sparse LDA topic representations, then using approximate nearest-neighbor search to cluster nearby documents. This addresses vocabulary differences and avoids choosing the number of clusters in advance; exact duplicates are removed so roundups can surface other perspectives. For scale, the post combines Alias sampling with Metropolis-Hastings proposals to speed LDA inference while accounting for changing count matrices. It reports an amortized complexity improvement and processing documents an order of magnitude faster, though the excerpt omits the runtime table and graph behind that comparison.

### Source excerpt

There is more to a story than meets the eye, and some stories deserve to be presented from more than just one perspective. With Flipboard 4.0, we have released story roundups, a new feature that adds coverage from multiple sources to a story and provides you with a fuller picture of an event. Here's how it looks: With our scale of millions of articles and constant stream of documents, it's impossible to generate these roundups manually. So, we have developed a clustering algorithm that's both fast and scalable, and in this blog post, I will explain how we create these roundups on Flipboard. Why is this difficult? Although there are many sophisticated automatic clustering algorithms, such as K-means or Agglomerative clustering, story clustering is a non-trivial problem. Because each text document can contain any word from our vocabulary, most text document representations are extremely high-dimensional. In high-dimensional spaces, even basic clustering or similarity measures fail or are very slow. Additionally, two very similar documents often have very different word usages. For example, one article may use the term kitten and another may use feline, but both articles could be referring to the same cat. Furthermore, we don't know the number of roundups that we expect to see beforehand. This makes it difficult for us to directly use parameteric algorithms such as K-means. Our clustering algorithm also needs to be fast and easy to update, because there is a constant stream of documents coming into our system. Overview Since even the most basic distance measures fail in high dimensions, the first thing we do is lower the problem's dimensionality. We represent each of our text documents as a bag-of-words, and remove stop-words and rare words from our vocabulary. Even after an aggressive trimming, the documents are still very high-dimensional. We then we use Latent Dirichlet Allocation (LDA) to further lower the documents' dimensionality. We use LDA because this algorith

## iOS Meetup

DevFeed: [iOS Meetup](<https://devfeed.tech/articles/ios-meetup-31892.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2015/09/ios-meetup>)

Author: https://twitter.com/timonus (Tim Johnsen)

Published: 2015-09-09T00:00:00Z

Content type: news

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>)

Tags: [apple-watch](<https://devfeed.tech/tags/apple-watch.md>), [developing](<https://devfeed.tech/tags/developing.md>), [ios](<https://devfeed.tech/tags/ios.md>), [meetup](<https://devfeed.tech/tags/meetup.md>), [talk](<https://devfeed.tech/tags/talk.md>), [video](<https://devfeed.tech/tags/video.md>), [watchos](<https://devfeed.tech/tags/watchos.md>)

### AI overview

Flipboard hosted a Palo Alto iOS Developers group meetup focused on developing apps for watchOS 2. Ben Morrow, author of the Happy Watch blog and host of Apple Watch hackathons, gave a talk covering various aspects of watchOS 2. Flipboard also shared how it built its WatchKit app and what it had planned for watchOS 2. The source says a complete video of the meetup is available.

### Source excerpt

Flipboard was honored to host a meetup of the Palo Alto iOS Developers group about developing apps for watchOS 2 at our office in Palo Alto last week. Ben Morrow, writer of the Happy Watch blog and host of several Apple Watch hackathons, gave a talk deep diving into various aspects of watchOS 2. We also gave a short talk sharing a bit of the story about how we built our WatchKit app and what we've got in store for watchOS 2. A photo posted by Flipboard (@flipboard) on Sep 3, 2015 at 11:29am PDT We'd like to thank Mike Suprovici and the community for giving us the oppourtunity to host this event. Here's a complete video of the meetup P.S. We're hiring!

## Introducing PSync

DevFeed: [Introducing PSync](<https://devfeed.tech/articles/introducing-psync-31893.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2015/09/psync>)

Author: https://github.com/hzsweers (Zac Sweers)

Published: 2015-09-08T00:00:00Z

Content type: article

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [gradle-plugin](<https://devfeed.tech/topics/gradle-plugin.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Java](<https://devfeed.tech/topics/java.md>), [XML](<https://devfeed.tech/topics/xml.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code](<https://devfeed.tech/tags/code.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [gradle-plugin](<https://devfeed.tech/tags/gradle-plugin.md>), [java](<https://devfeed.tech/tags/java.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [xml](<https://devfeed.tech/tags/xml.md>)

### AI overview

Flipboard introduces PSync, an Android-specific Gradle plugin that generates Java representations of XML preferences. The plugin reduces the boilerplate required to mirror preference values in code and supports both library and application projects.

### Source excerpt

Here on the Android team at Flipboard, we have a lot of settings for users to adjust their experience. If you throw in internal settings, we have about 100 total preferences to manage. This is a lot of boilerplate to maintain, because preferences in Android have no built-in synchronization (unlike Resources). Our 1 PreferenceFragment class has a couple hundred lines of boilerplate fields at the top where we keep in-code mirrors to these preference values. This design is tedious, brittle, and requires a lot of overhead to keep in sync with XML. We developed a Gradle plugin called PSync to solve this problem. PSync is an Android-specific Gradle plugin that generates Java representations of XML preferences. These Java classes can then be used directly in your code. The generated code is very much inspired by how 1 R.java works for resources, and should feel familiar to developers. It's easy to use, has some simple configurations for fine-tuning your generated code, and is ready to drop into both library and application projects. A full overview can be found on the GitHub README, but here's a quick preview: Say you have a preference: 1 2 3 4 <CheckboxPreference android:key="show_images" android:defaultValue="true" /> You can reference it like this: 1 2 3 4 5 6 7 8 9 String theKey = P.showImages.key; boolean current = P.showImages.get(); P.showImages.put(false).apply(); // If you use Rx-Preferences P.showImages.rx().asObservable().omgDoRxStuff! // If you need it boolean theDefault = P.showImages.defaultValue(); The generated Java code looks like so: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 public final class P { public static final class showImages { public static final String key = "show_images"; public static final boolean defaultValue() { return true; } public static final boolean get() { return PREFERENCES.getBoolean(key, defaultValue()); } public static final SharedPreferences.Editor put(final boolean val) { return PREFERENCES.edit().putBoolean(key, val

## Presenting BottomSheet

DevFeed: [Presenting BottomSheet](<https://devfeed.tech/articles/presenting-bottomsheet-31891.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2015/06/bottomsheet>)

Author: https://github.com/emilsjolander (Emil Sjölander)

Published: 2015-06-04T00:00:00Z

Content type: article

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [Material Design](<https://devfeed.tech/topics/material-design.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [components](<https://devfeed.tech/tags/components.md>), [filter](<https://devfeed.tech/tags/filter.md>), [github](<https://devfeed.tech/tags/github.md>), [interaction](<https://devfeed.tech/tags/interaction.md>), [material-design](<https://devfeed.tech/tags/material-design.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [sorting](<https://devfeed.tech/tags/sorting.md>)

### AI overview

Flipboard introduces BottomSheet, an open-source Android UI component for presenting views from the bottom of the screen with interactive dismissal and animations. It also releases IntentPickerSheetView, which provides filtering and sorting for activities handling an intent.

### Source excerpt

We are happy to introduce BottomSheet a new Open Source Android UI Component! At Flipboard, we love building visually stunning and highly interactive UIs. When building these UIs, we tend to build them as fairly stand alone components. This makes it very easy for our developers to implement a similar interaction model and aesthetic across the whole product while working in parallel. BottomSheet is a UI component we developed to facilitate a new interaction model for saving an article to one of your magazines (otherwise known as "The Flip UI"). The result of our efforts is a design you can now see in the current version of Flipboard. BottomSheet fits perfectly with Google's Material Design aesthetic as well, matching their Bottom Sheet specification. We think this component is great for displaying many types of views, from a simple intent picker to something as complex as the example shown from Flipboard. In its simplest form, BottomSheet can be used to show any view in a sort of modal UI that's presented from the bottom of the screen can be interactively dismissed. At Flipboard, we think it's very important that things feel responsive, and having interactive animations is an important part of this. Apart from providing a component for presenting views in a BottomSheet, we have also have a module for common views developers might like to present in a BottomSheet. The first such component we're releasing is the 1 IntentPickerSheetView. This sheet view is initialized with an intent and will show a grid of activities that can handle the intent. It works very similarly to Android's built in IntentChooser, and looks very similar to the picker used in Lollipop and above. There are a couple of ways in which our implementation improves upon the system intent chooser: It can be interactively dismissed, making it feel much more responsive. It adds an easy-to-use API for filtering and sorting the activities shown. Ever wanted to filter out the Bluetooth activity when adding sha

## Image Scaling using Deep Convolutional Neural Networks

DevFeed: [Image Scaling using Deep Convolutional Neural Networks](<https://devfeed.tech/articles/image-scaling-using-deep-convolutional-neural-networks-31890.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2015/05/scaling-convnets>)

Author: https://twitter.com/normantasfi (Norman Tasfi)

Published: 2015-05-06T00:00:00Z

Content type: article

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [Deep neural networks](<https://devfeed.tech/topics/deep-neural-networks.md>), [Image processing](<https://devfeed.tech/topics/image-processing.md>), [Neural Network](<https://devfeed.tech/topics/neural-network.md>), [Deep learning](<https://devfeed.tech/topics/deep-learning.md>), [model architecture](<https://devfeed.tech/topics/model-architecture.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [Hyperparameter optimization](<https://devfeed.tech/topics/hyperparameter-optimization.md>), [Image](<https://devfeed.tech/topics/image.md>), [pixel](<https://devfeed.tech/topics/pixel.md>), [image recognition](<https://devfeed.tech/topics/image-recognition.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [applications](<https://devfeed.tech/tags/applications.md>), [artifacts](<https://devfeed.tech/tags/artifacts.md>), [convolutional-neural-networks](<https://devfeed.tech/tags/convolutional-neural-networks.md>), [deep](<https://devfeed.tech/tags/deep.md>), [image](<https://devfeed.tech/tags/image.md>), [images](<https://devfeed.tech/tags/images.md>), [learning](<https://devfeed.tech/tags/learning.md>), [machine](<https://devfeed.tech/tags/machine.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [model](<https://devfeed.tech/tags/model.md>), [nearest-neighbor](<https://devfeed.tech/tags/nearest-neighbor.md>), [neural-networks](<https://devfeed.tech/tags/neural-networks.md>), [scale](<https://devfeed.tech/tags/scale.md>), [scaling](<https://devfeed.tech/tags/scaling.md>), [upscaling](<https://devfeed.tech/tags/upscaling.md>)

### AI overview

The post reports preliminary results from a Flipboard image upscaling model intended for cases where higher resolution originals are unavailable. The model doubles image dimensions and, in the presented examples, retains some fine details and edges better than bicubic scaling; these are preliminary comparisons, not a claim that the method replaces conventional upscaling. It uses an eight-layer convolutional and fully connected network trained on roughly three million natural-image low/high-resolution pairs with mean squared error. The author reports that pooling discarded useful spatial detail and produced grainy results, while a larger network generalized better than a smaller one. Training the final model took about 19 hours on Amazon g2.2xlarge instances. Proposed applications include still images, GIF frames, and sending smaller images for client-side upscaling, though client-side use is presented as a possibility rather than a demonstrated deployment.

### Source excerpt

This past summer I interned at Flipboard in Palo Alto, California. I worked on machine learning based problems, one of which was Image Upscaling. This post will show some preliminary results, discuss our model and its possible applications to Flipboard's products. High quality and a print-like finish play a key role in Flipboard's design language. We want users to enjoy a consistent and beautiful experience throughout all of Flipboard's content, as if they had a custom print magazine in hand. Providing this experience consistently is difficult. Different factors, such as image quality, deeply affect the overall quality of the presented content. Image quality varies greatly depending on the image's source. This varying image quality is especially apparent in magazines that display images across the whole page in a full bleed format. When we display images on either the web or mobile devices they must be above a certain threshold to display well. If we receive a large image on our web product we can create breathtaking full bleed sections. Full bleed High Quality Image Lower resolution images introduce pixelation, over smoothing and artifacts when scaled above 100%. This is especially apparent in a full bleed presentation as seen below. This severely reduces the quality of presentation in our products. Full bleed Low Quality Image What is the cause of this? In general, when we need an image of size X that is required to be of size Y it must be run through a scaling algorithm. This algorithm performs a mathematical operation to scale the image pixels to the desired size Y. Some of the possible algorithms are bicubic, bilinear, and nearest-neighbor interpolation. Many of the algorithms listed above perform an interpolation between pixel values to create a transition. These algorithms use the surrounding pixels to guess what the missing values should be in the new image. The problem in the case of scaling the image to a larger size is when there are too many 'new' values

## NSUserDefaults Performance Boost

DevFeed: [NSUserDefaults Performance Boost](<https://devfeed.tech/articles/nsuserdefaults-performance-boost-31889.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2015/03/nsuserdefaults-performance>)

Author: https://twitter.com/timonus (Tim Johnsen)

Published: 2015-03-16T00:00:00Z

Content type: article

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [mobile-app-performance](<https://devfeed.tech/topics/mobile-app-performance.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [Architecture & optimization](<https://devfeed.tech/topics/architecture-optimization.md>)

Tags: [cache](<https://devfeed.tech/tags/cache.md>), [ios](<https://devfeed.tech/tags/ios.md>), [performance](<https://devfeed.tech/tags/performance.md>), [simulator](<https://devfeed.tech/tags/simulator.md>), [speed](<https://devfeed.tech/tags/speed.md>)

### AI overview

After iOS 8, Flipboard found simulator sluggishness associated with time spent in CFPreferences. The excerpt attributes this to simulator emulation of cfprefsd requiring synchronous disk reads; an Apple engineer said device performance had priority in addressing it. Flipboard's workaround adds a per-instance in-memory write-through cache to NSUserDefaults by swizzling its getters and setters, enabled only for simulator builds via TARGET_IPHONE_SIMULATOR. The team reports CFPreferences time falling from 80% to 1% in its trace. The category is open source and can be included in a project, but may cause side effects when debugging extensions. These results describe the team's simulator use, not device performance.

### Source excerpt

Since iOS 8 was released we've noticed some sluggishness when using Flipboard in the simulator. When taking a trace with Instruments in normal use we noticed a significant amount of time was being spent in 1 CFPreferences. On Twitter, an Apple engineer acknowledged that there were some changes in iOS 8 that added something called 1 cfprefsd, and that emulating that in the simulator required synchronous reads from disk. This seemed to be the bottleneck we were encountering. @timonus unfortunately cfprefsd doesn't currently exist in the simulator, and emulating its behavior requires synchronize disk IO -- David Smith (@Catfish_Man) January 21, 2015 @timonus it's on my list to fix, but it's a large effort and device took priority -- David Smith (@Catfish_Man) January 21, 2015 About a month ago we were talking as a team about how slow we felt our app had become to debug in the simulator, so we decided to try to do something to speed it up. Our approach was to introduce a man-in-the-middle write-through cache to 1 NSUserDefaults in memory. We do so by swizzling out all of 1 NSUserDefaults' setters and getters and adding a per-instance 1 NSMutableDictionary to cache values. We avoid compiling this for device builds using 1 TARGET_IPHONE_SIMULATOR because there aren't such performance issues on device. The increase in performance is dramatic, where we were once spending 80% of our time in 1 CFPreferences we're now spending 1%. If you're seeing performance issues related to 1 NSUserDefaults in the simulator I recommend trying this out, it's open source and available for download on GitHub. To get started using it all you need to do is include it in your project. Please note that use of this category may cause side effects when debugging extensions. This is documented in the GitHub project.

## Introducing GoldenGate

DevFeed: [Introducing GoldenGate](<https://devfeed.tech/articles/introducing-goldengate-31887.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2015/02/golden-gate>)

Author: https://twitter.com/emilsjolander (Emil Sjölander)

Published: 2015-02-24T00:00:00Z

Content type: release

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [annotation-processor](<https://devfeed.tech/topics/annotation-processor.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [annotation](<https://devfeed.tech/tags/annotation.md>), [applications](<https://devfeed.tech/tags/applications.md>), [bridge](<https://devfeed.tech/tags/bridge.md>), [communication](<https://devfeed.tech/tags/communication.md>), [compile](<https://devfeed.tech/tags/compile.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [concatenation](<https://devfeed.tech/tags/concatenation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [library](<https://devfeed.tech/tags/library.md>), [native](<https://devfeed.tech/tags/native.md>), [types](<https://devfeed.tech/tags/types.md>), [webview](<https://devfeed.tech/tags/webview.md>)

### AI overview

GoldenGate is an Android annotation processing library that generates Java wrappers for JavaScript methods called through a WebView. Developers define an interface annotated with `@Bridge`; at compile time, GoldenGate generates an implementing bridge class, allowing Java calls such as `bridge.alert(myString)` and checking argument types against the interface. This replaces manually assembled `javascript:` strings, which the excerpt says can contain mistakes the compiler will not catch. Advanced options are mentioned but not described here.

### Source excerpt

You might not know it, but both Flipboard for iOS and Flipboard for Android make heavy use of web views. We use web views so we can ensure consistent designs for our partners' articles across all platforms. Communication between native code and the JavaScript code running in a web view is something that is both tedious to implement as well as very bug prone as it's mostly just string concatenation. Today we are releasing a library to make this task easier when developing Android applications which use web views. GoldenGate is a annotation processing library which generates java wrappers around your JavaScript code. An annotation processing library is a piece of code which runs when you compile your code and has the ability to generate new java classes. This means that GoldenGate can ensure at compile time that you are sending the correct types into the JavaScript functions you define in your bridge. If you're interested in knowing more about how to write your own, this blog post is a good intro. Let's get into a quick example to really show the power of the library! First of all a quick example of how to currently call a JavaScript function in a WebView. 1 webview.loadUrl("javascript:alert(" + myString + ");"); You should clearly see that a lot can go wrong here which the compiler won't catch. For example you could misspell 1 alert or maybe 1 myString isn't a string at all. GoldenGate allows for the compiler to have your back. The same code as above written with GoldenGate looks like this. 1 2 3 4 5 6 7 @Bridge class JavaScript { void alert(String message); } JavaScriptBridge bridge = new JavaScript(webview); bridge.alert(myString); We started by defining an interface which describes the JavaScript methods we want to call from java. This interface is annotated with 1 @Bridge which is where the magic happens. This will generate a class named 1 JavaScriptBridge in this case which implements all the methods defined by the interface. There are a couple more options for

## 60fps on the mobile web

DevFeed: [60fps on the mobile web](<https://devfeed.tech/articles/60fps-on-the-mobile-web-31888.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2015/02/mobile-web>)

Author: https://twitter.com/bapjuseyo (Michael Johnston)

Published: 2015-02-10T00:00:00Z

Content type: article

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [Front end](<https://devfeed.tech/topics/frontend.md>), [React](<https://devfeed.tech/topics/react.md>), [mobile optimization](<https://devfeed.tech/topics/mobile-optimization.md>), [web animation](<https://devfeed.tech/topics/web-animation.md>), [infinite scroll](<https://devfeed.tech/topics/infinite-scroll.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [HTML](<https://devfeed.tech/topics/html.md>), [Web Accessibility (a11y)](<https://devfeed.tech/topics/web-accessibility.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [about](<https://devfeed.tech/tags/about.md>), [all](<https://devfeed.tech/tags/all.md>), [animate](<https://devfeed.tech/tags/animate.md>), [animation](<https://devfeed.tech/tags/animation.md>), [animations](<https://devfeed.tech/tags/animations.md>), [apps](<https://devfeed.tech/tags/apps.md>), [avoid](<https://devfeed.tech/tags/avoid.md>), [best](<https://devfeed.tech/tags/best.md>), [black](<https://devfeed.tech/tags/black.md>), [book](<https://devfeed.tech/tags/book.md>), [browser](<https://devfeed.tech/tags/browser.md>), [but](<https://devfeed.tech/tags/but.md>), [can](<https://devfeed.tech/tags/can.md>), [circle](<https://devfeed.tech/tags/circle.md>), [content](<https://devfeed.tech/tags/content.md>), [css](<https://devfeed.tech/tags/css.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [mobile-web](<https://devfeed.tech/tags/mobile-web.md>), [web](<https://devfeed.tech/tags/web.md>)

### AI overview

Flipboard describes using canvas with React to build a mobile web timeline that can scroll at 60fps, targeting a sub-16ms frame budget. The authors say DOM updates during animation can exceed that budget, while canvas sends drawing commands to hardware-accelerated graphics; canvas also lacks conveniences such as text wrapping, load handling, and retained scene structure. Their React Canvas layer tree handles image and font loading, batches dirty-layer redraws, caches rendered content in off-screen canvases, pools layer objects, and renders only visible list items. JavaScript handles touch scrolling through the Scroller library. The approach is intended for performance-critical views, not as a full DOM replacement: the article notes DOM remains useful for other UI and necessary for elements such as inputs and audio/video. Accessibility support is described as unresolved, with mixed results from fallback content and ongoing investigation.

### Source excerpt

Flipboard launched during the dawn of the smartphone and tablet as a mobile-first experience, allowing us to rethink content layout principles from the web for a more elegant user experience on a variety of touchscreen form factors. Now we're coming full circle and bringing Flipboard to the web. Much of what we do at Flipboard has value independent of what device it's consumed on: curating the best stories from all the topics, sources, and people that you care about most. Bringing our service to the web was always a logical extension. As we began to tackle the project, we knew we wanted to adapt our thinking from our mobile experience to try and elevate content layout and interaction on the web. We wanted to match the polish and performance of our native apps, but in a way that felt true to the browser. Early on, after testing numerous prototypes, we decided our web experience should scroll. Our mobile apps are known for their book-like pagination metaphor, something that feels intuitive on a touch screen, but for a variety of reasons, scrolling feels most natural on the web. In order to optimize scrolling performance, we knew that we needed to keep paint times below 16ms and limit reflows and repaints. This is especially important during animations. To avoid painting during animations there are two properties you can safely animate: CSS transform and opacity. But that really limits your options. What if you want to animate the width of an element? How about a frame-by-frame scrolling animation? (Notice in the above image that the icons at the top transition from white to black. These are 2 separate elements overlaid on each other whose bounding boxes are clipped depending on the content beneath.) These types of animations have always suffered from jank on the web, particularly on mobile devices, for one simple reason: The DOM is too slow. It's not just slow, it's really slow. If you touch the DOM in any way during an animation you've already blown through your 16ms