{"id":31843,"date":"2019-10-31T21:43:27","date_gmt":"2019-10-31T18:43:27","guid":{"rendered":"https:\/\/prohoster.info\/blog\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet\/"},"modified":"2019-10-31T21:43:27","modified_gmt":"2019-10-31T18:43:27","slug":"sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet","status":"publish","type":"post","link":"https:\/\/prohoster.info\/hu\/blog\/news\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet","title":{"rendered":"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/faaae0beaf023f1c11bb9102312fe429.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nBemutatjuk, hogyan k\u00e9sz\u00edthet\u00fcnk egy egyszer\u0171 alkalmaz\u00e1st a borraval\u00f3 kisz\u00e1m\u00edt\u00e1s\u00e1ra Kotlin nyelven. Pontosabban, a Kotlin 1.3.21, Android 4, Android Studio 3. Ez a cikk els\u0151sorban azoknak \u00e9rdekes, akik az Android-alkalmaz\u00e1sfejleszt\u00e9s \u00fatj\u00e1ra l\u00e9pnek. Seg\u00edt meg\u00e9rteni, hogy mi \u00e9s hogyan m\u0171k\u00f6dik az alkalmaz\u00e1sban. <\/p>\n<p>Ez a kalkul\u00e1tor hasznos lesz, amikor ki kell sz\u00e1molni a borraval\u00f3t egy csapat sz\u00e1m\u00e1ra, amely \u00fagy d\u00f6nt\u00f6tt, hogy \u00e9tteremben vagy k\u00e1v\u00e9z\u00f3ban t\u00f6lti az id\u0151t. Term\u00e9szetesen nem mindenki \u00e9s nem mindig ad borraval\u00f3t a pinc\u00e9reknek, ez ink\u00e1bb nyugati hagyom\u00e1ny, de egy ilyen alkalmaz\u00e1s fejleszt\u00e9se \u00edgy is \u00e9rdekes. <br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<blockquote><p><b>Eml\u00e9keztetj\u00fck:<\/b> <i>minden \u00abHabr\u00bb olvas\u00f3nak 10 000 rubeles kedvezm\u00e9ny j\u00e1r b\u00e1rmely Skillbox kurzus jelentkez\u00e9sekor a \u00abHabr\u00bb prom\u00f3ci\u00f3s k\u00f3d felhaszn\u00e1l\u00e1s\u00e1val.<\/i><\/p>\n<p><b>A Skillbox aj\u00e1nlja:<\/b> Gyakorlati kurzus <noindex><a rel=\"nofollow\" href=\"https:\/\/skillbox.ru\/agima\/?utm_source=skillbox.media&amp;utm_medium=habr.com&amp;utm_campaign=AGIMA&amp;utm_content=articles&amp;utm_term=kotlintips\">Mobil fejleszt\u0151 PRO<\/a><\/noindex>.\n<\/p><\/blockquote>\n<p>\n\u00cdgy n\u00e9z ki az alkalmaz\u00e1s m\u0171k\u00f6d\u00e9s k\u00f6zben:<\/p>\n<p><img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/fa375744a4ca5d07667ec494db38648b.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nBe\u00edrja a k\u00edv\u00e1nt sz\u00e1zal\u00e9kot az \u00f6sszegb\u0151l, a r\u00e9sztvev\u0151k sz\u00e1m\u00e1t, \u00e9s megkapja az eredm\u00e9nyt \u2013 a borraval\u00f3t, amit \u00e9rdemes hagyni.<\/p>\n<h3>Kezd\u00fcnk<\/h3>\n<p>\nAz alkalmaz\u00e1s teljes fel\u00fclete a k\u00f6vetkez\u0151k\u00e9ppen n\u00e9z ki:<br \/>\n<img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/e95058f09c4a6c151b6c5500ae549c0e.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\n<img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/ac31c73ade24640078c76d71700de0b4.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nEls\u0151 l\u00e9p\u00e9s \u2013 <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/lawreyios\/tipcalculator\/tree\/starter_project\">a projekt alapjainak bet\u00f6lt\u00e9se.<\/a><\/noindex>Megnyitjuk az Android Studio 3.0 vagy \u00fajabb verzi\u00f3j\u00e1ban. \u00c9p\u00edtj\u00fck \u00e9s ind\u00edtjuk a projektet, \u00e9s egy feh\u00e9r k\u00e9perny\u0151t l\u00e1tunk. Minden rendben, \u00edgy kell lennie.<\/p>\n<p><img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/f4e3361ddc45d56794cc5c7c36d8b206.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\n<img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/7828c10dcb3936eb095f5110094ea8bf.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nA felhaszn\u00e1l\u00f3i l\u00e9p\u00e9sek id\u0151rendi sorrendben vannak meghat\u00e1rozva a projektben, hogy minden vil\u00e1gos legyen. Ennek megtekint\u00e9s\u00e9hez nyissa meg a N\u00e9zet -&gt; Eszk\u00f6zablakok -&gt; TODO men\u00fcpontot.<\/p>\n<p>Megvizsg\u00e1ljuk a projektet \u00e9s megnyitjuk a colors.xml f\u00e1jlt a sz\u00ednpaletta \u00e9rt\u00e9kel\u00e9s\u00e9hez. A strings.xml f\u00e1jlban tal\u00e1lhat\u00f3k a sz\u00f6veges adatok (feliratok), a styles.xml f\u00e1jlban pedig n\u00e9h\u00e1ny bet\u0171t\u00edpus sablon.<\/p>\n<h3>A k\u00f6lts\u00e9gek r\u00e9sz\u00e9nek fejleszt\u00e9se<\/h3>\n<p>\nMegnyitjuk az activity_main.xml f\u00e1jlt, \u00e9s hozz\u00e1adjuk az al\u00e1bbi k\u00f3dot a LinearLayouthoz (#1):<\/p>\n<pre><code class=\"kotlin\"><\/code><\/pre>\n<p>\nMost be\u00e1ll\u00edthatja az \u00e9rt\u00e9kek k\u00f6nyvt\u00e1r\u00e1nak st\u00edlus\u00e1t, vagy j\u00e1tszhat a sz\u00ednekkel a <noindex><a rel=\"nofollow\" href=\"https:\/\/material.io\/tools\/color\/#!\/?view.left=0&amp;view.right=0&amp;primary.color=37474F\">material.io eszk\u00f6z seg\u00edts\u00e9g\u00e9vel.<\/a><\/noindex>.<\/p>\n<p>Most a projekt \u00edgy n\u00e9z ki:<\/p>\n<p><img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/ab47023cafd97fdbd171a9d9a1c35dd5.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i> Ahogy l\u00e1tja, a k\u00f6lts\u00e9gek kisz\u00e1m\u00edt\u00e1sa a felhaszn\u00e1l\u00f3 \u00e1ltal megadott adatokon alapul. <\/i><\/p>\n<h3>A sz\u00e1ml\u00e1k r\u00e9sz\u00e9nek fejleszt\u00e9se<\/h3>\n<p>\nHozz\u00e1adjuk az al\u00e1bbi k\u00f3dot a LinearLayouthoz az Expense Section ut\u00e1n (#2):<\/p>\n<pre><code class=\"kotlin\">&lt;! \u2014 TODO #3: Build Bill Section \u2192\n \n\u2026<\/code><\/pre>\n<p>\nZ\u00e1rjuk le a LinearLayout-ot a TODO lista ut\u00e1n, majd adjuk hozz\u00e1 az \u00faj k\u00f3dot, elhelyezve azt a LinearLayout-on bel\u00fcl (#3):<\/p>\n<pre><code class=\"kotlin\"><\/code><\/pre>\n<p>\nMivel az alkalmaz\u00e1s f\u0151 feladata az \u00e9ttermi k\u00f6lts\u00e9gek egyedi kisz\u00e1m\u00edt\u00e1sa a r\u00e9sztvev\u0151k sz\u00e1m\u00e1ra, a costPerPersonTextView j\u00e1tssza a legfontosabb szerepet. <\/p>\n<p>Az EditText korl\u00e1tozza az egy sorba t\u00f6rt\u00e9n\u0151 adatbevitelt, ennek a param\u00e9ternek az inputType \u00e9rt\u00e9k\u00e9nek NumberDecimal-nak kell lennie.<\/p>\n<p><img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/7dc4e90d8188a08933e7a92b119472ee.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i> Ind\u00edtsuk el a projektet egy teszt c\u00e9lj\u00e1b\u00f3l, \u00e9s adjuk meg a teljes k\u00e1r param\u00e9tereit (t\u00f6r\u00f6tt b\u00f6grek, t\u00e1ny\u00e9rok stb.).<\/i><\/p>\n<h3>A 'N\u00e9pek \u00e9s borraval\u00f3k' r\u00e9sz fejleszt\u00e9se.<\/h3>\n<p>\nA borraval\u00f3 mennyis\u00e9g\u00e9nek kiv\u00e1laszt\u00e1s\u00e1hoz illessz\u00fck be az al\u00e1bbi k\u00f3dot az \u00faj LinearLayout szekci\u00f3ba (#4):<\/p>\n<pre><code class=\"kotlin\"><\/code><\/pre>\n<p>\nEz a k\u00f3dr\u00e9szlet sz\u00fcks\u00e9ges a borraval\u00f3 pontos \u00f6sszeg\u00e9nek kisz\u00e1m\u00edt\u00e1s\u00e1hoz. Az alap\u00e9rtelmezett sz\u00f6veg\u00e9rt\u00e9k 20. Az ImageButtons ikonnal rendelkezik a writable mapp\u00e1ban.<\/p>\n<p>Teljesen m\u00e1soljuk a szakaszt, \u00e9s adjuk hozz\u00e1 a k\u00f6vetkez\u0151t (#5):<\/p>\n<ul>\n<li> ImageButton azonos\u00edt\u00f3k (subtractPeopleButton, addPeopleButton)<\/li>\n<li> TextView azonos\u00edt\u00f3k (numberOfPeopleStaticText, numberOfPeopleTextView)<\/li>\n<li> DefaultText a numberOfPeopleTextView-hez (4-nek kell lennie).<\/li>\n<\/ul>\n<p>\n<img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/df99acfb33c3d27126db807b805c9c87.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nMost, amikor elind\u00edtjuk az alkalmaz\u00e1st, van lehet\u0151s\u00e9g\u00fcnk hozz\u00e1adni a sz\u00e1ml\u00e1t, a 'Hozz\u00e1ad'\/'Kivon' gombok m\u0171k\u00f6dnek, de egyel\u0151re semmi sem t\u00f6rt\u00e9nik.<\/p>\n<h3>N\u00e9zetek hozz\u00e1ad\u00e1sa.<\/h3>\n<p>\nNyissuk meg a MainActivity.kt-t, \u00e9s adjuk hozz\u00e1 ezt az initViews (#6) funkci\u00f3hoz:<\/p>\n<pre><code class=\"kotlin\">private fun initViews() {\n        expensePerPersonTextView = findViewById(R.id.expensePerPersonTextView)\n        billEditText = findViewById(R.id.billEditText)\n \naddTipButton = findViewById(R.id.addTipButton)\n        tipTextView = findViewById(R.id.tipTextView)\n        subtractTipButton = findViewById(R.id.subtractTipButton)\n \naddPeopleButton = findViewById(R.id.addPeopleButton)\n        numberOfPeopleTextView = findViewById(R.id.numberOfPeopleTextView)\n        subtractPeopleButton = findViewById(R.id.subtractPeopleButton)\n \n\/\/TODO #8: Bind Buttons to Listener\n \n\/\/TODO #16: Bind EditText to TextWatcher\n \n}<\/code><\/pre>\n<p><\/p>\n<h3>K\u00e9sz\u00edtj\u00fck el a gombokat<\/h3>\n<p>\nA gombok kattinthat\u00f3s\u00e1g\u00e1nak hozz\u00e1ad\u00e1s\u00e1hoz bevezetj\u00fck a View.OnClickListener-t a oszt\u00e1ly szintj\u00e9n (#7):<\/p>\n<p>class MainActivity: AppCompatActivity(), View.OnClickListener {<\/p>\n<p>A projektet most nem tudjuk ford\u00edtani, tov\u00e1bbi l\u00e9p\u00e9seket kell v\u00e9grehajtani (#8):<\/p>\n<pre><code class=\"kotlin\">override fun onClick(v: View?) {\n        when (v?.id) {\n            R.id.addTipButton -&gt; incrementTip()\n            R.id.subtractTipButton -&gt; decrementTip()\n            R.id.addPeopleButton -&gt; incrementPeople()\n            R.id.subtractPeopleButton -&gt; decrementPeople()\n        }\n    }<\/code><\/pre>\n<p>\nA Kotlin gombok \u00e9s kapcsol\u00f3k szempontj\u00e1b\u00f3l nagyon j\u00f3l van megszervezve! Az al\u00e1bbi k\u00f3dot minden increment \u00e9s decrement funkci\u00f3ba \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c<br \/>\n (#9\u200a\u2013#12):<\/p>\n<pre><code class=\"kotlin\">private fun incrementTip() {\n        if (tipPercent != MAX_TIP) {\n            tipPercent += TIP_INCREMENT_PERCENT\n            tipTextView.text = String.format(\"%d%%\", tipPercent)\n        }\n    }\n \nprivate fun decrementTip() {\n        if (tipPercent != MIN_TIP) {\n            tipPercent -= TIP_INCREMENT_PERCENT\n            tipTextView.text = String.format(\"%d%%\", tipPercent)\n        }\n    }\n \nprivate fun incrementPeople() {\n        if (numberOfPeople != MAX_PEOPLE) {\n            numberOfPeople += PEOPLE_INCREMENT_VALUE\n            numberOfPeopleTextView.text = numberOfPeople.toString()\n        }\n    }\n \nprivate fun decrementPeople() {\n        if (numberOfPeople != MIN_PEOPLE) {\n            numberOfPeople -= PEOPLE_INCREMENT_VALUE\n            numberOfPeopleTextView.text = numberOfPeople.toString()\n        }\n    }<\/code><\/pre>\n<p>\nEz a k\u00f3d v\u00e9di a n\u00f6vel\u0151 funkci\u00f3kat a maxim\u00e1lis \u00e9rt\u00e9kek (MAX_TIP &amp; MAX_PEOPLE) mellett. Ezenk\u00edv\u00fcl a k\u00f3d v\u00e9di a cs\u00f6kkent\u0151 funkci\u00f3kat a minim\u00e1lis \u00e9rt\u00e9kekkel (MIN_TIP &amp; MIN_PEOPLE).<\/p>\n<p>Most \u00f6sszekapcsoljuk a gombokat a figyel\u0151kkel az initViews funkci\u00f3ban (#13):<\/p>\n<pre><code class=\"kotlin\">private fun initViews() {\n \n...\n \naddTipButton.setOnClickListener(this)\n        subtractTipButton.setOnClickListener(this)\n \naddPeopleButton.setOnClickListener(this)\n        subtractPeopleButton.setOnClickListener(this)\n \n\/\/TODO #15: Bind EditText to TextWatcher\n}<\/code><\/pre>\n<p>\n<img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/73e7477d4b02548aad7c2112c6be5d80.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nMost hozz\u00e1adhatjuk a k\u00f6z\u00f6s k\u00f6lts\u00e9get, borraval\u00f3t \u00e9s a r\u00e9sztvev\u0151k sz\u00e1m\u00e1t. \u00c9s most a legfontosabb\u2026<\/p>\n<h3>K\u00f6lts\u00e9gsz\u00e1m\u00edt\u00f3 r\u00e9sz<\/h3>\n<p>Ez a k\u00f3d sz\u00e1m\u00edtja a k\u00f6lts\u00e9geket (#14):<\/p>\n<pre><code class=\"kotlin\">private fun calculateExpense() {\n \nval totalBill = billEditText.text.toString().toDouble()\n \nval totalExpense = ((HUNDRED_PERCENT + tipPercent) \/ HUNDRED_PERCENT) * totalBill\n        val individualExpense = totalExpense \/ numberOfPeople\n \nexpensePerPersonTextView.text = String.format(\"$%.2f\", individualExpense)\n \n}<\/code><\/pre>\n<p>\nItt pedig megh\u00edv\u00f3dik a funkci\u00f3, ami lehet\u0151v\u00e9 teszi a t\u00e1rsas\u00e1g l\u00e9tsz\u00e1m\u00e1nak figyelembev\u00e9tel\u00e9t \u00e9s a borraval\u00f3 kisz\u00e1m\u00edt\u00e1s\u00e1t (#15):<\/p>\n<pre><code class=\"kotlin\">private fun incrementTip() {\n \n\u2026\n \n}\n \nprivate fun decrementTip() {\n \n\u2026\n \n}\n \nprivate fun incrementPeople() {\n \n\u2026\n \n}\n \nprivate fun decrementPeople() {\n \n\u2026\n \n}<\/code><\/pre>\n<p>\nElind\u00edtjuk az alkalmaz\u00e1st. J\u00f3l n\u00e9z ki, \u00e9s remek\u00fcl m\u0171k\u00f6dik. De lehetne jobb is.<\/p>\n<p>Ha megpr\u00f3b\u00e1lja elt\u00e1vol\u00edtani a sz\u00e1ml\u00e1t, majd n\u00f6velni a borraval\u00f3k vagy a bar\u00e1tok sz\u00e1m\u00e1t, az alkalmaz\u00e1s \u00f6sszeomlik, mivel m\u00e9g nincs ellen\u0151rz\u00e9s a nulla k\u00f6lts\u00e9g\u00e9rt\u00e9kre. S\u0151t, ha megpr\u00f3b\u00e1lja megv\u00e1ltoztatni a sz\u00e1ml\u00e1t, a k\u00f6lts\u00e9gek nem friss\u00fclnek.<\/p>\n<h3>V\u00e9gs\u0151 l\u00e9p\u00e9sek<\/h3>\n<p>\nHozz\u00e1adjuk a TextWatchert (#16):<\/p>\n<p>class MainActivity: AppCompatActivity(), View.OnClickListener, TextWatcher {<\/p>\n<p>Ezut\u00e1n be\u00e1gyazzuk a billEditText felhaszn\u00e1l\u00f3t (#17):<\/p>\n<p>billEditText.addTextChangedListener(this)<\/p>\n<p>Plusz hozz\u00e1adjuk a TextWatcher v\u00e9grehajt\u00e1s\u00e1hoz sz\u00fcks\u00e9ges k\u00f3dot (#18):<\/p>\n<pre><code class=\"kotlin\">override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {\n        if (!billEditText.text.isEmpty()) {\n            calculateExpense()\n        }\n    }\noverride fun afterTextChanged(s: Editable?) {}\n\n    override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}<\/code><\/pre>\n<p>\n<img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/623256a43c969d8b3a434d10a357c1a0.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nMost pedig minden t\u00f6k\u00e9letesen m\u0171k\u00f6dik! Gratul\u00e1lunk, \u00edrt\u00e1l egy saj\u00e1t \"Borraval\u00f3 kalkul\u00e1tort\" Kotlin nyelven.<\/p>\n<p><img decoding=\"async\" alt=\"Tippek sz\u00e1mol\u00f3g\u00e9p k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik ez?\" src=\"\/wp-content\/uploads\/2019\/04\/5650bfecfadf3fd56785b7d6ac72ed87.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<blockquote><p><b>A Skillbox aj\u00e1nlja:<\/b><\/p>\n<ul>\n<li>K\u00e9t\u00e9ves gyakorlati tanfolyam <noindex><a rel=\"nofollow\" href=\"https:\/\/iamwebdev.skillbox.ru\/?utm_source=skillbox.media&amp;utm_medium=habr.com&amp;utm_campaign=WEBDEVPRO&amp;utm_content=articles&amp;utm_term=kotlintips\">\u201eWebfejleszt\u0151 PRO\u201d<\/a><\/noindex>.<\/li>\n<li>Online kurzus <noindex><a rel=\"nofollow\" href=\"https:\/\/skillbox.ru\/c-sharp\/?utm_source=skillbox.media&amp;utm_medium=habr.com&amp;utm_campaign=CSHDEV&amp;utm_content=articles&amp;utm_term=kotlintips\">C# fejleszt\u0151<\/a><\/noindex>.<\/li>\n<li>Gyakorlati \u00e9ves kurzus <noindex><a rel=\"nofollow\" href=\"https:\/\/skillbox.ru\/php\/?utm_source=skillbox.media&amp;utm_medium=habr.com&amp;utm_campaign=PHPDEV&amp;utm_content=articles&amp;utm_term=kotlintips\">\u201ePHP fejleszt\u0151 a null\u00e1t\u00f3l a PROig\u201d<\/a><\/noindex>.\n<\/li>\n<\/ul>\n<\/blockquote>\n<p>Forr\u00e1s: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/skillbox\/blog\/448582\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0447\u0430\u0435\u0432\u044b\u0445 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Kotlin. \u0415\u0441\u043b\u0438 \u0442\u043e\u0447\u043d\u0435\u0435, \u0442\u043e Kotlin 1.3.21, Android 4, Android Studio 3. \u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u043f\u0443\u0442\u044c \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0438 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u043e\u0439 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u0443 \u0447\u0430\u0435\u0432\u044b\u0445 \u0441 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":23712,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-31843","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/hu\/blog\/news\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"hu_HU\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0447\u0430\u0435\u0432\u044b\u0445 \u043d\u0430 Kotlin: \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/hu\/blog\/news\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:43:27+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:43:27+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Borraval\u00f3 kalkul\u00e1tor k\u00e9sz\u00edt\u00e9se Kotlin nyelven: hogyan m\u0171k\u00f6dik? | ProHoster","description":"Elmondjuk, hogyan k\u00e9sz\u00edthet\u0151 el egyszer\u0171en.","canonical_url":"https:\/\/prohoster.info\/hu\/blog\/news\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"hu_HU","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0447\u0430\u0435\u0432\u044b\u0445 \u043d\u0430 Kotlin: \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? | ProHoster","og:description":"\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435.","og:url":"https:\/\/prohoster.info\/hu\/blog\/news\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:43:27+00:00","article:modified_time":"2019-10-31T18:43:27+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"31843","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 08:07:20","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 03:10:45","updated":"2026-01-21 08:07:20","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/posts\/31843","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/comments?post=31843"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/posts\/31843\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/media\/23712"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/media?parent=31843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/categories?post=31843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/tags?post=31843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}