Coder Social home page Coder Social logo

yigit / dev-summit-architecture-demo Goto Github PK

View Code? Open in Web Editor NEW
1.2K 1.2K 230.0 169 KB

The demo application that we've used in the Architecture Talk @ Android Dev Summit 2015

License: Apache License 2.0

Java 66.40% Ruby 24.70% JavaScript 0.28% CSS 0.78% HTML 7.84%

dev-summit-architecture-demo's People

Contributors

yigit 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dev-summit-architecture-demo's Issues

Required SQLiteDatabase, got DatabaseWrapper Error

The following code errors in the ApplicationModule.class

@Provides
@Singleton
public SQLiteDatabase  database() {
    return FlowManager.getDatabase(DemoDatabase.NAME).getWritableDatabase();
}

with 'Required SQLiteDatabase, got DatabaseWrapper

am I missing something?

Cheers

Rails server not running with commands rails s

I followed the steps given in readme. i am able to run client app, but rails server not starting up

c:\server>rails s
Usage:
rails new APP_PATH [options]

Options:
-r, [--ruby=PATH] # Path to the Ruby bina
ry of your choice
# Default: C:/Ruby22-x6
4/bin/ruby.exe
-m, [--template=TEMPLATE] # Path to some applicat
ion template (can be a filesystem path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfil
e
-B, [--skip-bundle], [--no-skip-bundle] # Don't run bundle inst
all
-G, [--skip-git], [--no-skip-git] # Skip .gitignore file
[--skip-keeps], [--no-skip-keeps] # Skip source control .
keep files
-O, [--skip-active-record], [--no-skip-active-record] # Skip Active Record fi
les
-S, [--skip-sprockets], [--no-skip-sprockets] # Skip Sprockets files
[--skip-spring], [--no-skip-spring] # Don't install Spring
application preloader
-d, [--database=DATABASE] # Preconfigure for sele
cted database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserv
er/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
-j, [--javascript=JAVASCRIPT] # Preconfigure for sele
cted JavaScript library
# Default: jquery
-J, [--skip-javascript], [--no-skip-javascript] # Skip JavaScript files

  [--dev], [--no-dev]                                # Setup the application

with Gemfile pointing to your Rails checkout
[--edge], [--no-edge] # Setup the application
with Gemfile pointing to Rails repository
[--skip-turbolinks], [--no-skip-turbolinks] # Skip turbolinks gem
-T, [--skip-test-unit], [--no-skip-test-unit] # Skip Test::Unit files

  [--rc=RC]                                          # Path to file containi

ng extra configuration options for rails command
[--no-rc], [--no-no-rc] # Skip loading of extra
configuration options from .railsrc file

Runtime options:
-f, [--force] # Overwrite files that already exist
-p, [--pretend], [--no-pretend] # Run but do not make any changes
-q, [--quiet], [--no-quiet] # Suppress status output
-s, [--skip], [--no-skip] # Skip files that already exist

Rails options:
-h, [--help], [--no-help] # Show this help message and quit
-v, [--version], [--no-version] # Show Rails version number and quit

Description:
The 'rails new' command creates a new Rails application with a default
directory structure and configuration at the path you specify.

You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory.

Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.

Example:
rails new ~/Code/Ruby/weblog

This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
See the README in the newly created application to get going.

Does FeedActivity set 'mPendingRefresh' as true ?

I thought that 'mPendingRefresh' (in FeedActivity) should be true in this callback.

mBinding.swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {

@Override
public void onRefresh() {

    // mPendingRefresh = true;
    mFeedController.fetchFeedAsync(true, mUserId);
}

});

As far as I know, mPendingRefresh represents whether SwipeRefreshLayout is refreshing or not.
So it might be set as true in somewhere to prevent duplicated request for refresh.

Failed FeedFetchJob Event?

I'm having a little trouble finding where a failed fetch is handled, maybe I'm just missing it.

Here's where the activity checks for success:
public void onEventMainThread(FetchedFeedEvent event) {
if (event.isSuccess()) {
refresh(event.getOldest());
} else {
Snackbar.make(mBinding.coordinatorLayout,
R.string.cannot_refresh_feed, Snackbar.LENGTH_SHORT).show();
}

And here's where the job performs the call :
public void onRun() throws Throwable {
Response response = feed.execute();
if (response.isSuccess()) {
Post oldest = handleResponse(response.body());
mEventBus.post(new FetchedFeedEvent(true, mUserId, oldest));
} else {
throw new NetworkException(response.code());
}
}

The exception is thrown but I can't find where it's caught and translated to a failed FetchedFeedEvent.

Using this architecture in the context of an ecommerce app

Thank you for the great talk! I found the architecture very solid for the presented use cases and for this sample project. This architecture and the one presented by Virgil Dobjanschi at Google I/O 2010 are very enlightening and I reckon that using such constructs I could solve a lot of the crashes that happen today on my app.

However, the application I work on relies a lot on fresh data. We need to present the actual price of a product to the user and it can't be wrong (keeping this data in sync is already a pain and we have a lot of users complaining about divergencies). I went to study how other ecommerce apps work and even how Google Play works and they all get absolutely useless with no network.

I have been thinking and, maybe, this architecture may be useful for user generated content such as marking a product as favourite or viewing previous orders. However, I would like to hear your opinion on the subject. Do you think that there is any benefit from caching data in an app that requires up to date information? (Another use I can think of is avoiding boring serialization and deserialization of data on orientation change).

Server needs to accept at least one post to allow offline capabilities

Thanks for the great demo!

Nevertheless, I think there is an issue related to the offline capabilities of the app when
the server is not running while a first message is posted.

In this case, the new post is stored but the user is not.

https://github.com/yigit/dev-summit-architecture-demo/blob/master/client/app/src/main/java/com/android/example/devsummit/archdemo/job/post/SaveNewPostJob.java#L98

When the "NewPostEvent " event is fired and the post should be added to the list, the user is not found because it has not been saved to the datastore. As a consequence, "user" is null in the following line:

https://github.com/yigit/dev-summit-architecture-demo/blob/master/client/app/src/main/java/com/android/example/devsummit/archdemo/model/FeedModel.java#L74

Because "users" is empty, the result array is empty.

https://github.com/yigit/dev-summit-architecture-demo/blob/master/client/app/src/main/java/com/android/example/devsummit/archdemo/model/FeedModel.java#L73

So the post is never added to the list.

To get the expected behavior, the server has to run/respond at least the first time
a post is made. If this is the case, the returned user is added to the local datastore.

https://github.com/yigit/dev-summit-architecture-demo/blob/master/client/app/src/main/java/com/android/example/devsummit/archdemo/job/post/SaveNewPostJob.java#L116

In the case outlined above, this line never runs and posts never appear.

I do not think that this is intended behavior.

What do you think?

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.