<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум Александра Климова — Hello Kitty - Создаем первое приложение для Android]]></title>
		<link>http://forum.alexanderklimov.ru/viewtopic.php?id=5</link>
		<atom:link href="http://forum.alexanderklimov.ru/extern.php?action=feed&amp;tid=5&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Hello Kitty - Создаем первое приложение для Android.]]></description>
		<lastBuildDate>Wed, 21 Apr 2021 12:07:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1189#p1189</link>
			<description><![CDATA[<p>К новому слову apply нужно привыкнуть. Поэтому не все его используют</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Wed, 21 Apr 2021 12:07:44 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1189#p1189</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1188#p1188</link>
			<description><![CDATA[<p>Ни у кого не вижу чтоб юзали apply {}, ведь так в коде гараздо меньше повторений</p><p>package com.alexeyyuditsky.helloworld</p><p>import androidx.appcompat.app.AppCompatActivity<br />import android.os.Bundle<br />import com.alexeyyuditsky.helloworld.databinding.ActivityMainBinding</p><p>class MainActivity : AppCompatActivity() {</p><p>&nbsp; &nbsp; private lateinit var binding: ActivityMainBinding</p><p>&nbsp; &nbsp; override fun onCreate(savedInstanceState: Bundle?) {<br />&nbsp; &nbsp; &nbsp; &nbsp; super.onCreate(savedInstanceState)<br />&nbsp; &nbsp; &nbsp; &nbsp; binding = ActivityMainBinding.inflate(layoutInflater)<br />&nbsp; &nbsp; &nbsp; &nbsp; setContentView(binding.root)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; binding.apply {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imageButton.setOnClickListener {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (editText.text.isEmpty()) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textView.text = &quot;Hello Kitty&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; textView.text = &quot;Привет ${editText.text}&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}</p>]]></description>
			<author><![CDATA[null@example.com (AlexeyYuditsky)]]></author>
			<pubDate>Wed, 21 Apr 2021 05:37:53 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1188#p1188</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1187#p1187</link>
			<description><![CDATA[<p>package ru.alexanderklimov.hellokot</p><p>import android.os.Bundle<br />import androidx.appcompat.app.AppCompatActivity<br />import ru.alexanderklimov.hellokot.databinding.ActivityMainBinding</p><br /><p>class MainActivity : AppCompatActivity() {<br />&nbsp; &nbsp; private lateinit var binding: ActivityMainBinding</p><p>&nbsp; &nbsp; override fun onCreate(savedInstanceState: Bundle?) {<br />&nbsp; &nbsp; &nbsp; &nbsp; super.onCreate(savedInstanceState)<br />&nbsp; &nbsp; &nbsp; &nbsp; binding = ActivityMainBinding.inflate(layoutInflater)<br />&nbsp; &nbsp; &nbsp; &nbsp; val view = binding.root<br />&nbsp; &nbsp; &nbsp; &nbsp; setContentView(view)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; binding.imageButton.setOnClickListener{<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (binding.editText.text.isEmpty()) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; binding.textView.setText(&quot;Hello Kitty&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; binding.textView.setText(&quot;Привет, &quot; + binding.editText.text)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}</p>]]></description>
			<author><![CDATA[null@example.com (starletovod)]]></author>
			<pubDate>Tue, 17 Nov 2020 12:26:44 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1187#p1187</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1186#p1186</link>
			<description><![CDATA[<p>Насколько я понял, в новой версии студии 4.1 этот способ признали устаревшим. Поэтому вам надо не добавлять эту строчку, а писать код по другому. К сожалению, я не могу угнаться за всеми изменениями и вносить исправления в статьи.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Mon, 16 Nov 2020 06:10:21 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1186#p1186</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1185#p1185</link>
			<description><![CDATA[<p>У меня Android Studio выдавал <span style="color: #FF0000">Unresolved reference: button</span> <br />button - это id моей кнопки</p><p>В статье прочитал:</p><div class="quotebox"><blockquote><p>Давайте разбираться. В build.gradle есть строчка <strong>apply plugin: &#039;kotlin-android-extensions&#039;</strong>, позволяющая автоматически получать доступ к компоненту через его идентификатор в ресурсах.</p></blockquote></div><br /><p>Я нашел это место, у меня было вот так:</p><div class="quotebox"><blockquote><p>plugins {<br />&nbsp; &nbsp; id &#039;com.android.application&#039;<br />&nbsp; &nbsp; id &#039;kotlin-android&#039;<br />}</p></blockquote></div><p>Т.е. без нужной строчки, я добавил ее:</p><div class="quotebox"><blockquote><p>plugins {<br />&nbsp; &nbsp; id &#039;com.android.application&#039;<br />&nbsp; &nbsp; id &#039;kotlin-android&#039;<br />&nbsp; &nbsp; id &#039;kotlin-android-extensions&#039;<br />}</p></blockquote></div><p>Потом сделал &quot;Sync now&quot; - и все заработало)</p>]]></description>
			<author><![CDATA[null@example.com (bibip)]]></author>
			<pubDate>Sun, 15 Nov 2020 17:11:07 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1185#p1185</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1169#p1169</link>
			<description><![CDATA[<p>Здесь всё в ваших руках. Пишите код для вывода картинки. И пишите код для вывода текста при нажатии на картинку. Думаю, вам нужно просто проходить уроки дальше и сами разберетесь, как реализовать свои задумки.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Mon, 16 Dec 2019 06:04:17 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1169#p1169</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1168#p1168</link>
			<description><![CDATA[<p>Добрый вечер! <br />Александр, спасибо за урок, все получилось, кроме одной вещи. Выводится картинка, а вместе с ней текст &quot;TextView&quot;, при нажатии на котенка текст меняется на &quot;Hello kitty!&quot;. Подскажите, пожалуйста, как сделать так, чтобы выводилась только картинка, а уже при нажатии на нее появлялся текст?</p>]]></description>
			<author><![CDATA[null@example.com (levebrains)]]></author>
			<pubDate>Sun, 15 Dec 2019 14:11:21 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1168#p1168</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1135#p1135</link>
			<description><![CDATA[<div class="quotebox"><cite>alexander.klimoff wrote:</cite><blockquote><p>...Вы видимо запускали телефон или эмулятор с ранней версией.</p></blockquote></div><p>У меня аппарат zero f highscreen 4&#039;&#039; Android 4.2. Виртуальный avd предварительно я настроил также. В общем, продолжаем изучать! <img src="http://forum.alexanderklimov.ru/img/smilies/smile.png" width="15" height="15" alt="smile" /> Спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (MonoLife)]]></author>
			<pubDate>Mon, 19 Nov 2018 11:47:41 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1135#p1135</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1134#p1134</link>
			<description><![CDATA[<p>По следам ваших сообщений. В важных свойствах scrCompat есть. v24 - картинка будет отображаться в устройствах с API 24 и выше. Вы видимо запускали телефон или эмулятор с ранней версией.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Mon, 19 Nov 2018 11:10:42 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1134#p1134</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1133#p1133</link>
			<description><![CDATA[<div class="quotebox"><cite>alexander.klimoff wrote:</cite><blockquote><p>Выделяем элемент ImageButton на форме и в панели свойств откроем только важные свойства, выбираем свойство srcCompat...</p></blockquote></div><p>Хм.. в важных свойствах srcCompat не нашел. Возможно в посследней версии АС его убрали.. В &quot;подробных&quot; - srcCompat есть. При вводе в это поле атрибутов картинки создается строка tools:srcCompat=...<br />В главных свойствах есть 2 строки с src (одна под другой). При заполнении их или одной из них аргументами с картинкой, приложение не запускается <img src="http://forum.alexanderklimov.ru/img/smilies/sad.png" width="15" height="15" alt="sad" /> Ошибок в логе при этом не наблюдаю.<br />---<br />Это какой-то глюк IDE. Удалил заново создал кнопку. Появились поля srcCompat. Тем не менее, приложение не запускается<br /></p><div class="codebox"><pre><code>&lt;ImageButton
        android:id=&quot;@+id/imageButton&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:layout_marginStart=&quot;8dp&quot;
        android:layout_marginTop=&quot;8dp&quot;
        android:layout_marginEnd=&quot;8dp&quot;
        android:layout_marginBottom=&quot;8dp&quot;
        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
        app:layout_constraintEnd_toEndOf=&quot;parent&quot;
        app:layout_constraintStart_toStartOf=&quot;parent&quot;
        app:layout_constraintTop_toTopOf=&quot;parent&quot;
        app:layout_constraintVertical_bias=&quot;0.292&quot;
        app:srcCompat=&quot;@drawable/pinkhellokitty&quot; /&gt;</code></pre></div><p>---<br />Взял картинку app:srcCompat=&quot;@mipmap/ic_launcher&quot; всё заработало. С Вашей картинкой не хочет. Вопрос: в панели файлов drawable/ отображается как pinkhellokitty.jpg (v24) Что такое v24?<br />---<br />Решено! Оказывается, при вставке изображения предлагается 2 вида: drawable и drawable24. Снова скопировал картинку в просто-drawable и все Ок!</p>]]></description>
			<author><![CDATA[null@example.com (MonoLife)]]></author>
			<pubDate>Mon, 19 Nov 2018 01:52:13 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1133#p1133</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1132#p1132</link>
			<description><![CDATA[<p>В статье всё есть. Просто делайте по шагам и тогда всё получится. Атрибут app:srcCompat, а не android:srcCompat. Прописывать вручную пока не нужно, всё можно сделать через окно свойств. Просто вы не там прописываете. android:src раньше точно работал, но возможно сейчас этот способ запретили, я не проверял (завтра проверю, по идее должно работать).</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Sun, 18 Nov 2018 14:09:17 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1132#p1132</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1131#p1131</link>
			<description><![CDATA[<p>При добавлении строки android:src=&quot;@drawable/pinkhellokitty&quot; приложение не запускается: ни на эмуляторе ни на устройстве (андроид 4.2)</p>]]></description>
			<author><![CDATA[null@example.com (MonoLife)]]></author>
			<pubDate>Sun, 18 Nov 2018 13:06:05 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1131#p1131</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1130#p1130</link>
			<description><![CDATA[<p><em>Вы не указали атрибут android:srcCompat.</em><br />ну.. во-первых в уроке об этом ничего нет, во-вторых, после добавления в строки в <br />&lt;ImageButton<br />&nbsp; &nbsp; &nbsp; &nbsp; android:srcCompat=&quot;@drawable/pinkhellokitty&quot; ...<br />компиляция не происходит куча ошибок <img src="http://forum.alexanderklimov.ru/img/smilies/sad.png" width="15" height="15" alt="sad" /> <br />..Android resource linking failed<br />Output:&nbsp; ../Android/AndroidStudioProjects/HelloWord/app/src/main/res/layout/activity_main.xml:10: error: attribute android:srcCompat not found.<br />error: failed linking file resources...<br />Если можете подсказать быстрое решение, буду признателен. Пока поковыряюсь сам. Спасибо.<br />ps: я добавил строку android:srcCompat.. в xml вручную</p>]]></description>
			<author><![CDATA[null@example.com (MonoLife)]]></author>
			<pubDate>Sun, 18 Nov 2018 12:46:16 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1130#p1130</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1129#p1129</link>
			<description><![CDATA[<p>Вы не указали атрибут android:srcCompat. У вас только атрибут tools:srcCompat, который предназначен для режима дизайна.</p>]]></description>
			<author><![CDATA[null@example.com (alexander.klimoff)]]></author>
			<pubDate>Sun, 18 Nov 2018 06:57:43 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1129#p1129</guid>
		</item>
		<item>
			<title><![CDATA[Re: Hello Kitty - Создаем первое приложение для Android]]></title>
			<link>http://forum.alexanderklimov.ru/viewtopic.php?pid=1128#p1128</link>
			<description><![CDATA[<p>Уважаемый автор! <br />Не могу понять причину, почему не отображается картинка в real time. В дизайне нормально.<br />&lt;ImageButton<br />&nbsp; &nbsp; &nbsp; &nbsp; android:id=&quot;@+id/imageButton&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width=&quot;130dp&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height=&quot;159dp&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; android:layout_marginStart=&quot;8dp&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; android:layout_marginTop=&quot;8dp&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; android:layout_marginEnd=&quot;6dp&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; android:layout_marginBottom=&quot;8dp&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; android:contentDescription=&quot;TODO&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; android:onClick=&quot;onClick&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; app:layout_constraintBottom_toTopOf=&quot;@+id/textView&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; app:layout_constraintHorizontal_bias=&quot;0.5&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; app:layout_constraintStart_toStartOf=&quot;parent&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; app:layout_constraintTop_toTopOf=&quot;parent&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; app:layout_constraintVertical_bias=&quot;0.25&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; tools:contentDescription=&quot;@string/app_name&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; tools:srcCompat=&quot;@drawable/pinkhellokitty&quot; /&gt;</p>]]></description>
			<author><![CDATA[null@example.com (MonoLife)]]></author>
			<pubDate>Sun, 18 Nov 2018 06:23:00 +0000</pubDate>
			<guid>http://forum.alexanderklimov.ru/viewtopic.php?pid=1128#p1128</guid>
		</item>
	</channel>
</rss>
