<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hour of Code &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/hour-of-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 02 Mar 2021 18:42:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Hour of Code: Xojo Dojo</title>
		<link>https://blog.xojo.com/2018/11/29/hour-of-code-xojo-dojo/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Thu, 29 Nov 2018 08:00:41 +0000</pubDate>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Hour of Code]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[Xojo Dojo]]></category>
		<category><![CDATA[Xojo IDE]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=5198</guid>

					<description><![CDATA[Today kicks off Computer Science Education Week 2018! Alongside this is the Hour of Code promotion where schools throughout the world get students to try at least 1 hour of programming at some point during the week. This year I plan to demonstrate Xojo Dojo with a Raspberry Pi and show the kids how much fun coding can be.]]></description>
										<content:encoded><![CDATA[<p>December 3rd kicks off <a href="https://csedweek.org">Computer Science Education Week 2018</a>! Computer Science Education Week is held in early December every year in recognition of the birthday of computing pioneer <a href="https://en.wikipedia.org/wiki/Grace_Hopper">Admiral Grace Hopper</a>. Alongside this is the <a href="https://hourofcode.com/us">Hour of Code promotion</a> where schools throughout the world get students to try at least 1 hour of programming at some point during the week.</p>
<p>Each year for Hour of Code, I volunteer at the local Middle School to talk to the students about what it is like to be a programmer and do a little bit of programming. This year I plan to demonstrate <a href="https://gitlab.com/xojo/XojoDojo">Xojo Dojo</a> with a Raspberry Pi and show the kids how much fun coding and Xojo programming can be.</p>
<p><span id="more-5198"></span></p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-medium" src="https://documentation.xojo.com/images/b/b2/Xojo_Dojo.png" width="1195" height="758" /></p>
<p>My wife teaches 7th grade math so I have a somewhat receptive audience, at least when it comes to middle school students. Of course, I&#8217;ll be sure to show off a few games made with Xojo. <a href="https://blog.xojo.com/2017/12/05/hour-of-code-2017/">Asteroid Run</a> was popular last year.</p>
<p>As Xojo developers you have a great perspective on coding, which would be wonderful to share with the youth of today. Most schools would absolutely welcome a guest speaker for a day so if you have a child in school or know someone that works at a school, I encourage you to see if you can help out by volunteering.</p>
<p>Looking for ideas? Here&#8217;s what we&#8217;ve done for the Hour of Code in past years:</p>
<ul>
<li><a href="https://blog.xojo.com/2013/12/12/hour-of-code-math-facts/">Hour of Code 2013: Math Facts</a></li>
<li><a href="https://blog.xojo.com/2013/12/11/hour-of-code-spelling-test/">Hour of Code 2013: Spelling Test</a></li>
<li><a href="https://blog.xojo.com/2013/12/19/hour-of-code-recap/">Hour of Code 2013: Recap</a></li>
<li><a href="https://youtu.be/Y3HYu_QN614">Hour of Code 2014: iOS Doodle</a></li>
<li><a href="https://blog.xojo.com/2014/12/19/hour-of-code-2014/">Hour of Code 2014 Recap</a></li>
<li><a href="https://blog.xojo.com/2015/12/07/hour-of-code-cat-pictures/">Hour of Code 2015: Cat Pictures</a></li>
<li><a href="https://blog.xojo.com/2017/12/05/hour-of-code-2017/">Hour of Code 2017: Asteroid Run</a></li>
</ul>
<p><strong>Update (Dec 5, 2018)</strong>:</p>
<p>Finished hour of code with 7th Grade students. They were very excited to learn a bit about coding and see some Xojo-made games.</p>
<p><img decoding="async" class="alignnone wp-image-5219" src="https://blog.xojo.com/wp-content/uploads/2018/11/Paul1.png" alt="" width="600" height="450" /></p>
<p><img decoding="async" class="alignnone wp-image-5220" src="https://blog.xojo.com/wp-content/uploads/2018/11/Paul2.png" alt="" width="600" height="450" /></p>
<p>Also, Xojo Dojo is now available for Mac and Windows. Download either of these from the <a href="http://documentation.xojo.com/getting_started/creating_more_apps/raspberry_pi/xojo_dojo.html">main Xojo Dojo page</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Asteroid Run: Xojo&#8217;s Hour of Code 2017</title>
		<link>https://blog.xojo.com/2017/12/05/hour-of-code-2017/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Tue, 05 Dec 2017 18:42:22 +0000</pubDate>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Hour of Code]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=3586</guid>

					<description><![CDATA[It's Computer Science Education Week, which also means it's time for Code.org's Hour of Code. I've put together a short 5-part series of videos (less than 25 minutes total) to show how to make a simple game in Xojo called Asteroid Run. It's super fun so give it a shot!]]></description>
										<content:encoded><![CDATA[<p>It&#8217;s Computer Science Education Week, which also means it&#8217;s time for <a href="https://code.org">Code.org&#8217;s Hour of Code</a>.</p>
<p>To share Xojo with Hour of Code, I&#8217;ve put together a short 5-part series of videos (less than 25 minutes total) to show how to make a simple game called Asteroid Run.</p>
<p><span id="more-3586"></span></p>
<p>In Asteroid Run a spaceship flies through space shooting an ever-increasing number of asteroids that are coming at you.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3593" src="https://blog.xojo.com/wp-content/uploads/2017/12/AsteroidRun.gif" alt="" width="600" height="572" /></p>
<p>To get started, <a href="http://www.xojo.com/download">download Xojo &#8211; it&#8217;s free!</a></p>
<h2>Asteroid Run Part 1: Initial Setup</h2>
<p>In part 1 you will do initial setup and add a scrolling background starfield.</p>
<p><a href="http://files.xojo.com/HourOfCode/AsteroidRun-Part1.zip">Download project</a></p>
<p><iframe loading="lazy" title="Asteroid Run Part 1: Initial Setup" width="500" height="281" src="https://www.youtube.com/embed/avwgV1RpIP8?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<h2>Asteroid Run Part 2: Add Spaceship</h2>
<p>In part 2, you will add the spaceship and allow it to move with the mouse.</p>
<p><a href="http://files.xojo.com/HourOfCode/AsteroidRun-Part2.zip">Download project</a></p>
<p><iframe loading="lazy" title="Asteroid Run Part 2: Add Spaceship" width="500" height="281" src="https://www.youtube.com/embed/kpEgJ4o7_30?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<h2>Asteroid Run Part 3: Add Missiles</h2>
<p>In part 3, you will add the missiles that are fired from the spaceship when you click the mouse.</p>
<p><a href="http://files.xojo.com/HourOfCode/AsteroidRun-Part3.zip">Download project</a></p>
<p><iframe loading="lazy" title="Asteroid Run Part 3: Add Missiles" width="500" height="281" src="https://www.youtube.com/embed/_1Dz200fYmU?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<h2>Asteroid Run Part 4: Add Asteroids</h2>
<p>In part 4, you will add the asteroids and make the game end when an asteroid hits the spaceship.</p>
<p><a href="http://files.xojo.com/HourOfCode/AsteroidRun-Part4.zip">Download project</a></p>
<p><iframe loading="lazy" title="Asteroid Run Part 4: Adding Asteroids" width="500" height="281" src="https://www.youtube.com/embed/IgimObt1sxo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<h2>Asteroid Run Part 5: Finish the Game</h2>
<p>In part 5, you will finish the game by making the ship&#8217;s missiles destroys the asteroids for points.</p>
<p><a href="http://files.xojo.com/HourOfCode/AsteroidRun-Final.zip">Download finished project</a></p>
<p><iframe loading="lazy" title="Asteroid Run Part 5: Finish the Game" width="500" height="281" src="https://www.youtube.com/embed/pZuUn7QRa44?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>End your Summer with Xojo</title>
		<link>https://blog.xojo.com/2016/08/09/summertime-fun-learn-to-code/</link>
					<comments>https://blog.xojo.com/2016/08/09/summertime-fun-learn-to-code/#comments</comments>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Tue, 09 Aug 2016 07:36:07 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Beginner Tips]]></category>
		<category><![CDATA[Citizen Developer]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hour of Code]]></category>
		<category><![CDATA[Intro to Xojo Programming Textbook]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=1505</guid>

					<description><![CDATA[Coding teaches you skills that are valuable even if you aren't a professional software developer. ]]></description>
										<content:encoded><![CDATA[<p>My kids both recently finished their summer band camps. My son plays the trombone and my daughter plays the saxophone and trumpet. As one of the instructors at band camp said, even if you don’t take up a career in music, learning and playing music exercises important parts of your brain that are useful for learning other things. In fact, some have wondered if <a href="http://www.livescience.com/51370-does-music-give-you-math-skills.html">learning music helps with math skills</a>.</p>
<p>I think the same thing can be said about coding. In fact, there is <a href="http://psycnet.apa.org/psycinfo/1992-07098-001">research</a> that found students with computer programming skills <a href="http://psycnet.apa.org/psycinfo/1992-07098-001">scored higher on cognitive ability</a> tests than students without any programming skills. <strong>Coding teaches you skills that are valuable</strong> even if you don&#8217;t plan on being a professional software developer. Being able to code means utilizing incredible attention to detail and thinking about problems abstractly, useful skills for anyone &#8211; <strong>student or professional</strong>.</p>
<p>Remember, Summertime isn&#8217;t just an opportunity for the kids to learn new things. You&#8217;ve still got a month of Summer left, plenty of time to expand your own skill set. While the kids are at band camp or swim camp <strong>send yourself to programming camp from the comfort of your air-conditioned home</strong>.</p>
<p><span id="more-1505"></span><strong>Why not end your Summer with Xojo?</strong></p>
<p>It can be pretty empowering to <strong>create your own apps and tools</strong> that help you be more productive. In fact, many people who use Xojo do exactly that. These people are referred to as “<a href="http://blog.xojo.com/2015/11/19/the-citizen-developer/">citizen developers</a>” and they are a growing part of the workforce.</p>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1576" src="https://blog.xojo.com/wp-content/uploads/2016/08/Xojo-Summer_trimmed.png" alt="Learn to code with xojo" width="584" height="390" /></p>
<p>I know many of you are probably thinking: “I don’t have time to learn to code.” Well, here&#8217;s the thing. Learning Java is definitely lots of work, and not much fun, at least in my opinion. But learning Xojo? Now that is fun and <strong>you really can do it before this Summer is gone!</strong></p>
<p>If you don’t have coding experience or are still a beginner, the best way to learn to code is to start with the free <a href="http://www.xojo.com/learn">Introduction to Programming with Xojo book</a>. This book teaches you how to code as you work through creating many <strong>small, fun example apps.</strong></p>
<p>This book is also available in the <a href="https://itunes.apple.com/us/book/introduction-to-programming/id670341620?mt=11">iTunes Book Store</a>, if that fits how you read better.</p>
<p><strong>If you spend an hour a night on the book, you&#8217;ll finish it before this month is over. </strong>And the best part about learning to code? Once you learn how to code in one language, you can more easily learn other languages because the concepts behind most programming languages are incredibly similar. So whether you are a student or a professional, improve your skill set and learn to code before this Summer is gone!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.xojo.com/2016/08/09/summertime-fun-learn-to-code/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Hour of Code: Cat Pictures</title>
		<link>https://blog.xojo.com/2015/12/07/hour-of-code-cat-pictures/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Mon, 07 Dec 2015 00:00:00 +0000</pubDate>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cats]]></category>
		<category><![CDATA[Hour of Code]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2015/12/07/hour-of-code-cat-pictures/</guid>

					<description><![CDATA[In Hour of Code for 2015, learn how to make an iOS app that shows fun cat pictures.]]></description>
										<content:encoded><![CDATA[<p>It&#8217;s time again for <a href="https://code.org/">Hour of Code</a>! The Hour of Code is a global movement reaching tens of millions of students in 180+ countries. Anyone, anywhere can participate in Hour of Code, from ages 4 to 104. At Xojo, we are again participating in this wonderful way to help people learn to program.</p>
<p><span id="more-283"></span></p>
<h2>Catsup</h2>
<p>In this tutorial, you&#8217;ll learn how to create an iOS app that displays random cat pictures, which I call &#8220;Catsup&#8221;. Meow!</p>
<p>To get started, you&#8217;ll need the following:</p>
<ul>
<li>A Mac with OS X 10.7 or later. Creating iOS apps requires OS X.</li>
<li><a href="http://xojo.com/download/" target="_blank">Xojo</a> (the free version works for this tutorial)</li>
<li><a href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12">Xcode</a> (for the iOS Simulator, which is part of the installation)</li>
</ul>
<p>Download and install Xojo and then download and install Xcode from the <a href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12">App Store</a>. After Xcode is installed, you&#8217;ll need to run it once to accept its license agreement and allow it to finish the installation. After that you can quit Xcode; you will not need it again.</p>
<p>Start Xojo and in the Project Chooser window that appears click on iOS and in the Application Name field, enter the name for you app (&#8220;CatsUp&#8221;) and click OK.</p>
<p><img loading="lazy" decoding="async" title="ProjectChooser.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/ProjectChooser.pngt1466486449161ampwidth578ampheight319" sizes="auto, (max-width: 578px) 100vw, 578px" alt="ProjectChooser.png" width="578" height="319" /></p>
<p>This displays the Xojo main Workspace where you will create your app. In the Workspace, View1 is selected by default. This is where you will design the layout (aka user interface or UI) for you app. You do this using simple drag and drop. You&#8217;ll drag controls from the Library area on the right onto the layout area in the center.</p>
<p>Since this is your first app, it is pretty simple. You&#8217;ll only need two controls: an ImageView and a Button.</p>
<p>First, find the ImageView in the Library (on the right) and drag it onto the View in the center. Place the ImageView near the top of the area and resize it so that it uses about 3/4 of the space. It should look something like this:</p>
<p><img loading="lazy" decoding="async" title="ImageViewLayout.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/ImageViewLayout.pngt1466486449161ampwidth578ampheight390" sizes="auto, (max-width: 578px) 100vw, 578px" alt="ImageViewLayout.png" width="578" height="390" /></p>
<p>Now you can drag a button from the Library onto the layout. Place the button near the bottom of the layout and center it. Your layout should now look like this:</p>
<p><img loading="lazy" decoding="async" title="ButtonLayout.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/ButtonLayout.pngt1466486449161ampwidth578ampheight390" sizes="auto, (max-width: 578px) 100vw, 578px" alt="ButtonLayout.png" width="578" height="390" /></p>
<p>Now you need to clean up the layout a bit to prepare for writing code later. When writing code, it is helpful to have descriptive names for things so that your code makes more sense when you read it. The ImageView and the Button you added to the layout were just given default names of ImageView1 and Button1, which is not all that descriptive and certainly doesn&#8217;t make their purpose clear. So you should rename them.</p>
<p>Click on the ImageView in the layout and then in the toolbar at the top of the window, click the Inspector button. This displays the &#8220;properties&#8221; for the ImageView on the right side in what is called the Inspector. A property is a specific detail about something. For example, a property of the sky is that it is blue. As you can see, an ImageVIew has several property values that you can change. The first one to change is the &#8220;Name&#8221; property.</p>
<p>Click in the field next to Name and change its text from &#8220;ImageView&#8221; to something more descriptive, such as &#8220;CatImage&#8221;. Since you are making property changes with the Inspector, this is also a good time to change another property to make the pictures display better. Change the ContentMode property (using the dropdown) from &#8220;ScaleToFill&#8221; to &#8220;ScaleAspectFill&#8221;. What is the difference you ask? ScaleToFill just enlarges (or shrinks) the picture so that it uses all the space in the ImageView. But this can result is weird stretching of cat pictures, making cats appear fatter or skinnier. Of course, maybe you might prefer that! With &#8220;ScaleAspectFill&#8221;, the picture will be enlarged or shrunk as necessary to fit the space in the ImageView, but the proportions of the picture will remain the same. This might the picture might not use all the available space, but it will look the way it is supposed to, without scary resizing.</p>
<p>The Properties for the ImageView should now look like this:</p>
<p><img decoding="async" title="ImageViewProperties2.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/ImageViewProperties2.pngt1466486449161" alt="ImageViewProperties2.png" /></p>
<p>Now click on the Button to change its properties. You will not be referring to the Button in code, so you don&#8217;t <em>have</em> to change its name, but I like to change it anyway to better describe its purpose. This may be a simple project, but it is a good habit to get into doing and is especially important when projects get more sophisticated.</p>
<p>Change the name of the Button from &#8220;Button1&#8221; to &#8220;ShowCatPictureButton&#8221;. You might also have noticed that the button Caption says &#8220;Untitled&#8221;. That is not helpful. How will the user know what happens when they click it? So you also need to change the Caption property text from &#8220;Untitled&#8221; to something like &#8220;Show a Cat&#8221;.</p>
<p>The Properties for the Button should now look like this:</p>
<p><img loading="lazy" decoding="async" title="ButtonProperties.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/ButtonProperties.pngt1466486449161ampwidth349ampheight423" sizes="auto, (max-width: 349px) 100vw, 349px" alt="ButtonProperties.png" width="349" height="423" /></p>
<p><em>Even though you haven&#8217;t yet written any code, you have already created an app.</em> Sure, the app doesn&#8217;t technically do anything, but you can at least run it to take at look at how your user interface (UI) looks in the iOS Simulator. To do so, click the big &#8220;Run&#8221; button on the toolbar at the top of the window. This creates your app and runs it on the iOS Simulator. It should look like this:</p>
<p><img decoding="async" style="width: 320px;" title="Catsup2.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/Catsup2.pngt1466486449161ampwidth320" sizes="(max-width: 320px) 100vw, 320px" alt="Catsup2.png" width="320" /></p>
<p>That&#8217;s not all that interesting, so now it is time to start adding some code to actually get cat pictures and display them!</p>
<p>Your app will get pictures from the Internet using a web site called <a href="http://thecatapi.com/">TheCatAPI</a>. This website gives you a different cat picture each time you call it. The process for your app will be to call the web site (using a special URL for accessing its &#8220;web service&#8221;) when the button is clicked and then display the picture using the CatImage control after it is received.</p>
<p>Xojo uses an object-oriented programming language, which means that you create things (aka objects) to contain information or perform actions. In order to get a cat picture from the Internet, you need an object that can connect to the Internet and receive information as needed.  In Xojo, this is called an HttpSocket.</p>
<p>HttpSocket is a class that is built-in to Xojo. A class is essentially an object definition. With this information, you can now add an object to your view and tell it to use HttpSocket as it definition.</p>
<p><strong>But before you proceed here is a public service announcement:</strong> Now is a good time to make sure you save your project. Just like when writing a document in a word processor, you should always save your work often so that you don&#8217;t lose changes in case something bad happens, such as a power failure or an system crash. In the File menu, select Save As and save your project somewhere on the computer, such as the Desktop or Documents folder.</p>
<p>Back in Xojo, you&#8217;ll want to click the Library button on the toolbar to show the list of Library controls. You&#8217;ll want to drag the &#8220;Generic Object&#8221; control from the Library onto the layout area of the view. Since a Generic Object is not an actual UI control, it will not appear within the View, but will instead appear at the bottom (the Shelf).</p>
<p><img loading="lazy" decoding="async" title="GenericObjectLayout2.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/GenericObjectLayout2.pngt1466486449161ampwidth578ampheight435" sizes="auto, (max-width: 578px) 100vw, 578px" alt="GenericObjectLayout2.png" width="578" height="435" /></p>
<p>Now click on Generic Object and then click the Inspector button on the toolbar to show its properties. You need to give it a better name and tell it to use the HttpSocket class. Change the Name property to &#8220;CatConnector&#8221; since this object will be responsible for connecting to the Internet to get cat pictures.</p>
<p>Change the Super property to &#8220;Xojo.Net.HttpSocket&#8221;. This tells the the object that it is based on the HttpSocket, which exposes the capabilities to connect to the Internet and receive information.</p>
<p><img loading="lazy" decoding="async" title="SocketProperties.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/SocketProperties.pngt1466486449161ampwidth351ampheight93" sizes="auto, (max-width: 351px) 100vw, 351px" alt="SocketProperties.png" width="351" height="93" /></p>
<p>(Now is a good time to save your project.)</p>
<p>It time to add the first bit of code that displays the picture that was received. Right-click on the CatConnector object in the Shelf and select &#8220;Add to CatConnector&#8221; in the menu, from the submenu select &#8220;Event Handler&#8221;. This displays the Event Handler window.</p>
<p>In addition to being object-oriented, Xojo is event-based. Events are actions that occur when something happens in your app, such as the user tapping on the UI or data being received from the Internet.</p>
<p>In the list of event handlers, you want to click the PageReceived and then click the OK button to add the event handler to the CatConnector. The PageReceived event handler is what is called when the picture is received from the web site.</p>
<p>If you look back at the CatConnector in the Navigator on the left, you&#8217;ll now see that &#8220;PageReceived&#8221; is displayed below it. This is where you will put the code to display the picture.</p>
<p><img loading="lazy" decoding="async" title="SocketPageReceived.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/SocketPageReceived.pngt1466486449161ampwidth198ampheight81" sizes="auto, (max-width: 198px) 100vw, 198px" alt="SocketPageReceived.png" width="198" height="81" /></p>
<p>Click on &#8220;PageReceived&#8221; to display the Code Editor where you can enter this code:</p>
<pre>Dim catPic As iOSImage = iOSImage.FromData(Content)
CatImage.Image = catPic
ShowCatPictureButton.Enabled = True</pre>
<p>This code converts the data received by the CatConnector to an Image, then tells the CatImage control to display it and enables the button so you can request another picture.</p>
<p>Speaking of the button, the last bit of code to add is to actually request a cat picture from the web site, which is what the button is for. Double-click on the button to display the Add Event Handler window. The Action event handler is what gets called when the button is tapped, so click on that and then click the OK button.</p>
<p><img loading="lazy" decoding="async" title="ButtonEvents.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/ButtonEvents.pngt1466486449161ampwidth578ampheight310" sizes="auto, (max-width: 578px) 100vw, 578px" alt="ButtonEvents.png" width="578" height="310" /></p>
<p>This adds an Action event handler to ShowCatPictureButton. Click on the Action event in the Navigator on the left.</p>
<p><img loading="lazy" decoding="async" title="ButtonAction.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/ButtonAction.pngt1466486449161ampwidth209ampheight140" sizes="auto, (max-width: 209px) 100vw, 209px" alt="ButtonAction.png" width="209" height="140" /></p>
<p>This displays the code editor where you can add this code to request a cat picture:</p>
<pre>CatConnector.Send("GET", "http://thecatapi.com/api/images/get")
Me.Enabled = False</pre>
<p>The CatConnector.Send line of code is requesting a cat picture from the web site. The second line of code disables the button so that you cannot request another picture until the first one is received.</p>
<p>That is it for code. Now is a great time to save your project.</p>
<p>And now you can Run it. The finished app will display a new cat picture each time you click the button.</p>
<p><img loading="lazy" decoding="async" title="Catsup-Finished.png" src="https://blog.xojo.com/wp-content/uploads/2015/12/Catsup-Finished.pngt1466486449161ampwidth484ampheight746" sizes="auto, (max-width: 484px) 100vw, 484px" alt="Catsup-Finished.png" width="484" height="746" /></p>
<p>Here is the completed project: <a href="http://files.xojo.com/BlogExamples/CatsUpHourOfCode.xojo_binary_project.zip">Catsup</a></p>
<p>Now that you&#8217;ve created your first, fun app, it&#8217;s time for you to try to modify it a bit on your own.</p>
<p>Here are some additional things you can add to Catsup:</p>
<ul>
<li>Easy: Increase the size of the Button text and maybe change its font and color.</li>
</ul>
<ul>
<li>Play around with different values for the Button properties to change its color, font and size. Be sure to click the &#8220;Gear&#8221; button on the Inspector to see additional properties.</li>
</ul>
<p>&nbsp;</p>
<ul>
<li>Medium: Play a &#8220;Meow!&#8221; sound when a new picture is displayed.
<ul>
<li>Find a &#8220;Meow&#8221; MP3 sound on the Internet and drag it in the Navigator (on the left) of you project.</li>
<li>Use the name of the sound in the project followed by &#8220;.Play&#8221; to play the sound when the picture is displayed.</li>
</ul>
</li>
<li>Harder: Save the picture to the Camera Roll.
<ul>
<li>Store the picture in a property when it is received. Refer to <a href="http://developer.xojo.com/properties-methods-and-events$Properties">Properties</a> in the Xojo User Guide.</li>
<li>Add a Save button to the Navigation Bar. Refer to <a href="http://developer.xojo.com/ios-toolbars">Toolbars</a> in the Xojo User Guide for tips.</li>
<li>When the Save button is pressed, save the picture to the Camera Roll. Refer to Toolbars in the Xojo User Guide to determine when the button was pressed.</li>
<li>You&#8217;ll need to call the Apple iOS library to save to the Camera Roll with this code:</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<pre>Declare Sub UIImageWriteToSavedPhotosAlbum Lib "UIKit" ( _
  img As Ptr, target As Ptr, sel As Ptr, info As Ptr)
UIImageWriteToSavedPhotosAlbum(CatImageProperty.Handle, _
  Nil, Nil, Nil)
</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How Does Xojo Do #CodeDay?</title>
		<link>https://blog.xojo.com/2014/05/16/how-does-xojo-do-codeday/</link>
		
		<dc:creator><![CDATA[Xojo]]></dc:creator>
		<pubDate>Fri, 16 May 2014 00:00:00 +0000</pubDate>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Hour of Code]]></category>
		<category><![CDATA[Women in Tech]]></category>
		<category><![CDATA[Xojo IDE]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2014/05/16/how-does-xojo-do-codeday/</guid>

					<description><![CDATA[How Does Xojo Do #CodeDay?]]></description>
										<content:encoded><![CDATA[<p>Despite our best efforts here at Xojo, everyday can&#8217;t be #CodeDay! So we figure we better go all out for the <a href="http://codeday.org/">first official, national Code Day</a>! Saturday, May 24th, we want to help you join thousands of students in 24 cities across America celebrate technology, share ideas and build cool apps!</p>
<p><span id="more-121"></span></p>
<p>We&#8217;d love if you showed up ready to have some fun and learn something new at your local Code Day event with your new Xojo license! Starting Monday, May 19th and running through Sunday May 25th we&#8217;re offering students and teachers 30% off new Xojo licenses! Simply send me an email at custserv@xojo.com using your academic email address or include a picture of your current student ID and I&#8217;ll send you a coupon code for 30% off any new Xojo license! And don&#8217;t forget about Xojo&#8217;s free <a href="http://www.xojo.com/learn/">Introduction to Programming</a> textbook and our new <a href="http://www.xojo.com/learn/">Teacher&#8217;s Guide</a>!</p>
<p>Code Day is a special event, and this is the first time it will be celebrated across the United States. Please share this post and help spread the word about #CodeDay and codeday.org, let&#8217;s grow the Xojo community and encourage more coding across the world! Like they say at code.org, &#8220;Build something awesome in 24 hours!&#8221;</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
