Search Preview
Airbnb Engineering & Data Science
airbnb.ioAirbnb.io Open SourceEventsBlogGithubCareersAirbnb.io RxGroupsEasily group RxJava Observables together and tie them to your Android Activity lifecycle668B
.io > airbnb.io
SEO audit: Content analysis
Language | Error! No language localisation is found. | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Title | Airbnb Engineering & Data Science | ||||||||||||||||||||||||||||||||||||
Text / HTML ratio | 43 % | ||||||||||||||||||||||||||||||||||||
Frame | Excellent! The website does not use iFrame solutions. | ||||||||||||||||||||||||||||||||||||
Flash | Excellent! The website does not have any flash contents. | ||||||||||||||||||||||||||||||||||||
Keywords cloud | public Override void = RxGroups private Observer protected Activity automatically AutoResubscribe resubscriptionTag final CareersDesign Observable onResume method onDestroy return tag | ||||||||||||||||||||||||||||||||||||
Keywords consistency |
|
||||||||||||||||||||||||||||||||||||
Headings |
|
||||||||||||||||||||||||||||||||||||
Images | We found 1 images on this web page. |
SEO Keywords (Single)
Keyword | Occurrence | Density |
---|---|---|
public | 14 | 0.70 % |
Override | 12 | 0.60 % |
void | 11 | 0.55 % |
= | 10 | 0.50 % |
RxGroups | 6 | 0.30 % |
private | 6 | 0.30 % |
Observer | 6 | 0.30 % |
protected | 5 | 0.25 % |
Activity | 5 | 0.25 % |
automatically | 4 | 0.20 % |
AutoResubscribe | 4 | 0.20 % |
resubscriptionTag | 4 | 0.20 % |
final | 3 | 0.15 % |
CareersDesign | 3 | 0.15 % |
Observable | 3 | 0.15 % |
onResume | 3 | 0.15 % |
method | 3 | 0.15 % |
onDestroy | 3 | 0.15 % |
return | 3 | 0.15 % |
tag | 3 | 0.15 % |
SEO Keywords (Two Word)
Keyword | Occurrence | Density |
---|---|---|
to your | 7 | 0.35 % |
Override public | 7 | 0.35 % |
public void | 6 | 0.30 % |
Override protected | 5 | 0.25 % |
protected void | 5 | 0.25 % |
onErrorThrowable e | 2 | 0.10 % |
public final | 2 | 0.10 % |
public Object | 2 | 0.10 % |
Observer with | 2 | 0.10 % |
tag for | 2 | 0.10 % |
the same | 2 | 0.10 % |
AutoResubscribe public | 2 | 0.10 % |
= new | 2 | 0.10 % |
observer = | 2 | 0.10 % |
resubscriptionTag return | 2 | 0.10 % |
onNextLong l | 2 | 0.10 % |
void onNextLong | 2 | 0.10 % |
void onCompleted | 2 | 0.10 % |
e Override | 2 | 0.10 % |
you can | 2 | 0.10 % |
SEO Keywords (Three Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
Override public void | 6 | 0.30 % | No |
Override protected void | 5 | 0.25 % | No |
public void onCompleted | 2 | 0.10 % | No |
them to your | 2 | 0.10 % | No |
onCompleted Override public | 2 | 0.10 % | No |
e Override public | 2 | 0.10 % | No |
public void onNextLong | 2 | 0.10 % | No |
void onNextLong l | 2 | 0.10 % | No |
observer = new | 2 | 0.10 % | No |
AutoResubscribe public final | 2 | 0.10 % | No |
public Object resubscriptionTag | 2 | 0.10 % | No |
Object resubscriptionTag return | 2 | 0.10 % | No |
void onErrorThrowable e | 2 | 0.10 % | No |
to your Android | 2 | 0.10 % | No |
public void onErrorThrowable | 2 | 0.10 % | No |
RxJava Observables together | 2 | 0.10 % | No |
tie them to | 2 | 0.10 % | No |
group RxJava Observables | 2 | 0.10 % | No |
to your Activity | 2 | 0.10 % | No |
and tie them | 2 | 0.10 % | No |
SEO Keywords (Four Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
public void onErrorThrowable e | 2 | 0.10 % | No |
Override public void onNextLong | 2 | 0.10 % | No |
them to your Android | 2 | 0.10 % | No |
tie them to your | 2 | 0.10 % | No |
and tie them to | 2 | 0.10 % | No |
public void onNextLong l | 2 | 0.10 % | No |
public Object resubscriptionTag return | 2 | 0.10 % | No |
group RxJava Observables together | 2 | 0.10 % | No |
Override public void onCompleted | 2 | 0.10 % | No |
e Override public void | 2 | 0.10 % | No |
onCompleted Override public void | 2 | 0.10 % | No |
Override public void onErrorThrowable | 2 | 0.10 % | No |
subscribeobserver Override protected void | 1 | 0.05 % | No |
Override protected void onSaveInstanceStateBundle | 1 | 0.05 % | No |
observeOnAndroidSchedulersmainThread subscribeobserver Override protected | 1 | 0.05 % | No |
composeobservableGroup |
1 | 0.05 % | No |
protected void onSaveInstanceStateBundle outState | 1 | 0.05 % | No |
observable composeobservableGroup |
1 | 0.05 % | No |
> observable composeobservableGroup |
1 | 0.05 % | No |
buttonsetOnClickListenerv > observable composeobservableGroup |
1 | 0.05 % | No |
Internal links in - airbnb.io
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb.io Spined HTML
Airbnb Engineering & Data Science Airbnb.io Open SourceEventsBlogGithubCareersAirbnb.io RxGroupsEasily group RxJava Observables together and tie them to your Android Activity lifecycle668By Felipe LimaRxGroups lets you group RxJava Observables together in groups and tie them to your Android lifecycle. This is expressly useful when used with Retrofit. For simple scenarios you can probably just let the original request be cancelled and fire a new one. However it's easy to see how this becomes a problem in increasingly ramified situations. Let's say your user is submitting a payment. You'll probably want to to guarantee that you can reattach to the same in-flight or completed request without rotating the screen or leaving the Activity and returning later. RxGroups will moreover automatically prevent events from stuff delivered to your Activity or Fragment surpassing onResume() and without onPause(). If that happens, they will be automatically cached in memory and delivered once the user returns to your screen. If they never return, the memory is then reclaimed automatically without onDestroy(). Usage Add a GroupLifecycleManager field to your Activity, Fragment, Dialog, etc. and undeniability its respective lifecycle methods equal to your own (eg.: onPause, onResume, onDestroy, etc.); Annotate your ResubscriptionObserver with @AutoResubscribe and use method resubscriptionTag() to tell RxGroups what tag it should use for reattaching your Observer to it Observable automatically.Surpassingsubscribing to your Observable, etch it with observableGroup.transform() to pinpoint a tag for that Observable; Example public matriculation MyActivity extends Activity { private static final String OBSERVABLE_TAG = "arbitrary_tag"; private TextView output; private FloatingActionButton button; private GroupLifecycleManager groupLifecycleManager; private ObservableGroup observableGroup; private Observable<Long> observable = Observable.interval(1, 1, TimeUnit.SECONDS); // The Observer field must be public, otherwise RxGroups can't wangle it @AutoResubscribe public final ResubscriptionObserver<Long> observer = new ResubscriptionObserver<Long>() { @Override public void onCompleted() { Log.d(TAG, "onCompleted()"); } @Override public void onError(Throwable e) { Log.e(TAG, "onError()", e); } @Override public void onNext(Long l) { output.setText(output.getText() + " " + l); } @Override public Object resubscriptionTag() { return OBSERVABLE_TAG; } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); output = (TextView) findViewById(R.id.txt_output); sawed-off = (FloatingActionButton) findViewById(R.id.fab); SampleApplication using = (SampleApplication) getApplication(); ObservableManager manager = application.observableManager(); groupLifecycleManager = GroupLifecycleManager.onCreate(manager, savedInstanceState, this); observableGroup = groupLifecycleManager.group(); button.setOnClickListener(v -> observable .compose(observableGroup.<Long>transform(OBSERVABLE_TAG)) .observeOn(AndroidSchedulers.mainThread()) .subscribe(observer)); } @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); groupLifecycleManager.onSaveInstanceState(outState); } @Override protected void onResume() { super.onResume(); groupLifecycleManager.onResume(); } @Override protected void onPause() { super.onPause(); groupLifecycleManager.onPause(); } @Override protected void onDestroy() { super.onDestroy(); groupLifecycleManager.onDestroy(this); } } Optional: If you don't want to use a ResubscriptionObserverwith @AutoResubscribe just use a regular Observer unrecognized matriculation with a public method tabbed resubscriptionTag(). Eg.: @AutoResubscribe public final Observer<Long> observer = new Observer<Long>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { } @Override public void onNext(Long l) { } public Object resubscriptionTag() { return Arrays.asList("tag1", "tag2", "tag3"); } }; If the method doesn't exist or is not public, RxGroups will throw a RuntimeException letting you know. You can use any Object tag for your Observer, including arrays and List, In that case, it will socialize the Observer with all the tags in the collection, permitting you to share the same Observer with multiple Observables. Download with Gradle compile 'com.airbnb:rxgroups-android:0.3.5' Check out the Sample app for increasingly details and a well-constructed example! Snapshots of the minutiae version are misogynist in Sonatype's snapshots repository.LinksGithubSample App© Airbnb, Inc.© Airbnb, Inc.CareersDesignCareersDesignCareersDesign