Hilt makes testing easier on Android

  Рет қаралды 16,432

CodingWithMitch

CodingWithMitch

4 жыл бұрын

The best android courses in the world: codingwithmitch.com/
Watch the HILT course here (FREE): codingwithmitch.com/courses/h...
Everything you need to know about writing android instrumentation tests if you using Hilt for dependency injection.
Code: github.com/mitchtabian/Dagger...
Instagram: / codingwithmitch
Twitter: / mitch_tabian
.
.
#AndroidDev

Пікірлер: 48
@pejmanazad5852
@pejmanazad5852 4 жыл бұрын
before each person watches the video says in mind, Ohh sexy shirt.
@codinginflow
@codinginflow 4 жыл бұрын
Thank you for this video
@codingwithmitch
@codingwithmitch 4 жыл бұрын
You're welcome. Always nice to be appreciated by my fans
@deepak5283
@deepak5283 4 жыл бұрын
@@codingwithmitch how to add voice message feature for chat app in andriod by using java .any api or packages available for the process pls tell me
@rajiac7552
@rajiac7552 3 жыл бұрын
Mitch, you are the best teacher I ever had, I was scratching my head over this launchFragmentInHiltContainer ,and finally landed in your video now it is pretty clear. big thanks
@suhadbinzubair
@suhadbinzubair 2 жыл бұрын
@Raji 👋
@renatoarg
@renatoarg 3 жыл бұрын
hi @CodingWithMitch congrats for the great video. Please do you have any example testing UIs?
@grooss4002
@grooss4002 3 жыл бұрын
Thanks, very helpful video! Is there a way to mock a ViewModel in a fragment test or how should i test it?
@mehdiparsaei1867
@mehdiparsaei1867 3 жыл бұрын
Thanks a lot, my teacher! I could get the MainFragment without a factory.
@Mandoo145
@Mandoo145 2 жыл бұрын
Thanks, you are a lifesaver!
@Vemu
@Vemu 4 жыл бұрын
Can you make a video about package installer? No one has done video about that yet
@dreewr
@dreewr 3 жыл бұрын
Is it production ready or should I wait a little bit more?
@genesiscatano
@genesiscatano 2 жыл бұрын
24:18 "android:exported" is required to be included in everywhere you use "intent-filter" after the SDK version 31. If you want your app to share intents from one specific class you should make it true, if not then false.
@jagadeeshtummalacharla7163
@jagadeeshtummalacharla7163 2 жыл бұрын
Hi Mitch, how can we launch the app using hiltAndroidTest approach? My app will starts from splachActivity and i would need to launch the app from splash activity.!
@mattgraves3709
@mattgraves3709 3 жыл бұрын
Well, I wasted a bunch of time trying to get this to work for my unit tests yesterday guess I should have seen this video! hahaha oh well. Thank man
@David-xy4nw
@David-xy4nw 4 жыл бұрын
even though I do not know anything about the android development, I still watch your videos, because I really enjoy the way you explain things. Would be really cool if you could make a react-native course
@codingwithmitch
@codingwithmitch 4 жыл бұрын
Maybe in the future who knows. I think react native is a better choice than flutter personally because JavaScript jobs are so easy to come by. It gives you more employment options
@deepak5283
@deepak5283 4 жыл бұрын
@@codingwithmitch how to add voice message feature for chat app in andriod studio .what is procedure or process and is there any api or packages to available to add voice message features
@ganeshrajpadhayay3714
@ganeshrajpadhayay3714 3 жыл бұрын
What a lovely comment :P :)
@LunarCosmic
@LunarCosmic 3 жыл бұрын
I gave up with React Native environment 😅 still love native
@abelmengesha3773
@abelmengesha3773 Жыл бұрын
@@codingwithmitch Fact! I still wonder why Javascript jobs are so easy to come by?
@oscarperry641
@oscarperry641 4 жыл бұрын
sharp guy
@abhijithkp7381
@abhijithkp7381 4 жыл бұрын
Tks for #Hilt 👍
@ALIRAZA-hz1db
@ALIRAZA-hz1db 4 жыл бұрын
Hii hope you are doing well. I saw your old video on caching with retrofit. I have a question that how we can load data from cache first then from network if the Internet is available.
@codingwithmitch
@codingwithmitch 3 жыл бұрын
Watch my db caching course or powerful Android apps codingwithmitch.com/courses/powerful-android-apps-with-jetpack-architecture/
@AhmadShahwaiz
@AhmadShahwaiz 2 жыл бұрын
can you do a tutorial retrofit + hiltandroidtest
@AhsanAli-vz6mg
@AhsanAli-vz6mg 3 жыл бұрын
Superb
@sfk1991
@sfk1991 4 жыл бұрын
Hey Mitch , for someone who just have started about dependency injection do you recommend I pick up hilt over plain dagger?
@codingwithmitch
@codingwithmitch 4 жыл бұрын
Yeah its way easier. Dagger is good to know but learning curve is rough
@codinginflow
@codinginflow 4 жыл бұрын
Normal Dagger is only for people with 200 IQ
@sfk1991
@sfk1991 4 жыл бұрын
@@codinginflow Having followed your great tutorial on dagger a couple months ago I laughed harder than I should on this comment.
@bangmind7318
@bangmind7318 3 жыл бұрын
help me pls i get error java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.codingwithmitch.daggerhiltplayground/.HiltTestActivity (has extras) }
@toto3451
@toto3451 4 жыл бұрын
God bless you
@deepak5283
@deepak5283 4 жыл бұрын
how to add voice message feature for chat app in andriod by using java .any api or packages available for the process pls tell me sir
@perfergonchsiardov695
@perfergonchsiardov695 3 жыл бұрын
developer.android.com/reference/android/speech/tts/TextToSpeech
@beshoyfakhry936
@beshoyfakhry936 4 жыл бұрын
Please check certificate of web site as it shows it's expired and chrome makes it unsafe to use your website.
@codingwithmitch
@codingwithmitch 3 жыл бұрын
Clear cache
@wasimreza9910
@wasimreza9910 3 жыл бұрын
Thanks for the video. I am getting the following exception while running the main fragment test of your code. I have tried with commitAllowingStateLoss() but failed. Can you help me anyway? java.lang.RuntimeException: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at androidx.test.runner.MonitoringInstrumentation.runOnMainSync(MonitoringInstrumentation.java:441) at androidx.test.core.app.ActivityScenario.onActivity(ActivityScenario.java:564) at com.codingwithmitch.daggerhiltplayground.MainTest.mainFragmentTest(MainTest.kt:120) at java.lang.reflect.Method.invoke(Native Method) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80) at dagger.hilt.android.internal.testing.MarkThatRulesRanRule$1.evaluate(MarkThatRulesRanRule.java:92) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56) at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2106) Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at androidx.fragment.app.FragmentManager.checkStateLoss(FragmentManager.java:1766) at androidx.fragment.app.FragmentManager.enqueueAction(FragmentManager.java:1806) at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:324) at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:289) at com.codingwithmitch.daggerhiltplayground.MainTest$mainFragmentTest$$inlined$launchFragmentInHiltContainer$1.perform(HiltExt.kt:72) at com.codingwithmitch.daggerhiltplayground.MainTest$mainFragmentTest$$inlined$launchFragmentInHiltContainer$1.perform(Unknown Source:2) at androidx.test.core.app.ActivityScenario.lambda$onActivity$2$ActivityScenario(ActivityScenario.java:551) at androidx.test.core.app.ActivityScenario$$Lambda$4.run(Unknown Source:4) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:2124) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
@wasimreza9910
@wasimreza9910 3 жыл бұрын
PC restart solves the problem. Thanks.
@bryanneuberger5886
@bryanneuberger5886 3 жыл бұрын
engagement
@astrologykhan8125
@astrologykhan8125 4 жыл бұрын
What do u want???
@codingwithmitch
@codingwithmitch 3 жыл бұрын
$6000
@buzzminkyunghoon3856
@buzzminkyunghoon3856 4 жыл бұрын
That one fkn dislike
@codingwithmitch
@codingwithmitch 4 жыл бұрын
Probably a Flutter baby
@mehdiparsaei1867
@mehdiparsaei1867 3 жыл бұрын
Why don't we do a full UI test instead of Unit and Integration tests? I mean by ignoring the UI test time, UI tests can test everything in the real world. Who agrees with me?
@wajdidaghlas3178
@wajdidaghlas3178 4 жыл бұрын
How are you 🥰
@codingwithmitch
@codingwithmitch 4 жыл бұрын
good
Hilt 2.31-Alpha Updates
11:09
CodingWithMitch
Рет қаралды 6 М.
Hilt Modules, Binds and Provides (Dagger2)
18:02
CodingWithMitch
Рет қаралды 21 М.
Я нашел кто меня пранкует!
00:51
Аришнев
Рет қаралды 3 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 41 МЛН
Please be kind🙏
00:34
ISSEI / いっせい
Рет қаралды 193 МЛН
Is Kotlin Multiplatform Mobile Ready for Production?
36:03
CodingWithMitch
Рет қаралды 110 М.
Hilt Dependency Injection (Kotlin Beginner Example)
21:20
CodingWithMitch
Рет қаралды 42 М.
Android Unit Test Room Database
12:44
Simplified Coding
Рет қаралды 19 М.
MVVM  / MVI Repository Pattern with Hilt
1:00:24
CodingWithMitch
Рет қаралды 67 М.
Senior Android Developer Checklist
19:53
Oday
Рет қаралды 11 М.
Tinkering With Spirographs in C++
22:01
javidx9
Рет қаралды 12 М.
Hilt ViewModels and Dependency Injection
16:35
CodingWithMitch
Рет қаралды 30 М.
Modularizing Android Apps
18:16
CodingWithMitch
Рет қаралды 20 М.
Неразрушаемый смартфон
1:00
Status
Рет қаралды 2,3 МЛН