<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Mobile_App_Development_2021W_Lecture_20</id>
	<title>Mobile App Development 2021W Lecture 20 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Mobile_App_Development_2021W_Lecture_20"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_20&amp;action=history"/>
	<updated>2026-04-24T00:39:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_20&amp;diff=23108&amp;oldid=prev</id>
		<title>Soma at 19:48, 29 March 2021</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_20&amp;diff=23108&amp;oldid=prev"/>
		<updated>2021-03-29T19:48:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:48, 29 March 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Video==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Video==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video from the lecture given on March 29, 2021 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;may be corrupted&lt;/del&gt;.  &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If the video is successfully converted it will be posted here&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video from the lecture given on March 29, 2021 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[https://homeostasis.scs.carleton.ca/~soma/mad-2021w/lectures/comp1601-2021w-lec20-20210329.m4v is now available]&lt;/ins&gt;.  &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Note that this recording ends a bit abruptly and early as there were technical issues&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_20&amp;diff=23107&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lecture given on March 29, 2021 may be corrupted.  If the video is successfully converted it will be posted here.  ==Notes==  &lt;pre&gt; Lecture 20 ------...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_20&amp;diff=23107&amp;oldid=prev"/>
		<updated>2021-03-29T18:27:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture given on March 29, 2021 may be corrupted.  If the video is successfully converted it will be posted here.  ==Notes==  &amp;lt;pre&amp;gt; Lecture 20 ------...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
Video from the lecture given on March 29, 2021 may be corrupted.  If the video is successfully converted it will be posted here.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 20&lt;br /&gt;
----------&lt;br /&gt;
&lt;br /&gt;
* Tutorial 8 is finally posted&lt;br /&gt;
  - will be finalized this afternoon&lt;br /&gt;
&lt;br /&gt;
* Tutorial 9 will come out by next Monday&lt;br /&gt;
&lt;br /&gt;
* Assignment 4 will be due still on April 12&lt;br /&gt;
  - will come out this week, hopefully by Wednesday&lt;br /&gt;
  - will give away answers in class&lt;br /&gt;
&lt;br /&gt;
* No Tutorial 10 (schedule will be updated)&lt;br /&gt;
&lt;br /&gt;
* Final exam on April 23, 2 PM&lt;br /&gt;
  - same format as the midterm, just 2 hours instead of 80 min&lt;br /&gt;
&lt;br /&gt;
* Solutions for A3 will be posted on Wednesday&lt;br /&gt;
  - turn in by Tuesday night if you haven&amp;#039;t already&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Kotlin is a bit funny about numbers&lt;br /&gt;
 - it does NO automatic conversions&lt;br /&gt;
 - a number with no decimals is an Int&lt;br /&gt;
 - a number with decimals is a Double&lt;br /&gt;
 - but then, how do you write a Float as a constant?&lt;br /&gt;
    - append with an F&lt;br /&gt;
&lt;br /&gt;
Floats vs Doubles&lt;br /&gt;
 - floats use 4 bytes, doubles use 8 bytes&lt;br /&gt;
 - so, doubles allow for much greater precision&lt;br /&gt;
    - larger exponent and mantissa&lt;br /&gt;
 - both are binary representations of numbers in&lt;br /&gt;
   scientific notation&lt;br /&gt;
&lt;br /&gt;
Android intents &amp;amp; activities go together&lt;br /&gt;
 - intents are messages to an app to do something&lt;br /&gt;
 - activities are screens that can be displayed in response to intents&lt;br /&gt;
    - an intent doesn&amp;#039;t have to cause a screen to be&lt;br /&gt;
      displayed, but if you want to display a new screen&lt;br /&gt;
      (including the first one), it will start with an&lt;br /&gt;
      intent&lt;br /&gt;
&lt;br /&gt;
 - so, to switch screens we generate and receive intents&lt;br /&gt;
 - also, to call outside apps, we send intents&lt;br /&gt;
&lt;br /&gt;
Intents have two kinds: explicit and implicit&lt;br /&gt;
 - explicit specifies exactly what to do&lt;br /&gt;
 - implicit allows the receiver to interpret,&lt;br /&gt;
   may even be receivable by multiple apps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&lt;br /&gt;
Below is the layout created during class.  The app was just the default Kotlin hello world (empty activity).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
    xmlns:app=&amp;quot;http://schemas.android.com/apk/res-auto&amp;quot;&lt;br /&gt;
    xmlns:tools=&amp;quot;http://schemas.android.com/tools&amp;quot;&lt;br /&gt;
    android:layout_width=&amp;quot;match_parent&amp;quot;&lt;br /&gt;
    android:layout_height=&amp;quot;match_parent&amp;quot;&lt;br /&gt;
    tools:context=&amp;quot;.MainActivity&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;TextView&lt;br /&gt;
        android:id=&amp;quot;@+id/valueLabel&amp;quot;&lt;br /&gt;
        android:layout_width=&amp;quot;wrap_content&amp;quot;&lt;br /&gt;
        android:layout_height=&amp;quot;wrap_content&amp;quot;&lt;br /&gt;
        android:layout_marginEnd=&amp;quot;33dp&amp;quot;&lt;br /&gt;
        android:layout_marginBottom=&amp;quot;215dp&amp;quot;&lt;br /&gt;
        android:text=&amp;quot;Value&amp;quot;&lt;br /&gt;
        app:layout_constraintBottom_toBottomOf=&amp;quot;parent&amp;quot;&lt;br /&gt;
        app:layout_constraintEnd_toStartOf=&amp;quot;@+id/value&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;EditText&lt;br /&gt;
        android:id=&amp;quot;@+id/value&amp;quot;&lt;br /&gt;
        android:layout_width=&amp;quot;wrap_content&amp;quot;&lt;br /&gt;
        android:layout_height=&amp;quot;wrap_content&amp;quot;&lt;br /&gt;
        android:layout_marginEnd=&amp;quot;74dp&amp;quot;&lt;br /&gt;
        android:ems=&amp;quot;8&amp;quot;&lt;br /&gt;
        android:inputType=&amp;quot;numberDecimal&amp;quot;&lt;br /&gt;
        app:layout_constraintBaseline_toBaselineOf=&amp;quot;@+id/valueLabel&amp;quot;&lt;br /&gt;
        app:layout_constraintEnd_toEndOf=&amp;quot;parent&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/androidx.constraintlayout.widget.ConstraintLayout&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>