Building a Step Counter App in Android Studio. In this video, we will create a step counter app using Android Studio using a Java programming language.
It works perfectly on a real device, but I have a problem when I close the app and remove it from the background, because when I try to open it again it closes automatically. Any solution?
If your app does not start while reopening it manually. The error is in savedata method instead of editor.putstring to editor.putInt("key1, previous Steps)
Thank you, good friend. You are the best!
Thank you very much for the video, it has helped me a lot. Do you have the project code? I would like to test with it and learn.
Thanks a lot, you're a day saver
Great video bro
Does this app work in background or does the app needs to be open to count the steps ?
You can test that
Thank you, you have saved my day.
Thanks buddy
It works perfectly on a real device, but I have a problem when I close the app and remove it from the background, because when I try to open it again it closes automatically. Any solution?
I will try to find the solution
@@itsitwala93 if found please post a video.
The problem is in load data you need to tweak it a little bit
private void loadData() {
SharedPreferences sharedPreferences = getSharedPreferences("myPref", Context.MODE_PRIVATE);
previewsTotal = sharedPreferences.getInt("key1",-1);
}
If your app does not start while reopening it manually.
The error is in savedata method instead of editor.putstring to editor.putInt("key1, previous Steps)
still not work :C
nvm , in loadData() should be getInt instead of getFloat
NO SOURCE CODE BRO? DOWNVOTE!!!
Can you share code github link
👍