Git Product home page Git Product logo

githubclient's People

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

githubclient's Issues

Fails on Android process restart

I really love your app as a model for DI for my own! Here's one design problem:

Sometimes Android kills an app process in the background because of low memory. It restarts it automatically when it come back.
(This is different from killing and restarting activities: for a good review see here http://stackoverflow.com/questions/14375720/android-destroying-activities-killing-processes)

Your app crashes under such conditions, if you are not on the startup activity, since the user component is not recreated. The reason is that Android when restarting the app, Android recreates the app object, then the topmost activity (not the earlier ones, until they come into view).

You can verify in your own app by turning on the Developer Option...Background process limit to zero, then drilling down into a user, then switching away from your app and back. The app crashes.

It would be cool to see how you would modify your app and your design pattern to deal with this.

Android 4.4 version java.lang.NoClassDefFoundError ApplicationModule_ProvideContextFactory compile time in android ?

When i am compile app in 4.4 it it gives error in marshamallow it is working perfect .

8-04 14:33:18.342 10759-10759/com.app.readyb E/AndroidRuntime: FATAL EXCEPTION: main
                                                                Process: com.app.readyb, PID: 10759
                                                                java.lang.NoClassDefFoundError: com.app.readyb.config.ApplicationModule_ProvideContextFactory
                                                                    at com.app.readyb.config.DaggerAppComponent.initialize(DaggerAppComponent.java:70)
                                                                    at com.app.readyb.config.DaggerAppComponent.<init>(DaggerAppComponent.java:58)
                                                                    at com.app.readyb.config.DaggerAppComponent.<init>(DaggerAppComponent.java:35)
                                                                    at com.app.readyb.config.DaggerAppComponent$Builder.build(DaggerAppComponent.java:174)
                                                                    at com.app.readyb.ReadyBApp.onCreate(ReadyBApp.java:68)
                                                                    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1030)
                                                                    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4409)
                                                                    at android.app.ActivityThread.access$1500(ActivityThread.java:139)
                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                    at android.os.Looper.loop(Looper.java:136)
                                                                    at android.app.ActivityThread.main(ActivityThread.java:5086)
                                                                    at java.lang.reflect.Method.invokeNative(Native Method)
                                                                    at java.lang.reflect.Method.invoke(Method.java:515)
                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
                                                                    at dalvik.system.NativeStart.main(Native Method)

Make UserComponent be Sub Component of another one?

Thank you for your sharing this tutorial, it s very helpful

I am using your idea about User Scope to share signed user instance across it's sub components. And I want to make UserComponent itself be sub component of another one, like Base Activity Component.
My graph is
App component > base activity component > User Component > User Details Component (and many others)

The arrow stands for sub-component relationship.
In your example, you used SubComponent Builder to create User component, how can i make it extends all resource provide by App component and Base Activity component?

java.lang.VerifyError when run app

java.lang.VerifyError: frogermcs/io/githubclient/ui/activity/SplashActivity$AjcClosure1
                                                     at frogermcs.io.githubclient.ui.activity.SplashActivity.onCreate(SplashActivity.java:46)
                                                     at android.app.Activity.performCreate(Activity.java:5231)
                                                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
                                                     at android.app.ActivityThread.access$800(ActivityThread.java:135)
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:136)
                                                     at android.app.ActivityThread.main(ActivityThread.java:5001)
                                                     at java.lang.reflect.Method.invokeNative(Native Method)
                                                     at java.lang.reflect.Method.invoke(Method.java:515)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
                                                     at dalvik.system.NativeStart.main(Native Method)

Hi, when I build this project with gradle build tool 2.1.0 and run the app, I get the above error. But after reverting gradle to 2.0.0, this error disappear, I do not know why this happens.

Why do we need ActivityScope in this example?

We need new presenter on every activity creation anyways. If it is to handle activity recreation then the associated component will also be recreated which in turns results in new presenter object.

Presenter and Activity Lifecycle

Hi Mirosław!

Thanks for the tutorials and introduction to Dagger 2. After some research, a common issue with using ReactiveX programming for Android applications is properly handling unsubcribes when the Activity is destroyed. How is it handled here? Should the Presenters also have an "onDestroy" method which is called by the Activity when it is getting destroyed? Or is Dagger 2 somehow helping us here?

Thanks!
-- Charles

./gradlew build fails :app:compileReleaseJavaWithJavac

GithubClient/app/src/main/java/frogermcs/io/githubclient/GithubClientApplication.java:6: error: package com.frogermcs.androiddevmetrics does not exist
import com.frogermcs.androiddevmetrics.AndroidDevMetrics;

This is because the com.frogermcs.androiddevmetrics plugin only adds source for the debugCompile variant

How user component is restored?

What if user opens RepositoriesListActivity and then goes in background. System can kill application process, and then when user will try to open app back to foreground - RepositoriesListActivity will be restored and GithubClientApplication.get(this).getUserComponent() will return null object, which will produce nullpointer exception. Is am I missing something?

DaggerAppComponent missing

Hi,
in GithubClientApplication.java file there's the creation of the global dependencies graph

DaggerAppComponent.builder()
     .appModule(new AppModule(this))
     .githubApiModule(new GithubApiModule())
     .build();

But where is the DaggerAppComponent class in the project? I couldn't find it. I'm missing something?

Thanks
Nico

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.