Simple Calculator App Tutorial E02 - Writing the Java Code (Android 2.3)

  Рет қаралды 202,488

Professor DK

Professor DK

7 жыл бұрын

In this video, we define the various variables and set action on the buttons using Java code in Android Studio 2.3 latest 2017.
Next Video Link: • Simple Calculator App ...
Previous video link: kzfaq.info?o=U&vide...
Please like and subscribe.
Comment the topic you need to know about and I will return with a video next week.

Пікірлер: 166
@ProfessorDK
@ProfessorDK 7 жыл бұрын
Hello everyone, the video you all were waiting for has been uploaded. Sorry for the delay. It took some time to record it. Its 22mins long. So do watch and let me know if it was helpful! :) Link: kzfaq.info/get/bejne/nZp6qaZ9mLyyaI0.html
@Kermitthesatan
@Kermitthesatan 7 жыл бұрын
heyyyyyyy'
@Kermitthesatan
@Kermitthesatan 7 жыл бұрын
keep going'
@technicprince5011
@technicprince5011 6 жыл бұрын
Professor DK hey u can declare variables just by putting comma in a single line ass well ..dont work madely...smart works gets Appriciated
@mscit_08_omprakash40
@mscit_08_omprakash40 5 жыл бұрын
you didnt show the output ???
@ranjith8927
@ranjith8927 2 жыл бұрын
Not helpful
@reynoldfrancis6060
@reynoldfrancis6060 5 жыл бұрын
I am using Android studio latest version of 2019. With a few differences, your program is working fine. Excellent tutorial!
@noff1735
@noff1735 7 жыл бұрын
Nice video! You are the best! Don`t stop!
@zuhaibphul662
@zuhaibphul662 7 жыл бұрын
well done and i am sooo impress
@viiali
@viiali 7 жыл бұрын
very good tutorial thank you! Please upload the 3rd video!
@devashishbote
@devashishbote 6 жыл бұрын
nicely explained !!
@Kermitthesatan
@Kermitthesatan 7 жыл бұрын
yay u released it
@ameralmonajed8392
@ameralmonajed8392 3 жыл бұрын
thank you for your useful videos
@edgarrevgonzales8207
@edgarrevgonzales8207 7 жыл бұрын
don't stop sir please :)
@jeevanrajput3445
@jeevanrajput3445 5 жыл бұрын
Great job
@ravindraprajapati468
@ravindraprajapati468 6 жыл бұрын
very good and very simple
@jeetkumar5399
@jeetkumar5399 4 жыл бұрын
Please always upload a good quality videos
@thipputk
@thipputk 4 жыл бұрын
Sir thank you for your useful videos. Sir, I follow your instruction and try to create my first app, but analyzer shows many errors and warnings. Should i stop or continue? I use android studio latest version.
@michaellee8985
@michaellee8985 4 жыл бұрын
The explanation is clear. It is a little bit too 'hardcoded' tho (Maybe that's the characteristics of Android programming, idk)
@shivammittal733
@shivammittal733 4 жыл бұрын
Iam not able to extend the textView as you have done ? Iam using the cursor but the text view is miving from one place to another but not extending????
@rk-kk1du
@rk-kk1du 5 жыл бұрын
You need zoom the screen when you add coding I not understand what u writen even in 480p
@Kermitthesatan
@Kermitthesatan 7 жыл бұрын
keep making vids man
@prateekgupta535
@prateekgupta535 3 жыл бұрын
Sir in java we also have something called "array" to make programs shorter
@abdoolrasheed7842
@abdoolrasheed7842 6 жыл бұрын
Hi ProfDK - can we have the source codes for the tutorial for a better follow up of the tutorial as the text displayed is not very clear. Thanks.
@deepakvaishnav4935
@deepakvaishnav4935 4 жыл бұрын
osm sir
@jeevanrajput3445
@jeevanrajput3445 5 жыл бұрын
THANKS lot
@balajis7989
@balajis7989 6 жыл бұрын
error: is not abstract and does not override abstract method onClick(View) in OnClickListener This is the error I am facing can you please let me know how to resolve???
@RAMKUMAR-eb1kq
@RAMKUMAR-eb1kq 2 жыл бұрын
sir can u please post a vedio for learning methods in java for giving functions for buttons the basic buttons like setclick(); the fn with prefix set i am not able to understand clearly abt the fns
@Dontfkwithme69
@Dontfkwithme69 6 жыл бұрын
Sir could you explain why did you create the sertupUIViews function and also what does View.OnClickListerner do which is on the 38th line at 7:33. Thanks in advance. :)
@ProfessorDK
@ProfessorDK 6 жыл бұрын
I just like grouping things which perform a task into a function. So that is why I created the setupUIViews to assign all variables with their corresponding XML IDs. At 7:33 what u see is just a grouping done by Android Studio. If u double click on the grey area, it will open up the code and it is nothing but "new OnClickListener" which I do previously. I should have opened up that function. Many have got confused because of that. Hope I cleared your doubt :)
@oussamabenaicha5796
@oussamabenaicha5796 7 жыл бұрын
Thank you for the great tutorial, i would like to know how to make an EditText non accessible for the user. he should no tbe able to modify it. for that can you please tell me how to make a text zone static!
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+Oussama Ben Aicha You can either do it in XML layout by typing android:editable="false" Or by writing editText.setEnabled = "false" in your Java file.
@oussamabenaicha5796
@oussamabenaicha5796 7 жыл бұрын
Thank you !
@haseebbhandara9583
@haseebbhandara9583 2 жыл бұрын
After completing cording as I run the calculator app I recieve a message " you may need to adjust the proxy settings in Gradle" how can I resolve it? Kindly tell me
@sukanyamurali2092
@sukanyamurali2092 6 жыл бұрын
thank you sir...really I get an idea to work with Android studio and where is the 3rd part...when will you release that
@ProfessorDK
@ProfessorDK 6 жыл бұрын
+Sukanya Murali Third part has already been released. Check out the videos section on my channel :)
@vladimirdimitrov1065
@vladimirdimitrov1065 6 жыл бұрын
Hi I get to 10:19 where I need to create add.setOnClickListener... and when typing "add" I do not get the option listed on the video. Instead I get an error - cannot resolve symbol 'add'. Any help?
@ProfessorDK
@ProfessorDK 6 жыл бұрын
It is because the add variable isn't defined. Check if you have defined the add variable before the onCreate method.
@maxpetrov6116
@maxpetrov6116 7 жыл бұрын
are we supposed to do something with the add.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); for addition and the other operations or wait till next vid?
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+Max Petrov The next video will up soon latest by 22nd May. :) That will cover the entire code.
@maxpetrov6116
@maxpetrov6116 7 жыл бұрын
awesome! thx for the speedy reply
@dhruvilbagadia305
@dhruvilbagadia305 5 жыл бұрын
What is info.getText().toString() + "1" mean it?
@thipputk
@thipputk 4 жыл бұрын
Private final char ADDITION = " + " ; SHOWS ERROR AND OPTION TO CHANGE IT TO FINAL STRING. IS IT OK?
@akhileshbibiyan8367
@akhileshbibiyan8367 3 жыл бұрын
Bro I'm having this error. If you resolved this then can you tell me what should I do now?
@vigneshsrinivasan6143
@vigneshsrinivasan6143 7 жыл бұрын
Bro I get some message displaying on the line : zero.setOnClickListener(new View.OnClickListener()) Saying : cannot resolve method 'setOnClickListener(android.view.view.OnClickListener)'
@ProfessorDK
@ProfessorDK 7 жыл бұрын
That means the variable zero hasn't been defined. Revert back if its not the issue! :)
@HellyKShahVADBTECH-CSEF-ed7lf
@HellyKShahVADBTECH-CSEF-ed7lf 6 жыл бұрын
Why you put (R.id.btn1) what is the meaning of capital R??
@Kermitthesatan
@Kermitthesatan 7 жыл бұрын
dang a guy with 48 watched ur vid nice man
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+The Random Guys Thank you! :)
@agenthulk4288
@agenthulk4288 3 жыл бұрын
What setupUiViews function does? Why it is required?
@edgarrevgonzales8207
@edgarrevgonzales8207 7 жыл бұрын
thankyou sir ..
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+Edgar Rev Gonzales Glad you liked it :)
@edgarrevgonzales8207
@edgarrevgonzales8207 7 жыл бұрын
your video helped me a lot sir.. and easy to understand :) thankyou so much!
@sheerazamushtaq368
@sheerazamushtaq368 6 жыл бұрын
Is E03 vedio here?
@ritik84629
@ritik84629 4 жыл бұрын
Why detected a hanging thread in emulator error is popping up? Please explain Sir.
@RAMKUMAR-eb1kq
@RAMKUMAR-eb1kq 2 жыл бұрын
sir can u explain the functions used .give more information of why using these fns
@ishtiyaquekhan6479
@ishtiyaquekhan6479 5 жыл бұрын
why we create constant bro??
@abhi36292
@abhi36292 4 жыл бұрын
why did you used that double.NAN please explain
@MuhammadMusthafaD
@MuhammadMusthafaD 5 жыл бұрын
I think I am watching Chinese movie without subtitles 😀😀
@abhishekkumarsah1917
@abhishekkumarsah1917 6 жыл бұрын
why = button and clear button is not defined in java class in the above video
@SIDHATHSAGAR
@SIDHATHSAGAR 4 жыл бұрын
Hi there, Anyone Can help me. Android Studio 3.5 1 setupUIviews(); 2 zero.setOnClickListener(new View.OnClickListener() { 3 @Override 4 public void onClick(View v) { 5 info.setText(info.getText().toString()+ zero); 6 } 7 }); Getting 2 Errors: 1.) line 1 // Cannot resolve method "setupuiviews()" 2.) line 5 // Do not Concatenate text displayed with setText. Use resource string with placeholder. Please Help
@cfayaay2227
@cfayaay2227 6 жыл бұрын
the "Button" text is in red? it says cannot resolved symbol
@Prerona11
@Prerona11 5 жыл бұрын
Exactly same problem I got! You got a solution?
@nihagummakonda467
@nihagummakonda467 5 жыл бұрын
That happened to me too! It happens because I think the android studio we are using is a more recent version. You can solve it using a layout and the one I used was the tableLayout to get it into a table format for the buttons
@sidharthanjayavelu6175
@sidharthanjayavelu6175 5 жыл бұрын
Just type import android.widget.Button; After the import ... Statement
@rakharuan
@rakharuan 3 жыл бұрын
Do you have a github link for this?
@InvictusM0n
@InvictusM0n 5 жыл бұрын
Button is appearing crossed like a line is drawn over Button please help
@austinboss4420
@austinboss4420 6 жыл бұрын
my app keeps crashing anytime i use the action keys like +,-,/,* it says 'invalid double' as the error and the function compute() has something wrong i cannot figure out. please what do i do
@ProfessorDK
@ProfessorDK 6 жыл бұрын
There is a mismatch in the data types somewhere. Check your variables :)
@austinboss4420
@austinboss4420 6 жыл бұрын
THANKS! FINALLY WORKING.
@leonardmadiva
@leonardmadiva 7 жыл бұрын
Awesome...when is the third video coming out?
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+madiva lenny Have my exams going on, will be out on 22nd May. Sorry for the delay.. :)
@leonardmadiva
@leonardmadiva 7 жыл бұрын
Cool bro. I'll be waiting
@leonardmadiva
@leonardmadiva 7 жыл бұрын
Cool bro. I'll be waiting
@mrinalinipatil3974
@mrinalinipatil3974 6 жыл бұрын
Hello, Iam getting error in declaring the variables. Error is expecting member declaration. Thanks in advance.
@ProfessorDK
@ProfessorDK 6 жыл бұрын
U must declare the global variables outside the onCreate function but inside the main class. Check if you have defined it at the right place
@ankanbhattacharya6748
@ankanbhattacharya6748 5 жыл бұрын
How to resolve "error: class, interface or enum expected"?
@muhammadsaadmansoor7777
@muhammadsaadmansoor7777 4 жыл бұрын
you have brackets (( parentthesis or curly brackets}) not placed correctly.
@praveenthakur6995
@praveenthakur6995 6 жыл бұрын
M getting errors at override and at view.onclicklistner
@ammarrrrrrrr
@ammarrrrrrrr 7 жыл бұрын
Hello how do I take a space down without changes in codes?
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+Ammar abutalip Since it is a relative layout, moving the parent will move all of the childs down. So move the first thing that you placed in the layout a bit down. :)
@munirulhaikal
@munirulhaikal 6 жыл бұрын
If we press the + and - button, it's crashes because of a bug. How to prevent this?
@ProfessorDK
@ProfessorDK 6 жыл бұрын
Yes it is because we say that the second button pressed after a symbol is a value. You can prevent this, by checking what is entered. If it "NaN" which is when a symbol like + or - is clicked, you can just replace the previous operation by the new one and then proceed with the same logic :)
@ankurkumar4-yrb.tech.elect771
@ankurkumar4-yrb.tech.elect771 6 жыл бұрын
how to add constraints to each button??
@ProfessorDK
@ProfessorDK 6 жыл бұрын
+ANKUR KUMAR 4-Yr B.Tech. Electrical Engg., IIT (BHU) Use the design tab and then drag each point to the different sides of the parent layout
@learnplus333
@learnplus333 3 жыл бұрын
شنو سمية التطبيق ل كتركوردي بيه
@zuhaibphul662
@zuhaibphul662 7 жыл бұрын
plx upload next video as soon as possible because we are waiting next tutorial .
@ProfessorDK
@ProfessorDK 7 жыл бұрын
I have my exams going on. After 22nd May onwards, I'll be uploading two videos a week and I will be more consistent. Thank you for your patience.
@zuhaibphul662
@zuhaibphul662 7 жыл бұрын
but i make a calculator so what can i doo plx upload remaing calculator videos
@muhammadbilalmukhtar8807
@muhammadbilalmukhtar8807 5 жыл бұрын
can u give next video link
@psycho_zu6294
@psycho_zu6294 2 жыл бұрын
cannot resolve method 'setText' in 'info' HELP
@jenziie_olivia1384
@jenziie_olivia1384 6 жыл бұрын
for some reason all the layout setting got messed up as soon as I pressed "RUN". I will write the code again some other time
@nofl_salon2459
@nofl_salon2459 6 жыл бұрын
press ctrl+z its will remove your last move
@shielamarieestepa1334
@shielamarieestepa1334 3 жыл бұрын
zero.setOnClickListener(new View.onClickListener() { @Override public void Onclick (View v) { info.setText(info.getText().toString()+"0"); i am stucked in this part. OnClickListener is an error
@shielamarieestepa1334
@shielamarieestepa1334 3 жыл бұрын
It says: Class 'Anonymous class derived from OnClickListener' must either be declared abstract or implement abstract method 'onClick(View)' in 'OnClickListener'
@SomebodyOutTh3re
@SomebodyOutTh3re 5 жыл бұрын
what is the "R" in FindViewById(R.id...) ?
@sanjayyadav-ul9hd
@sanjayyadav-ul9hd 5 жыл бұрын
R is Resource
@anyonecancode8462
@anyonecancode8462 6 жыл бұрын
info in coding get red how can over come this
@ProfessorDK
@ProfessorDK 6 жыл бұрын
Check if you have defined the variable correctly :)
@LokirofRoriksted
@LokirofRoriksted 6 жыл бұрын
The "info" is a variable and not some fixed java coding thing. It's the variable that you declared on one of the textViews. Professor wrote "info" and "result" while I wrote "equation" and "result", so I'll have to change the word "info" in the video to "equation" in my code. Maybe you named something else back in the textviews
@haojiepang2006
@haojiepang2006 6 жыл бұрын
make sure u define the variable private TextView info;
@MrAllenTan
@MrAllenTan 7 жыл бұрын
Hello,why my info.setText(); setText is red colour?
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+Mr Allen Check your themes in styles.xml
@MrAllenTan
@MrAllenTan 7 жыл бұрын
Can i have your e-mail? Thanks
@MrAllenTan
@MrAllenTan 7 жыл бұрын
Thx,i will contact you by e-mail.
@IanPizzolo
@IanPizzolo 6 жыл бұрын
how was this issue solved?
@monirbaulaofficials6775
@monirbaulaofficials6775 6 жыл бұрын
where next video???
@ProfessorDK
@ProfessorDK 6 жыл бұрын
+Lingkon Ahmed Tomal I have made a playlist for this series. Find it in the playlist section of my channel :)
@surajvermaa
@surajvermaa 4 жыл бұрын
CAN WE SUBMIT AS OUR PROJECT IN OUR GRADUATION?
@ProfessorDK
@ProfessorDK 4 жыл бұрын
Yes sure :)
@Fullmetal85
@Fullmetal85 4 жыл бұрын
Bahahaha, lazy and unskilled... What a combination! 😂 🤣
@sbo54
@sbo54 6 жыл бұрын
zero.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { info.setText(info.getText().toString()+"0") I get cannot resolve symbol 'info' please help thank you.
@ProfessorDK
@ProfessorDK 6 жыл бұрын
Go to your xml layout and check if you have defined the ID "info" :)
@sbo54
@sbo54 6 жыл бұрын
link/ time to where you do it on your tutorials?
@sbo54
@sbo54 6 жыл бұрын
never mind...got it ... thanks again... subbed
@mrinalsingh8397
@mrinalsingh8397 6 жыл бұрын
where is the next video?? alteast complete the ongoing series of videos.
@ProfessorDK
@ProfessorDK 6 жыл бұрын
It is completed. Follow the playlists on my channel :)
@preetisaroj2872
@preetisaroj2872 7 жыл бұрын
I'm not able to find the next video. I'm scared that will i be able to complete my program or not. can somebody please help me
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+Preet Kaur Next video on May 22nd. Thanks for your patience.
@panditdareboy
@panditdareboy 7 жыл бұрын
Next Video kaha hi
@nostalgicstudio
@nostalgicstudio 4 жыл бұрын
can you give this project source code for learning purpose i am newbie and just want to see how an app is made ...
@jadedmalcolm2209
@jadedmalcolm2209 3 жыл бұрын
Stop being lazy. I bet you're still a newbie lol
@talhaqayyum2963
@talhaqayyum2963 4 жыл бұрын
Brother Assalam O Allikum..Can you please provide that code ?
@sabyasachibiswas7546
@sabyasachibiswas7546 5 жыл бұрын
setonclicklistner is not being able to resolve what to do
@ProfessorDK
@ProfessorDK 5 жыл бұрын
Java is case sensitive. Make sure you typed properly
@supervirus5831
@supervirus5831 7 жыл бұрын
when will be the next video uploaded
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+TechoBomb Today itself. It's almost ready.
@juhikumari4243
@juhikumari4243 5 жыл бұрын
Supper but you should make it clear
@muhammadbakar1471
@muhammadbakar1471 3 жыл бұрын
Sir you have forget to implement the CLR button implementation
@priyaborkar.10
@priyaborkar.10 4 жыл бұрын
im getting error in @Override
@neenuprasannan1069
@neenuprasannan1069 7 жыл бұрын
(y)
@neerajsahu402
@neerajsahu402 6 жыл бұрын
Pls don't assume we are understanding, tell each and everything for our better understanding, assume like we all are fools!!
@shyamsundarmadabathula4769
@shyamsundarmadabathula4769 5 жыл бұрын
yes u r
@smartphone8846
@smartphone8846 4 жыл бұрын
yes u r
@milindhvijay
@milindhvijay 7 жыл бұрын
When is the next part coming?
@ProfessorDK
@ProfessorDK 7 жыл бұрын
+Milindh Vijay Today itself. Sorry for the delay. Had audio problems.
@milindhvijay
@milindhvijay 7 жыл бұрын
kkk
@mohammedmateenahmed1291
@mohammedmateenahmed1291 Жыл бұрын
Sir contractor calculator idea
@lateefmayowa7914
@lateefmayowa7914 4 жыл бұрын
How do I create the private void I think you are not teaching learners you are just teaching the professionals I regret downloading this video
@maxpetrov6116
@maxpetrov6116 7 жыл бұрын
where is part 3??
@ProfessorDK
@ProfessorDK 7 жыл бұрын
Here it is: kzfaq.info/get/bejne/nZp6qaZ9mLyyaI0.html
@shubhamchauhan6633
@shubhamchauhan6633 7 жыл бұрын
where is 3rd part .... it was to be uploaded by 23
@ProfessorDK
@ProfessorDK 7 жыл бұрын
Here it is: kzfaq.info/get/bejne/nZp6qaZ9mLyyaI0.html
@shubhamchauhan6633
@shubhamchauhan6633 7 жыл бұрын
Professor DK thanks bro
@jenziie_olivia1384
@jenziie_olivia1384 6 жыл бұрын
i DONT THINK THIS WORKS FOR ANDROID STUDIO 3.0 BECAUSE ALL THE LINES BECOME RED WITH THIS CODE
@ProfessorDK
@ProfessorDK 6 жыл бұрын
+Jenalin Balela No this works with Android 3.0 as well :)
@jenziie_olivia1384
@jenziie_olivia1384 6 жыл бұрын
THANKS i FIGURED IT OUT the reason was the design layout codes did not correspond with the java code. I must have made a mistake because when I ran the program the layout got messed up. I will try again another day I stayed up all night trying to do this video thanks man
@technicprince5011
@technicprince5011 6 жыл бұрын
Jenalin Balela bcz it is still in beta version dear
@Moses-yd7jf
@Moses-yd7jf 7 жыл бұрын
where is next video?
@Moses-yd7jf
@Moses-yd7jf 7 жыл бұрын
plz , release next video
@ProfessorDK
@ProfessorDK 7 жыл бұрын
On 22nd May. Thank you for your patience. :)
@Moses-yd7jf
@Moses-yd7jf 7 жыл бұрын
why I can't find the next video?
@rajahammad6187
@rajahammad6187 6 жыл бұрын
where is the E3???????????????????????
@ProfessorDK
@ProfessorDK 6 жыл бұрын
You can check the playlists on my channel :)
@AbhishekKumar-xb5ic
@AbhishekKumar-xb5ic 6 жыл бұрын
you could have used a loop and array bruh!!
@allreactions3295
@allreactions3295 5 жыл бұрын
where is private Button zero btn in 2:38
@ritik84629
@ritik84629 4 жыл бұрын
+1
@prathmayawasthi2684
@prathmayawasthi2684 4 жыл бұрын
0 kidhar hai???
@ademolaoluwayemisiisrael1055
@ademolaoluwayemisiisrael1055 4 жыл бұрын
The video is not clear please
@jounaidzouiten8533
@jounaidzouiten8533 5 жыл бұрын
info doesn't wor sir
@shivammittal733
@shivammittal733 4 жыл бұрын
?? Answer me please someone
Simple Calculator App Tutorial E03 - Full Code Android 2.3
22:39
Professor DK
Рет қаралды 125 М.
Simple Calculator in Android Studio Java
12:38
ProgrammingGeek
Рет қаралды 98 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 11 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
Airflow DAG: Coding your first DAG for Beginners
20:31
Data with Marc
Рет қаралды 219 М.
How to make a Calculator in Android Studio | 2024
21:24
Easy Tuto
Рет қаралды 251 М.
Calculator App Example Android Studio Tutorial
12:33
Code With Cal
Рет қаралды 87 М.
12 VS Code Extensions to INCREASE Productivity 2024
27:13
Devression
Рет қаралды 619 М.