<?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>Console &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/console/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, 09 Dec 2025 16:29:34 +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>Checking Out Xojo Libraries</title>
		<link>https://blog.xojo.com/2025/12/09/checking-out-xojo-libraries/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Tue, 09 Dec 2025 16:29:31 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[2025r3]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[Libraries]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=15569</guid>

					<description><![CDATA[The ability to create a compiled Library with Xojo has been a long-requested feature. Starting with 2025 Release 3, Library support is now available as&#8230;]]></description>
										<content:encoded><![CDATA[
<p>The ability to create a compiled Library with Xojo has been a long-requested feature. Starting with 2025 Release 3, Library support is now available as a preview. Here’s more information about what it is and how you can use it.</p>



<h2 class="wp-block-heading">What is a Library?</h2>



<p>A Library is a collection of pre-written, reusable code containing methods, classes and UI.&nbsp;Up until now, the way to distribute a Library for use with Xojo was to create a Plugin or to manually re-use project items across projects. Both have pros and cons.</p>



<p>Plugins are compiled and do not expose source code, but plugins cannot be created using Xojo itself and are typically created using C/C++ along with the Xojo Plugin SDK. Sharing project items is fine for internal projects or open-source projects, but less ideal for commercial libraries. They can be harder to manually add to a project and are recompiled along with the project, slowing the debug process.</p>



<p>With a Xojo Library, you can now create your own compiled Library using Xojo itself. This Library can contain nearly any Xojo project item and can be easily used in other Xojo projects because it is distributed as a single file.</p>



<p>At a high-level, you create your Library in Xojo, add your project items to it and built it into a Library package file. Other projects can then use this Library package, which gives them access to the items you included in the Library.</p>



<h2 class="wp-block-heading">Creating a Library</h2>



<p>Here is a brief overview of how you create a Xojo Library:</p>



<ol class="wp-block-list">
<li>In a Desktop, Web, Console or iOS project add a Library by choosing Insert-&gt;Library.</li>



<li>Add the project items you want to the Library. Any Xojo project item is supported, except for Worker.</li>



<li>Build the project. It will build the main app (which should serve as a test app for your Library) and a separate Library package file (with extension .xojo_library).</li>



<li>You can put this Library package alongside another project (on the drive) and it will be loaded when that project is opened by Xojo. You can then use the classes, methods and UI contained in the Library within your project. If you instead put the Library in the Plugins folder, then it will be available for all projects.</li>
</ol>



<p>This is all best demonstrated by a quick example. Go ahead and create a Desktop project and add a Library to it, which adds a Library1 project item to the Navigator. Change its name using the Inspector to LibHello.</p>



<p>While LibHello is selected, choose Insert-&gt;Class. This adds Class1 to it. This new class is now part of the Library. With Class1 selected, change its name to StringStuff.</p>



<p>You can now add whatever methods or properties you want to the class. For our example purposes here we will add a simple method that reverses a string.</p>



<pre class="wp-block-code"><code>Public Function ReverseString(s As String) As String
  Var newString As String
  
  For Each c As String In s.Characters
    newString = c + newString
  Next
  
  Return newString
End Function</code></pre>



<p>The Library could contain many other things of course, but to keep things simple this Library will have just the single class with its single method. Here&#8217;s what it looks like in the project:</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="311" src="https://blog.xojo.com/wp-content/uploads/2025/11/CleanShot-2025-11-25-at-10.13.55@2x-1024x311.png" alt="" class="wp-image-15570" srcset="https://blog.xojo.com/wp-content/uploads/2025/11/CleanShot-2025-11-25-at-10.13.55@2x-1024x311.png 1024w, https://blog.xojo.com/wp-content/uploads/2025/11/CleanShot-2025-11-25-at-10.13.55@2x-300x91.png 300w, https://blog.xojo.com/wp-content/uploads/2025/11/CleanShot-2025-11-25-at-10.13.55@2x-768x233.png 768w, https://blog.xojo.com/wp-content/uploads/2025/11/CleanShot-2025-11-25-at-10.13.55@2x.png 1382w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>The first thing to do is to test this Library ReverseString method. Add a button to Window1 and have it call the function, verifying the result.</p>



<pre class="wp-block-code"><code>Var stuff As New StringStuff
Var result As String = stuff.ReverseString("Xojo")

MessageBox(result)</code></pre>



<p>When you run, you can see the output:</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="744" height="584" src="https://blog.xojo.com/wp-content/uploads/2025/11/CleanShot-2025-11-25-at-10.15.21@2x.png" alt="" class="wp-image-15572" style="width:407px;height:auto" srcset="https://blog.xojo.com/wp-content/uploads/2025/11/CleanShot-2025-11-25-at-10.15.21@2x.png 744w, https://blog.xojo.com/wp-content/uploads/2025/11/CleanShot-2025-11-25-at-10.15.21@2x-300x235.png 300w" sizes="(max-width: 744px) 100vw, 744px" /></figure>



<p>So far this is all not much different than you would normally be doing with a Xojo project. The next step is to create the Library package for use by other projects.</p>



<p>In the Build Settings area, select Shared. This is where you can enter some information about the Library that can be seen by those that use it.</p>



<ul class="wp-block-list">
<li>In the Version field, enter &#8220;1.0&#8221;.</li>



<li>In the Copyright field, enter &#8220;Acme, Inc.&#8221;</li>



<li>In the Description field, enter &#8220;A Xojo Library test.&#8221;</li>
</ul>



<p>Also in the Build Settings area, check the boxes for the platforms you want the Library to work on. In most situations, you will want to select macOS, Windows and Linux.</p>



<p>Now click Build. This builds the app as usual, but also creates a separate Library package file (LibHello.xojo_library for this example) that can be used with other projects.</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" width="1024" height="558" src="https://blog.xojo.com/wp-content/uploads/2025/11/FinderLibrary-1-1024x558.png" alt="" class="wp-image-15577" style="width:590px;height:auto" srcset="https://blog.xojo.com/wp-content/uploads/2025/11/FinderLibrary-1-1024x558.png 1024w, https://blog.xojo.com/wp-content/uploads/2025/11/FinderLibrary-1-300x163.png 300w, https://blog.xojo.com/wp-content/uploads/2025/11/FinderLibrary-1-768x418.png 768w, https://blog.xojo.com/wp-content/uploads/2025/11/FinderLibrary-1-1536x837.png 1536w, https://blog.xojo.com/wp-content/uploads/2025/11/FinderLibrary-1.png 1542w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Using a Library</h2>



<p>Now that you&#8217;ve created your Library package, you can use it with other Xojo projects. The Library built above was created within a Desktop project, so it can only be used with other Desktop projects. So the first thing to do is to create a new Desktop project (call it MyTest), save it and close it.</p>



<p>Once it is saved, go to Finder or Explorer and place a copy of the LibHello.xojo_library file (from its build location) alongside this saved project file.</p>



<p>Go back to Xojo and open the MyTest project. The project will open normally, but the Library will also be loaded up as well. You can see this by showing the Xojo About window and going to the Plugins &amp; Libraries tab. There you will see the Library name along with the information you entered about it earlier. (Double-click on the Library row to show the description.)</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="726" src="https://blog.xojo.com/wp-content/uploads/2025/11/AboutWindow-1024x726.png" alt="" class="wp-image-15578" style="width:664px;height:auto" srcset="https://blog.xojo.com/wp-content/uploads/2025/11/AboutWindow-1024x726.png 1024w, https://blog.xojo.com/wp-content/uploads/2025/11/AboutWindow-300x213.png 300w, https://blog.xojo.com/wp-content/uploads/2025/11/AboutWindow-768x544.png 768w, https://blog.xojo.com/wp-content/uploads/2025/11/AboutWindow.png 1524w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Going back to the MyTest project, you can now use the Library with it. Add a button to the window and have it call the StringReverse function the same way you did before:</p>



<pre class="wp-block-code"><code>Var stuff As New StringStuff
Var result As String = stuff.ReverseString("Xojo")

MessageBox(result)</code></pre>



<p>Now run the project and it will use the class and its method just as if it is part of the project.</p>



<p>That&#8217;s the basics of how to create and use a Library. You can of course include whatever you want in the Library, but as with any library it is usually a good idea to keep things well-organized.</p>



<h2 class="wp-block-heading">Considerations</h2>



<ul class="wp-block-list">
<li>A Library package (which uses ZIP) contains compiled code and definitions of the public API in that code.</li>



<li>Only a single Library project item can be added to a project when developing.</li>



<li>A project can use any number of Library packages.</li>



<li>For a built library to work on all OS platforms, then those platforms must be selected before building it.</li>



<li>Libraries only support 64-bit builds.</li>



<li>Library packages are placed alongside the project file and are loaded when the project is loaded.</li>



<li>Library packages can also be placed in the Plugins folder. These libraries will be loaded separately for each project.</li>



<li>If items in your Library have dependencies outside the Library, then the Library package will not be usable in another project without those dependencies. For example, if a Library class method references a class in the main project, then it will build without an error (because the main project is available), but if you use that Library in another project you will get linker errors.</li>
</ul>



<h2 class="wp-block-heading">Why a Preview?</h2>



<p>We are referring to this initial version of Xojo Libraries as a preview release because it is very new and we want to give more developers a chance to test with it so we can iron out issues. We encourage you to try moving your existing reusable code collections over to a Library to help test, while also improving your workflow. If you have any open-source projects that are essentially a Library, you might try building them into a Xojo Library package as well.</p>



<p>You can make Library packages available publicly, but you should probably tag them as a preview, beta or test version until we remove the preview label.</p>



<p>Read more about Libraries in the <a href="https://documentation.xojo.com/topics/code_management/sharing_code_among_multiple_projects.html" target="_blank" rel="noreferrer noopener">Xojo Documentation</a>. Check out these open-source projects on GitHub that have recently been updated for API 2.0 and now have a Library that you can download from the Releases section:</p>



<ul class="wp-block-list">
<li><a href="https://github.com/xojo/VB" target="_blank" rel="noreferrer noopener">Visual Basic Library</a></li>



<li><a href="https://github.com/xojo/FM" target="_blank" rel="noreferrer noopener">FileMaker Library</a></li>



<li><a href="https://github.com/paullefebvre/winapilib" target="_blank" rel="noreferrer noopener">WinAPI Library</a></li>
</ul>



<p><em>Paul learned to program in BASIC at age 13 and has programmed in more languages than he remembers, with Xojo being an obvious favorite. When not working on Xojo, you can find him talking about retrocomputing at <a href="https://goto10.substack.com" target="_blank" rel="noreferrer noopener">Goto 10</a> and </em>on Mastodon @lefebvre@hachyderm.io.</p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Year of Code 2025: August Project, Console Apps</title>
		<link>https://blog.xojo.com/2025/08/07/year-of-code-2025-august-project-console-apps/</link>
					<comments>https://blog.xojo.com/2025/08/07/year-of-code-2025-august-project-console-apps/#comments</comments>
		
		<dc:creator><![CDATA[Gabriel Ludosanu]]></dc:creator>
		<pubDate>Thu, 07 Aug 2025 13:30:00 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Year of Code]]></category>
		<category><![CDATA[#YearofCode]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[GitHub]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=15219</guid>

					<description><![CDATA[Welcome back to the Year of Code 2025 series! For August, I built a minimalist and fun Console Task App that allows users to add,&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Welcome back to the Year of Code 2025 series! For August, I built a minimalist and fun Console Task App that allows users to add, remove, and list tasks interactively in the terminal. No graphical interface, just pure console magic that demonstrates the power of Xojo for CLI apps.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="577" src="https://blog.xojo.com/wp-content/uploads/2025/08/August-Project-Console-Apps-1024x577.jpg" alt="August Project, Xojo Console Apps" class="wp-image-15286" srcset="https://blog.xojo.com/wp-content/uploads/2025/08/August-Project-Console-Apps-1024x577.jpg 1024w, https://blog.xojo.com/wp-content/uploads/2025/08/August-Project-Console-Apps-300x169.jpg 300w, https://blog.xojo.com/wp-content/uploads/2025/08/August-Project-Console-Apps-768x433.jpg 768w, https://blog.xojo.com/wp-content/uploads/2025/08/August-Project-Console-Apps.jpg 1115w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">What this project includes:</h3>



<ul class="wp-block-list">
<li>Interactive command-line interface to manage tasks</li>



<li>Commands to add new tasks, mark tasks complete, list all tasks, and remove tasks</li>



<li>Simple file saving/loading to keep your tasks persistent between sessions</li>



<li>Clean and modular code architecture for easy customization or extension</li>
</ul>



<p>This project highlights how Xojo can be used beyond GUI applications, making it ideal for automation scripts, tooling, or quick utilities you want to run directly in the console (Mac, any Linux flavor, Windows) without the overhead of a full UI.</p>



<p>You can check out the full source code and try it out yourself at&nbsp;<a href="https://github.com/xolabsro/Xojo-Console-Tasks" target="_blank" rel="noreferrer noopener">GitHub: Xojo-Console-Tasks</a>.</p>



<p>Give it a spin, modify it to suit your needs, and share your enhancements or questions with the <a href="https://forum.xojo.com/" data-type="link" data-id="https://forum.xojo.com/" target="_blank" rel="noreferrer noopener">Xojo community</a>. This is a great way to get comfortable with console application design in Xojo and to stretch your coding skills in a new context.</p>



<p>Stay tuned for next month’s project as we continue our journey deep into the many facets of coding with Xojo!</p>



<p><strong>Year of Code Project</strong></p>



<ul class="wp-block-list">
<li><a href="https://blog.xojo.com/2025/01/09/year-of-code-2025-kickoff/">Year of Code: Kickoff</a></li>



<li><a href="https://blog.xojo.com/2025/01/15/year-of-code-2025-january-project/" target="_blank" rel="noreferrer noopener">January Project: Desktop Apps</a>&nbsp;|&nbsp;<a href="https://forum.xojo.com/t/year-of-code-2025-january-project-sharing/83927" target="_blank" rel="noreferrer noopener">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/02/11/year-of-code-2025-february-project/">February Project: Database Apps</a>&nbsp;|&nbsp;<a href="https://forum.xojo.com/t/2025-year-of-code-february" target="_blank" rel="noreferrer noopener">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/03/05/year-of-code-2025-march-project-web-apps/">March Project: Web Apps</a> | <a href="https://forum.xojo.com/t/2025-year-of-code-march/84474?u=alyssa_foley">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/04/08/year-of-code-2025-april-project-user-interface/">April Project: User Interface</a> | <a href="https://forum.xojo.com/t/2025-year-of-code-april-user-interface/84926">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/05/07/year-of-code-2025-may-project-mobile-apps/">May Project: Mobile Apps</a> | <a href="https://forum.xojo.com/t/2025-year-of-code-may-is-mobile/85272">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/06/10/year-of-code-2025-june-project-cross-platform-code-class/">June Project: Code Sharing</a> | <a href="https://forum.xojo.com/t/2025-year-of-code-june-is-code-sharing/85612">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/07/10/year-of-code-2025-july-project-charting/">July Project: Charting</a> | <a href="https://forum.xojo.com/t/2025-year-of-code-july-is-charting/85896">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/08/07/year-of-code-2025-august-project-console-apps/">August Project: Console Apps</a> | <a href="https://forum.xojo.com/t/august-2025-year-of-code-console-apps/86203">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/09/08/year-of-code-2025-september-project-games/">September Project: Games</a> | <a href="https://forum.xojo.com/t/2025-year-of-code-septgamer">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/10/13/year-of-code-2025-october-project-multi-platform-communication/">October Project: Multi-Platform</a> | <a href="https://forum.xojo.com/t/2025-year-of-code-october-multi-platform-communication/86717">Forum Discussion</a></li>



<li><a href="https://blog.xojo.com/2025/11/10/year-of-code-2025-november-project-pdf-postcard-generator/">November Project: PDF</a> | <a href="https://forum.xojo.com/t/2025-year-of-code-november-pdf/86969">Forum Discussion</a></li>
</ul>



<p><strong>How to Play:</strong></p>



<p>Each month we&#8217;ll announce a new theme and share an example project of our own. Share your projects to the Xojo Forum thread for that month via GitHub (all the links you need are posted above ↑ ). Learn how to use <a href="https://blog.xojo.com/2024/04/02/using-xojo-and-github/">Xojo and GitHub</a>.</p>



<p><strong>The Prizes:</strong></p>



<p>Monthly winners get $100 at the Xojo store. Every month you submit a project is another chance to win the grand prize. The grand prize is $250 cash plus a Xojo Pro license and a year of GraffitiSuite and will be announce in December. Learn more about the <a href="https://blog.xojo.com/2025/01/09/year-of-code-2025-kickoff/#prizes">prizes</a>.</p>



<p><em>Gabriel is a digital marketing enthusiast who loves coding with Xojo to create cool software tools for any platform. He is always eager to learn and share new ideas!</em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.xojo.com/2025/08/07/year-of-code-2025-august-project-console-apps/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>New Database Connections</title>
		<link>https://blog.xojo.com/2024/06/26/new-database-connections/</link>
		
		<dc:creator><![CDATA[William Yu]]></dc:creator>
		<pubDate>Wed, 26 Jun 2024 15:00:00 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[2024r2]]></category>
		<category><![CDATA[Beginner Tips]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[ODBC]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=13226</guid>

					<description><![CDATA[While Xojo has always supported adding database connections, the old method was far from ideal. Let's delve into the improved approach using the new DatabaseConnection project items and explore some recent additions to our database API.]]></description>
										<content:encoded><![CDATA[
<p>While Xojo has always supported adding database connections, the old method was far from ideal. Let&#8217;s delve into the improved approach using the new Database Connection project items and explore some recent additions to our database API.</p>



<h2 class="wp-block-heading">Out With The Old</h2>



<p>The old database connections were quite limiting, requiring you to create a new connection and re-enter all the parameters whenever one changed. With our new Database Connection items, you can now easily update specific connection parameters directly in the inspector.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="303" src="https://blog.xojo.com/wp-content/uploads/2024/06/PostgresqlDBConnectionModification-1024x303.png" alt="" class="wp-image-13230" srcset="https://blog.xojo.com/wp-content/uploads/2024/06/PostgresqlDBConnectionModification-1024x303.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/06/PostgresqlDBConnectionModification-300x89.png 300w, https://blog.xojo.com/wp-content/uploads/2024/06/PostgresqlDBConnectionModification-768x228.png 768w, https://blog.xojo.com/wp-content/uploads/2024/06/PostgresqlDBConnectionModification-1536x455.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/06/PostgresqlDBConnectionModification-2048x607.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Additionally, you can now choose whether the item will auto-connect or if you prefer to connect to it later in your code.</p>



<h2 class="wp-block-heading">Connecting to a Specific Database</h2>



<p>There are times when you need to connect to a database for debugging and testing, but for the final builds, you want to connect to your production database/server. Setting this up correctly with the old database connection method required creating two separate connection items—one for debug and one for release. With the new Database Connection items, this process is much simpler and fits more easily into the build process.  You now have several new Database Connection subitems that can be customized based on the stage of your build. These subitems are linked to the Stage Code in your Shared Build Settings, ensuring that when you build a final release, your database connection uses the correct settings automatically.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="329" src="https://blog.xojo.com/wp-content/uploads/2024/06/DatabaseConnectionStageCode-1024x329.png" alt="" class="wp-image-13238" srcset="https://blog.xojo.com/wp-content/uploads/2024/06/DatabaseConnectionStageCode-1024x329.png 1024w, https://blog.xojo.com/wp-content/uploads/2024/06/DatabaseConnectionStageCode-300x96.png 300w, https://blog.xojo.com/wp-content/uploads/2024/06/DatabaseConnectionStageCode-768x247.png 768w, https://blog.xojo.com/wp-content/uploads/2024/06/DatabaseConnectionStageCode-1536x493.png 1536w, https://blog.xojo.com/wp-content/uploads/2024/06/DatabaseConnectionStageCode.png 1968w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Additional Database Features</h2>



<p>In addition to this change, there are two new database APIs that may be useful to you:</p>



<ol class="wp-block-list">
<li>A new method, IsConnected, has been added to the SQLiteDatabase, ODBCDatabase, PostgreSQLDatabase, and MySQLCommunityServer classes. This method returns true if the connection is still active, and false if it is not.</li>



<li>We&#8217;ve enhanced <a href="https://documentation.xojo.com/api/databases/database.html#database-addrow">Database.AddRow</a> with a new signature that returns the unique ID of the newly inserted row. This feature is supported for SQLiteDatabase, ODBCDatabase, PostgreSQLDatabase, and MySQLCommunityServer classes. It is recommended to use this new API instead of the deprecated SQLiteDatabase.LastRowID and MySQLCommunityServer.LastInsertedRowID</li>
</ol>



<p>Let&#8217;s explore how the new Database.AddRow feature can assist you. Previously, only SQLiteDatabase and MySQLCommunityServer had APIs to retrieve the unique ID of the last inserted row. Now, PostgreSQLDatabase and ODBCDatabase also have this capability by using the new <code>Database.AddRow(tableName As String, row As DatabaseRow, idColumnName As String = "") As Integer</code></p>



<p>The new aspect of this signature is the idColumnName parameter and the return value. For databases that support the SQL <strong>RETURNING</strong> clause, the idColumnName specifies the column whose value will be returned.  For databases that do not support the <strong>RETURNING</strong> clause, we will use the suitable method for each specific database to return a unique value.</p>



<p>We recognize the significance of databases in your Xojo apps. So with these updates to database connectivity for your desktop, web and console apps, and the addition of new features, we aim to make your database programming easier and more efficient.</p>



<p><em><em><em>William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.</em></em></em></p>



<ul class="wp-block-social-links has-normal-icon-size is-content-justification-center is-layout-flex wp-container-core-social-links-is-layout-16018d1d wp-block-social-links-is-layout-flex"><li class="wp-social-link wp-social-link-facebook  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.facebook.com/goxojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg><span class="wp-block-social-link-label screen-reader-text">Facebook</span></a></li>

<li class="wp-social-link wp-social-link-x  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://x.com/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" /></svg><span class="wp-block-social-link-label screen-reader-text">X</span></a></li>

<li class="wp-social-link wp-social-link-linkedin  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.linkedin.com/company/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg><span class="wp-block-social-link-label screen-reader-text">LinkedIn</span></a></li>

<li class="wp-social-link wp-social-link-github  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://github.com/topics/xojo" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg><span class="wp-block-social-link-label screen-reader-text">GitHub</span></a></li>

<li class="wp-social-link wp-social-link-youtube  wp-block-social-link"><a rel="noopener nofollow" target="_blank" href="https://www.youtube.com/c/XojoInc" class="wp-block-social-link-anchor"><svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg><span class="wp-block-social-link-label screen-reader-text">YouTube</span></a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Running Xojo Web projects on Raspberry Pi 64-bit ARM boards</title>
		<link>https://blog.xojo.com/2022/12/13/running-xojo-web-projects-on-raspberry-pi-64-bit-arm-boards/</link>
		
		<dc:creator><![CDATA[Ricardo Cruz]]></dc:creator>
		<pubDate>Tue, 13 Dec 2022 15:22:45 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Raspbian]]></category>
		<category><![CDATA[Remote Debugging]]></category>
		<category><![CDATA[Single Board Computer]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Xojo API 2.0]]></category>
		<category><![CDATA[Xojo Forum]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=11065</guid>

					<description><![CDATA[Xojo 2022r4 opens the door for running projects on 64-bit Raspberry Pi ARM boards. Console, Desktop and Web are supported.]]></description>
										<content:encoded><![CDATA[
<p>Xojo 2022r4 opens the door for running projects on 64-bit Raspberry Pi ARM boards. Console, Desktop and Web are supported.</p>



<p>Xojo Web is an excellent way to expose the features of your electronics projects without having to attach any screen to them. It&#8217;s never been easier to build a Web GUI for your smart clocks, drones, POS, domotics, robots or just some automation services. Thinking about building a solar powered server to automate your tweets? Why not!</p>



<p>If you prefer, you can just expose a Web API instead that can be remotely consumed from another device.</p>



<h2 class="wp-block-heading">What Raspberry Pi boards support ARM 64-bit Linux OS?</h2>



<ul class="wp-block-list">
<li>Raspberry Pi Zero 2</li>



<li>Raspberry Pi 3</li>



<li>Raspberry Pi 4</li>



<li>Raspberry Pi 400</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="763" src="https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-zero-2-1024x763.png" alt="" class="wp-image-11066" srcset="https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-zero-2-1024x763.png 1024w, https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-zero-2-300x224.png 300w, https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-zero-2-768x573.png 768w, https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-zero-2.png 1336w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">One of my Raspberry Pi Zero 2, running a 64-bit Xojo Web application.</figcaption></figure>



<h2 class="wp-block-heading">Preparing your Raspberry Pi</h2>



<p>The easiest way to get your operating system ready is by using the <a href="https://www.raspberrypi.com/software/" data-type="URL" data-id="https://www.raspberrypi.com/software/" target="_blank" rel="noreferrer noopener">Raspberry Pi Imager</a>.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="690" src="https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-imager-1024x690.png" alt="" class="wp-image-11067" srcset="https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-imager-1024x690.png 1024w, https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-imager-300x202.png 300w, https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-imager-768x518.png 768w, https://blog.xojo.com/wp-content/uploads/2022/12/raspberry-pi-imager.png 1510w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Raspberry Pi Imager v1.7.3.</figcaption></figure>



<p>At the moment of writing this article, it selects the 32-bit flavor by default. If you have one of the supported boards, go ahead and try Raspberry Pi OS (64-bit) or Raspberry Pi OS Lite (64-bit). The later won&#8217;t include any desktop environment, you&#8217;ll have to access by SSH.</p>



<p>Select your SD Card storage and press on Write. Optionally, if you want to set a hostname for your board, enable SSH, or even configure your Wifi, press on the gears icon.</p>



<p>In just a few minutes you will have a ready to boot SD card for your Raspberry Pi.</p>



<h2 class="wp-block-heading">Remotely debugging your projects</h2>



<p>This is one of my favorite features of Xojo.</p>



<p>In your Xojo installation Extras folder, you will find a &#8220;Remote Debugger Console&#8221; and &#8220;Remote Debugger Desktop&#8221;, that also works for your Linux 64-bit OS.</p>



<p>Depending on which flavor of Linux you&#8217;ve selected in the previous step, send the Console or Desktop ZIP to your board, run it and configure the settings.</p>



<p>Inside Xojo, go to Preferences and press on the Debugging tab.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="599" src="https://blog.xojo.com/wp-content/uploads/2022/12/xojo-preferences-debugging-1024x599.png" alt="" class="wp-image-11068" srcset="https://blog.xojo.com/wp-content/uploads/2022/12/xojo-preferences-debugging-1024x599.png 1024w, https://blog.xojo.com/wp-content/uploads/2022/12/xojo-preferences-debugging-300x176.png 300w, https://blog.xojo.com/wp-content/uploads/2022/12/xojo-preferences-debugging-768x449.png 768w, https://blog.xojo.com/wp-content/uploads/2022/12/xojo-preferences-debugging.png 1480w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Xojo Debugging Preferences panel.</figcaption></figure>



<p>That&#8217;s it. Now you will be able to remotely run and debug your applications. Add a few breakpoints and the execution will stop as soon as it reaches it, allowing you to explore the current state.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="667" src="https://blog.xojo.com/wp-content/uploads/2022/12/xojo-remote-debug-1024x667.png" alt="" class="wp-image-11070" srcset="https://blog.xojo.com/wp-content/uploads/2022/12/xojo-remote-debug-1024x667.png 1024w, https://blog.xojo.com/wp-content/uploads/2022/12/xojo-remote-debug-300x195.png 300w, https://blog.xojo.com/wp-content/uploads/2022/12/xojo-remote-debug-768x500.png 768w, https://blog.xojo.com/wp-content/uploads/2022/12/xojo-remote-debug-1536x1000.png 1536w, https://blog.xojo.com/wp-content/uploads/2022/12/xojo-remote-debug.png 1910w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Running your project remotely, to debug.</figcaption></figure>



<h2 class="wp-block-heading">Deploying the final version</h2>



<p>Once you&#8217;re ready to build the final version of your application, all the wires attached and components soldered, the last step is to &#8220;Deploy&#8221; your application.</p>



<p>There is a tutorial covering this step in detail: <a href="https://blog.xojo.com/2021/05/28/tutorial-deploying-web-apps-on-linux/" data-type="post" data-id="8552">Deploying Web Apps on Linux</a>.</p>



<p>If you create a Raspberry Pi project, please make sure you open a <a href="https://forum.xojo.com" data-type="URL" data-id="https://forum.xojo.com" target="_blank" rel="noreferrer noopener">Forum thread</a>. The Xojo community loves seeing this kind of projects!</p>



<p>What will you build?</p>



<p><em>Ricardo has always been curious about how things work. Growing up surrounded by computers</em> he became interested in <em>web technologies in the dial-up connections era. Xojo has been his secret weapon and language of preference since 2018. When he’s not online, chances are he will be scuba diving … or crocheting amigurumis. Find Ricardo on Twitter <a href="https://web.archive.org/web/20220805000833/https://www.twitter.com/piradoiv" target="_blank" rel="noreferrer noopener">@piradoiv</a>.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>All You Need is Xojo Pro</title>
		<link>https://blog.xojo.com/2021/10/04/all-you-need-is-xojo-pro/</link>
		
		<dc:creator><![CDATA[Alyssa Foley]]></dc:creator>
		<pubDate>Mon, 04 Oct 2021 14:00:00 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Multi-Platform Development]]></category>
		<category><![CDATA[Priority Support]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Xojo Pro]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=9127</guid>

					<description><![CDATA[Whether you are new to Xojo or looking to upgrade your existing licenses, Xojo Pro is the best way to take advantage of everything Xojo has to offer. Xojo Pro includes support for every platform - desktop, web, mobile and Pi.]]></description>
										<content:encoded><![CDATA[
<p>Whether you are new to Xojo or looking to upgrade your existing licenses, Xojo Pro is the best way to take advantage of everything Xojo has to&nbsp;offer.</p>



<p>Xojo Pro includes support for every platform:</p>



<ul class="wp-block-list">
<li>Desktop &#8211; Cross-compile for Windows, macOS X &amp; Linux.</li>



<li>Web &#8211; Deploy web apps as standalone apps or to Xojo Cloud.</li>



<li>Mobile &#8211; Make apps for iPhone and iPads (iOS) and Android.</li>



<li>Pi &#8211; Make apps for Raspberry Pi and other single-board computers.</li>



<li>Console &#8211; Make apps with no graphical user interface that run from the terminal, command line or as background processes.</li>
</ul>



<p>In addition, Xojo Pro developers enjoy the following&nbsp;benefits:</p>



<ul class="wp-block-list">
<li>Technical Email &amp; Phone Support</li>



<li>Access to Xojo pre-releases</li>



<li>License activation on 3 machines</li>



<li>First access to Consulting Leads</li>
</ul>



<p><strong><a rel="noreferrer noopener" href="https://xojo.com/store/index.php" target="_blank"><span style="text-decoration: underline;">Xojo Pro is $799</span></a> and a new license includes build access to new Xojo releases for 12 months. </strong>Your Xojo license is perpetual, but access to building apps with new Xojo releases is limited. After 12 months you can renew your access to build apps with new releases or continue building apps with the older releases, indefinitely.<strong> </strong>You are never required to renew and can do so anytime to access new features and supported platforms. Your apps built with Xojo are yours forever. </p>



<p><strong>Already have a Xojo license? Upgrading it to Xojo Pro will earn you a discount.</strong> We&#8217;ve made it easy to Upgrade to Xojo Pro, just log in to <a rel="noreferrer noopener" href="https://xojo.com/account/login.php" target="_blank">your account</a>, go to your <a rel="noreferrer noopener" href="https://www.xojo.com/account/licenses/manage.php" target="_blank">licenses page</a> and select the license(s) you wish to upgrade. The more licenses you select, the greater your discount. After you have selected the licenses to upgrade,&nbsp;choose &#8220;Upgrade to Xojo Pro&#8221; to see your personal upgrade discount in the store.</p>



<p>Questions about Xojo Pro or upgrading your existing Xojo licenses to Xojo Pro? Email me anytime at hello@xojo.com.</p>



<p>Think you need more? Look into <a href="https://www.xojo.com/store/proplus.php">Xojo Pro Plus</a>, developed for businesses that depend on Xojo.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Use Multiple CPU Cores with Worker</title>
		<link>https://blog.xojo.com/2020/11/24/use-multiple-cpu-cores-with-worker/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Tue, 24 Nov 2020 14:15:58 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Worker]]></category>
		<category><![CDATA[Xojo API 2.0]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=7677</guid>

					<description><![CDATA[A Worker provides a way for you to have code that runs on multiple CPU cores. A Worker achieves this by running its code in a Console app. One or more of these console apps are started based on your Worker settings. Since these run as Console apps, the OS treats them as separate processes and spreads them out amongst available CPU cores.]]></description>
										<content:encoded><![CDATA[
<p>One of the many new features included in 2020 Release 2 is the Worker class. A Worker provides a way for you to have code that runs on multiple CPU cores.</p>



<p>A Worker achieves this by running its code in a Console app. One or more of these console apps are started based on your Worker settings. Since these run as Console apps, the OS treats them as separate processes and spreads them out amongst available CPU cores.</p>



<p><em>Note:</em> For now, Worker can be used with Desktop projects, but we plan to make it available for Web projects in the future.</p>



<p>When run in Debug mode, Workers use Threads to simulate separate Console apps to make debugging easier. This means that when debugging everything still runs on a single CPU core. Build your project to allow your Workers to run on multiple CPU cores.</p>



<h2 class="wp-block-heading">Worker Overview</h2>



<p>Add a Worker to your projects using the Insert toolbar or menu. This creates a special Worker object in your project which provides properties and events for controlling how it operates.</p>



<p>There are three properties you can adjust in the Inspector for a Worker.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.xojo.com/wp-content/uploads/2020/11/Screen-Shot-2020-11-18-at-4.01.45-PM.png" alt="" class="wp-image-7703" width="321" height="233" srcset="https://blog.xojo.com/wp-content/uploads/2020/11/Screen-Shot-2020-11-18-at-4.01.45-PM.png 598w, https://blog.xojo.com/wp-content/uploads/2020/11/Screen-Shot-2020-11-18-at-4.01.45-PM-300x218.png 300w" sizes="auto, (max-width: 321px) 100vw, 321px" /></figure></div>



<ul class="wp-block-list"><li><strong>Core Percent</strong>: This indicates the percentage of CPU cores that should be used. For example, if you have an 8-core CPU, enter 50 here to limit the Worker to 4 (50% of 8) CPU cores.</li><li><strong>Maximum Core Count</strong>: This indicates the most cores you want the Worker to use. This works in conjunction with Core Percent. For example, if you have a 12-core CPU with Core Percent set to 50 then that would mean use up to 6 CPU cores. If you then set Maximum Core Count to 4, then the Worker will use no more than 4 (rather than 6).</li><li><strong>Project Items to Include</strong>: When this is blank all classes and modules in your project are included in the Worker Console project for use. However you may not need everything, so you can choose to be specific about which supporting classes and modules you want to include (one project item per line).</li></ul>



<p>The Worker object itself has five events you use to project jobs for the Worker to do.</p>



<p><strong>JobRequested</strong>: When a Worker is first started, it requests a job which calls this method in your app. Here you can return a String containing details about the Job that the Worker will run. You can return information here such as a path to a file, a key to a database table, a URL, or whatever else makes sense. However, you should avoid passing round large amounts of data as that is slower and will use more memory. Instead, allow the Worker to get what it needs based on the information you return here. When there are no more jobs, return an empty string to tell the Worker it can quit.</p>



<p><strong>JobRun</strong>: The code in this event runs in the Worker Console app where it can make use of multiple CPU cores. The parameter contains a String with the information that was returned from JobRequested. Remember that this code is independent and should not refer to any values that were set in your app as they won’t be available in the Worker. The only data the Worker gets is what is passed in, which it can then use to look up additional data elsewhere. You can return a String from this event to provide information about the job that just finished running. In addition, when a job is finished a new job is requested by calling JobRequested.</p>



<p><strong>JobCompleted</strong>: When JobRun finishes, the JobCompleted event is called and the value that was returned from JobRun is provided here. You can use this method to update your job list or do other housekeeping.</p>



<p><strong>JobProgressed</strong>: You can call the SendProgress() method to send progress information back to your app, which you can process in this event.</p>



<p><strong>Error</strong>: The error event is called if there was an error running a job. You will be provided with the details of the job that caused the error so you can log it or add it back to a queue so that it can attempt to run again.</p>



<p>Once you have implemented the events (at a minimum JobRequested and JobRun), you start a Worker by calling its Start method.</p>



<p>Workers automatically stop when they have no more jobs to do or if they lose communication with your app.</p>



<h2 class="wp-block-heading">Word Counter Example</h2>



<p>There are a couple Worker example projects that are included with Xojo: PictureResizer and WordCounter (Examples/Worker). In particular, the Word Counter example shows how Worker can be used to improve performance by using multiple CPU cores. Without Worker, counting the words in 4 text files takes about 12 seconds. With Worker using 4 CPU cores, it takes about 4 seconds.</p>



<p>The WordCounter example has a simple class (called WordCounter) that counts words (intentionally) slowly.</p>



<p>There is a Jobs() array on the WordCountWorker that contains the paths to the text files to word count. In the JobRequested event, the first item in the array is removed from the array and returned so that JobRun can work on it.</p>



<p>JobRun uses the WordCounter class to load the text file and count its words, returning the word count and the path of the file it counted.</p>



<p>JobCompleted updates the main window with the word count.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="828" height="419" src="https://blog.xojo.com/wp-content/uploads/2020/11/2020-11-11_10-28-03.gif" alt="" class="wp-image-7678"/></figure>



<p>For more information about Worker, refer to the <a href="https://documentation.xojo.com/topics/data_processing/faster_processing_using_the_worker_class.html">Worker topic in the User Guide</a>. </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PDF Arrives at Xojo!</title>
		<link>https://blog.xojo.com/2020/08/27/pdf-arrives-at-xojo/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Thu, 27 Aug 2020 11:11:00 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=7308</guid>

					<description><![CDATA[Xojo 2020r1 brings a highly requested feature to the Xojo IDE: the ability to create PDF documents from code! Now you can use the already familiar methods in Xojo's Graphics class to create Standard PDF 1.4 documents with the PDFDocument class.]]></description>
										<content:encoded><![CDATA[<p>Xojo 2020r1 brings a highly requested feature to the Xojo IDE: the ability to create PDF documents from code! Now you can use the already familiar methods in Xojo&#8217;s Graphics class to create Standard PDF 1.4 documents with the PDFDocument class.<span id="more-7308"></span></p>
<p>This is the first iteration of the <a href="https://documentation.xojo.com/api/pdf/pdfdocument.html">PDFDocument</a> class and we are very aware of the things that we will be adding in future releases that are not in 2020r1.&nbsp;Nevertheless, this first set of features will let you create many of the documents you need in Desktop, Web and Console.</p>
<p>In addition, you’ll be glad to know that both the text and the geometric forms you add to your PDF documents are vectorial! Except those generated when “printing” PDF documents from your Reports; those will be vectorial once we add Obejct2D support to the PDFDocument class.</p>
<p>The fact that both text and geometric forms are vectorial in your PDF documents means that these will be rendered with &nbsp;100% quality, independently the scale factor you (or your users) may be using once they display them with any PDF viewer utility or App.</p>
<p>In addition, because the text is vectorial it will be searchable using any PDF utility with text search capabilities; and, for example, when using the Preview app on macOS, the data detector&#8217;s technology will be able to catch and act on some specific data like telephone numbers or postal addresses.</p>
<h2>Creating a PDF Document</h2>
<p>As when using any other class from the Xojo framework, start by creating a new instance for the PDF document. So, in this case you only need to use:</p>
<pre>Var MyPDF As New PDFDocument</pre>
<p>It will use the by default constructor, creating a document with a letter size blank page.</p>
<p>If you want to specify a concrete page size, you may use any of the included Enumeration values, for example:</p>
<pre>Var MyPDF As New PDFDocument(PDFDocument.PageSizes.A4)</pre>
<p>Or any other arbitrary size:</p>
<pre>Var MyPDF As New PDFDocument(500, 500)</pre>
<p>So, in this case, the PDF document will be created with a 500 width x 500 height pixels for the page.</p>
<h2>Drawing into the PDF Document Page</h2>
<p>You’ll be able to include text, Pictures and some geometric forms like Lines, Circles/Ovals, Rectangles/Rounded Rectangles (both in their filled or outline variants). For that you can use the same methods and properties you use when drawing over any regular Graphics context.</p>
<p>For example, the following code snippet will draw a filled circle centered on the PDF page:</p>
<pre>Var g As Graphics = MyPDF.Graphics

g.DrawingColor = &amp;C00ff00

Var x, y As Integer

Var size As Integer = 200
Var offset As Integer = size / 2
x = MyPDF.Graphics.Width / 2
y = MyPDF.Graphics.Height / 2

g.FillOval(x - offset, y - offset, size, size)</pre>
<p>While the next one will draw the “Hello PDF World” text centered on the page and over the previously drawn circle.</p>
<pre>Var helloWorld As String = "Hello PDF World"

g.FontUnit = FontUnits.Pixel
g.FontSize = 20
g.Bold = True
g.DrawingColor = &amp;cffffff

Var textWidth As Integer = g.TextWidth(HelloWorld) / 2
Var textHeight As Integer = (g.TextHeight / 2) - g.FontAscent

g.DrawText(helloWorld, x - textWidth, y - textHeight)</pre>
<h2>Adding New Pages to the PDF Document</h2>
<p>In order to add a new page to your PDF document you only need to call the NextPage method on its graphic context:</p>
<pre>g.NextPage</pre>
<p>And that means that, from now on, all the drawing commands will be made on the new page. For example, let’s use some large fragment of text so it will be centred on the new Page (this one will be the classic “Lorem Ipsum” text, stored in this case by the <code>kLoremIpsum</code> Constant):</p>
<pre>Var textWrap As Integer = 200

x = g.Width / 2 - textWrap / 2
g.FontSize = 10
g.Bold = False
g.DrawingColor = &amp;c000000
g.DrawText(kLoremIpsum, x, 20, 200)</pre>
<p>At this point, our PDF document will be as the one displayed in the following screenshot:</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-7310 size-large" src="https://blog.xojo.com/wp-content/uploads/2020/08/PDF-TwoPages-550x1024.png" alt="" width="550" height="1024" srcset="https://blog.xojo.com/wp-content/uploads/2020/08/PDF-TwoPages-550x1024.png 550w, https://blog.xojo.com/wp-content/uploads/2020/08/PDF-TwoPages-161x300.png 161w, https://blog.xojo.com/wp-content/uploads/2020/08/PDF-TwoPages.png 555w" sizes="auto, (max-width: 550px) 100vw, 550px" /></p>
<h2>Adding Pictures</h2>
<p>Let’s say we did add the “Trees” Picture to our Xojo project. We will be able to draw it on the desired coordinates (and with the desired size of 50 x 50 pixels) over the PDF document page using the following sentences:</p>
<pre>g.DrawPicture(Arboles, 20, 20, 50, 50)
g.DrawPicture(Arboles, g.Width - 70, 20, 50, 50)</pre>
<p><img loading="lazy" decoding="async" class="size-full wp-image-7311 aligncenter" src="https://blog.xojo.com/wp-content/uploads/2020/08/PDF-Picture.png" alt="" width="652" height="213" srcset="https://blog.xojo.com/wp-content/uploads/2020/08/PDF-Picture.png 652w, https://blog.xojo.com/wp-content/uploads/2020/08/PDF-Picture-300x98.png 300w" sizes="auto, (max-width: 652px) 100vw, 652px" /></p>
<h2>Metadata</h2>
<p>You can set the usual metadata to the PDF documents using Xojo. For example:</p>
<pre>MyPDF.Author = "Xojo Developer"
MyPDF.Creator = "My Fancy App"
MyPDF.Title = "PDF Document"
MyPDF.Subject = "My First PDF Document"
MyPDF.Keywords = "Xojo, PDF, Code, Multiplatform”</pre>
<p>Once you save the document to disk, this information will be available (and displayed) as part of the PDF properties- for example, using the Preview app on macOS:</p>
<p><img loading="lazy" decoding="async" class="size-large wp-image-7312 aligncenter" src="https://blog.xojo.com/wp-content/uploads/2020/08/Preview-Keywords-1024x540.png" alt="" width="1024" height="540" srcset="https://blog.xojo.com/wp-content/uploads/2020/08/Preview-Keywords-1024x540.png 1024w, https://blog.xojo.com/wp-content/uploads/2020/08/Preview-Keywords-300x158.png 300w, https://blog.xojo.com/wp-content/uploads/2020/08/Preview-Keywords-768x405.png 768w, https://blog.xojo.com/wp-content/uploads/2020/08/Preview-Keywords.png 1444w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<h2>Saving a PDF Document to Disk</h2>
<p>In order to save the PDF documents created with Xojo to disk, you’ll need a valid FolderItem instance. Next call the Save method on the PDF document instance and give to it the FolderItem instance as the parameter. For example:</p>
<pre>Var f As FolderItem = SpecialFolder.Desktop.Child("MyPDF.pdf")
MyPDF.Save(f)

f.Open</pre>
<p>In this case, the last line of code will open the PDF document using the default app or utility set on your OS.</p>
<h2>Included PDF Examples</h2>
<p>These are just some of the basics when creating and working with PDF Documents in Xojo, and I encourage you to explore the PDF project examples you’ll find inside the Example <strong>Projects &gt; PDF folder</strong>. For example, there you can find how to create PDF documents that look the same both when using a regular Graphics context and the PDFDocument instance, including composing documents with data retrieved from a database or any dynamic data source, both in Desktop and Web.</p>
<p><img loading="lazy" decoding="async" class="size-full wp-image-7313 aligncenter" src="https://blog.xojo.com/wp-content/uploads/2020/08/PDFWeb.png" alt="" width="726" height="762" srcset="https://blog.xojo.com/wp-content/uploads/2020/08/PDFWeb.png 726w, https://blog.xojo.com/wp-content/uploads/2020/08/PDFWeb-286x300.png 286w" sizes="auto, (max-width: 726px) 100vw, 726px" /></p>
<p>In addition, you can find how to create PDF documents with more complex layouts, combining text, geometric figures and pictures, or even creating a basic graphic chart using rectangles.</p>
<p><img loading="lazy" decoding="async" class="size-large wp-image-7314 aligncenter" src="https://blog.xojo.com/wp-content/uploads/2020/08/PDFDesktop-1024x695.png" alt="" width="1024" height="695" srcset="https://blog.xojo.com/wp-content/uploads/2020/08/PDFDesktop-1024x695.png 1024w, https://blog.xojo.com/wp-content/uploads/2020/08/PDFDesktop-300x204.png 300w, https://blog.xojo.com/wp-content/uploads/2020/08/PDFDesktop-768x521.png 768w, https://blog.xojo.com/wp-content/uploads/2020/08/PDFDesktop.png 1207w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<h2>Coming Next!</h2>
<p>We are well aware of all the possibilities offered by the PDF standard! Future features coming to the PDFDocument class include support for Object2D, full Unicode text support, hyperlinks, document ciphering, and much more! We also intend to support PDFDocument with iOS in the future.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Raspberry Pi Library Requirement for 2018r1</title>
		<link>https://blog.xojo.com/2018/04/19/raspberry-pi-library-requirement-for-2018r1/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Thu, 19 Apr 2018 08:00:29 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[Raspbian]]></category>
		<category><![CDATA[RPi]]></category>
		<category><![CDATA[Single Board Computer]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=4144</guid>

					<description><![CDATA[Starting with Xojo 2018r1, your Xojo apps require the libunwind8 library to be installed on your Raspberry Pi.  Here's how to update your Pi.]]></description>
										<content:encoded><![CDATA[<p>Starting with Xojo 2018r1, your Xojo apps require the libunwind8 library to be installed on your Raspberry Pi. You can easily do that from Terminal on the Pi with this command:</p>
<pre>sudo apt-get install libunwind8</pre>
<p>The Raspberry Pi OS (Raspbian) does not automatically update itself. Since it is always a good idea to keep your Pi up to date, you can do it easily from Terminal using these commands:</p>
<pre>sudo apt-get update
sudo apt-get upgrade</pre>
<p>To learn more about Raspberry Pi and Xojo:</p>
<ul>
<li><a href="http://developer.xojo.com/raspberry-pi">Getting Started with Raspberry Pi</a></li>
<li><a href="http://developer.xojo.com/pibook">Programming the Raspberry Pi with Xojo</a> book</li>
</ul>
<p>And don&#8217;t forget, you can build Console and Desktop apps for Raspberry Pi with your <a href="https://blog.xojo.com/2018/03/14/have-you-pie-build-with-it-too/">free Xojo license</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Have Your Pi &#038; Build For It Too</title>
		<link>https://blog.xojo.com/2018/03/14/have-you-pie-build-with-it-too/</link>
		
		<dc:creator><![CDATA[Alyssa Foley]]></dc:creator>
		<pubDate>Wed, 14 Mar 2018 12:00:03 +0000</pubDate>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[RPi]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<category><![CDATA[Xojo Resources]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=4007</guid>

					<description><![CDATA[In honor of Pi Day 2018, Xojo Pi licenses will be free! Xojo Pi licenses allow you to build console apps for Linux ARM for use with Raspberry Pi 2 and Raspberry Pi 3.]]></description>
										<content:encoded><![CDATA[<p>In honor of Pi Day 2018, we will be giving away Xojo Pi licenses for free!</p>
<p><strong>UPDATE:</strong> Now with Xojo 2019r1, you can develop and build console and desktop apps for the Raspberry Pi for free! <a href="https://www.xojo.com/download/">Download</a> today and get started! Xojo Pi supports Raspberry Pi 2, 3 &amp; 4.</p>
<p>Back at XDC 2015 when we announced Xojo would be adding support for the Raspberry Pi, we thought it was a fun extra for Xojo users. We were not expecting the overwhelming excitement and interest from the Xojo community and makers around the world! To celebrate Pi Day like the true geeks we are, we&#8217;re making <strong>Xojo Pi licenses free from Pi Day &amp; forever!</strong></p>
<p>Email hello@xojo.com for your free Xojo Pi license activation code.</p>
<p>Share the new with you friends, we&#8217;re on <a href="https://twitter.com/xojo">Twitter</a>, <a href="https://www.facebook.com/goxojo/">Facebook</a>, <a href="https://www.instagram.com/goxojo/">Instagram</a> and <a href="https://www.linkedin.com/company/xojo/">LinkedIn</a>.</p>
<p>UPDATED: 4/8/2019</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PDF File Generation? There is an API for that!</title>
		<link>https://blog.xojo.com/2018/02/06/pdf-file-generation-there-is-an-api-for-that/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Tue, 06 Feb 2018 15:40:25 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[PDF]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=3874</guid>

					<description><![CDATA[Need to export to PDF from Xojo? There are lots of answers pointing to a bunch of resources, including excelent plug-ins from third parties. But there is also a remote API for that! Your Xojo app will need to have access to Internet … and, of course, you'll need to do just a bit of coding.]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve heard it several times: how can I export to PDF from Xojo? Sure, there are lots of answers pointing to a bunch of resources, including excellent <a href="https://www.xojo.com/store/#addons">plug-ins from third parties</a>. But can you accomplish the same thing using an already available API? Yes, there is a remote API for that! The requirement is that your Xojo app will need to have access to Internet … and, of course, you&#8217;ll need to do just a bit of coding.</p>
<p><span id="more-3874"></span></p>
<p>So I have a challenge for you, you can <a href="https://github.com/aprendexojo/HTTPDocConverter">download the already canned Xojo class</a> ready to use … or you can continue reading and discover how easy is to use Xojo to generate your PDF files!</p>
<p>The service we are going to use is the <b>OpenSource</b> software <a href="https://docverter.com/">Docverter</a>, able to convert any plain, <b>HTML</b>, <b>Markdown</b> or LaTeX file to <b>PDF</b>, <b>Docx</b>, <b>RTF</b> or <b>ePub</b> using a simple HTTP API. In my tests it worked like a charm from the HTML + CSS returned from <b>Markdown Parser</b> class of my own.</p>
<p>In fact it is possible to use this service stright from a Shell class instance, but I&#8217;ve found it more portable and <b>multiplatform</b> to wrap it in a Class so you can simply drop it in your project, passing the file or files you want, and specifying the conversion you want to get back; as simple as that!</p>
<p>For that API wrapper we are going to create a new class derived from <a href="http://developer.xojo.com/httpsocket"><b>HTTPSocket</b></a>. Let&#8217;s name it <code>HTTPDocConverter</code> and put as the next step these <b>String</b> constants that will ease its use:</p>
<ul>
<li><code>kDOCX As String = "docx"; scope: public</code>.</li>
<li><code>kePUB As String = "ePub"; scope: public</code>.</li>
<li><code>kMOBI As String = "mobi"; scope: public</code>.</li>
<li><code>kRTF As String = "rtf"; scope: public</code>.</li>
<li><code>kRemoteAPI As String = "http://c.docverter.com/convert"; scope: private</code>.</li>
</ul>
<p>I think that is a good habit to get accustomed to constants wherever Strings or other frozen values are involved in order to minimize possible minor bugs in the code.</p>
<p>Now it is time to implement the class Constructor passing along three parameters that will simplify its use:</p>
<ul>
<li><code>convertDataTo As String</code>. This is the text that identifies the format we want our document converted to and that is why we defined the Constants in the previous step.</li>
<li><code>inputFile As folderItem</code>. A valid FolderItem file pointing to the file we want to use as the source for the conversion process.</li>
<li><code>notification as callback</code>. This is new Delegate Type we will define in the next step, and that will be used by the class to, well, notify of the process completion. This way, your code and UI will not be locked.</li>
</ul>
<p>So our class <b>Constructor</b> will have the following signature:</p>
<p><code>Constructor( convertDataTo As String, inputFile As FolderItem, notification as callback )</code></p>
<p>Once we add the Constructor method, the Xojo IDE will put the right class initialization here, and we will complete the code with the following sentences:</p>
<pre>Super.Constructor
registeredCallback = notification
encodeRequest( inputFile, convertDataTo )</pre>
<p>Time to add to the class a new <b>Delegate</b> Type (Insert &gt; Delegate), using the following signature in the Inspector Panel:</p>
<ul>
<li><b>Delegate Name</b>: callback</li>
<li><b>Parameters</b>: content As String, documentType As String</li>
<li><b>Scope</b>: Private.</li>
</ul>
<p>That is: our class will accept as a <code>callback</code> Delegate any method that accepts two strings. In fact our class will return the already converted data into the argument <code>content</code>, and also the document type used for the conversion into the <code>documentType</code> argument.</p>
<p>With our Delegate already set, it&#8217;s time to add the <code>registeredCallback</code> Property to the class, and that will be responsible to point to the Delegated method passed to the class instance throught the Constructor:</p>
<ul>
<li><b>Name</b>: registeredCallback</li>
<li><b>Type</b>: callback</li>
<li><b>Scope</b>: Private</li>
</ul>
<p>In fact, let&#8217;s add two more Properties:</p>
<ul>
<li><b>Name</b>: convertedToType. This one will contain the conversion format.</li>
<li><b>Type</b>: String</li>
<li><b>Scope</b>: Private</li>
</ul>
<p>&nbsp;</p>
<ul>
<li><b>Name</b>: receivedData. This property will contain the converted data received from the remote service.</li>
<li><b>Type</b>: String</li>
<li><b>Scope</b>: Private</li>
</ul>
<h2>Encoding the Post Request … the right way</h2>
<p>With all our properties set, it is time to add the Method <code>encodeRequest</code>. Here is where we will take care of constructing our <b>Post</b> Header request including the data for the source file we have to send to the remote URL, along all the required stuff. Create the Method with the following signature:</p>
<ul>
<li><b>Method Name</b>: encodeRequest</li>
<li><b>Parameters</b>: inputFile As Folderitem, convertdataTo as String</li>
</ul>
<p>And write the following snippet of code in the resulting Code Editor:</p>
<pre>Dim formData As New Dictionary
formData.Value("input_files[]") = inputFile
formData.value("from") = "html"
formData.value("to") = convertDataTo
convertedToType = convertDataTo
Dim boundary As String = ""
Boundary = "--" + Right(EncodeHex(MD5(Str(Microseconds))), 24) + "-reQLimIT"
Static CRLF As String = EndOfLine.Windows
Dim data As New MemoryBlock(0)
Dim out As New BinaryStream(data)
For Each key As String In FormData.Keys
  out.Write("--" + Boundary + CRLF)
  If VarType(FormData.Value(Key)) = Variant.TypeString Then
    out.Write("Content-Disposition: form-data; name=""" + key + """" + CRLF + CRLF)
    out.Write(FormData.Value(key) + CRLF)
  Elseif FormData.Value(Key) IsA FolderItem Then
    Dim file As FolderItem = FormData.Value(key)
    out.Write("Content-Disposition: form-data; name=""" + key + """" + "; filename="""+inputFile.Name+""""+ CRLF)
    out.Write("Content-Type: text/html" + CRLF + CRLF)
    Dim bs As BinaryStream = BinaryStream.Open(File)
    out.Write(bs.Read(bs.Length) + CRLF)
    bs.Close
  End If
Next
out.Write("--" + Boundary + "--" + CRLF)
out.Close
Super.SetRequestContent(data, "multipart/form-data; boundary=" + Boundary)</pre>
<h2>Calling the remote API</h2>
<p>Now that the hard part is complete, we are going to add the Method <code>getConvertedFile</code>, in charge of call the remote API:</p>
<ul>
<li><b>Method Name</b>: getConvertedFile</li>
<li><b>Scope</b>: Public</li>
</ul>
<p>And write this simple line of code in the Code Editor:</p>
<p><code>Super.post( kRemoteAPI )</code></p>
<p>This single line fires all the magic behind the scenes, now in order to get our response we need to add the Event <code>PageReceived</code> to our class, writing the following code in the resulting Code Editor:</p>
<pre>If registeredCallback &lt;&gt; Nil Then
  registeredCallback.Invoke content, convertedToType
End If</pre>
<p>If you want, you can also add the <code>Error</code> Event, so you can raise or inform about any error during the process.</p>
<h2>Testing our class!</h2>
<p>In order to test the class, and convert some documents along the way, add a new Method to the project Window (let&#8217;s assume its a Xojo Desktop Project). This is the one we will use as Delegate for the callback once we receive the converted data:</p>
<ul>
<li><b>Method Name</b>: conversionCompleted</li>
<li><b>Parameters</b>: convertedData As String, documentType as String</li>
<li><b>Scope</b>: Public</li>
</ul>
<p>And write the following code in the resulting Code Editor for the Method:</p>
<pre>Dim f As FolderItem = GetSaveFolderItem("", "ConvertedFile." + documentType)
If f &lt;&gt; Nil Then
  Dim tof As TextOutputStream = TextOutputStream.Create(f)
  If tof &lt;&gt; Nil Then
    tof.Write convertedData
    tof.Flush
    tof.Close
  End If
End If</pre>
<p>Add now the <b>Open</b> Event to the same Window and write the following code, this is the one in charge of creating our class instance and firing the conversion process. In this example converting the source file to a PDF file (you only need to change the file format constant to get other kind of documents as result):</p>
<pre>Dim f As FolderItem = GetOpenFolderItem("")
If f &lt;&gt; Nil Then
  Dim post As New HTTPDocConverter(HTTPDocConverter.kPDF,f, AddressOf conversioncompleted)
  post.getConvertedFile
End If</pre>
<h2>Creating PDF Files without Internet connection</h2>
<p>What if you need to generate PDF files without having an active Internet connection or because you handle confidential information? Well, in these cases I&#8217;m sure you&#8217;ll find of interest the <a href="https://wkhtmltopdf.org/"><strong>wkhtmltopdf</strong></a> tool/library.</p>
<p>Add it to your product bundle/folder or directory during the compilation process and you&#8217;re set!</p>
<p>In this case, you have to invoke it from a <a href="http://documentation.xojo.com/api/os/shell.html">Shell</a> instance passing HTML as the source file and getting the PDF as result. The downside is that the distributable product will be weighter (47 Megabytes)! Not a big problem these days, anyway.</p>
<h2>The Last Word</h2>
<p>As you have seen, with a couple of methods and Events we were able to create a multiplatform Class that works in 32-bit and 64-bit targets for Desktop, Console, web and Raspberry Pi deployments. I&#8217;ve been able to create PDF, DOCX, RTF and even MOBI files in no time!</p>
<p><em>Javier Rodri­guez has been the Xojo Spanish Evangelist since 2008, he’s also a Developer, Consultant and Trainer who has be using Xojo since 1998. He manages <a href="http://www.aprendexojo.com">AprendeXojo.com</a> and is the developer behind the GuancheMOS plug-in for Xojo Developers, Markdown Parser for Xojo and the Snippery app, among others</em></p>
<p>*<a href="https://www.aprendexojo.com/2018/02/creacion-archivos-pdf-una-app-i/">Read this post in Spanish</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Supporting Multiple Cores</title>
		<link>https://blog.xojo.com/2018/01/25/supporting-multiple-cores/</link>
		
		<dc:creator><![CDATA[Norman Palardy]]></dc:creator>
		<pubDate>Thu, 25 Jan 2018 20:13:00 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Threads]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=3832</guid>

					<description><![CDATA[With today's multi-core CPU's it seems that an application made with Xojo running on a single core is somewhat restricting. If you have a lot of data to process, large images to manipulate or other things that could happen in the background, it would seem that with a multi-core machine you could do this faster "if only Xojo would make threads preemptive". If you think you need preemptive threads today, try the helper application approach and I think you'll be pleasantly surprised at how well it works.]]></description>
										<content:encoded><![CDATA[<p>With today&#8217;s multi-core CPU&#8217;s it seems that an application made with Xojo running on a single core is somewhat restricting. If you have a lot of data to process, large images to manipulate or other things that could happen in the background, it would seem that with a multi-core machine you could do this faster &#8220;if only Xojo would make threads preemptive&#8221;. We get a lot of requests for preemptive threads so that people can take advantage of multiple cores.</p>
<p><span id="more-3832"></span></p>
<p>It&#8217;s been suggested that this should be <em>easy</em> to do. Just make threads preemptive (so that they will then run on any available core) and voila! Unfortunately, it&#8217;s not that simple. Let&#8217;s look at why the current threads are not preemptive. It&#8217;s hard for you, the developer, to work with preemptive threads. Some languages, like Java, have language features built in to them to try and help make this less work, but it is still hard to get right and very hard to debug when you don&#8217;t. Much of the framework would need updating to be thread safe and your application&#8217;s user interface is not thread safe on any platform because the operating systems themselves don&#8217;t have thread-safe user interface code. If you access something from a pre-emptive thread and that something is not thread-safe, there&#8217;s a very good chance your application is going to crash. We have had to go to a lot of extra work just to make the threads you have today work without causing problems.</p>
<p>The Xojo language already has functions like mutex and semaphores that help you make a multi-threaded program. But you have to protect every place you might set a value that could be shared by many threads. This would mean protecting any globals and pretty much anything that is not local to the method or the thread being executed. That&#8217;s very different than what you have to do today and a lot more work. It&#8217;s just not <em>simple</em> or <em>easy to use</em> the way most of Xojo is designed to be.</p>
<p>The end goal is to use all cores and thereby make your software more responsive, faster, or able to handle more data, or do more things all at the same time. There&#8217;s been a way to do this for as long as Xojo has supported building console applications. The design is to create a main application (GUI or not) and use other helper applications to run separate tasks. The main application and the helpers can communicate in any one of several ways: IPCSockets, TCPSockets, UDPSockets, XML, files, or just about any other way you can dream of. The upside to this way of solving the problem is you can design and implement the main application and the helpers independently and use the debugger to debug each independently. You can use any data in either program in the same way you always have. You don&#8217;t have to worry about the framework being thread safe as the helper and main application run as completely separate processes with their own memory space. Most importantly, you can do this today.</p>
<p>I&#8217;m not going to say it&#8217;s simple. You have to think about what portion of your application can be segmented out into a helper console application. You have to design the communications between the main and helper applications. You have to write, test and debug them. But you don&#8217;t have to worry about variables changing mysteriously because some other thread changed the value. You don&#8217;t have to use lots of mutexs or sempahores to block other threads from altering things when you least expect them. And you can use the entire framework that is available to console applications. Last but not least, you can run as many instances of these helper applications as your computer (or all the computers available to you) can run.</p>
<p>If you think you need preemptive threads today, try the helper application approach and I think you&#8217;ll be pleasantly surprised at how well it works.</p>
<p>For more information: <a href="https://blog.xojo.com/2013/07/26/take-advantage-of-your-multi-core-processor/">Take advantage of your multi-core processor</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Taking Your App From In-House to Commercial</title>
		<link>https://blog.xojo.com/2017/04/25/taking-your-app-from-in-house-to-commercial/</link>
		
		<dc:creator><![CDATA[Xojo]]></dc:creator>
		<pubDate>Tue, 25 Apr 2017 13:58:14 +0000</pubDate>
				<category><![CDATA[Cross-Platform]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[Rapid Application Development]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=2588</guid>

					<description><![CDATA[Like many in-house solutions, the demand on Server Ranger increased over time and it became a more vital part of my business. It was time to move it from a console project to a fully-fledged desktop app, making it more flexible and more friendly - and commercial.]]></description>
										<content:encoded><![CDATA[<p><b></b>Server Ranger started life as a small in-house Xojo console project that I used to monitor servers for several clients. Rather than getting paged (in the very early days) or getting angry phonecalls from clients, it was much more pleasant to have my app play an alert on my Mac and send me an email to notify me of a server issue. With this heads-up, it was often possible to have the issue resolved before a client even realised there had been an issue.</p>
<p>Like many in-house solutions, the demand on Server Ranger increased over time and it became a more vital part of my business.</p>
<p><span id="more-2588"></span></p>
<p><b>Growth</b></p>
<p>Not just more clients, but clients with varied requirements, including monitoring of mail servers were depending on Server Ranger. Plus, I was starting to share some of the workload with less-techy people who had a hard time grasping my little Terminal app. <strong>It was time to move it from a console project to a fully-fledged desktop app, making it more flexible and more friendly.</strong> So, I created a brand new Xojo desktop project and started mocking up the app.</p>
<p>It’s fine to mock an app up in Sketch, Photoshop or even Keynote (my personal favorite &#8211; no, seriously, it’s great for mock-ups). But there is often a compelling reason to mock-up your app right in a RAD tool like Xojo because what you have at the end of the mocking-up process is a working app, not just a wireframe. Granted, your app won’t <i>do</i> anything yet but you can nevertheless build and run the app on real devices and get a feel for the flow of the app as you move around Views and Windows. It looks and feels like a real, native app, because it is.</p>
<p>So, I took my desktop mockup and integrated it with the original console project and I pretty much had a working app. But to do this right I used MVC.</p>
<p><b>MVC</b></p>
<p><a href="https://en.wikipedia.org/wiki/Model–view–controller">Model-View-Controller</a> (or MVC) is a an architectural pattern that assists in the fundamental design of your app. If you’ve never used it, you’re probably getting ready to skip the rest of this post but <strong>let me give you two good reasons why everyone, including Xojo developers, should be using MVC.</strong> First, it’s actually pretty easy to take advantage of the basics of MVC if you follow a few simple rules when developing your next Xojo project. And secondly, MVC will help you take maximum advantage of Xojo’s cross-platform abilities. Let me explain.</p>
<p>MVC asks you to think of the objects in your app and sort them, in your head, into three categories &#8211; Model objects, View objects and Controller objects.</p>
<p>&#8211; <i>Model</i> objects manage the data and logic in your project.</p>
<p>&#8211; <i>View</i> objects are what the user sees. Anything that represents information to the user.</p>
<p>&#8211; <i>Controller</i> objects are the glue in the middle. The View talks to the Controller which then talks to the Model.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2590" src="https://blog.xojo.com/wp-content/uploads/2017/04/model_view_controller_2x.png" alt="" width="1304" height="539" /></p>
<p><b>MVC In Practice</b></p>
<p>If you’re new to this, it probably still sounds very abstract so let me put it into the context of a new Xojo project and then we’ll return to the benefits of all of this. I should say that <strong>there are many ways to implement MVC so I’m not about to give you some perfect, academic MVC example, but I will try to give you real-world, pragmatic examples.</strong></p>
<p>Let’s start with the Model. I said earlier that Server Ranger started life as a console project which was in effect largely Model objects. It did processing in the background and recorded results. There was nothing in the way of user interaction and practically nothing in terms of what the user could see happening. Server Ranger’s Model layer largely consists of instances of a <i>Server</i> class. Each site or server that a user adds to Server Ranger is another instance of the <i>Server</i> class. Each of these instances process its own information and retains its own records. They are self-contained and don’t care how, or if, that data is ever presented to the user.</p>
<p>When I later mocked up the desktop version of Server Ranger, I was effectively designing the View part of MVC. It was all the stuff that the user could see and interact with. It didn’t <i>do</i> anything or process any data or retain any results. And that’s just fine. Server Ranger’s View layer therefore consists of custom Containers, charts, Xojo’s built-in ListBox, Labels and Canvases.</p>
<p>So how do we tie this together? If the View layer never talks to the Model layer, how does the app work? The answer is in the Controller layer. In Server Ranger, the Controller is a singleton object. For simplicity, I literally call this object ‘<i>Controller’. </i>When a user clicks on a PushButton, the only code in a PushButton’s Action event is a call to a method in the Controller. It’s this Controller method that talks to the Model layer and asks it to retrieve the data that the user requested when he/she clicked the PushButton. The Controller then says to the View layer, “hey, I have some information for you” and it’s up to the View layer to grab that information from the Controller, if it so chooses. But the PushButton itself <i>never</i> communicates directly with the Model layer.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2589" src="https://blog.xojo.com/wp-content/uploads/2017/04/Server-Ranger-screenshot.png" alt="" width="2280" height="1356" /></p>
<p><b>The Future of Server Ranger and Benefits of MVC</b></p>
<p>Most of my customers install Server Ranger on a single Mac which then monitors their various sites and servers. But I know of a customer who has several offices throughout the world and he has a Mac in each office with Server Ranger on it. Wherever he is in the world, he can get a notification that there is trouble somewhere in his infrastructure. But ultimately, Server Ranger is a single-instance stand-alone project.</p>
<p>On our roadmap for this Fall, we plan to build a subscription-based Web version of Server Ranger, also built in Xojo. They can sign-up for our service which will have multiple instances on each continent, all coordinating and updating each other and the user will receive emails or SMS alerts when problems occur. Using MVC, the basic heart of Server Ranger will be retained because the Model will largely be the same as it was in the stand-alone product. Remember, the Model knows nothing of how the information is displayed and it doesn’t care. It just does its work and remembers its results. Naturally, the View layer will be different but because the View layer on the macOS product only had calls to the Controller layer, there’s nothing to decouple from it.</p>
<p>The stand-alone product will similarly expand with new features. I also plan to target the Windows platform and iOS as well &#8211; though I’m still investigating that one. <strong>But whatever platforms we end up targeting, using the MVC design pattern will help bring the core of the product to a new platform much faster.</strong> And that helps you, as a Xojo developer, get more bang for your Xojo buck.</p>
<p>We all know how quickly Xojo helps you get an app up and running but I urge you to take a little time to consider the architecture of your next app as you can reap benefits down the road. You might start out as I did with Server Ranger&#8217;s rather modest goals but over time you might find your needs expand and you want to start targeting other platforms. Architecting your app using MVC from the start, helps you do that more efficiently.</p>
<p><em>Guest Post from Gavin Smith. Gavin Smith has been using Xojo (and its predecessors) since 1998 and has been running LibertyApp Ltd for 8 years. Find out more about <a href="http://www.serverranger.com">Server Ranger </a>or <a href="https://itunes.apple.com/us/app/server-ranger/id1123314447?mt=12">purchase it</a>. Please feel free to email me at gavin@libertyapp.com or follow me on Twitter <a href="https://twitter.com/gvnsmth">@gvnsmth</a>.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Headless Pi: Using Xojo and Raspberry Pi Without a Display</title>
		<link>https://blog.xojo.com/2016/03/30/headless-raspberry-pi-using-xojo-and-your-raspberry-pi-without-a-display/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Wed, 30 Mar 2016 00:00:00 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[RPi]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2016/03/30/headless-raspberry-pi-using-xojo-and-your-raspberry-pi-without-a-display/</guid>

					<description><![CDATA[Learn how to use Xojo and your Raspberry Pi without a display, but still connect to it to run apps.]]></description>
										<content:encoded><![CDATA[<p>You don&#8217;t need to hook up your Pi to a physical display, keyboard and mouse. You can set up <a href="https://en.wikipedia.org/wiki/Virtual_Network_Computing" target="_blank" rel="noopener">VNC</a> on the Pi so you can remotely connect to it.</p>
<p>My Raspberry Pi 2 sits on my desk next to one of my speakers. It&#8217;s not hooked up to any display. I use a combination of SSH, SFTP and VNC when I need to work with it.</p>
<p><span id="more-282"></span></p>
<p>To connect to the Pi, I just need its IP address, which currently is 10.0.1.11. I leave the Pi on all the time, but if I reboot it then the IP address could change since I have not set it up with a fixed IP address. To identify the IP address, I run the utility <a href="https://itunes.apple.com/us/app/lanscan/id472226235?mt=12">LanScan</a> (free on the Mac App Store) which shows me all the IP addresses of everything on my local network. The Raspberry Pi is clearly identified.</p>
<p><img loading="lazy" decoding="async" title="LanScan.png" src="https://blog.xojo.com/wp-content/uploads/2016/03/LanScan.pngt1466486449161ampwidth578ampheight266" sizes="auto, (max-width: 578px) 100vw, 578px" alt="LanScan.png" width="578" height="266" /></p>
<p>I can then connect to the Pi via ssh:</p>
<pre>ssh <a href="../../../com/xojo/blog/index.html">pi@10.0.1.11</a></pre>
<p>I&#8217;m prompted for the password, which I&#8217;ve left at the default (&#8220;raspberry&#8221;).</p>
<p>If I am only going to be running Xojo console apps, then this is all I need. You really only need to set up VNC if you want to access the Desktop so you can run Xojo desktop apps (or use the Pi UI to run other desktop apps).</p>
<p>Personally I do like using the Pi desktop, so I now need to start the VNC server, which I have previously installed. If you need to install it, easy <a href="https://www.raspberrypi.org/documentation/remote-access/vnc/">VNC installation steps</a> are at the official Raspberry Pi site.</p>
<p>At the ssh terminal, I start VNC using its defaults with this command:</p>
<pre>vncserver</pre>
<p>After typing this command, I&#8217;m back at the terminal prompt. Use the &#8220;exit&#8221; command to disconnect from the ssh connection.</p>
<p><img loading="lazy" decoding="async" title="Terminal.png" src="https://blog.xojo.com/wp-content/uploads/2016/03/Terminal.pngt1466486449161ampwidth578ampheight393" sizes="auto, (max-width: 578px) 100vw, 578px" alt="Terminal.png" width="578" height="393" /></p>
<p>Now I can connect to the Pi using a VNC client. I&#8217;m going to use the client that is built into OS X since it is always available and reasonably fast. In Finder, select Go-&gt;Connect to Server from the menu. In the window, enter the address and port for the VNC server and click Connect:</p>
<pre>vnc://10.0.1.11:5901</pre>
<p><img loading="lazy" decoding="async" title="VNCViewer.png" src="https://blog.xojo.com/wp-content/uploads/2016/03/VNCViewer.pngt1466486449161ampwidth578ampheight274" sizes="auto, (max-width: 578px) 100vw, 578px" alt="VNCViewer.png" width="578" height="274" /></p>
<p>You&#8217;ll again be prompted for your password. This is the password you set up when you installed TightVNC, not the Raspberry Pi password.</p>
<p>When everything connects you&#8217;ll get a window displaying the Raspberry Pi desktop, shown here running the XojoNotes example app:</p>
<p><img loading="lazy" decoding="async" title="PiDesktop.png" src="https://blog.xojo.com/wp-content/uploads/2016/03/PiDesktop.pngt1466486449161ampwidth578ampheight471" sizes="auto, (max-width: 578px) 100vw, 578px" alt="PiDesktop.png" width="578" height="471" /></p>
<p>But how do you get apps to the Pi so you can run them? I use SFTP. There are many SFTP tools available. I primarily use ForkLift and ExpanDrive, but other apps have also been recommended on the <a href="https://forum.xojo.com/30628-xojo-my-rasberry-pi-experience">Xojo forum</a>. Regardless of the tool you use, create a new SFTP connection and enter the same credentials you used to connect via ssh.</p>
<p>You&#8217;ll now have access to the file system on the Pi and you can drag files from your computer to the Pi&#8217;s file system, which will copy them across your network to the Pi. With ExpanDrive, I get a drive mounted to the Finder that is connected to the Pi, making access to the Pi always available.</p>
<p><img loading="lazy" decoding="async" title="ExpanDrive.png" src="https://blog.xojo.com/wp-content/uploads/2016/03/ExpanDrive.pngt1466486449161ampwidth578ampheight330" sizes="auto, (max-width: 578px) 100vw, 578px" alt="ExpanDrive.png" width="578" height="330" /></p>
<p>With your free Xojo Pi license you can develop and build desktop and console Pi apps. <a href="https://www.xojo.com/download/">Download</a> today and get the latest release!<span id="hs-cta-wrapper-aeb03183-a469-4f96-9547-7dd75111c681" class="hs-cta-wrapper"><span id="hs-cta-aeb03183-a469-4f96-9547-7dd75111c681" class="hs-cta-node hs-cta-aeb03183-a469-4f96-9547-7dd75111c681"><br />
</span></span><!-- end HubSpot Call-to-Action Code --></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
