0

I am developing android application on which peoples donate food etc and when they submit their donations i want to start timer about 30 to 50 minutes in background even they close the application. Timer continuously run in background and if any user open the app it shows the remaining time also according to background progress.

I want to use background service which count time but if any user submitted multiple orders then how it works and also I want to change time duration through firebase. Background time is running and if we decide to increase time then we increase it through firebase and changes also takes place in app background service.

What are they ways I used to implement this kind functionality.

1 Answer 1

1

Do you want any notification from background ? If not, you don't need a background service just to display remaining time.

All you have to do is :

  • save the time of the last donation in SharedPreferences for example or in Database
  • every time the app is opened
    • check the duration with Firebase
    • launch a CountDown timer to display remaining time

I think it will do the job.

Sign up to request clarification or add additional context in comments.

4 Comments

Can you please elaborate it how I can save donation time when it has been submitted.
Becuse one people can submit multiple donations at a time or vary with time.
It depends on your business. If you have multiple donation type for example and a remaining time per type, you should save one duration time per type
I don't get your remaining time.When one person submit one donation so I need to save donation submitted time to firebase and donation completion time(like 30/50min) on firebase and when any person app open we need to check donation submitted time ,completion time and find its difference and show up that. is that what you want to say...???

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.