Worth pointing out that Kotlin Synthetics (Which is the feature [Extension Plugin] that allows you to call your Views (Buttons, Edittexts, etc) with their respective ID directly onto your Kt file/class is deprecated, which in general means it is not recommended to use anymore, instead it is good to use ViewBinding or DataBinding (or both if needed).
I was going through a bunch of videos on UA-cam trying to look on getting into Android Studio with Kotlin since it is the new language going forward by Google on Android. And all of the videos I could find would show you how to do something but not really explain what each part of the video does. For example, the way you broke down the meaning of "R.id.but..." to indicate this comes from resources and ID's, it's something not many do. Thanks for making this fundamental series, it has been super helpful so far for someone looking for a concentration in their CS degree ;)
Wow holy crap these videos are easily the best coding tutorial videos I have ever seen. I am a complete beginner and self taught (more youtube taught honestly) and you are by far the most helpful.
Followed along through your entire Newbie to Pro series, and per your recommendation, I'm going through this series to learn XML before jumping into Jet Pack Compose. This is my first time committing to learn to program since my Web Design HTML/CSS days over a decade ago. Anyways, THANK YOU. You're videos are not only well thought out and made, but your playlists are well structured and paced. I actually feel confident that I can be good at this because of your tutorials and advice. Figured after having watched 30+ videos of yours, I should stop and express my appreciation. Keep doing your thing!
from 2021 and I got problems when I have tried to import views by using "synthetic". But I have fixed it by replacing with 'view binding'. Great tutorial bro keep going on!
Phillipp, your video about buttons is extremely good. Your tip about renaming buttons is very important. I had problem with renaming buttons. However I need button to save data in database - to implement Insert statement. I do not know how to do this in button.onclick. Could you please show this in comment. Because it is important for all Android Studio beginners. Or can you make video " Buttons to save and delete data in database". Thanks a lot
Great video, bro. I finished an Android App Development course on Udemy, and I'm now using your videos for review. These are helping tremendously. Keep up the good up work.
to do what he did in this video you need first to learn about view binding in this videos ua-cam.com/video/z0F2QTAKsWU/v-deo.html ua-cam.com/video/QVIgunA3jcQ/v-deo.html this will help you to understand how android studio calls view by id now after that you can follow with the setOnClickListener part because after you call the button its the same in both ways
first of all thank you so much for you very useful curse and then I have a question in the 8 min where you teaching about "importing btnApply" it dosn't work for me I pressed Alt+Enter but it didn't work can you pleas help me to fix it?
Just in case if you are following along this tutorial as I am so the import " synthetic " is deprecated but Philipp has made an updated video using View Binding. Just keep coding. ua-cam.com/video/z0F2QTAKsWU/v-deo.html
Anyone please help me in my Android Studio it doesn't work when i type btnApply it shows create local variable also there the import library doesn't work i Tried many places still im stuck . help me
Hello, I'm a newbie here. Many thanks to your video, one of the best explained android tutorials! Some issue occurred when I followed steps in the video Program compiled fine, but my emulator still showed "Hello World" layout, which is really strange because in the previous Linearlayout video the app ran no problem. My first thought is it's maybe android studio had some syntax updates during this time since 2020? I've googled it but most answers were so many years ago. Sorry if the question sounds stupid, would appreciate any help, thanks!
Hey I was following this tutorial and I tried using the Alt enter shortcut and it didnt work I then tried doing the import with kotlinx and it didnt give me that as an option is this something I have missed during the setup? Other than that loving this content just finished your kotlin newbie to pro course and I never knew I could fall in love with a language but I think I have lol
I'm following this course so far but when I click alt + enter at 7:30 it doesn't import anything, I've tried manually typing it but kotlinx doesn't even autocomplete it only says kotlin
While running Android studio emulator when I increase the volume of the emulator it got crashed and showed blue screen error what could be the possible reason ??
First - thanks again and again for the videos. Second - Just a suggestion, you do not have to accpet: Instead of teaching us the shortcut to refactor (and we are familiiar with many other), right click and show us the popup menu - refactor All the best :)
Thanks for the feedback! For which particular reason? I mean the shortcut is faster of course and I never needed another option out of the refractor menu than renaming
@@PhilippLackner True, it is faster. But we are familiar with shortcut from (e.g. office, visual studio, python , norton commander (lol) ,android studio, access , you got it...) but if one will study "first" to do it with the correct menu - he/she will look for the shortcut there :)
to solve button problem: - add : apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' to your build gradle (module...) -add : import kotlinx.android.synthetic.main.activity_main.* to your main activity
Thanks. This modification worked for me ``` plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'org.jetbrains.kotlin.android.extensions' } ```
@@S_Karthik You have to add id 'kotlin-android-extensions' in build.gradle (:app) file not in the other gradle file which is build.gradle (Your App Name)
Worth pointing out that Kotlin Synthetics (Which is the feature [Extension Plugin] that allows you to call your Views (Buttons, Edittexts, etc) with their respective ID directly onto your Kt file/class is deprecated, which in general means it is not recommended to use anymore, instead it is good to use ViewBinding or DataBinding (or both if needed).
He covers view binding in this video here ua-cam.com/video/z0F2QTAKsWU/v-deo.html
thanks
Yeah It didn't use the synthetics stuff because i as did that it didn't work but I knew about viewbinding so yeah I used viewbinding 😁
Glad I saw this comment. I would have driven myself insane and probably found a different set of tutorials and started all over.. AGAIN..
without this i would have found my self lost
I was going through a bunch of videos on UA-cam trying to look on getting into Android Studio with Kotlin since it is the new language going forward by Google on Android. And all of the videos I could find would show you how to do something but not really explain what each part of the video does. For example, the way you broke down the meaning of "R.id.but..." to indicate this comes from resources and ID's, it's something not many do. Thanks for making this fundamental series, it has been super helpful so far for someone looking for a concentration in their CS degree ;)
Thanks so much for your feedback and taking your time. I'm glad I could help and I hope you benefit from my other videos too🙏
True
Wow holy crap these videos are easily the best coding tutorial videos I have ever seen. I am a complete beginner and self taught (more youtube taught honestly) and you are by far the most helpful.
Thank you! ❤️
Followed along through your entire Newbie to Pro series, and per your recommendation, I'm going through this series to learn XML before jumping into Jet Pack Compose. This is my first time committing to learn to program since my Web Design HTML/CSS days over a decade ago. Anyways, THANK YOU. You're videos are not only well thought out and made, but your playlists are well structured and paced. I actually feel confident that I can be good at this because of your tutorials and advice.
Figured after having watched 30+ videos of yours, I should stop and express my appreciation. Keep doing your thing!
Yeah I been following through this too. Well you are 2 weeks ahead of me. How's it going?
Thank you Professor God Bless You from Senegal Great Job Enjoy you contribute to the humanity
from 2021 and I got problems when I have tried to import views by using "synthetic". But I have fixed it by replacing with 'view binding'. Great tutorial bro keep going on!
Hi,
You can add the line: id 'kotlin-android-extensions'
into plugins section in build.gradle(app)
@@cutaguy Thanks for the solution.😊
@@cutaguy Thanks for this!
ua-cam.com/video/z0F2QTAKsWU/v-deo.html&ab_channel=PhilippLackner view binding
Phillipp, your video about buttons is extremely good. Your tip about renaming buttons is very important. I had problem with renaming buttons. However I need button to save data in database - to implement Insert statement. I do not know how to do this in button.onclick. Could you please show this in comment. Because it is important for all Android Studio beginners. Or can you make video " Buttons to save and delete data in database". Thanks a lot
Hi Philipp, How do we import a button nowadays (Oct 2021)? the alt + enter method doesn't work anymore.
Same here
Great video, bro. I finished an Android App Development course on Udemy, and I'm now using your videos for review. These are helping tremendously. Keep up the good up work.
can you send me the link of the course?
Great Tutorial. You are what is getting me through my Mobile App Class. Thank you!
to do what he did in this video you need first to learn about view binding in this videos
ua-cam.com/video/z0F2QTAKsWU/v-deo.html
ua-cam.com/video/QVIgunA3jcQ/v-deo.html
this will help you to understand how android studio calls view by id now
after that you can follow with the setOnClickListener part because after you call the button its the same in both ways
Thank you
@@gangardarwagle8938 No problem Brother
your comment helped me lot
thank you
if you add ads, i pleasure to watch it. thank you so much for good explanation
first of all thank you so much for you very useful curse
and then I have a question
in the 8 min where you teaching about "importing btnApply" it dosn't work for me
I pressed Alt+Enter but it didn't work
can you pleas help me to fix it?
what about now
Love your videos. Could you also show how to do this stuff in code besides the design views?
I love how much this looks like Visual Basic but with OOP
Just in case if you are following along this tutorial as I am so the import " synthetic " is deprecated but Philipp has made an updated video using View Binding. Just keep coding.
ua-cam.com/video/z0F2QTAKsWU/v-deo.html
thanks!
Thanks! Saved me an hour of trying to find the correct google search string.
Thanks. whenever you think its just something small and easy, but you actually need a whole video to explain!! thank you so much.
Anyone please help me in my Android Studio it doesn't work when i type btnApply it shows create local variable also there the import library doesn't work
i Tried many places still im stuck . help me
Same error
Hello, I'm a newbie here.
Many thanks to your video, one of the best explained android tutorials!
Some issue occurred when I followed steps in the video
Program compiled fine, but my emulator still showed "Hello World" layout,
which is really strange because in the previous Linearlayout video the app ran no problem.
My first thought is it's maybe android studio had some syntax updates during this time since 2020?
I've googled it but most answers were so many years ago.
Sorry if the question sounds stupid, would appreciate any help, thanks!
Being a Java Developer at 7:18 i realized (one of the reasons maybe) why u hate java & love KOTLIN
Great series!
Thank you!
New ways to implement binding - ua-cam.com/video/QVIgunA3jcQ/v-deo.html&ab_channel=ProgrammingWithNick
thanks a lot friend
Hey I was following this tutorial and I tried using the Alt enter shortcut and it didnt work I then tried doing the import with kotlinx and it didnt give me that as an option is this something I have missed during the setup? Other than that loving this content just finished your kotlin newbie to pro course and I never knew I could fall in love with a language but I think I have lol
You can add this
id 'kotlin-android-extensions'
to the plugins in your build.gradle file.
@@ashrayapandey5576 It works, thank you.
I'm following this course so far but when I click alt + enter at 7:30 it doesn't import anything, I've tried manually typing it but kotlinx doesn't even autocomplete it only says kotlin
nvm I fixed it in my build.gradle (app) plugins for some reason there wasn't id 'kotlin-android-extensions' I added that and it worked
@@dimitritsikaridze6220 Thanks !
another thanks !!
And another thank you!
@@dimitritsikaridze6220 Thank you
just binge watching
While running Android studio emulator when I increase the volume of the emulator it got crashed and showed blue screen error what could be the possible reason ??
First - thanks again and again for the videos.
Second - Just a suggestion, you do not have to accpet: Instead of teaching us the shortcut to refactor (and we are familiiar with many other), right click and show us the popup menu - refactor
All the best :)
Thanks for the feedback! For which particular reason? I mean the shortcut is faster of course and I never needed another option out of the refractor menu than renaming
@@PhilippLackner True, it is faster. But we are familiar with shortcut from (e.g. office, visual studio, python , norton commander (lol) ,android studio, access , you got it...) but if one will study "first" to do it with the correct menu - he/she will look for the shortcut there :)
Perfect explanation :)
Thanks!
Nice 👍
What is the difference between left_to_left_of and start_to_start_of?
to solve button problem:
- add :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
to your build gradle (module...)
-add :
import kotlinx.android.synthetic.main.activity_main.*
to your main activity
Thanks. This modification worked for me
```
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.android.extensions'
}
```
why the placeholder text in the edittext fields stay when i write something
Mad respect
I think we need to know view binding here
in buttons whn am using Log.d its shwing error am imported android.util.Log
Great
couldn't add my view directly in main activity. not showing any import
Add id 'kotlin-android-extensions' in your build.gradle file in the plugins block. Google removed this feature by default
@@PhilippLackner Thanks for reply, I tried it but now uninstalled and retried again it doesn't works.. also learning from your videos is good thanks
@@PhilippLackner I was having the same problem. That worked for me. Thanks!
ua-cam.com/video/dXVWTqXnF5U/v-deo.html
This will save u my brother
@@S_Karthik You have to add id 'kotlin-android-extensions' in build.gradle (:app) file not in the other gradle file which is build.gradle (Your App Name)
How do we import a button , the alt + enter method doesn't work anymore
Did you find it bro?
@@devprasad8767 same here
Binding is used nowadays. This will help you
ua-cam.com/video/z0F2QTAKsWU/v-deo.html
Bro did you find the solution for it???
how to import button in kotlin file its not importing on presssing alt + enter
android.util.log not working. how to resolve?
when i click on Apply Button nothing works... why my button onclicklistener not working ??? no any logcat neither any response ... reply soon
it is deprecated now
Not able to import the id. How to do it?
Ok done thx for the amazing video
I couldn't import my button id automatically, I'm using Android Studio v4.1.2
it looks like the kotlinx synthetics got deprecated developer.android.com/topic/libraries/view-binding/migration
@@amine250 tnx, it helped
NamingExceptionError: "New York" is not a country! 😜
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.applyBtn.setOnClickListener{
val firstName = binding.firstNameTxt.text.toString()
val lastName = binding.lastNameTxt.text.toString()
val birthDate = binding.birthdateTxt.text.toString()
val country = binding.countryTxt.text.toString()
Log.d("MainActivity:", "$firstName, $lastName, $birthDate, $country")
}
}