Calendar App Example Android Studio Tutorial

  Рет қаралды 110,726

Code With Cal

Code With Cal

Күн бұрын

How to create a simple calendar view using Android Studio and Java. In this example project we are building a basic calendar view Android app. A great beginner programming project to further your understanding of using recycler views, working with dates using Java v8 and later, text views, linear layouts and more.
Calendar Source Code:
github.com/codeWithCal/Calend...
Part 2 Weekly Calendar View:
• Weekly Calendar Androi...
Part 3 Daily Calendar View:
• Daily Calendar View An...
⏱️ TIMESTAMPS ⏱️
00:00 - Intro
00:37 - Android XML Layout
03:17 - Calendar Java Code
#CalendarAppTutorial #LearnAndroidStudio #AppDevelopment

Пікірлер: 251
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Weekly Calendar Tutorial: kzfaq.info/get/bejne/odSghsWlx7beY6M.html
@bencorrell
@bencorrell 3 ай бұрын
3 years later and this tutorial is still helping people! Thanks for making it!
@andrewm2103
@andrewm2103 Жыл бұрын
Awesome, Thank you used this tutorial to add to my project, 90% of the code worked perfectly, I just changed a couple of lines that didn't work in a Fragment. 100% happy with the outcome, looking forward to the next step.
@ChrisPugsworth
@ChrisPugsworth 5 ай бұрын
what was the 10% that didnt work? Im also planning on implementing it in a fragment but the calendar dates wont show in the recycler view.
@aldrensalada1002
@aldrensalada1002 Жыл бұрын
Great video. I was hoping to see a calendar tutorial with only months and years to choose from without displaying the days. Thanks!!
@scooynilo
@scooynilo Жыл бұрын
Mate, you just about saved a uni project cause I was dumb enough to assume CalendarView would be useful. Thank you
@doc4153
@doc4153 2 жыл бұрын
You seemed like a normal, level-headed young man at first, until you blinded me with your usage of light mode. GAHHHH!! I tease. Thank you for the great video.
@CodeWithCal
@CodeWithCal 2 жыл бұрын
😆 Light mode for the win! Thanks, you're welcome.
@qpdbwvwdbqp4730
@qpdbwvwdbqp4730 2 жыл бұрын
Thank you so much Cal! This was super super useful!
@rajmodi5669
@rajmodi5669 Жыл бұрын
Hi Cal, thanks for the great example! I am trying to reference certain days of the month to change their color. Seems to work fine on the current month, but once we go to a different month, I can't grab a reference to any of the days. Any hints you can pass along on how to reference each day? Thanks!
@japogi3639
@japogi3639 2 жыл бұрын
Thank you for this tutorial, very helpful specially if we want custom calendar
@mrsmile1982
@mrsmile1982 Жыл бұрын
Thank you man you helped me so much!!!!
@whitewolf143
@whitewolf143 3 жыл бұрын
can pls make your videos a bit slow it's hard to follow for beginners like me (a little more explanation will help). thanks
@vidyab1821
@vidyab1821 3 жыл бұрын
Hei Arif! Try changing the playback speed by clicking on the three dots on the top right corner to 0.5x.
@metalheadgamers6376
@metalheadgamers6376 Жыл бұрын
Thank you so much for the video bro . I am new to android development and this video was very helpful and easy ❤
@kingjiealdwinlee9189
@kingjiealdwinlee9189 2 жыл бұрын
sir, I am having a bit of trouble implementing the codes into a fragment is there a different code for that or is it just the same ? thank you
@jamesheiman1602
@jamesheiman1602 Жыл бұрын
hello, I would like to know the way to highlight the chosen day. Would that be possible?
@gigajoules6636
@gigajoules6636 3 жыл бұрын
I honestly though I had speed set to 2x. Not complaining.
@azamsulaiman1626
@azamsulaiman1626 11 ай бұрын
Hello sir. Can you make a tutorial video about taking or passing the retrieved data inside the recyclerview into the form of timetable where table consist of time and day? if you know what I mean. like the ClassUp app, just that it takes the data from the recyclerview. that data may consists of subject, time, classroom, and etc.
@user-kc9ug3li4z
@user-kc9ug3li4z 2 жыл бұрын
Thanks for your tutorial, it helps me a lot.
@user-gg6im1pl9q
@user-gg6im1pl9q 3 жыл бұрын
I really like your video thanks
@jairolima959
@jairolima959 2 жыл бұрын
thanks for the tutorial, :3
@mysgrown
@mysgrown 2 жыл бұрын
Thanks a lot Sir. 💌Your Channel is very helpful.👐🏻 I loved the way that you make your videos 🥳 the unique style with no audio explanation but everything is clear in video 🔥🔥
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Thanks 😊
@mysgrown
@mysgrown 2 жыл бұрын
@@CodeWithCal 😊 welcome Sir 👐🏻
@fabriqr2930
@fabriqr2930 3 ай бұрын
Hey bro how to change color the date selected? And the save the pósiton selected with a api get?
@Johnlisb
@Johnlisb 4 ай бұрын
Hi from Brazil. Do you have any video that shows the connection to the database?
@salvorotta6485
@salvorotta6485 3 жыл бұрын
Cale how you build a weekly calendar??
@adityakamath6096
@adityakamath6096 3 жыл бұрын
Hey cal, this was a really helpful video. I had one small doubt regarding adding holidays. Like what if i want to highlight particular days which are holidays
@CodeWithCal
@CodeWithCal 3 жыл бұрын
The highlighting part should be easy enough. How would you go about importing Holidays? Would it be user input? Or are you thinking of pulling from web service?
@086_it_jeetpatel4
@086_it_jeetpatel4 3 жыл бұрын
@@CodeWithCal pulling from webservice and what if want to highlight present date ? Thank you for you time and consideration.
@prateeksrivastava6940
@prateeksrivastava6940 3 жыл бұрын
Hey Cal,this video was very helpful and you are making great videos , Can we put notification and reminder to the specific ocassion or date
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Notifications tutorial, can go on the to do list, thanks.
@charmcharm124
@charmcharm124 3 жыл бұрын
U R GENIUS
@jonn6038
@jonn6038 Жыл бұрын
can we save events and store it in database? thanks in advance sir
@yokupham
@yokupham Жыл бұрын
Is it possible to highlight some events that we want?
@vikramragunathan6392
@vikramragunathan6392 6 ай бұрын
Useful 🙏
@vijayreddy4372
@vijayreddy4372 2 жыл бұрын
Thanks Buddy great tutorial....
@CodeWithCal
@CodeWithCal 2 жыл бұрын
🙏
@panmacabre9895
@panmacabre9895 2 жыл бұрын
you are genius and so inspiration to me
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Thanks 😊
@ayodejiadesuyi2248
@ayodejiadesuyi2248 3 жыл бұрын
This was very helpfu brother. thanks a lot. What can i do to implement same for api lower than Orea
@CodeWithCal
@CodeWithCal 3 жыл бұрын
The only reason I choose a higher target. Is for the use of Localdate, if you need to target lower I see no reason it shouldn't work you'll just have to rewrite out local dates for dates.
@user-jp9lk4su4b
@user-jp9lk4su4b 2 жыл бұрын
Thank you for your Android Studio tutorials! Why when in the adapter add code: if(date.equals(CalendarUtils.selectedDate.now()) holder.dayOfMonth.setTextColor(Color.RED); Then the text of the current date is not highlighted in red? Please tell me my mistake.
@abdurraqib7031
@abdurraqib7031 Жыл бұрын
is it possible to make it swipable?
@pinkdiabanth6734
@pinkdiabanth6734 3 жыл бұрын
Nice tutorial!! Thanks for sharing your knowledge... Please keep posting these videos so that we (beginners) can learn from you. I want to add one more features that how to highlight the today's or current date? for example if today's date is 02-08-2021 so in the calendar how to highlight 2 ? currently it showing current month and year what about day?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Have you seen the weekly calendar tutorial? We highlight selected date in that and you could apply that to the monthly calendar. kzfaq.info/get/bejne/odSghsWlx7beY6M.html
@CodeWithCal
@CodeWithCal 3 жыл бұрын
06:35 in Weekly calendar tutorial
@pinkdiabanth6734
@pinkdiabanth6734 3 жыл бұрын
@@CodeWithCal thanks a lot.. I will try to highlight the current day...
@jonilsoncoelho8930
@jonilsoncoelho8930 2 жыл бұрын
Thank you so much! How to remove the empty items in recycleview in that case?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
I'm not sure I understand what you mean?
@jonilsoncoelho8930
@jonilsoncoelho8930 2 жыл бұрын
@@CodeWithCal Hi, bro! fine? I solved my question.. follow the solution: //before inserting the array into adapter if(firstDayOfMonth==7){ // remove all the empty elements from the beginning of the array when the first day of the month is on sunday. while(daysInMonthArray.get(0).isEmpty()){ daysInMonthArray.remove(0); } } // remove all the empty elements from the end of the array. while(daysInMonthArray.get(daysInMonthArray.size()-1).isEmpty()){ daysInMonthArray.remove(daysInMonthArray.size()-1); }
@rrebel9938
@rrebel9938 5 ай бұрын
Hi, I have the application working, however it is one day ahead. How do I change this?
@binnyandroid7774
@binnyandroid7774 3 жыл бұрын
Cal , can you make a custom calendar example with add event using contentResolver query? It will be a great help for me. Thanks in advance.
@CodeWithCal
@CodeWithCal 3 жыл бұрын
A follow up Weekly Android tutorial is in the making. :) I'm not using content resolver how ever...
@srys7146
@srys7146 3 жыл бұрын
Thank's for this video Cal ❤️ How can I add privious month's dates & next month's dates in remaining position!!!!
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Absolutely possible. 06:46 try to really understand what we are doing here with our days in month array. And I think the answer will become apparent. I would probably change the array to hold dates intead of strings and when we loop through the 42 days save each date, then in the calendar view holder check to see if the date is either the next or previous months and if so maybe change the text color or something.
@srys7146
@srys7146 3 жыл бұрын
@@CodeWithCal I tried whatever you said to me yesterday...but in ArrayList i got extra days for PREVIOUS and NEXT months.. can you please help me out and if possible please share code regarding this..
@srys7146
@srys7146 3 жыл бұрын
@@CodeWithCal done bro see yr weekly calendar code & solve my bugs tq dude
@blackiron8501
@blackiron8501 3 жыл бұрын
hi , i changed the layout to a Relative layout so i can add a bottom Navigation but now i can't see the days
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Hard one to troubleshoot with out seeing the layout myself. Try nesting the original layout inside your new relative layout
@mariemepi4601
@mariemepi4601 Жыл бұрын
Hello, is it possible to change the language for the month's name ? And if so how? Thank you very much for your help !
@CodeWithCal
@CodeWithCal Жыл бұрын
Absolutely! Worth doing properly have a read of the following developer.android.com/training/basics/supporting-devices/languages
@irfanulhaqsoofi5275
@irfanulhaqsoofi5275 2 жыл бұрын
Hi Cal Hope you will be doing well. Thanks a lot for publishing this very useful video. It's a great tutorial for beginners like me. I just want to ask you how I can highlight the current date in this app. Kindly help me solve this problem. A big thanks again for your productive efforts for the beginners community.
@CodeWithCal
@CodeWithCal 2 жыл бұрын
kzfaq.info/get/bejne/d8-XbJylks2yoYE.html&ab_channel=CodeWithCal 09:32 - Monthly Calendar (Prev & Next Months Greyed out) You can do a similar thing as to here, where you compare current date to date and if so change bg color or something
@Lurg
@Lurg 2 жыл бұрын
Hey Cal, I hope you can help me with this. When I implement the CalendarAdapter.onItemListener in the MainActivity, I cant implemet the methods. Instead I get this Error "Non-static field 'onItemListener' cannot be referenced from a static context"
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Hey Lurg, The on ItemListener is an interface, have you added this line public class MainActivity extends AppCompatActivity implements CalendarAdapter.OnItemListener
@Lurg
@Lurg 2 жыл бұрын
@@CodeWithCal I try to Integrate the Calendar in my App. So its not my MainActivity but that shouldn't be a problem, right ? First I thought its because my MainActivity was a Fragment but I also tried it with an new Activity with the same problem
@user-jp9lk4su4b
@user-jp9lk4su4b 2 жыл бұрын
Thanks for your tutorial. Please, tell me how to highlight the current date in color.
@CodeWithCal
@CodeWithCal 2 жыл бұрын
In the adapter add an if statement to check if the date is todays date. if so change the bg color or something similar
@marko6457
@marko6457 2 ай бұрын
@@CodeWithCal But how to do that? This solution does it for the same day in other months too
@ticklemyturbine7801
@ticklemyturbine7801 2 жыл бұрын
I've coded all of the video, but the only part that shows up in the design view, or with the Pixel 2 Emulator is just the months without days. Any help?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Hard to say without seeing the code. Break points are a great debugging tool.
@vamsimadhavh4664
@vamsimadhavh4664 2 жыл бұрын
Hello Cal just was wondering is there any way to start the calendar week from the top always as some times the top row is empty and it starts from 2nd row, thanks for a wonderful video
@AimesX8
@AimesX8 Жыл бұрын
After setting the dayOfWeek variable create an if statement before the for loop to see if it equals 7. If it does set it to 0. if (dayOfWeek == 7) { dayOfWeek = 0 } There is probably a better way, but this worked for me
@charchar2375
@charchar2375 Жыл бұрын
​@@AimesX8 where would you write this? In the for loop?
@Carlwiththehair
@Carlwiththehair 2 жыл бұрын
When I run this, it's set the date to be one day off.... By that I mean it's set the 1st of Feb 2022 to be on a Wednesday in the app, when the 1st of Feb 2022 is on a Tuesday.... Googling it date issues are common in java when different timezones are used, but I have no idea how to set a timezone to correct this. Please can you help?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
I think you can do something along the lines of setlocale stackoverflow.com/questions/35581921/localdate-format-with-locale
@Lurg
@Lurg 2 жыл бұрын
hey i want to code a studyplanner app. I was wondering if I can just use the already existing calenderview of the widgets pallete?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
I mean you probably could use the widget... Only you know the requirements of what you are trying to build. Benefit of the calendar in this tutorial is that it very customisable.
@Lurg
@Lurg 2 жыл бұрын
@@CodeWithCal I will create my own calendar. I think its easier to work with because i know how to access everything
@DK-ij9sh
@DK-ij9sh 2 жыл бұрын
Hi Cal. This is a great tutorial. I'm a beginner for android app development and I'm learning it with Kotlin for my university project. Can you do a tutorial for Calendar Views with Kotlin. Thank You.
@CodeWithCal
@CodeWithCal 2 жыл бұрын
I think the tutorial would be too similar. Thanks for watching :) good luck at uni
@jonn6038
@jonn6038 Жыл бұрын
have you tried it on kotlin? I really need help as well I tried converting all into kotlin however, it wont open:((
@jaihaya7667
@jaihaya7667 2 жыл бұрын
can you help me regrading the calendar with previous month day faded
@CodeWithCal
@CodeWithCal 2 жыл бұрын
09:32 - Monthly Calendar (Prev & Next Months Greyed out) kzfaq.info/get/bejne/d8-XbJylks2yoYE.html&ab_channel=CodeWithCal
@syedmoinahmed9556
@syedmoinahmed9556 2 жыл бұрын
If there ever was a android studio on steroids Advertisement, it would be this video. No cap.
@CodeWithCal
@CodeWithCal 2 жыл бұрын
😆😉
@ChrisPugsworth
@ChrisPugsworth 5 ай бұрын
When I run the code inside a fragment, the calendar dates wont show in the recycler view. based on my troubleshooting, it seems like the problem is lies inside the setMonthView after initializing the values inside the daysInMonth array. Can you help me fix it?
@LogDog2171
@LogDog2171 4 ай бұрын
@ChrisPugsworth Wasn't sure if you solved this yet, but I'm doing a similar section inside fragments. Mine seems to be working but only once you click one of the buttons and not upon creating the fragment (fixing that now). My setMonthView looks like monthYearText.setText(monthYearFromDate(selectedDate)); ArrayList daysInMonth = daysInMonthArray(selectedDate); CalendarAdapter calendarAdapter = new CalendarAdapter(daysInMonth, this); RecyclerView.LayoutManager layoutManager = new GridLayoutManager(v.findViewById(R.id.calendarRecyclerView).getContext(), 7); calendarRecyclerView.setLayoutManager(layoutManager); calendarRecyclerView.setAdapter(calendarAdapter); For myself I did have an issue where my RecyclerView simply wasn't partitioned to show correctly and wasn't visible so I would start there next if it still doesn't work. Hope this helps!
@andreasflensmark8616
@andreasflensmark8616 3 жыл бұрын
It is properly only me, but I had a hard time following along. I wouldn't mind if the video was longer, just take it a bit slower
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Yeah, I have gotten a bit carried away with the pace on a few videos. Like everything I'm still working on finding that balance. That's for the feedback. 😊
@andreasflensmark8616
@andreasflensmark8616 3 жыл бұрын
​@@CodeWithCal ​ Of course, you could try to go with something like Dani Krossing was doing, slow talk explaining the basics, if that is what you are aiming for of course. People will watch an hour-long video if they feel they are in control and understand what is going on. Other than that, great video. ;)
@CodeWithCal
@CodeWithCal 3 жыл бұрын
I'll check out some of his videos, cheers :)
@ethanhang7415
@ethanhang7415 Жыл бұрын
Why did you use the condition "i
@CodeWithCal
@CodeWithCal Жыл бұрын
6x7 =42
@MuhammadAhmad-ew6po
@MuhammadAhmad-ew6po 2 жыл бұрын
Thankyou.
@CodeWithCal
@CodeWithCal 2 жыл бұрын
☺️
@seanmiguel9717
@seanmiguel9717 Жыл бұрын
Hey Cal, How can i get the maximum day of a specific month like, is it 30 or 31? Thank you Cal
@CodeWithCal
@CodeWithCal Жыл бұрын
Localdate is awesome fort this www.studytonight.com/java-examples/java-localdate-lengthofmonth-method-with-examples#:~:text=Method%20With%20Examples-,Java%20LocalDate%20lengthOfMonth()%20Method%20With%20Examples,returns%2031%20as%20a%20result.
@ruixuanchew2937
@ruixuanchew2937 3 жыл бұрын
hey may i ask if its possible for each date to be clicked on and possibly intent to another page for example adding an event?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Absolutely possible. I have a video on a more standard recycler view see link. You should be able to apply the on item click listener from the recycler view tutorial to the calendar view. :) kzfaq.info/get/bejne/f9xnediYyqnJoZs.html
@ruixuanchew2937
@ruixuanchew2937 3 жыл бұрын
@@CodeWithCal may i ask under what method and java file do i implement this on item click listener should it be in calenderViewHolder?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
From memory that's correct the view holder implements view on click listener.
@NightWolf-cg6jn
@NightWolf-cg6jn 2 жыл бұрын
✌️✌️ so good
@CodeWithCal
@CodeWithCal 2 жыл бұрын
🎉
@alokeshnath4269
@alokeshnath4269 3 жыл бұрын
Great tutorial!! I Need help can you please tell me, How I will select the month and year from spinners (I mean I want to put two spinners for month and year that will drop down) that will also change the month and year in the colander that you have created and at last choose a date from the calendar and then it should display selected date. Actually I am using your concept to choose D.O.B of a user. Can you please help me with that?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
kzfaq.info/get/bejne/g7ilgsaDzKuUnYE.html Sounds like a good plan see link to custom spinner tutorial.
@alokeshnath4269
@alokeshnath4269 3 жыл бұрын
@@CodeWithCal thank you cal. Can you please make a tutorial on that or can you give hint how to do it...
@CodeWithCal
@CodeWithCal 3 жыл бұрын
​@@alokeshnath4269With the custom spinner tutorial you have the tools you need. You need 2 spinners a month and year. Create an array list of years and a list of months id probably just manually create them. Then pass them into your custom spinner adapter. You should be able to use the same adapter for both
@alokeshnath4269
@alokeshnath4269 3 жыл бұрын
@@CodeWithCal I have created two spinners that is month and year. Now the question is how to change month and year dynamically in the calendar that you have shown in this tutorial. Please Help me...
@67Diadem
@67Diadem 3 жыл бұрын
Did you get any help?
@nicopintea3949
@nicopintea3949 Жыл бұрын
I followed all the steps but when I click my button in the main screen thats supposed to take me to the calendar the app just stops working, how could I fix it?
@CodeWithCal
@CodeWithCal Жыл бұрын
Have you resolved this? what error are you getting?
@jeremyheng8573
@jeremyheng8573 3 жыл бұрын
Good tutorial!
@CodeWithCal
@CodeWithCal 3 жыл бұрын
🙏
@jeremyheng8573
@jeremyheng8573 3 жыл бұрын
@@CodeWithCal u have tutorial for calender with event?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
@@jeremyheng8573 kzfaq.info/get/bejne/odSghsWlx7beY6M.html
@jeremyheng8573
@jeremyheng8573 3 жыл бұрын
@@CodeWithCal got it! 1 more question is do you know how to create swipe-able month view?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
@@jeremyheng8573 I do have an idea but it's probably a bit to complicated for a KZfaq comment. The tricky thing will be ignoring the recylerviews default on tap and swipe
@huungocluong8122
@huungocluong8122 3 жыл бұрын
thank you very muck. This video was very helpful. But how can i make an appointment?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Do you mean creating an event? A tutorial extending this one is on the to do list. But in the mean time. You can put a list view or a recycler view inside our calendar recycler view cell. (For list of events) And implement an on on item click listener per calendar cell to create a new event.
@codingcosmos7010
@codingcosmos7010 3 жыл бұрын
Hi, i want to change color of all Sundays... how can I achieve this ?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Hi, I would change the daysofMonth Array to hold the dates as apposed to the string of the day of month. Then inside the adapter you can check to see if what day of the week it is you will also have to extract the day of month. Finally change the colors accordingly.
@codingcosmos7010
@codingcosmos7010 3 жыл бұрын
@@CodeWithCal okay... Thanks a lot for answering
@gloriamartins5395
@gloriamartins5395 3 жыл бұрын
Hi, I'm getting an error , can you help me? Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Hello, I believe the textview is null, the find view by id is not matched with the id in your xml. Double check the ids match in xml and java.
@Quintav
@Quintav 2 жыл бұрын
Hey, i got the same problem and ive been looking for it for a while now, ive checked the ids in my xml and theyre matched with the java. just wondering if you fixed yours and if you could share it, thanks
@jimt9471
@jimt9471 2 жыл бұрын
hey so have you found any solution? i got the same problem too :/
@sim-card8685
@sim-card8685 Жыл бұрын
I found a solution: execute initWidgets() and setMonthView() in the onStart() method instead of onCreate()
@jrod1577
@jrod1577 2 жыл бұрын
Seems to not be working for me. Copied your exact code and "view" is underlined red in 'return new CalenderViewHolder(view);' in 'CalendarAdapter.java. The error says that this is associated with the line 'public class CalenderViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {' in 'CalenderViewHolder.java'. Any suggestions?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Have you inflated the calendar_cell.xml correctly? Sounds like something is not quite right there.
@jrod1577
@jrod1577 2 жыл бұрын
@@CodeWithCal I took a step back and took more lessons on Android Studio and Java and came back after a few months and I still don't understand why "view" keeps throwing an error for me but not for you in this video. right-clicking on 'view' gives the following suggestions "Create constructor" and "Remove 2nd parameter from constructor 'CalenderViewHolder' " However, If I remove the second variable as suggested (The "CalendarAdapter.OnItemListener onItemListener" part) "view" wont throw an error anymore BUT now I get "Variable 'onItemListener' might not have been initialized" in that constructor. very confused. Edit: My understanding is that I would need two variables to pass into the constructor requiring two variables but I am only passsing one variable named "view" and it wont accept that. Unless im missing something that I am not understanding?
@seoul_Jin500
@seoul_Jin500 Жыл бұрын
@@jrod1577 i am having same problem with you....and i am writing this with kotlin
@rogeliosalvadorify
@rogeliosalvadorify Жыл бұрын
E P I C
@Lurg
@Lurg 2 жыл бұрын
Is it possible to change the color of a day number ?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
So in the Calendar Adapter you can add an if statement to. check if the day you are up too is today. basically the same thing we do here in the daily calendar tutorial. 09:32 - Monthly Calendar (Prev & Next Months Greyed out) kzfaq.info/get/bejne/d8-XbJylks2yoYE.html
@Lurg
@Lurg 2 жыл бұрын
@@CodeWithCal but how can I do this with single days saved in a SqLite Databank. Its not possible to load data because I cant pass a Context in the parameter from the Adapter class but I also can't pass an Arraylist from a different class with the Constructor because It says that its might not be initialized. What can I do ?
@delossantoskeithjo7815
@delossantoskeithjo7815 Жыл бұрын
Hi cal, i need your help i want to know why i cant select Daytext in calendar Cell it only Shows (Selected _ MM YYYY) why is that hope you can reply to me
@CodeWithCal
@CodeWithCal Жыл бұрын
Looks like you've got your date formatter already sorted. or was that not the question?
@nemoelkristianalarcio3287
@nemoelkristianalarcio3287 2 жыл бұрын
What if I used a lower version of the API? Will it still work
@nemoelkristianalarcio3287
@nemoelkristianalarcio3287 2 жыл бұрын
Newer*
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Yes, but Localdate class will not be available. No reason you couldn't rewrite all date functions to use java.util.Date instead of localdate :)
@datdothanh4273
@datdothanh4273 2 жыл бұрын
Can i put it into a fragment?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
I don't see why not ☺️
@KarnikDew
@KarnikDew 2 жыл бұрын
Hey Cal, I know I'm being dumb here but I wanna know where I'm wrong... Everything works like a dream except for my arrow keys where both of them pull the months back instead of the forward button adding the month count... Where could I have had my logical error? And the app crashes if I click on a date... Help a fella out please!
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Did you find a fix, sounds like you've got a few small mistakes
@KarnikDew
@KarnikDew 2 жыл бұрын
@@CodeWithCal Yeah, i got my bug fixed for the buttons taking the months back, so when I copied the button code to mirror it to the other side, I forgot to change the onclick listener to nextMonth... Yeah, it was me being a zombie. And as for the crashing when i click, i still didn't get it. Thanks a million for helping me learn Android App Development and also, a real big thanks to you cause I used to be a person who used to shy away from coding cause i thought it was Rocket Science, watching your tutorials really helped me get out of that head space and approach coding with an open mind. Thank you Big Time Cal!
@eyanahmed9720
@eyanahmed9720 2 жыл бұрын
@@KarnikDew Hi I was following this tutorial and I also have the problem where both arrows face backward. how exactly did you fix this bug?
@user-ho8mq5qb2j
@user-ho8mq5qb2j Жыл бұрын
謝謝!你的課程非常實用! 我學習到很多! 希望之後能再提供 kotlin, 以及能在行事曆上呈現多日期的教學! :)
@sumitkb2770
@sumitkb2770 2 жыл бұрын
sir how to highlight event date in calendar?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
You can add a conditional statement to the adapter.
@joshuatan5841
@joshuatan5841 2 жыл бұрын
Anyone knows if this can be done on Minimum SDK Lollipop?
@joshuatan5841
@joshuatan5841 2 жыл бұрын
Since Cal did it in Orea, if so may I know how?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
You can absolutely! You just won't have access to LocalDates which have a lot of convenience methods. But you can use just a regular dates. your methods will need to be a bit longer as there is a little more logic you will have to be responsible for
@releNtless-eu3xc
@releNtless-eu3xc 2 жыл бұрын
Sorry I have just started learning kotlin and I want to know how long will it take to become an intermitiate android developer at least.
@CodeWithCal
@CodeWithCal 2 жыл бұрын
🤔 interesting question. Depends. so many factors. Ultimately it does take some time to learn programming and android development. But I highly recommend to stick with it. I still only consider myself an intermediate at best, got to have the attitude that you are allways learning even after years of development :)
@releNtless-eu3xc
@releNtless-eu3xc 2 жыл бұрын
@@CodeWithCal Thanks Cal ;) sorry but Android Studio highlights the words Vertical & Horizontal in these lines in red! And I have just typed everything exactly like yours :) android:orientation="Vertical" android:orientation="Horizontal" You also still haven't really answered my question regarding how long will it take to be able to at least create an app that you can make money with? lol or at least for yourself? thx
@CodeWithCal
@CodeWithCal 2 жыл бұрын
​@@releNtless-eu3xc Could you have set the orientation twice? or is the parent definitely a Linear layout. These are just guesses as I cannot see your code. Well its true, I haven't answered your question as i feel it is an impossible one to answer. as there are just so many factors. I won't sugar coat, the app store is a very saturated market and to make money is tough... not impossible.. but tough. This is again maybe more philosophical of answer than you are looking for, but i believe there are no shortcuts in life and programming for that matter. Put in the time and effort and you will be rewarded eventually. Programming is a life long skill. that takes years to get good at. If you are only in it for the short term and for a quick dollar. I think you will be disappointed.
@releNtless-eu3xc
@releNtless-eu3xc 2 жыл бұрын
for some reason, I can't copy and paste my code in here!?
@releNtless-eu3xc
@releNtless-eu3xc 2 жыл бұрын
Also, I think I figured out myself what's the problem in here :) looks like there is nothing wrong with my code but for some reason although at the start of creating a new project I chose the template called with no activity for some reason my design view template doesn't show any textbox and I've even tried to insert one manually myself (textview or plain text) but looks like it inserts both of them outside that white rectangle and I'm not sure what I need to do in order to fix this problem?
@moshelevceder
@moshelevceder 2 жыл бұрын
Any idea why my months are starting on the wrong number?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Could be a few different things. Have you tried setting a break point in the adapter?
@leventestancz4522
@leventestancz4522 3 жыл бұрын
Hey, how can I make it with the RecyclerView height set to wrap_content?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Wrap the whole thing in another view plus what ever view you need below it. I take it that's what you are trying to do?
@leventestancz4522
@leventestancz4522 2 жыл бұрын
@@CodeWithCal What I'm trying to do is have your calendar in LinearLayout in a ScrollView that have an another RecyclerView under the calendar where I can post events (cardViews), and I thought both RecyclerView can have wrap_content as height but I can't seem to figure it out because the recycleviews just doesn't show when the app is running
@CodeWithCal
@CodeWithCal 2 жыл бұрын
The recylerview will need some sort of fixed height im fairly sure.
@leventestancz4522
@leventestancz4522 2 жыл бұрын
@@CodeWithCal And what can use to add cardviews to and it's height is wrap content, I tried ListView but that did not work, any idea?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
​@@leventestancz4522 Well a scroll view has ambiguous vertical height. So you need to add fixed heights to all nested views. Im not sure what you are talking about with the list view and card view. I thought I was helping with a layout issue 😂
@bilgipaylasmplatformu8454
@bilgipaylasmplatformu8454 3 жыл бұрын
How can i change color of selected date
@CodeWithCal
@CodeWithCal 3 жыл бұрын
We highlight selected date weekly calendar view tutorial 06:35 kzfaq.info/get/bejne/odSghsWlx7beY6M.html
@bilgipaylasmplatformu8454
@bilgipaylasmplatformu8454 3 жыл бұрын
​@@CodeWithCal how can i change the color of today's date
@yushuerguevarra
@yushuerguevarra 3 жыл бұрын
I'm struggling in looking the errors. can someone help me?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Sure, what errors are you getting?
@yushuerguevarra
@yushuerguevarra 3 жыл бұрын
@@CodeWithCal i fixed the error. but now I need the whole code for the numbers in the calendar
@hi_my_day
@hi_my_day 2 жыл бұрын
Unfortunately, my app is not working. Do you know why it's forced to end?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
Could be lots of things try adding a break point and reading the error message in your console :)
@hi_my_day
@hi_my_day 2 жыл бұрын
@@CodeWithCal There is no error. However, it is forced to shut down when you run the app. My code is the same as yours.
@mobius369
@mobius369 3 жыл бұрын
Hey Cal, I am trying to add the same logic to a fragment instead of a main activity and the fragment keeps crashing, I tried to add methods such as getActivity() in order to invoke getApplicationContext() but I am not sure why it's still crashing. Also, when I try to create onClick methods in the fragment layout's code mode, it sends me to the MainActivity and not the fragment in which I am going to write the methods. Would appreciate it if you can give me some direction
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Hey Z, I haven't had much experience with fragments. But will try to help best I can. What exception are you getting?
@mobius369
@mobius369 3 жыл бұрын
Thank u for the reply Cal, my java compiles with no errors, when I run it, the app works, but the calendar fragment doesn’t respond. I tried looking at my logcat and build but there wasn’t an error pointing to my calendar-related classes. I am starting to think it has to do with the fact that it’s a fragment so I guess gotta debug line by line to.
@mattbangs5710
@mattbangs5710 2 жыл бұрын
@@mobius369 Anyone here a year later trying to solve this in fragments, the key is to remove the onCreate() method and put it in the onCreateView. View view = inflater.inflate(R.layout.fragment_calendar, container, false); then use calendarRecyclerView = view.findViewById(R.id.calendarRecyclerView); ect. I hope this helps. I got his code working with these tweeks. (you also need to fix the back and forward buttons.)
@salvorotta6485
@salvorotta6485 3 жыл бұрын
Cale how you build a weekly calendar
@salvorotta6485
@salvorotta6485 3 жыл бұрын
Can you make a tutorial pls...
@CodeWithCal
@CodeWithCal 3 жыл бұрын
I will put on the to do list :) Thanks for the suggestion.
@salvorotta6485
@salvorotta6485 3 жыл бұрын
Can I ask you how can I highlight the current date???
@CodeWithCal
@CodeWithCal 3 жыл бұрын
LocalDate.now() to get current date. Then you want to pass selected month and year into calendar adapter. Compare then if day month year matched change background color of view or what ever. Hope this helps.
@dreadmanhua9552
@dreadmanhua9552 3 жыл бұрын
I got a question, why can't I find "android.recyclerview.widget.recyclerview" for 2:42?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
I'm using androidx for this tutorial, perhaps you are targeting lower/older versions of android? developer.android.com/jetpack/androidx developer.android.com/jetpack/androidx/migrate
@dreadmanhua9552
@dreadmanhua9552 2 жыл бұрын
@@CodeWithCal Thank you! I continued the tutorial and found myself with the toast that doesn't appear. Do you know what causes this?
@CodeWithCal
@CodeWithCal 2 жыл бұрын
​@@dreadmanhua9552 Try double checking the context you pass to the toast. I know that has caught me out in the past
@elieckhaus566
@elieckhaus566 Жыл бұрын
how do you do this so fast?? is the video sped up w/ audio over it?😭
@CodeWithCal
@CodeWithCal Жыл бұрын
😅😉
@marcospereira3150
@marcospereira3150 Жыл бұрын
I don't speak English but I'm having to manage, it seems that there is no content in my language
@thesharonway4612
@thesharonway4612 3 жыл бұрын
Is it possible to add pictures?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Add pictures to each day in the month? That would be possible
@thesharonway4612
@thesharonway4612 3 жыл бұрын
@@CodeWithCal how?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
​@@thesharonway4612 So first thing would be to add an Image View to the cell xml file. Inside CalendarViewHolder.java duplicate whats happening for: TextView dayOfMonth; so ImageView myImageView; etc.. As far as the CalendarAdapter maybe instead of passing in ArrayList daysOfMonth you could create a custom class with two fields dayOfMonth of type String and image resource ID (I'm pretty sure is an int) you can then pass in ArrayList daysOfMonth Hope this helps and good luck :)
@thesharonway4612
@thesharonway4612 3 жыл бұрын
@@CodeWithCal thank you
@incodewetrust8862
@incodewetrust8862 Жыл бұрын
in this function public CalandarViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) this line return new CalandarViewHolder(view); gives error as the constructor in calandarViewHolder has 2 arguments what is the solution ? i tries to make 2 constructor the other with only one parameter it completly breaks the code
@ayodejiadesuyi2248
@ayodejiadesuyi2248 3 жыл бұрын
This has given me so much headache bro. My dates keep starting from 9 and i have followed your tutorial over 3 times
@ayodejiadesuyi2248
@ayodejiadesuyi2248 3 жыл бұрын
sorry. found the bug.
@CodeWithCal
@CodeWithCal 3 жыл бұрын
🥳
@reflection3570
@reflection3570 3 жыл бұрын
can I talk to you please? I need your help.
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Sure thing, how can I help?
@sawankumar6355
@sawankumar6355 3 жыл бұрын
dates are not showing in recycler view I am using databinding
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Happy to help, might need a bit more to go off. So you aren't getting any dates showing. does the recycler view have the correct number of squares?
@sawankumar6355
@sawankumar6355 3 жыл бұрын
@@CodeWithCal Yes, although all functions are working fine but the issues are with only dates
@sawankumar6355
@sawankumar6355 3 жыл бұрын
@@CodeWithCal I think the adapter is not attached properly
@sawankumar6355
@sawankumar6355 3 жыл бұрын
@@CodeWithCal Is it related to the minimum SDK version as I'm using min API level 21? Does this have something to do with it?
@CodeWithCal
@CodeWithCal 3 жыл бұрын
@@sawankumar6355 Yes, LocalDate class requires API 26. You could convert all local dates into java.util.Date. It will just take longer to write all methods and not have as many convenient things to call upon. Or up your min API
@klaasdeeindbaas
@klaasdeeindbaas Жыл бұрын
nice but you go a little too fast over things. eg. at layout.xml you clicked 'something' (1:10) to display the actual xml instead of the preview panes, but even at 0.25 speed I, a total beginner, still couldn't make clear what exactly you clicked to get the xml itself into view :( have some compassion with the people who actually need these tutorials bro!
@elben8140
@elben8140 2 жыл бұрын
Why so fast though? You here to teach or to show off showoff
@CodeWithCal
@CodeWithCal 2 жыл бұрын
I provide a free tutorial, and you insult me by calling me a show off. Yeah this tutorial isn't perfect and maybe it is to fast, but you should be more considerate in the way you give feedback. Name calling is simply bullying and I won't stand for it.
@AxLdmh
@AxLdmh 3 жыл бұрын
I think tutorials are supposed to explain why you do stuff, not just show you doing it and you explain nothing at all
@CodeWithCal
@CodeWithCal 3 жыл бұрын
😜
@dany168168
@dany168168 Ай бұрын
Yeah, feel the same. But I think we as the beginners are not the target audience. This tutorial shows how you could implement a calendar when you already got a hold on the basic kotlin and Android Studio functionalities. He doesn't explain anything related to the programming language. This is a tutorial of how to implement a calendar functionality, not a kotlin tutorial. We'll have to find that somewhere else and maybe someday this will be also useful to us too.
@sylladnaphang6660
@sylladnaphang6660 2 жыл бұрын
Are u a developer or a rapper
@CodeWithCal
@CodeWithCal 2 жыл бұрын
🙃🙃🙃
@superprocz
@superprocz 3 жыл бұрын
1. 😃
@TheZym0
@TheZym0 Жыл бұрын
Slow down pls
@auditi8920
@auditi8920 11 ай бұрын
Plz someone help When I click run ,it shows -- Unable to make field private final.lang.string.path accessible
@English.7310
@English.7310 3 жыл бұрын
Hey
@CodeWithCal
@CodeWithCal 3 жыл бұрын
Hey
@stadrag
@stadrag Жыл бұрын
dude...slow down :D
@CodeWithCal
@CodeWithCal Жыл бұрын
😉
@romanmedyanik1268
@romanmedyanik1268 Жыл бұрын
Lol
Weekly Calendar Android Studio Tutorial | Daily Events List
14:10
Code With Cal
Рет қаралды 73 М.
Daily Calendar View Android Studio Tutorial
11:31
Code With Cal
Рет қаралды 27 М.
Son ❤️ #shorts by Leisi Show
00:41
Leisi Show
Рет қаралды 8 МЛН
Box jumping challenge, who stepped on the trap? #FunnyFamily #PartyGames
00:31
Family Games Media
Рет қаралды 18 МЛН
لقد سرقت حلوى القطن بشكل خفي لأصنع مصاصة🤫😎
00:33
Cool Tool SHORTS Arabic
Рет қаралды 29 МЛН
Most overpowered way to build mobile apps?
8:33
Beyond Fireship
Рет қаралды 754 М.
How to implement CalendarView Android
11:05
Codes Easy
Рет қаралды 14 М.
React Native vs Flutter in 2024 - Make the RIGHT Choice (Difference Explained)
10:31
Daniel Dan | Tech & Data
Рет қаралды 160 М.
How to Insert an Event to Calendar Using Android Intent
18:28
Coding Demos
Рет қаралды 38 М.
Calculator App Example Android Studio Tutorial
12:33
Code With Cal
Рет қаралды 87 М.
Nvidia CEO: "We're Completely F**ked & Nobody Realizes It..."
13:47
Nvidia Latest News
Рет қаралды 7 М.
Простейшая SQLite база данных (android studio, java, часть 1)
57:51
Best the best 2024❤️ Subscribe
0:14
Hayot Sinovlari
Рет қаралды 5 МЛН
Funniest pool clips #funny #laugh  #funnyvideos #funnyfails
0:46
Best the best 2024❤️ Subscribe
0:14
Hayot Sinovlari
Рет қаралды 5 МЛН
30 luglio 2024
0:15
Leonardograti
Рет қаралды 16 МЛН