Questions tagged [android-mvp]

On Android, MVP is a way to separate background tasks from activities/views/fragments to make them independent of most lifecycle-related events. This way an application becomes simpler and code maintainability becomes better. Use this tag if your question is specifically about using MVP in Android.

On Android, MVP is a way to separate background tasks from activities/views/fragments to make them independent of most lifecycle-related events. This way an application becomes simpler and code maintainability becomes better. Use this tag if your question is specifically about using MVP in Android.

The tag should be used along with

278 questions
0
votes
1 answer

Dagger2 how to use constructor injection

I've read more about Dagger2 and I find that is similar to Butterknife, because when I need to use it I create a module, and use: ((MyApp) getApplication()).createAppComponent().inject(this); to use, for example, this: @Inject RegisterPresenter…
nani
  • 382
  • 5
  • 15
0
votes
1 answer

Unittesting the cancellation of a retrofit call

I'm trying to write a unittest that tests a cancellation of a Retrofit call, but I'm stuck. Here's the implementation: public class LoginInteractorImpl extends AbstractInteractor implements LoginInteractor { private volatile Call
Bohsen
  • 4,242
  • 4
  • 32
  • 58
0
votes
2 answers

how to change the structure of already developed android project?

I am just a beginner and at the time of developing i was blind about following an architecture, but now I've come across many awesome architecture and frameworks out there which i can follow to make code clean and easy to maintain.. so I have 3…
Niki
  • 1,566
  • 1
  • 19
  • 36
0
votes
1 answer

Dagger 2 Scoped Activity Context Issue

I am trying to follow this template for an MVP/Dagger2/RxJava project. I cannot get an injection of the Activity context into my presenter, every other injection passes through as I know that a subcomponent has open access to all parent provided…
TheSunny
  • 371
  • 4
  • 14
0
votes
1 answer

rxJava2 CompositeDisposable in presenter

I'm migrating my app to the rxJava2 and would like to clarify some things. In my BasePresenter class I do following: @Override public void attachView(T mvpView) { this.mvpView = mvpView; compositeDisposable = new…
Vadims Savjolovs
  • 2,618
  • 1
  • 26
  • 51
0
votes
0 answers

How to test View in MVP+Dagger 2 in Android

I develop a liitle application (example) and I want to train to write tests also. At that moment I have MyActivity class, that implement View interface, also I have Presenter interface. And I define all necessary methods in my MyActivity, but I…
0
votes
1 answer

MVP with Fragments and Container activities

Currently we are have a container activity that hold 2 buttons(next and cancel) along with a content layout that switches depending on the fragment. The fragments follow the mvp pattern but the omain questions seems to how to correctly implement the…
0
votes
1 answer

How to design network layer with refresh token request?

So I currently face the situation when a logged in user token expires and for any of his requests to succeed refresh token call needs to be performed first. how should I design my requests. //Network Calls Observable
Abdelrhman Talat
  • 1,205
  • 2
  • 13
  • 25
0
votes
1 answer

Andriod Not Showing Process Dialague Box While Call Goes To Server

I'm new to asking questions here so any advice about that will be appreciated...but to my problem:enter code here I am Trying To show Process Dialague While Waiting for Data From Server..I am Using Retrofit Call For Get Data From Server And Using…
0
votes
1 answer

customlayout as mvp in fragment mvp

I've been practising the MVP pattern in android. My question is related to how to design the situation where you have a fragment with a custom layout.(see the below layout) customlayout in fragment There are 2 cardviews in the customlayout: - if you…
SzabK
  • 75
  • 1
  • 7
0
votes
1 answer

Dagger 2 How to create a Module for Base Activity Components and a separate Module for all MVP components

Hello I am new to Dagger2. Goal. Take my Networking DI and MVP DI. MVP as in the presenter for an an activity that extends base activity. I want to combine all this into one super module and place this into my base activity. Over time add more…
StarWind0
  • 1,554
  • 2
  • 17
  • 46
0
votes
1 answer

Camera crashes, when trying to save fileI

I'm stucked. Here is my methods, that get picture from camera, and save them: > > @Override > public File createImageFile() throws IOException { > String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); > …
-1
votes
1 answer

Is it OK to load an image from the Fragment/Acvtivity when using Coil?

Question 1: When I load an image using the Coil library, I do it in the Fragment or Activity: imageView.load("https://example.com/image.jpg"). Is it OK to use the internet connection (method load()) from the UI? Doesn't it break the app…
-1
votes
1 answer

Android. Repository from data layer with global lifecycle

I have a project that currently supports MVP and MVVM. Coroutines, hilt, repository pattern are also used. I need single resources that I will cache. For example, activity A executes a network request, the user can go to activity B during the…
-1
votes
2 answers

How to add access token to headers in MVP Pattern

I am using MVP Pattern for my android app, I need to add access token to my request headers. The access token is saved in the SharedPreferences. How to access that SharedPreferences in MVP Pattern. I am using Retrofit for network request. public…
byteC0de
  • 5,153
  • 5
  • 33
  • 66
1 2 3
18
19