// Path: app/src/main/java/com/asanchezyu/retrofitsoap/injection/application/ApplicationComponent.java
// @Singleton
// @Component(modules = ApplicationModule.class)
// public interface ApplicationComponent {
// 
//     UsStatesApi providesApi();
// 
// 
// 
// }
// 
// Path: app/src/main/java/com/asanchezyu/retrofitsoap/injection/application/ApplicationModule.java
// @Module
// @Singleton
// public class ApplicationModule {
// 
//     private RetrofitSoapApplication application;
// 
//     public ApplicationModule(RetrofitSoapApplication application) {
//         this.application = application;
//     }
// 
//     @Provides
//     @Singleton
//     public UsStatesApi providesApi(){
// 
//         HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
// 
//         interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
// 
//         Strategy strategy = new AnnotationStrategy();
// 
//         Serializer serializer = new Persister(strategy);
// 
//         OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                 .addInterceptor(interceptor)
//                 .connectTimeout(2, TimeUnit.MINUTES)
//                 .writeTimeout(2, TimeUnit.MINUTES)
//                 .readTimeout(2, TimeUnit.MINUTES)
//                 .build();
// 
//         Retrofit retrofit =  new Retrofit.Builder()
//                 .addConverterFactory(SimpleXmlConverterFactory.create(serializer))
//                 .baseUrl("http://www.webservicex.net/")
//                 .client(okHttpClient)
//                 .build();
// 
//         return retrofit.create( UsStatesApi.class);
// 
//     }
// 
// }


import android.app.Application;
import com.asanchezyu.retrofitsoap.injection.application.ApplicationComponent;
import com.asanchezyu.retrofitsoap.injection.application.ApplicationModule;
import com.asanchezyu.retrofitsoap.injection.application.DaggerApplicationComponent;
/*
 * Copyright 2016. Alejandro Sánchez
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.asanchezyu.retrofitsoap;



/**
 * Class Description.
 *
 * @author asanchezyu@gmail.com.
 * @version 1.0.
 * @since 15/6/16.
 */
public class RetrofitSoapApplication extends Application {

    private ApplicationComponent component;

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

        component =  DaggerApplicationComponent.builder()
// Path: app/src/main/java/com/asanchezyu/retrofitsoap/injection/application/ApplicationComponent.java
// @Singleton
// @Component(modules = ApplicationModule.class)
// public interface ApplicationComponent {
// 
//     UsStatesApi providesApi();
// 
// 
// 
// }
// 
// Path: app/src/main/java/com/asanchezyu/retrofitsoap/injection/application/ApplicationModule.java
// @Module
// @Singleton
// public class ApplicationModule {
// 
//     private RetrofitSoapApplication application;
// 
//     public ApplicationModule(RetrofitSoapApplication application) {
//         this.application = application;
//     }
// 
//     @Provides
//     @Singleton
//     public UsStatesApi providesApi(){
// 
//         HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
// 
//         interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
// 
//         Strategy strategy = new AnnotationStrategy();
// 
//         Serializer serializer = new Persister(strategy);
// 
//         OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                 .addInterceptor(interceptor)
//                 .connectTimeout(2, TimeUnit.MINUTES)
//                 .writeTimeout(2, TimeUnit.MINUTES)
//                 .readTimeout(2, TimeUnit.MINUTES)
//                 .build();
// 
//         Retrofit retrofit =  new Retrofit.Builder()
//                 .addConverterFactory(SimpleXmlConverterFactory.create(serializer))
//                 .baseUrl("http://www.webservicex.net/")
//                 .client(okHttpClient)
//                 .build();
// 
//         return retrofit.create( UsStatesApi.class);
// 
//     }
// 
// }


// Path: app/src/main/java/com/asanchezyu/retrofitsoap/RetrofitSoapApplication.java
import android.app.Application;
import com.asanchezyu.retrofitsoap.injection.application.ApplicationComponent;
import com.asanchezyu.retrofitsoap.injection.application.ApplicationModule;
import com.asanchezyu.retrofitsoap.injection.application.DaggerApplicationComponent;

/*
 * Copyright 2016. Alejandro Sánchez
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.asanchezyu.retrofitsoap;



/**
 * Class Description.
 *
 * @author asanchezyu@gmail.com.
 * @version 1.0.
 * @since 15/6/16.
 */
public class RetrofitSoapApplication extends Application {

    private ApplicationComponent component;

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

        component =  DaggerApplicationComponent.builder()
                .applicationModule( new ApplicationModule(this))