yigit / dev-summit-architecture-demo Goto Github PK
View Code? Open in Web Editor NEWThe demo application that we've used in the Architecture Talk @ Android Dev Summit 2015
License: Apache License 2.0
The demo application that we've used in the Architecture Talk @ Android Dev Summit 2015
License: Apache License 2.0
ActivityComponent interface doesn't have modules argument. Why is it so?
Moreover it extends AppComponent, should there not be a scope problem?
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).
Why isn't observable objects used?
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.
AppComponent and Data Binding module is missing
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.
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.
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
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.
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:
Because "users" is empty, the result array is empty.
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.
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?
I assume you wanted to set it to true when user does a "swipe to refresh", or am I missing something?
There is import here https://github.com/yigit/dev-summit-architecture-demo/blob/b5c6bd562d7a4fc7eebf19bd03573d7819ad3140/client/app/src/main/java/com/android/example/devsummit/archdemo/view/activity/FeedActivity.java of class which does not exist in the project:
import com.android.example.devsummit.archdemo.databinding.ActivityFeedBinding;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.