protected override void OnCreate(Bundle savedInstanceState) { QueryParameters = new ContactsQueryParameters(LeaseId); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.contacts_activity); PreferencesHelper.SetInstanceUrl(this, "http://192.168.108.219:57204/"); PreferencesHelper.SetAuthenticationToken(this, new Guid("476F624F-2238-4041-AC31-C78F4E1DE869")); FindViews( ); SetupViews( ); }
public override void OnCreate( ) { base.OnCreate( ); PreferencesHelper.SetIsAuthenticated( ApplicationContext, true ); PreferencesHelper.SetInstanceUrl( ApplicationContext, "http://192.168.108.219:57204/" ); string instanceUrl = PreferencesHelper.GetIsAuthenticated( ApplicationContext ) ? PreferencesHelper.GetInstanceUrl( ApplicationContext ) : "todo"; string consumerKey = CoreConfig.TestConsumerKey.ToString( ); Container = new UnityContainer( ); Container.RegisterInstance( RestService.For<IApi>( ApiHelper.GetHttpClient( instanceUrl, consumerKey ) ) ); Container.RegisterType<IContactsDataSource, ContactsApiDataSource>( "ContactsRemoteDataSource" ); Container.RegisterType<IGetContactsCallback, ContactsViewCallback>( ); Container.RegisterType<IContactsDataSource, ContactsRepository>( new InjectionConstructor( new ResolvedParameter<IContactsDataSource>( "ContactsRemoteDataSource" ) ) ); }