Android Kotlin: Essentials to Creating a ListView (Ep 1)
Вставка
- Опубліковано 9 лип 2024
- Creating a ListView is essential for great User Experiences on Android applications. Today we explore the necessary bits and pieces to setup one. More specifically, we need to create our own custom Adapter that provides our ListView with data. Enjoy.
Android Studio Introduction: • Android Kotlin: Introd...
Instagram Firebase Course
www.letsbuildthatapp.com/cour...
Facebook Group
/ 1240636442694543
iOS Basic Training Course
www.letsbuildthatapp.com/basi...
Completed Source Code
www.letsbuildthatapp.com/cour...
Follow me on Twitter: / buildthatapp
Easily the best Android videos on youtube. I love it thanks for the great content!
youre very professional and we love you thx for them all.
thanks for uploading awesome video!
I've been waiting for your android lesson
thank you so much!!!! i been looking so much for good listView tutorial!!!!
Excellent as usual! thank you
Thank you Sir for making such an easy and clear tutorial. The way you explain things are very clear.
hey, sound is imbalanced... The left channel is way quiter than right channel
Thanks. Interesting stuff!
Thank you so much! Really useful videos!
thanks for you tutorials bro, when i was learn IOS programming i also watch and learn from you. Im your fans. keep moving. chers
Old Video but really good. Face and Voice of the author. Good illustration, good microphone. Yes definitely a like !. Thank you sir !
another awesome tutorial cheer
Parabéns pela aula, ótima explicação... Obrigado
Best tutorial on the net!
man, thanks for doing android tutorials you are awesome!
When you're setting a value for a property in constructor, you don't need to use init block, you can just declare your property inside a constructor like this
class ClassName(val property: Type)
Oh you're right, I'm still stuck in the Java mindset of doing things!
You can, but don't have to. You must not to! It's bad practice, leading to muddy code.
its not bad practice. It is purposelly put into Kotlin to prevent the boilerplate code
"bad practice" no.. no...
You can also use access modifiers like private, public, and package-private inside the constructor.
lets build+ sir can i use android studio in my laptop having 1 gb ram if not how can i increase my ram
Nice lesson, very clear
Hi Brianm is there any chance that you will do a swipe menubar couser (free or paid) for android?
Thank you
How do I know when I should swap from ListView to RecyclerView or the other way?
thanks for the awesome tutorial
Thanks for the tutorial Brian. Coming from Xcode and iOS I have a love/hate towards android studio :)
thank you for Android tutorials...
its nice to have Android tutorials from you...
hope ti will be continuining in comming videos also..
We'll slowly have more and more Android related content on this channel for all of your starving out there.
Lets Build That App thanks for the videos. I wonder whats you take on react native replacing kotlin/Java and swift/objective-c? Isn't that the direction where it's all heading?
Thank you very much ...
and it would be better if you start a series of complete app developing tutorials...
This was supposed to happen 10 years ago according to predictions in the software industry.
You can go ahead and sign up for an account on my website and I'll announce when a full series course comes out for Android Kotlin. Thanks.
Awesome tutorial.
Hi, I'm doing it like this
var listado = Array(2,{"a"})
var adaptador = ArrayAdapterr(this,android.R.layout.simple_list_item_1,listado)
lista.adapter = adaptador
its the same? or is better do it like you?
Hi Brian, just a few question. How will you differentiate ListView vs RecyclerView and which is much better for you? Like how you define the differences of TableView & CollectionView in SWIFT. Thank you in advance. :)
Hadn't even realized you have Android videos aswell - is this the first? Looking forward to watching it!
There is 2 other videos
HELLO BRIAN,can I ask now Apple device can restore without upgrading IOS? Currently on IOS 9 .
anyone can help me pls, I am trying to develop a Full piano, by means of fragments, with structure MVVM and LiveData (targetveb.com/android-piano-kotlin-mvvm-livedata.html), but I do not know how to put more than two fragments in one ListView or a RecyclerView, how should I use the adapter to work properly and move me around the keyboard?
Thanks man
Hey Brian, thank you for this tutorial and all content that you do about iOS developer. I have learning a lot with you.
I have a listView that does not run. I don't know what to do at this moment. I have tried everything. Please help.
Lost in programming
Margarita
Anybody have any idea how to add the grey colour to once every 2 itemViews like in the thumbnail?
So im new to android studio, I decided to create a listview similar to yours therefore I took the liberty and used the exact code you showed in the video but to my shock , the code doesnt work at all , nothing shows up on the list view , the val function doesnt even work only has error and yeh I was wondering whether you could kinda help me out with my listview since its not working for me at all
I’ll be putting up an updated paid course on my website later this year. You’ll find better code there.
Hi Brian! Could you make video on using MVVM with retrofit, realm(or ant other data base), livedata on kotlin. Thanks.
thanks for the tutorial ... in the demo that you use to explain what you are going to teach in the navbar there is a search engine ... that at some point you show it how it is done? I did not see it in this tutorial ... Thank you!
Super!!
love ur tutorials
.... do jetpack compose tutorial plz ...
Subscribed
большое спасибо за видео
I always get a typecast error in the exact same line in the getView() method no matter what i do 😖
Hi Brian. As Kotlin compatible with Java, and Java can run on any OS where JVM is installed. Can i use Kotlin to create apps for Windows? If it’s possible, can you make video about that? Thanks a lot!
nice
So do we get unlimited number of list view or is it only 5?
Hey Brian! I've got something to ask you. Why do you use findViewById on Kotlin? Kotlin can get de UI element by itself if you just give the ID declared on the layout file.
like this:
val listView = main_listview
But I bet you know this, so, is there any benefit in using findViewById in Kotlin ? Or it's just your personal preference.
+Tiago Bastos yeah I read about this but wasn't able to get it to work. It's also helpful to go over things the long way first
Yeah, you're right :)
Ok, I finally figured it out, hopefully I'll be able to show this in a later video.
Hi, how to retrieve image from firebase using Kotlin?
Keeping reference to a context sounds like a recipe for memory leaks
Hello sir,
I want listview to open a new activity and display certain information when clicked in certain row of listview. So far i am only able to display same information when clicked on every row . i dont know how to set these information for particular row for example when i click on row 1 the details of mobile are shown have textView and when i click on row 2 mobile price is shown
Sir plz help me out.
You just want to use putExtra on your intents.
Lets Build That App
Yes sir
But how we will display different information in one activity.
Thank you sir for replying 😊
Check out the next series where we build out these features: ua-cam.com/video/SamS4UA-b4Q/v-deo.html
What does google say?
Lets Build That App
This is the code which I m trying and Google said.
protected void onListItemClick(ListView lv, View v, int position, long id){ super.onListItemClick(lv, v, position, id); Intent intent = new Intent(StudentHall.this, StudentHallSelect.class); switch(position){ case 0: intent.putExtra("description",getResources().getStringArray(R.array.hallsdescription)[0]); break; case 1: intent.putExtra("description",getResources().getStringArray(R.array.hallsdescription)[1]); break; } startActivity(intent); }
Good morning, can you do a tutorial for Table Registration/Reservation App.
Like this.
* 4 tables - grid
* 5 pax per table
if table is clicked - Show customer list
Parameternames such as p0... pn is pretty useless. No offense but android studio autocompletion seems to be absolute garbage from my experience. Is there a way to get proper autocomplete, close to what xcode offers? Brian says the autocomplete is not working "for some reason". Would that imply that it usually works differently?
The autocomplete has gotten better over the years. Pretty soon we can utilize Jetpack Compose to draw out all the UI. Lists will be a thing of the past.
which brand mic do you have
It's a Rode mic: amzn.to/2zdGwyd
if only my teacher could explain the problem like you do
True, most teachers are absolutely not fit to be teaching.
How to use fragment
Bonjour, je sais pas si vous allez pouvoir me donner l'info. J'ai créé une liste view et je croyais pouvoir attacher une autre liste wiew mais je n'y arrive pas. Mon projet et de présenter des articles de péche et pour cela j'ai besoin de créer des catégories exemples A1) matériels de pêche et B1) matériels vêtements de pêche sous catégories Aa1 accessoires de pêche les bouchons Ab1 les apats Ac1 les Cannes à pêche.... et une dernière sous catégorie Aaa1 les bouchon bois Aaa2 les bouchons pvc Aaa3 les bouchons..... Et après la fiche de l'article. Comment procéder. J'ai cherché et rien trouvé si vous pouviez m'orienter ou me donner une source ou autre je suis preneur. Merci beaucoup par avance.
Thanks, finally tutorials about Android, Are you going to explain all the layouts and widgets, like ListView, RecyclerView etc, or it will be project based?
I'm probably going to do an intro on the basic components I need for the first project, then move onto writing some real project code.
Ok great, thanks:)
which keyboard do you use?
Why does he not want to answer this question but my guess will be a mac keyboard maybe the one on the laptop
Brian, can you disable the device frame on emulator ? Look pretty neat :)
Thank you for the suggestion! I really hate the frame.
please tab layout or recyclerview !
Can you do quick video on AdvanceWebview ? Please I converted my website to an app but I cant download any file like video and music. Please help me how to do that. Thnak you so much
That's great, how would you like the solution presented?
Lets Build That App anything can work at this time. A video or even through chat. Please help me out
I am using this > github.com/delight-im/Android-AdvancedWebView
problem is when I click on download button it doesn't do anything
Lets Build That App
Hey Brain, This tutorial is really awesome, easy to understand and implement. As I am new to Android development could you come up with a video where you can show Collection View functionality implemented in Android.
Thanks Brian. Are you planning to update this tutorial videos?
What's there to update?
@@LetsBuildThatApp for example I just read in the comments below that is better to use RecycledView instead of ListView (for something of the ViewHolder) and that you don't need to use init block, you can just declare your property inside a constructor like this
class ClassName(val property: Type)
I just updated like this: private class CustomAdapter(val context: Context): BaseAdapter()
So just to be sure to use kotlin benefits
There’s already a ton of recycler view tutorials on this channel. I suggest you go through those as well.
Hello! Nice videos! One suggestion: In 17:30, instead of Init{} you can use "val" before the variable to be able to use it on the class.
great video bro, how can I see user name and password on a save pokemon go backup apk? I lost my password and user name to login
It's kotlin now and why still use findviewById ?
Yeah, the next couple of videos I show how to avoid findViewById.
Isn't Java still better than Kotlin atm? I've heard there are very few resources for Kotlin. Let's say if somebody wanted to learn android app development, wouldn't it be better to start with Java. I don't see Kotlin taking Java's place anytime soon.
Btw, are there a lot of syntax changes between swift 3 and 4? I'm learning swift 3 right now thus I was wondering if I'll be able to swiftly transition my projects to swift 4? There were quite a few drastic changes in the past between swift 1, 2, and 3.
PS. I love your channel.
Hello Sophie, I would highly encourage you to get out of the mindset of finding the "BEST" language out there. End of the day, all of the programming concepts are the same and can be transferred over quite easily. Good luck.
Kotlin is 100% interoperable with Java so all Java resources are available in Kotlin. Now that Google has provided first class support for Kotlin in Android development it is very likley that it will be the de facto language in due time.
Sounds great. It's just a pain in the neck for rookie developers, myself included, who'll be forced to learn two languages now to develop apps on a single platform :/. Google could've used swift instead since it's open-source.
Indeed, however this is like going into the ice cream shop for the first time and saying "There are way too many flavors, I wish you guys would just sell vanilla! I'm so confused."
But that's the great thing about Kotlin, Sophie. You don't necessarily need to learn it. Some of your team can use Kotlin while you use Java and they both work well together. Learn Java first because I think it helps learning a more verbose approach first. Then when you're comfortable, learning Kotlin will be a breeze.
It seems like Kotlin is throwing you off haha. I much prefer Java with Kotlin sprinkled in - don't think I'll be a fan of Kotlin when Java is around. Maybe you could do that? Seems like the workflow currently adopted in the industry.
+Josh Gallagher yeah kotlin is certainly harder to explain since I'm not really used to it, however it is a true pleasure to type and code in it. Kotlin and intellij is blazing fast. I think going forward we will see more and more adoption of kotlin. Slowly the Java docs will morph into kotlin as well just like swift.
put a val before context and it will create a field for you.
old java habits die hard.
I am using android 3.0.1
if you just have a return you don't need the return type and block
No need for find by id in kotlin
I think it is better to use recycler view
It still boggles my mind that people don’t know that recycler view is a list view with view holder implemented
Android :D
Yeah gotta love android.
How's the 上海 trip?
+Albert Lu it was super hot and fun teaching
Ha ha, It's nice to have you back!
I'll love android definitely :D
There needs to be more educational videos with good production quality
One person doesn't understand lambdas
why teach something that will never be used? was this a lazy upload?
Why teach math when we have calculators?
My guy programs and burns people at the same time lul.
Oh god, way too old method.
Go ahead and catch up on the latest Android Kotlin series where we go through RecyclerView.
booooooooooooooooooooooooooooooooooooooooo
Since we have RecyclerView there is no reason to use Listview :)
What the hell is this, just a waste of time.
List View? what are you ! 12? , use a recyclerview
I hope you realize recyclerview is just a listview with view holder pattern. If you don't know how a list view works, then recyclerviews don't make sense.
If you stare at it long enough it'll make sense. /s