BUTTONS - Android Fundamentals

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024

Комментарии • 105

  • @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 ruclips.net/video/z0F2QTAKsWU/видео.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 5 дней назад

      without this i would have found my self lost

  • @pikaboyny
    @pikaboyny 4 года назад +29

    I was going through a bunch of videos on RUclips 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

  • @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 8 месяцев назад

      ruclips.net/video/z0F2QTAKsWU/видео.html&ab_channel=PhilippLackner view binding

  • @TzarPlatypus
    @TzarPlatypus 3 года назад +4

    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 8 месяцев назад +1

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

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

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

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

  • @loganwhite5467
    @loganwhite5467 3 года назад

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

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

  • @captainbr0st.189
    @captainbr0st.189 Год назад

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

  • @fulksatavonsamith4815
    @fulksatavonsamith4815 4 года назад +1

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

  • @BballShot90
    @BballShot90 3 года назад +2

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

  • @TheSharkbeast
    @TheSharkbeast 3 года назад +1

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

  • @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 2 года назад

      And another thank you!

    • @tolugantidivyareddy6053
      @tolugantidivyareddy6053 2 года назад

      @@dimitritsikaridze6220 Thank you

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

  • @mikemikee7797
    @mikemikee7797 4 года назад +1

    Great series!

  • @benbouzaadel
    @benbouzaadel Год назад +12

    to do what he did in this video you need first to learn about view binding in this videos
    ruclips.net/video/z0F2QTAKsWU/видео.html
    ruclips.net/video/QVIgunA3jcQ/видео.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

  • @gutic4824
    @gutic4824 4 года назад +1

    Perfect explanation :)

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

  • @ahmedsabahsabri1494
    @ahmedsabahsabri1494 Год назад

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

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

  • @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.
    ruclips.net/video/z0F2QTAKsWU/видео.html

    • @wahyukoco4562
      @wahyukoco4562 2 года назад

      thanks!

    • @regressumdiabolus
      @regressumdiabolus 2 года назад

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

    • @timmyroberts1
      @timmyroberts1 6 месяцев назад

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

  • @Luffy_2804
    @Luffy_2804 Год назад

    just binge watching

  • @rounakdas3411
    @rounakdas3411 3 года назад

    What is the difference between left_to_left_of and start_to_start_of?

  • @sidbot9622
    @sidbot9622 Год назад +1

    I think we need to know view binding here

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

  • @abdremo
    @abdremo 4 года назад +1

    Nice 👍

  • @ranganathprasadkr3239
    @ranganathprasadkr3239 3 года назад

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

  • @shashwatkumarjain3337
    @shashwatkumarjain3337 2 года назад

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

  • @marypaul9627
    @marypaul9627 2 года назад

    Mad respect

  • @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
      ruclips.net/video/z0F2QTAKsWU/видео.html

    • @aaaaa0000wu
      @aaaaa0000wu 7 месяцев назад

      Bro did you find the solution for it???

  • @S_Karthik
    @S_Karthik 3 года назад +2

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

    • @PhilippLackner
      @PhilippLackner  3 года назад +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 3 года назад

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

      ruclips.net/video/dXVWTqXnF5U/видео.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)

  • @akshayaarora4979
    @akshayaarora4979 3 года назад

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

  • @princedonkor44
    @princedonkor44 Год назад +3

    New ways to implement binding - ruclips.net/video/QVIgunA3jcQ/видео.html&ab_channel=ProgrammingWithNick

  • @AjaySharma-pk5sc
    @AjaySharma-pk5sc 4 года назад

    Great

  • @akshayrajsinhchudasama7315
    @akshayrajsinhchudasama7315 2 года назад

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

  • @KhulKeBoloo
    @KhulKeBoloo 2 года назад

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

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

  • @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'
      }
      ```

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