// Path: AuthProject/app/src/main/java/com/zhy/authproject/data/local/PreferencesManager.java
// public class PreferencesManager {
//     public static final String PREFERENCES_NAME = "androidarchitecture";
//     private SharedPreferences sharedPreferences;
// 
// 
//     public PreferencesManager(Application application){
//         sharedPreferences = application.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE);
//     }
// 
//     public void saveLoginInfo(String username,String password){
//         SharedPreferences.Editor editor = sharedPreferences.edit();
//         editor.putString("username",username);
//         editor.putString("password",password);
//         editor.commit();
//     }
// 
// 
// 
//     public String getUserName(){
//         return sharedPreferences.getString("username","");
//     }
// 
//     public String getPassword(){
//         return sharedPreferences.getString("password","");
//     }
// 
// }


import android.app.Application;
import com.zhy.authproject.data.local.PreferencesManager;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
package com.zhy.authproject.di;





/**
 * Created by zhanghaoye on 10/24/16.
 */
@Module
public class AppModule {
    private final Application application;

    public AppModule(Application application) {
        this.application = application;
    }

    @Provides
    @Singleton
    public Application provideApplication() {
        return application;
    }

    @Provides
    @Singleton
// Path: AuthProject/app/src/main/java/com/zhy/authproject/data/local/PreferencesManager.java
// public class PreferencesManager {
//     public static final String PREFERENCES_NAME = "androidarchitecture";
//     private SharedPreferences sharedPreferences;
// 
// 
//     public PreferencesManager(Application application){
//         sharedPreferences = application.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE);
//     }
// 
//     public void saveLoginInfo(String username,String password){
//         SharedPreferences.Editor editor = sharedPreferences.edit();
//         editor.putString("username",username);
//         editor.putString("password",password);
//         editor.commit();
//     }
// 
// 
// 
//     public String getUserName(){
//         return sharedPreferences.getString("username","");
//     }
// 
//     public String getPassword(){
//         return sharedPreferences.getString("password","");
//     }
// 
// }


// Path: AuthProject/app/src/main/java/com/zhy/authproject/di/AppModule.java
import android.app.Application;
import com.zhy.authproject.data.local.PreferencesManager;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;

package com.zhy.authproject.di;





/**
 * Created by zhanghaoye on 10/24/16.
 */
@Module
public class AppModule {
    private final Application application;

    public AppModule(Application application) {
        this.application = application;
    }

    @Provides
    @Singleton
    public Application provideApplication() {
        return application;
    }

    @Provides
    @Singleton
    public PreferencesManager provideSharedPreferences(){