{"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\/sq\/blog\/novosti-interneta\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet","title":{"rendered":"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/faaae0beaf023f1c11bb9102312fe429.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nPo flasim se si t\u00eb krijoni nj\u00eb aplikacion t\u00eb thjesht\u00eb p\u00ebr llogaritjen e majave n\u00eb gjuh\u00ebn Kotlin. N\u00ebse jemi m\u00eb t\u00eb sakt\u00eb, Kotlin 1.3.21, Android 4, Android Studio 3. Ky artikull do t\u00eb jet\u00eb i interesant, n\u00eb radh\u00eb t\u00eb par\u00eb, p\u00ebr ata q\u00eb po fillojn\u00eb rrug\u00ebtimin e tyre n\u00eb zhvillimin e aplikacioneve Android. Ai ndihmon n\u00eb kuptimin e funksionimit t\u00eb ndryshm\u00ebve brenda aplikacionit. <\/p>\n<p>Ky kalkulator do t\u00eb jet\u00eb i dobish\u00ebm kur duhet t\u00eb llogaritni shum\u00ebn e majave p\u00ebr nj\u00eb kompani q\u00eb ka vendosur t\u00eb kaloj\u00eb koh\u00eb n\u00eb nj\u00eb restorant ose kafen\u00e9. Sigurisht, jo t\u00eb gjith\u00eb dhe jo gjithmon\u00eb l\u00ebn\u00eb maj\u00eb p\u00ebr kamerier\u00ebt, kjo \u00ebsht\u00eb m\u00eb shum\u00eb nj\u00eb tradit\u00eb per\u00ebndimore, por procesi i zhvillimit t\u00eb nj\u00eb aplikacioni t\u00eb till\u00eb \u00ebsht\u00eb gjithsesi interesant. <br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<blockquote><p><b>Kujtojm\u00eb:<\/b> <i>p\u00ebr t\u00eb gjith\u00eb lexuesit e \"Habra\" \u2014 zbritje prej 10,000 rublej p\u00ebr regjistrimin n\u00eb \u00e7do kurs Skillbox me kodin promocional \"Habr\".<\/i><\/p>\n<p><b>Skillbox rekomandon:<\/b> Kurs praktik <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\">\u00abZhvilluesi Mobil PRO<\/a><\/noindex>.\n<\/p><\/blockquote>\n<p>\nJa si duket aplikacioni n\u00eb procesin e pun\u00ebs:<\/p>\n<p><img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/fa375744a4ca5d07667ec494db38648b.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nJu jepni percentin e d\u00ebshiruar t\u00eb shum\u00ebs totale, numrin e pjes\u00ebmarr\u00ebsve n\u00eb takim dhe merrni rezultatin \u2014 shum\u00ebn e majave q\u00eb duhet t\u00eb lini.<\/p>\n<h3>Fillojm\u00eb<\/h3>\n<p>\nInterfaci i plot\u00eb i aplikacionit duket si m\u00eb posht\u00eb:<br \/>\n<img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/e95058f09c4a6c151b6c5500ae549c0e.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\n<img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/ac31c73ade24640078c76d71700de0b4.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nVeprimi i par\u00eb \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/lawreyios\/tipcalculator\/tree\/starter_project\">ngarkimi i baz\u00ebs s\u00eb projektit<\/a><\/noindex>. E hapim at\u00eb n\u00eb Android Studio 3.0 ose nj\u00eb version m\u00eb t\u00eb ri. E nd\u00ebrtuam dhe e ekzekutuam projektin dhe pam\u00eb nj\u00eb ekran t\u00eb bardh\u00eb. \u00c7do gj\u00eb \u00ebsht\u00eb n\u00eb rregull, ashtu duhet t\u00eb jet\u00eb.<\/p>\n<p><img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/f4e3361ddc45d56794cc5c7c36d8b206.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\n<img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/7828c10dcb3936eb095f5110094ea8bf.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nVeprimet e p\u00ebrdoruesit jan\u00eb t\u00eb renditura n\u00eb projekt n\u00eb rend kronologjik, p\u00ebr ta kuptuar leht\u00ebsisht. P\u00ebr ta par\u00eb, hapim View -&gt; Tool Windows -&gt; TODO.<\/p>\n<p>Studjojm\u00eb projektin dhe hapim colors.xml p\u00ebr t\u00eb vler\u00ebsuar palet\u00ebn e ngjyrave. T\u00eb dh\u00ebnat tekstuale (etiketat) gjenden n\u00eb strings.xml, nd\u00ebrsa n\u00eb styles.xml ka disa shabllone p\u00ebr fonte.<\/p>\n<h3>Zhvillimi i seksionit t\u00eb shpenzimeve<\/h3>\n<p>\nHapim activity_main.xml dhe shtojm\u00eb kodin e vendosur m\u00eb posht\u00eb n\u00eb LinearLayout (#1):<\/p>\n<pre><code class=\"kotlin\"><\/code><\/pre>\n<p>\nTani mund t\u00eb konfiguroni stilin e drejtoris\u00eb values ose t\u00eb eksperimentoni me ngjyrat, duke p\u00ebrdorur <noindex><a rel=\"nofollow\" href=\"https:\/\/material.io\/tools\/color\/#!\/?view.left=0&amp;view.right=0&amp;primary.color=37474F\">instrumentin material.io<\/a><\/noindex>.<\/p>\n<p>Aktualisht projekti duket k\u00ebshtu:<\/p>\n<p><img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/ab47023cafd97fdbd171a9d9a1c35dd5.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i> Si\u00e7 e shihni, llogaritja e shpenzimeve b\u00ebhet sipas t\u00eb dh\u00ebnave q\u00eb jep p\u00ebrdoruesi. <\/i><\/p>\n<h3>Zhvillimi i seksionit t\u00eb faturave<\/h3>\n<p>\nShtojm\u00eb kodin e vendosur m\u00eb posht\u00eb n\u00eb LinearLayout pas Seksionit t\u00eb Shpenzimeve (#2):<\/p>\n<pre><code class=\"kotlin\">&lt;! \u2014 TODO #3: Nd\u00ebrto Seksionin e Bill-ave \u2192\n \n\u2026<\/code><\/pre>\n<p>\nMbyllim LinearLayout pas list\u00ebs TODO, dhe pastaj shtojm\u00eb kodin e ri, duke e vendosur brenda LinearLayout (#3):<\/p>\n<pre><code class=\"kotlin\"><\/code><\/pre>\n<p>\nDuke qen\u00eb se q\u00ebllimi kryesor i aplikacionit \u00ebsht\u00eb llogaritja e shpenzimeve individuale p\u00ebr secilin nga pjes\u00ebmarr\u00ebsit n\u00eb restorant, vlera kryesore luan costPerPersonTextView. <\/p>\n<p>EditText kufizon hyrjen e t\u00eb dh\u00ebnave n\u00eb nj\u00eb rresht, ky parametr duhet t\u00eb ket\u00eb vler\u00ebn NumberDecimal inputType.<\/p>\n<p><img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/7dc4e90d8188a08933e7a92b119472ee.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i> Fillojm\u00eb projektin p\u00ebr testim dhe futim parametrat e d\u00ebmit t\u00eb p\u00ebrgjithsh\u00ebm (pjes\u00eb t\u00eb thyera, pjata etj.)<\/i><\/p>\n<h3>Zhvillimi i seksionit 'Njer\u00ebzit dhe dhuratat'<\/h3>\n<p>\nP\u00ebr t\u00eb shtuar zgjedhjen e shum\u00ebs s\u00eb dhuratave, futim kodin e vendosur m\u00eb posht\u00eb n\u00eb nj\u00eb seksion t\u00eb ri LinearLayout (#4):<\/p>\n<pre><code class=\"kotlin\"><\/code><\/pre>\n<p>\nKy segment i kodit \u00ebsht\u00eb i nevojsh\u00ebm p\u00ebr llogaritjen e sakt\u00eb t\u00eb shum\u00ebs s\u00eb dhurat\u00ebs. Vlera e paracaktuar e tekstit \u00ebsht\u00eb 20. ImageButtons jan\u00eb t\u00eb pajisura me ikona n\u00eb dosjen e t\u00eb drejtave t\u00eb shkruar.<\/p>\n<p>Kopjojm\u00eb plot\u00ebsisht seksionin dhe shtojm\u00eb t\u00eb following (#5):<\/p>\n<ul>\n<li> ImageButton ids (subtractPeopleButton, addPeopleButton)<\/li>\n<li> TextView ids (numberOfPeopleStaticText, numberOfPeopleTextView)<\/li>\n<li> DefaultText p\u00ebr numberOfPeopleTextView (duhet t\u00eb jet\u00eb 4).<\/li>\n<\/ul>\n<p>\n<img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/df99acfb33c3d27126db807b805c9c87.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nTani, kur \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c aplikimi, ka mund\u00ebsin\u00eb p\u00ebr t\u00eb shtuar shum\u00ebn e llogaris\u00eb, gjithashtu punojn\u00eb butonat \u2018Shto\/Hiq\u2019, por deri m\u00eb tani nuk ndodh asgj\u00eb.<\/p>\n<h3>Shtohedhim Views<\/h3>\n<p>\nHapim MainActivity.kt dhe shtojm\u00eb k\u00ebt\u00eb n\u00eb funksionin initViews (#6):<\/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: Lidheni butonat me d\u00ebgjuesin\n\n\/\/TODO #16: Lidheni EditText me TextWatcher\n\n}<\/code><\/pre>\n<p><\/p>\n<h3>P\u00ebrfundojm\u00eb butonat<\/h3>\n<p>\nP\u00ebr t\u00eb shtuar mb\u00ebshtetje p\u00ebr klikimet e butonave, zbatoni View.OnClickListener n\u00eb nivelin e klas\u00ebs (#7):<\/p>\n<p>class MainActivity: AppCompatActivity(), View.OnClickListener {<\/p>\n<p>Tani nuk do t\u00eb mund t\u00eb kompiloni projektin, duhen kryer edhe disa hapa t\u00eb tjer\u00eb (#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>\nN\u00eb planin e butonave dhe nd\u00ebrruesve, Kotlin \u00ebsht\u00eb organizuar shum\u00eb mir\u00eb! Shtojeni kodin e m\u00ebposht\u00ebm n\u00eb t\u00eb gjitha funksionet increment dhe decrement<br \/>\n (#9\u200a\u2013#12):<\/p>\n<pre><code class=\"kotlin\">fun private incrementTip() {\n        if (tipPercent != MAX_TIP) {\n            tipPercent += TIP_INCREMENT_PERCENT\n            tipTextView.text = String.format(\"%d%%\", tipPercent)\n        }\n    }\n \nfun private decrementTip() {\n        if (tipPercent != MIN_TIP) {\n            tipPercent -= TIP_INCREMENT_PERCENT\n            tipTextView.text = String.format(\"%d%%\", tipPercent)\n        }\n    }\n \nfun private incrementPeople() {\n        if (numberOfPeople != MAX_PEOPLE) {\n            numberOfPeople += PEOPLE_INCREMENT_VALUE\n            numberOfPeopleTextView.text = numberOfPeople.toString()\n        }\n    }\n \nfun private decrementPeople() {\n        if (numberOfPeople != MIN_PEOPLE) {\n            numberOfPeople -= PEOPLE_INCREMENT_VALUE\n            numberOfPeopleTextView.text = numberOfPeople.toString()\n        }\n    }<\/code><\/pre>\n<p>\nKy kod mbron funksionet e rritjes me vlera maksimale (MAX_TIP &amp; MAX_PEOPLE). P\u00ebr m\u00eb tep\u00ebr, ky kod mbron funksionet e zvog\u00eblimit me vlera minimale (MIN_TIP &amp; MIN_PEOPLE).<\/p>\n<p>Tani, lidhim butonat me d\u00ebgjuesit n\u00eb funksionin initViews (#13):<\/p>\n<pre><code class=\"kotlin\">fun private initViews() {\n \n...\n \naddTipButton.setOnClickListener(this)\n        subtractTipButton.setOnClickListener(this)\n \naddPeopleButton.setOnClickListener(this)\n        subtractPeopleButton.setOnClickListener(this)\n \n\/\/TODO #15: Lidh EditText me TextWatcher\n}<\/code><\/pre>\n<p>\n<img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/73e7477d4b02548aad7c2112c6be5d80.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nTani mund t\u00eb shtoni d\u00ebm t\u00eb p\u00ebrgjithsh\u00ebm, k\u00ebshilla dhe numrin e pjes\u00ebmarr\u00ebsve n\u00eb takim. Tani, gj\u00ebja m\u00eb e r\u00ebnd\u00ebsishme...<\/p>\n<h3>Seksi i llogaritjes s\u00eb shpenzimeve<\/h3>\n<p>Ky kod llogarit shpenzimet (#14):<\/p>\n<pre><code class=\"kotlin\">funksioni privat 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>\nK\u00ebtu thirret funksioni q\u00eb lejon t\u00eb merret parasysh numri i personave n\u00eb kompani dhe t\u00eb llogariten bakshish\u00ebt (#15):<\/p>\n<pre><code class=\"kotlin\">funksioni privat incrementTip() {\n \n\u2026\n \n}\n \nfunksioni privat decrementTip() {\n \n\u2026\n \n}\n \nfunksioni privat incrementPeople() {\n \n\u2026\n \n}\n \nfunksioni privat decrementPeople() {\n \n\u2026\n \n}<\/code><\/pre>\n<p>\nPo e nisim aplikacionin. Duket dhe funksionon shk\u00eblqyesh\u00ebm. Por mund t\u00eb jet\u00eb edhe m\u00eb mir\u00eb.<\/p>\n<p>N\u00ebse p\u00ebrpiqeni t\u00eb fshini shum\u00ebn e fatur\u00ebs dhe m\u00eb pas t\u00eb rrisni numrin e bakshish\u00ebve ose miqve, aplikacioni do t\u00eb bjer\u00eb, pasi nuk ka ende kontroll p\u00ebr vler\u00ebn e zero. P\u00ebr m\u00eb tep\u00ebr, n\u00ebse p\u00ebrpiqni t\u00eb ndryshoni shum\u00ebn e fatur\u00ebs, shpenzimet nuk do t\u00eb p\u00ebrdit\u00ebsohen.<\/p>\n<h3>Hapat p\u00ebrfundimtar\u00eb<\/h3>\n<p>\nShtojm\u00eb TextWatcher (#16):<\/p>\n<p>klasa MainActivity: AppCompatActivity(), View.OnClickListener, TextWatcher {<\/p>\n<p>M\u00eb pas, vendosim d\u00ebgjuesin n\u00eb billEditText (#17):<\/p>\n<p>billEditText.addTextChangedListener(this)<\/p>\n<p>Plus, shtojm\u00eb kodin p\u00ebr t\u00eb ekzekutuar TextWatcher (#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=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/623256a43c969d8b3a434d10a357c1a0.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n <br \/>\nTani gjith\u00e7ka funksionon plot\u00ebsisht! Urime, keni shkruar kalkulatorin tuaj t\u00eb dhuratave n\u00eb Kotlin.<\/p>\n<p><img decoding=\"async\" alt=\"Krijimi i nj\u00eb kalkulatori t\u00eb majave n\u00eb Kotlin: si funksionon?\" src=\"\/wp-content\/uploads\/2019\/04\/5650bfecfadf3fd56785b7d6ac72ed87.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<blockquote><p><b>Skillbox rekomandon:<\/b><\/p>\n<ul>\n<li>Kurs praktik dyvje\u00e7ar <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\">\u00abUn\u00eb jam Zhvillues WEB PRO\u00bb<\/a><\/noindex>.<\/li>\n<li>Kurs online <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\">Programues C#<\/a><\/noindex>.<\/li>\n<li>Kurs praktik nj\u00ebvje\u00e7ar <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\">\u00abPHP zhvillues nga 0 n\u00eb PRO\u00bb<\/a><\/noindex>.\n<\/li>\n<\/ul>\n<\/blockquote>\n<p>Burimi: <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-novosti-interneta"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - 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 \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,\" \/>\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\/sq\/blog\/novosti-interneta\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\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 \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,\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/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\udd47Krijimi i kalkulatorit t\u00eb dhuratave n\u00eb Kotlin: si funksionon? | ProHoster","description":"N\u00eb k\u00ebt\u00eb artikull do t\u00eb tregojm\u00eb se si t\u00eb krijoni nj\u00eb aplikacion t\u00eb thjesht\u00eb p\u00ebr llogaritjen e dhuratave n\u00eb gjuh\u00ebn Kotlin. N\u00ebse jemi m\u00eb t\u00eb sakt\u00eb, po flasim p\u00ebr Kotlin 1.3.21, Android 4, Android Studio 3. Ky artikull do t\u00eb jet\u00eb sidomos i interesant p\u00ebr ata q\u00eb po fillojn\u00eb rrug\u00ebtimin e tyre n\u00eb zhvillimin e aplikacioneve Android. Ai ndihmon p\u00ebr t\u00eb kuptuar se si funksionojn\u00eb t\u00eb gjitha pjes\u00ebt brenda aplikacionit. Nj\u00eb kalkulator i till\u00eb \u00ebsht\u00eb i dobish\u00ebm kur duhet t\u00eb llogarisim shum\u00ebn e dhuratave nga kompania.","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/sozdanie-kalkulyatora-chaevyh-na-kotlin-kak-eto-rabotaet","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","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 \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,","og:url":"https:\/\/prohoster.info\/sq\/blog\/novosti-interneta\/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\/sq\/wp-json\/wp\/v2\/posts\/31843","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=31843"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/31843\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/23712"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=31843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=31843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=31843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}