Git Product home page Git Product logo

bakingapp's Introduction

Hi there! πŸ‘‹

πŸ”­ My name is Sergey and I'm mobile developer currently working at Raiffeisen Bank Russia.

Among other things sometimes I make mods for CD Projekt RED games, just for fun ☺️

djkovrik
djkovrik

bakingapp's People

Contributors

djkovrik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bakingapp's Issues

the subscribe method of the Observable is not called...!!

Hi , i am just beginner in rx android and dagger2 . i tried implementing some samples from your codebase..this is my code sample..

LocalDataSource.java

@Singleton
public class LocalDataSource implements DataSource {

@Override
public Observable getServerSettings() {
return mDBHelper.createQuery(ServerSettingsEntry.TABLE_NAME,
DbUtils.getSelectAllQuery(ServerSettingsEntry.TABLE_NAME))
.mapToOne(DbUtils::getServerSettings);

Repository.java

@Singleton
public class MyRepository implements DataSource {
@Override
    public Observable<ServerSettings> getServerSettings() {
        return mLocalDataSource.getServerSettings().compose(RxUtils.applySchedulers());

LoginPresenter.java

public class LoginPresenter implements LoginActivityContract.Presenter{
 @Override
    public void checkServerDbSynced() {
        mCompositeDisposable.clear();
        Disposable subscription = mRepository
                .getServerSettings()
                .doOnSubscribe(disposable -> {
                    Timber.d(" onSubscribe");
                    mView.showLoadingIndicator(true, "Checking Server ....");
                })
                .subscribe(serverSettings -> {
                            if (serverSettings == null) {
                                Timber.d("*** Server Db Synced ****" + "\n" + "*** Checking Licence Key **** ");
                                checkLicenceKey();
                                } else {
                                Timber.d("*** Server Db Not Synced *** " + " \n" + "*** Opening Login Dialog ****");
                                mView.showLoadingIndicator(false, "Db Not Synced ....");
                                mView.openLoginDialog();
                                }
                                },
                        throwable -> {
                            mView.showErrorMessage(throwable.getLocalizedMessage());
                            });
        mCompositeDisposable.add(subscription);
    }
}



    @Override
    public void subscribe() {
        checkServerDbSynced();
    }

    @Override
    public void unSubscribe() {
        mCompositeDisposable.clear();
    }

The problem is the statements inside subscribe is not being called. When debugging,
I noticed that after this line composite disposable.add(subscription); Observable.subscribe() is not called!!…
Kindly help …!!

PS :if i use if (Thread.currentThread() == Looper.getMainLooper().getThread()) throw new IllegalStateException(); inside the onSubscribe ...the error is thrown and caught in OnError method of the subscribe to check whether executed on the main thread..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.