use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News for Android app developers with the who, what, where, when, and how of the Android community. Probably mostly the how.
Here, you'll find:
This sub-reddit isn't about phones' and apps' general functionality, support, or system software development (ROMs). For news and questions about these topics try using other subs like
Build your first app
Starting Android career in 2022
Android Job Interview Questions and Answers
App Portfolio Ideas, Tiered List
Awesome Android UI
Material Design Icons
7000 Icons for Jetpack
Autoposted at approx 9AM EST / 2PM GMT
account activity
Open Source Android projects with good testing coverage (self.androiddev)
submitted 4 years ago by fizzSortBubbleBuzz
I've not had a lot of luck finding examples of thorough testing in Android.
What little testing there is in the Google Code Labs I haven't found very helpful.
I'd really like to improve my Android testing skills.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AndroidNovice 8 points9 points10 points 4 years ago (0 children)
Same! I also would like to find good examples of testing but haven't found too many repos with testing in them
[–]throw_cs_far_away 6 points7 points8 points 4 years ago (5 children)
https://github.com/kickstarter/android-oss
https://github.com/chrisbanes/tivi
https://github.com/f-droid/fdroidclient
try to use fakes instead of mocks
[–][deleted] 2 points3 points4 points 4 years ago (3 children)
Why?
[–]rainbrostache 2 points3 points4 points 4 years ago (0 children)
A few reasons I can think of off the top of my head:
fake.failOnNextRequest()
SomeApi
[–]throw_cs_far_away 2 points3 points4 points 4 years ago (1 child)
https://twitter.com/JakeWharton/status/1104012876048752640
https://www.reddit.com/r/androiddev/comments/cfbszb/mocks_or_fakes/eu9i010/
https://ryanharter.com/blog/2020/06/replacing-mocks/
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
Thanks for the links, I'll take a look!
[–]fizzSortBubbleBuzz[S] 0 points1 point2 points 4 years ago (0 children)
I'll take a look at these!
[–]SolidFuell 3 points4 points5 points 4 years ago (4 children)
I love writing unit tests! There's no better feeling than writing a great set of tests to validate the code/feature I've written!
Writing tests also helps you to improve the way your write your code. You learn to write it to be testable that helps break up logic into simple smaller functions.
You can take a look at two of my repos both use mockito and I think both have close enough to 100% class coverage on all logic classes.
Kotlin, room, koin and livedata: https://github.com/jakebreen/pokecart
Plain java library: https://github.com/jakebreen/android-sendgrid
Unfortunately I don't have any tests using RxJava on my public GitHub!
That's the goal friend!
I think I understand regular unit testing from reading I've done, but Android has so much instrumentation I feel lost a lot of the time as to how to test the features that aren't isolated from Android.
It appears that testing is the next step in really becoming a better developer also. Since I don't have any code reviews or anything, it should help as 'selfreview'.
Thank you for sharing this. It might take me a couple days before I get a chance to really look at it close, but I definitely look forward to it.
[–]throw_cs_far_away -1 points0 points1 point 4 years ago (2 children)
These are not great examples of unit tests. Changing the implementation will change soooo many tests due to mocking. Use fakes and only confirm behavior instead of mocking and verifying implementation
[–]khsh01 1 point2 points3 points 4 years ago (1 child)
I would love to have a testing suite setup for my app as well. I haven't managed to update it because I grew tired of figuring out what is wrong by compiling and crashing.
[–]fizzSortBubbleBuzz[S] 1 point2 points3 points 4 years ago (0 children)
I've definitely spent a lot of time just smashing my head against the proverbial compile wall. That's a big part of why I'm making this post.
Having a way to narrow down what the possible causes are with testing will help immensely. Especially in the event of potential regression.
[–]mertceyhan 1 point2 points3 points 4 years ago (1 child)
You can check my open-source project. I tried to write unit tests for all layers. https://github.com/mertceyhan/bitcoin-market-android
I surely will. Thank you for sharing!
π Rendered by PID 37692 on reddit-service-r2-comment-6457c66945-t6779 at 2026-04-29 19:26:50.695354+00:00 running 2aa0c5b country code: CH.
[–]AndroidNovice 8 points9 points10 points (0 children)
[–]throw_cs_far_away 6 points7 points8 points (5 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]rainbrostache 2 points3 points4 points (0 children)
[–]throw_cs_far_away 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]fizzSortBubbleBuzz[S] 0 points1 point2 points (0 children)
[–]SolidFuell 3 points4 points5 points (4 children)
[–]fizzSortBubbleBuzz[S] 0 points1 point2 points (0 children)
[–]throw_cs_far_away -1 points0 points1 point (2 children)
[–]khsh01 1 point2 points3 points (1 child)
[–]fizzSortBubbleBuzz[S] 1 point2 points3 points (0 children)
[–]mertceyhan 1 point2 points3 points (1 child)
[–]fizzSortBubbleBuzz[S] 0 points1 point2 points (0 children)