Android Open Source - template-android App






From Project

Back to project page template-android.

License

The source code is released under:

MIT License

If you think the Android project template-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.org.application;
/*w ww  .ja  v a  2s .c  o m*/
import android.app.Application;
import android.content.Context;

import com.org.application.util.Log;

import dagger.ObjectGraph;

/**
 *
 */
public class App extends Application {
    private static final String TAG = App.class.getSimpleName();

    private ObjectGraph objectGraph;


    @Override public void onCreate() {
        super.onCreate();

        if(BuildConfig.DEBUG){
            Log.sLogEnabled = true;
            Log.sLogLevel = 0; //Print all the logs!
        }

        buildObjectGraphAndInject();
    }

    public void buildObjectGraphAndInject() {

        objectGraph = ObjectGraph.create(Modules.list());
        objectGraph.inject(this);
    }

    public void inject(Object o) {
        objectGraph.inject(o);
    }

    public static App get(Context context){
        return (App)context.getApplicationContext();
    }
}




Java Source Code List

com.org.application.App.java
com.org.application.Modules.java
com.org.application.Modules.java
com.org.application.Modules.java
com.org.application.mock.Foo.java
com.org.application.mock.IFoo.java
com.org.application.mock.MockFoo.java
com.org.application.module.MockFooModule.java
com.org.application.module.ReleaseModule.java
com.org.application.ui.activity.MainActivity.java
com.org.application.util.Log.java