BUTTONS - Android Fundamentals

Поділитися
Вставка
  • Опубліковано 7 лис 2024

КОМЕНТАРІ • 106

  • @SuegroLM
    @SuegroLM 3 роки тому +76

    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).

    • @ewomer100
      @ewomer100 2 роки тому +15

      He covers view binding in this video here ua-cam.com/video/z0F2QTAKsWU/v-deo.html

    • @lovenangelo5415
      @lovenangelo5415 2 роки тому +1

      thanks

    • @TheImaginativeSachin
      @TheImaginativeSachin 2 роки тому

      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 😁

    • @jimlthor
      @jimlthor Рік тому +2

      Glad I saw this comment. I would have driven myself insane and probably found a different set of tutorials and started all over.. AGAIN..

    • @dennisotieno5540
      @dennisotieno5540 23 дні тому

      without this i would have found my self lost

  • @pikaboyny
    @pikaboyny 4 роки тому +29

    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 ;)

    • @PhilippLackner
      @PhilippLackner  4 роки тому

      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🙏

    • @AyushSachan2211
      @AyushSachan2211 4 роки тому

      True

  • @TzarPlatypus
    @TzarPlatypus 3 роки тому +5

    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.

  • @JoeMadds0
    @JoeMadds0 2 роки тому +4

    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!

    • @TheImaginativeSachin
      @TheImaginativeSachin 2 роки тому

      Yeah I been following through this too. Well you are 2 weeks ahead of me. How's it going?

  • @sibymohamed3013
    @sibymohamed3013 9 місяців тому +1

    Thank you Professor God Bless You from Senegal Great Job Enjoy you contribute to the humanity

  • @daiyrkanybekov8575
    @daiyrkanybekov8575 3 роки тому +12

    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!

    • @cutaguy
      @cutaguy 3 роки тому +3

      Hi,
      You can add the line: id 'kotlin-android-extensions'
      into plugins section in build.gradle(app)

    • @shubhamgupta3396
      @shubhamgupta3396 3 роки тому +2

      @@cutaguy Thanks for the solution.😊

    • @sahalsm2651
      @sahalsm2651 3 роки тому

      ​@@cutaguy Thanks for this!

    • @maxvoleanin570
      @maxvoleanin570 9 місяців тому

      ua-cam.com/video/z0F2QTAKsWU/v-deo.html&ab_channel=PhilippLackner view binding

  • @brianryan4053
    @brianryan4053 3 роки тому +3

    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

  • @nawledge4pwr
    @nawledge4pwr 3 роки тому +7

    Hi Philipp, How do we import a button nowadays (Oct 2021)? the alt + enter method doesn't work anymore.

  • @gracialonignasiver6302
    @gracialonignasiver6302 4 роки тому +1

    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.

    • @nBioTechie
      @nBioTechie Рік тому

      can you send me the link of the course?

  • @loganwhite5467
    @loganwhite5467 3 роки тому

    Great Tutorial. You are what is getting me through my Mobile App Class. Thank you!

  • @benbouzaadel
    @benbouzaadel Рік тому +12

    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

  • @fulksatavonsamith4815
    @fulksatavonsamith4815 4 роки тому +1

    if you add ads, i pleasure to watch it. thank you so much for good explanation

  • @monbebex7302
    @monbebex7302 Рік тому +2

    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?

  • @BballShot90
    @BballShot90 3 роки тому +2

    Love your videos. Could you also show how to do this stuff in code besides the design views?

  • @captainbr0st.189
    @captainbr0st.189 Рік тому

    I love how much this looks like Visual Basic but with OOP

  • @bacanalienigena
    @bacanalienigena 2 роки тому +20

    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

    • @wahyukoco4562
      @wahyukoco4562 2 роки тому

      thanks!

    • @regressumdiabolus
      @regressumdiabolus 2 роки тому

      Thanks! Saved me an hour of trying to find the correct google search string.

    • @timmyroberts1
      @timmyroberts1 7 місяців тому

      Thanks. whenever you think its just something small and easy, but you actually need a whole video to explain!! thank you so much.

  • @aayushukey4524
    @aayushukey4524 Рік тому +6

    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

  • @nervous711
    @nervous711 2 роки тому

    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!

  • @TheSharkbeast
    @TheSharkbeast 3 роки тому +1

    Being a Java Developer at 7:18 i realized (one of the reasons maybe) why u hate java & love KOTLIN

  • @mikemikee7797
    @mikemikee7797 4 роки тому +1

    Great series!

  • @princedonkor44
    @princedonkor44 Рік тому +3

    New ways to implement binding - ua-cam.com/video/QVIgunA3jcQ/v-deo.html&ab_channel=ProgrammingWithNick

  • @haydendavies2862
    @haydendavies2862 4 роки тому +1

    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

    • @ashrayapandey5576
      @ashrayapandey5576 4 роки тому +9

      You can add this
      id 'kotlin-android-extensions'
      to the plugins in your build.gradle file.

    • @712allen
      @712allen 3 роки тому +1

      @@ashrayapandey5576 It works, thank you.

  • @dimitritsikaridze6220
    @dimitritsikaridze6220 3 роки тому +19

    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

    • @dimitritsikaridze6220
      @dimitritsikaridze6220 3 роки тому +14

      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

    • @morganlombard5985
      @morganlombard5985 3 роки тому +1

      @@dimitritsikaridze6220 Thanks !

    • @ucminh7630
      @ucminh7630 3 роки тому

      another thanks !!

    • @Joe-sm7mf
      @Joe-sm7mf 3 роки тому

      And another thank you!

    • @tolugantidivyareddy6053
      @tolugantidivyareddy6053 2 роки тому

      @@dimitritsikaridze6220 Thank you

  • @Luffy_2804
    @Luffy_2804 Рік тому

    just binge watching

  • @anupambhatt3376
    @anupambhatt3376 4 роки тому +1

    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 ??

  • @guy1407
    @guy1407 4 роки тому

    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 :)

    • @PhilippLackner
      @PhilippLackner  4 роки тому

      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

    • @guy1407
      @guy1407 4 роки тому +1

      @@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 :)

  • @gutic4824
    @gutic4824 4 роки тому +1

    Perfect explanation :)

  • @abdremo
    @abdremo 4 роки тому +1

    Nice 👍

  • @rounakdas3411
    @rounakdas3411 3 роки тому

    What is the difference between left_to_left_of and start_to_start_of?

  • @moattia9126
    @moattia9126 Рік тому +1

    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

    • @yunierolivera5091
      @yunierolivera5091 Рік тому

      Thanks. This modification worked for me
      ```
      plugins {
      id 'com.android.application'
      id 'org.jetbrains.kotlin.android'
      id 'org.jetbrains.kotlin.android.extensions'
      }
      ```

  • @ahmedsabahsabri1494
    @ahmedsabahsabri1494 Рік тому

    why the placeholder text in the edittext fields stay when i write something

  • @marypaul9627
    @marypaul9627 2 роки тому

    Mad respect

  • @sidbot9622
    @sidbot9622 Рік тому +1

    I think we need to know view binding here

  • @ranganathprasadkr3239
    @ranganathprasadkr3239 3 роки тому

    in buttons whn am using Log.d its shwing error am imported android.util.Log

  • @AjaySharma-pk5sc
    @AjaySharma-pk5sc 4 роки тому

    Great

  • @S_Karthik
    @S_Karthik 4 роки тому +2

    couldn't add my view directly in main activity. not showing any import

    • @PhilippLackner
      @PhilippLackner  4 роки тому +5

      Add id 'kotlin-android-extensions' in your build.gradle file in the plugins block. Google removed this feature by default

    • @S_Karthik
      @S_Karthik 4 роки тому

      @@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

    • @SimspaceDev
      @SimspaceDev 3 роки тому

      @@PhilippLackner I was having the same problem. That worked for me. Thanks!

    • @mrak7588
      @mrak7588 3 роки тому +1

      ua-cam.com/video/dXVWTqXnF5U/v-deo.html
      This will save u my brother

    • @kesavguru415
      @kesavguru415 Рік тому +2

      @@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)

  • @abdulbasid2539
    @abdulbasid2539 2 роки тому +1

    How do we import a button , the alt + enter method doesn't work anymore

    • @devprasad8767
      @devprasad8767 2 роки тому

      Did you find it bro?

    • @wellingtonschutz6752
      @wellingtonschutz6752 Рік тому

      @@devprasad8767 same here

    • @ucraceviri
      @ucraceviri Рік тому

      Binding is used nowadays. This will help you
      ua-cam.com/video/z0F2QTAKsWU/v-deo.html

    • @aaaaa0000wu
      @aaaaa0000wu 8 місяців тому

      Bro did you find the solution for it???

  • @shashwatkumarjain3337
    @shashwatkumarjain3337 2 роки тому

    how to import button in kotlin file its not importing on presssing alt + enter

  • @akshayaarora4979
    @akshayaarora4979 3 роки тому

    android.util.log not working. how to resolve?

  • @KhulKeBoloo
    @KhulKeBoloo 3 роки тому

    when i click on Apply Button nothing works... why my button onclicklistener not working ??? no any logcat neither any response ... reply soon

  • @akshayrajchudasama
    @akshayrajchudasama 2 роки тому

    Not able to import the id. How to do it?

  • @amine250
    @amine250 3 роки тому

    I couldn't import my button id automatically, I'm using Android Studio v4.1.2

    • @amine250
      @amine250 3 роки тому +1

      it looks like the kotlinx synthetics got deprecated developer.android.com/topic/libraries/view-binding/migration

    • @bekzattolegenov8517
      @bekzattolegenov8517 3 роки тому +1

      @@amine250 tnx, it helped

  • @g3org3210
    @g3org3210 3 роки тому

    NamingExceptionError: "New York" is not a country! 😜

  • @javar1987
    @javar1987 Рік тому

    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")
    }
    }