<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Eduardo Arellano on Medium]]></title>
        <description><![CDATA[Stories by Eduardo Arellano on Medium]]></description>
        <link>https://medium.com/@earel329?source=rss-10dddb6416f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7hWiwr-23RdZaudD.jpg</url>
            <title>Stories by Eduardo Arellano on Medium</title>
            <link>https://medium.com/@earel329?source=rss-10dddb6416f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:03:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@earel329/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Watch Face with Garmin Monkey C]]></title>
            <link>https://medium.com/@earel329/building-a-watch-face-with-garmin-monkey-c-6030a86a4595?source=rss-10dddb6416f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6030a86a4595</guid>
            <dc:creator><![CDATA[Eduardo Arellano]]></dc:creator>
            <pubDate>Mon, 30 Mar 2020 05:47:04 GMT</pubDate>
            <atom:updated>2020-03-30T05:47:04.879Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome friends, to the third and last in this series of posts where we have initiated our path to become masters in Garmin’s Monkey C. In my last post (Garmin Monkey C — Next Steps) we finalize the learning of basic concepts and submerged of ourselves in more intermediate stuff. And so, it is time to get our hands dirty, and start coding our way to our first Monkey C application.</p><p>This post is focused on applying those basic concepts to build a watch face application for a Garmin watch. I will provide you with step by step instructions on how to create this application and I will try to explain how some of those basic concepts that we previously learned, are applied.</p><p>The finish line is at sight, so let’s go!</p><h3><strong>The Idea</strong></h3><p>I have to confess that during this time of quarantine due to the coronavirus pandemic, I have become obsessed with a game called Star Wars Galaxy of Heroes, and so I have decided my watch face will have a Star Wars theme. Note that this does not have to be the design for your watch face, you can decide a different theme, the steps will stay exactly the same.</p><h3><strong>The Tools</strong></h3><p><strong>Fonts</strong></p><p>For those Star Wars fans, I will be using the Aurebesh writing system, which look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*tOUkeT3QvADfjoBjF-Pw9A.png" /></figure><p>For those interested in doing the same here is the link to download the fonts:</p><p><a href="http://www.mediafire.com/file/ts916ofossq6d67/Aurebesh.otf/file">http://www.mediafire.com/file/ts916ofossq6d67/Aurebesh.otf/file</a></p><p>From the download you should get a file with a .otf extension.</p><p>Open the file and click install on the upper left side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*EBLizjYYrPbMKbQvHs-STw.png" /></figure><p>For those who prefer to use something else, simply download the fonts of your preference in to your machine and install them.</p><p><strong>Bitmap Font Generator</strong></p><p>In order to make use of this fonts in the application, we need to use a generator. Here is the link to download the one I will be using for this example from angelcode.com.</p><p><a href="https://www.angelcode.com/products/bmfont/">https://www.angelcode.com/products/bmfont/</a></p><p>Once installed, it should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*oBB6WLtRPOICPuNDa6AQnw.png" /></figure><p><strong>The Application</strong></p><p>For this example, I will assume that you already have install and configure the Eclipse IDE. If you haven not, here is the link to the Garmin documentation on how to do it.</p><p><a href="https://developer.garmin.com/connect-iq/sdk/">https://developer.garmin.com/connect-iq/sdk/</a></p><p>Here we go!</p><p>1)Open Eclipse.</p><p>2)Right click on the Project Explorer area, on the left side of the screen.</p><p>3)Select New from the menu.</p><p>4)Select Project from the submenu.</p><p>Note: A small window should pop-up.</p><p>5)Select Connect IQ Project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*xN-wwUxDu7Q0a5dxzhR4xw.png" /></figure><p>6)Click Next.</p><p>7)Type a name for your project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*q0W97RwA4wky9rEG8mAHWQ.png" /></figure><p>8)Click Next.</p><p>9)Select Watch Face from the first dropdown list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*TQFZCEYiPbL5Y0j2C7WUCg.png" /></figure><p>Note: For this example, the App Version and the Minimum SDK Version are not important, as I will not be uploading this to the Garmin Store. Typically, if you are just starting this app, you would say is version 1.0.1 and you would have to choose the minimum SDK needed.</p><p>10) Click Next.</p><p>Note: We will use the Simple predefined template that Garmin makes available to developers.</p><p>11) Click Next.</p><p>Note: The Target Platforms list should appear. This is where you select the watch you will develop your app for. You can select multiple devices if that is what you want, but I must warn you, since devices have different sizes and designs. Your watch face design will not look the same in all of them.</p><p>12)Select your targeted device.</p><p>Note: In this case, I will select vivoactive 3, as it is the watch I am currently using.</p><p>13) Click Finish.</p><p>Note: We will skip the next configurations as they are not relevant for this example.</p><p>Note: <em>&lt;YourAppName&gt;</em>View.mc should display.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*SXwkF1ZWBajb3fcLQmaW8g.png" /></figure><p>Before we continue, let’s take a minute to understand what we have on screen.</p><p>First of all, on the left side, our project is composed of 3 major folders, bin, resources and source.</p><p>Bin, contains all the files that are copied to your real device in order to execute your program.</p><p>Resources has all the files in charge of the appearance of you app. We will be modifying some files in here in order to create our watch face.</p><p>Source, contains the files where the code is edited, and as you can see, is where the View.mc file is located.</p><p>The View.mc is where all the magic happens in this application.</p><p>Finally, the App.mc file is the one in charge of starting our app.</p><p>As you can see, at the top of the View.mc file the program is importing some libraries with the “using” keyword. The methods and the classes accessible from these libraries, will allow us to construct our watch face. If you want to know more about each one, or all the libraries offered to us, open the Connect IQ menu at the top and select API Documentation. This will open a website with all the API’s, methods and classes available to developers, and their descriptions.</p><p>Something important to notice is that after all the library imports, our class is already making use of inheritance by extending the WatchUi.WatchFace class.</p><p>The template from Garmin is so nice, that it actually has some comments explaining what the methods are used for in the class. Take your time and read through the comments to familiarize yourself with the layout of the class. Once you are done, come back and we will continue with our project.</p><p>Now that we are ready to continue, lets delete a few lines from the template. The methods that we need to modify are onLayout() and onUpdate(). Here is a picture of how they should look like before the next steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*ASMlaIFIvkedPgmwK9TUPQ.png" /></figure><p>14)Right click on the resources folder.</p><p>15)Select New from the menu.</p><p>16)Click on Folder.</p><p>17)Type “fonts” on the Folder name field.</p><p>18)Click finish.</p><p>19) Right click on the fonts folder.</p><p>20) Select New from the menu.</p><p>21)Click on File.</p><p>22) Type “fonts.xml” on the File name field.</p><p>Note: The fonts.xml file should display.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*XMKKf5jpssz0kjZ8WjwcCA.png" /></figure><p>23)Open the Bitmap font generator (BMFont).</p><p>24)Open the options menu.</p><p>25)Select Font settings.</p><p>26)Select Aurebesh from the Font list.</p><p>27)Set Size(px) to 90.</p><p>28)Uncheck the Font smoothing box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*z9fC0gvBQ-xS3FzuqnpOrg.png" /></figure><p>Note: This is how the settings should look like.</p><p>29)Click OK.</p><p>30)Open the options menu.</p><p>31)Select Export options.</p><p>32)Select png — Portable Network Graphics from the Textures list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*u-8nywLqsEhuMVd_5gJ7Jw.png" /></figure><p>Note: This is how the export options should look like.</p><p>33) Click OK.</p><p>34) Open the options menu.</p><p>35)Select Save bitmap font as…</p><p>Note: You will have to look for the fonts folder inside the resources folder in your application. Once there, continue with the steps.</p><p>36)Type “myfonts” in the File name field.</p><p>37)Click Save.</p><p>38)Go back to Eclipse.</p><p>39)Press F5.</p><p>Note: This will refresh the files in your application.</p><p>Note: You should be able to see the new generated file under the fonts folder.</p><p>40)Type “&lt;fonts&gt;” in the fonts.xml file.</p><p>Note: Eclipse should auto generate a closing tag.</p><p>41)Press enter twice.</p><p>42)Type “&lt;font id=”myfonts” filename=”myfonts.fnt” filter=”0123456789:”/&gt;” in between the &lt;fonts&gt; tags.</p><p>Note: The id will help us use the fonts in our code by calling this name.</p><p>Note: The file name is where we are getting the fonts from.</p><p>Note: The filter is so that we can use the numbers and the colon.</p><p>43)Press ctrl + s.</p><p>Note: This will save the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*LsWLMnk2GIeR71jLG6JjHg.png" /></figure><p>Note: this is how the file fonts.xml should look like.</p><p>44)Close fonts.xml</p><p>45)Create 2 lines of empty space between line 6 and line 8 in the View.mc file.</p><p>46)Type “var myfonts = null;” in line 8.</p><p>Note: This is a global variable that we will use to hold our fonts later.</p><p>47)Type “myfonts=WatchUi.loadResource(Rez.Fonts.myfonts);” on the first line of the onLayout() function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WTGwN69MylEvsMWzogEQiQ.png" /></figure><p>Note: This is how the View.mc file should look like until now.</p><p>48)Type “dc.setColor(dc.COLOR_BLACK,dc.COLOR_BLACK);” on the first line of the onUpdate() function.</p><p>49)Type “dc.clear();” in the next line.</p><p>Note: These lines will help us create the background color.</p><p>50)Type “dc.setColor(dc.COLOR_RED,dc.COLOR_BLACK);” after the line holding the variable clockTime.</p><p>51)Type “dc.drawText(dc.getWidth()/2, 30, myfonts, Lang.format(“$1$”,[clockTime.hour]), dc.TEXT_JUSTIFY_RIGHT);” in the next line.</p><p>Note: These two lines will help us set the color for the hours</p><p>52)Type “dc.setColor(dc.COLOR_BLUE,dc.COLOR_BLACK);” in the next line.</p><p>53)Type “dc.drawText(dc.getWidth()/2, 30, myfonts, Lang.format(“$1$”,[clockTime.min.format(“%02d”)]), dc.TEXT_JUSTIFY_LEFT);” in the next line.</p><p>Note: These two lines will help us set the color for the minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*2VYFAPZIMJ8xpN3SrEH4Ig.png" /></figure><p>Note: This is how the View.mc file should look like now.</p><p>Congrats!!! You have built your first Watch Face with Garmin C!!!!</p><p>If you run the simulator on Eclipse it should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*tguyA-9JVKIWkU2PE4YqDg.png" /></figure><p>With our numbers taken from the Star Wars Fonts.</p><p>Thank you for accompanying me in this journey. I hope it was entertaining as well as informative. I encourage you to keep going and learn more about Monkey C so you can get the most out of your devices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6030a86a4595" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Garmin Monkey C — Next Steps]]></title>
            <link>https://medium.com/@earel329/garmin-monkey-c-next-steps-a449651b77f5?source=rss-10dddb6416f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a449651b77f5</guid>
            <dc:creator><![CDATA[Eduardo Arellano]]></dc:creator>
            <pubDate>Mon, 24 Feb 2020 00:00:56 GMT</pubDate>
            <atom:updated>2020-02-24T00:00:56.662Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Garmin Monkey C — Next Steps</strong></h3><p>In my last post (<a href="https://medium.com/@earel329/garmin-iq-and-monkey-c-fundamentals-ffe83eebb3fc?source=friends_link&amp;sk=03d97b812100ddc1d11905931ef98af3">Garmin IQ and Monkey C Fundamentals</a>) we started our journey to building an app for a Garmin watch using Garmin’s programming language Monkey C. In the final notes of the post I mentioned the next steps I will be covering to get to our end goal. But, before we can do that, we need to extend our knowledge about Monkey C.</p><p>The focus of this post is simply to cover more ground on the basics and more intermediate topics of programming for a Garmin device. For example, I will talk about how inheritance works, what happens when an error occurs, and how the virtual machine collects the garbage in Monkey C.</p><p>Again, it is important to mention that my point of reference will be Java, for any difference that we encounter along the way.</p><p>So, let’s keep going! We are almost half way there.</p><p><strong>Arrays</strong></p><p>Coming back to some review of the code we find that arrays in Monkey C, are not as different from arrays in Java.</p><p>As variables, arrays in Monkey C do not need a declared type. There are 2 ways of creating an array. One with a fixed size, and the other being dynamic. For example:</p><pre>var array = new [size];</pre><p>And</p><pre>var array = [1, 2, 3, 15];</pre><p>The last is also an example of a pre-initialized array.</p><p>We can also make use of two-dimensional arrays. I this case, there is no direct way to create an empty array. The easiest way, is to pre-initialize one using the following syntax:</p><pre>var twodimensions = [[x,y,z], [a,b,c]];</pre><p><strong>Errors</strong></p><p>Errors in Monkey C can cause our applications to terminate at runtime depending on the severity. Although Garmin might tackle this issue in future updates, errors that are severe like the ones I am about to list, cannot be caught.</p><p>For simplicity purposes, the following list contains only the name of the errors without a description. These errors are in most cases self-explanatory. In case you would like to look at the description, visit the Garmin developer’s website.</p><p>· Array Out Of Bounds</p><p>· Circular Dependency</p><p>· Communications Error</p><p>· File Not Found</p><p>· Illegal Frame</p><p>· Initializer Error</p><p>· Invalid Value</p><p>· Null Reference</p><p>· Out of Memory</p><p>· Permission Required</p><p>· Stack Underflow</p><p>· Stack Overflow</p><p>· Symbol Not Found</p><p>· System Error</p><p>· Too Many Arguments</p><p>· Too Many Timers</p><p>· Unexpected Type</p><p>· Unhandled Exception</p><p>· Watchdog Tripped</p><p><strong>Exception Handling</strong></p><p>For all non-fatal cases, Monkey C supports exception handling. Like Java, “try” and “catch” are used to handle the exception, and “throw” for actually throwing the exception.</p><p><strong>Inheritance</strong></p><p>Like Java, Monkey C supports inheritance with the use of the word “extends”. Classes that inherit from a super class can make use of its methods, modifying them to serve the needs of the subclass, like in the example from Garmin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*ZT-_Z_fra09r5-d4DVq9FQ.png" /></figure><p><strong>Access Modifiers</strong></p><p>“Public”, “private” and “protected” are still used in Monkey C the way they are used in Java. With “hidden” as another word for “protected”.</p><p>One thing to note here is that classes and modules are always public in Monkey C, so using these access modifiers will only work at a class member level.</p><p>If no modifier is specified, it will be considered public, as it is the default value.</p><p><strong>Callbacks</strong></p><p>In Monkey C, functions cannot be passed directly to other functions to be used as an object. In order to use a function in a different function we must use method() and invoke.</p><p>Once the Method object has been created, it can invoke a function from the instance of the object referenced. I know, it gets a little confusing, but hopefully this example from Gamin helps to illustrate what I am saying.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*AVO_ofxdJCgiMOEaxok-gA.png" /></figure><p><strong>Reference counting</strong></p><p>As you know, because of their size, wearable devices do not posses a big amount of memory. This resource is one of the most important when dealing with these kinds of devices. This is why like in Java, the virtual machine from Monkey C cleans up the memory. Freeing up space so we can use it.</p><p>The difference lays on the fact that Java uses garbage collection and Monkey C reference counting. This is where any memory space that does not have a reference from an object and gets its count to zero, gets “garbage collected”.</p><p>Reference counting is very useful in this kind of environments where memory is limited, but it has its problems too. Circular references block reference counting from achieving its objective, as they form a circle where no reference is dropped and so no memory is released. Avoiding circular references is crucial in order to make better use of memory.</p><p><strong>Modules</strong></p><p>In Monkey C, modules work as packages do in Java. The difference is that modules have most of the same properties as classes do. You could have variables, classes, functions and other modules at the module level.</p><p>Modules, in contrast with classes, cannot make use of inheritance or the “hidden-protected” access modifier.</p><p>And so here we are, the final stretch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pTMQZI9NyPM_gvcv" /><figcaption>Photo by <a href="https://unsplash.com/@quinoal?utm_source=medium&amp;utm_medium=referral">Quino Al</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Now that we have covered most of the basics and some intermediate concepts, we are ready for the gran finale. In the next blog, I will mention the Api’s that we can make use of, and the steps to construct our app from scratch.</p><p>Hang in there, we are almost at the end of this amazing journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a449651b77f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Garmin IQ and Monkey C Fundamentals]]></title>
            <link>https://medium.com/@earel329/garmin-iq-and-monkey-c-fundamentals-ffe83eebb3fc?source=rss-10dddb6416f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffe83eebb3fc</guid>
            <dc:creator><![CDATA[Eduardo Arellano]]></dc:creator>
            <pubDate>Mon, 17 Feb 2020 05:01:21 GMT</pubDate>
            <atom:updated>2020-02-17T05:01:21.520Z</atom:updated>
            <content:encoded><![CDATA[<p>Garmin’s technology and wearable devices are a powerful tool for any kind of sportsperson, as well as a nice-looking watch for anyone whose only goal is to own a smartwatch. Competitive or recreational, beginners or experienced, we all have something to gain from all the data and information that a device like this can provide us. But, have you ever thought about what is under the hood? What If you could create your own app? Something that actually displays or do exactly what you want, what you need.</p><p>It’s been I while since my last competition, yet I still remember the feeling and the adrenaline rushing through my body on race day. My friends, my Garmin Fenix 3 and I crossing the finish line. An unforgettable memory that I would like to experience again in the near future. Now, as a software development student, I have realized the possibility of combining my two passions, sport and technology.</p><p>In the next couple of weeks, I will be writing a series of blog posts to share with you some insight of Garmin’s Monkey C and its SDK Garmin IQ. From the Fundamentals, to building my own app for a Garmin device, I want to invite you to come along and share this exiting adventure with me.</p><p>So, ready your watches and let us begin…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kkg3Q544epSUur6yeULEjQ.jpeg" /><figcaption>You and me beginning our path together</figcaption></figure><p>As I mentioned before, I am currently studying software development, so I know a thing or two about programming with Java. This language will be my point of comparison moving forward. Also, I will assume you have some basic knowledge of programming. If you do not, don’t worry, Monkey C was developed to be easy to learn and use, so it is very intuitive.</p><p><strong>Background information</strong></p><p>Connect IQ was first introduced in 2015. As of right now, there has been 3 versions of the SDK, being the last the one currently supported by Garmin.</p><p>Garmin is committed to support every version for two years, after this, they release a new version. Which is why there is 3 versions today.</p><p>On the other hand, Monkey C, which is the name of the actual language we will be using to code, was molded from the mix of several other languages like Java, JavaScript, Python, PHP, and Ruby. If you are familiar with any of these, it should be very simple for you to learn how to use Monkey C.</p><p><strong>What can I achieve with Monkey C?</strong></p><p>Once you understand how this language is used, you should be able to develop any of the followings for a Garmin device:</p><p>· Watch Faces. The first screen you see on your watch, where you have the time.</p><p>· Widgets. These are small applications that provide us with some information, like the temperature.</p><p>· Data fields. These are where you can calculate some value depending on the activity you are tracking.</p><p>· Wearable apps. Bigger applications that have to be started by the user, which can be activities, games or any other thing you can imagine.</p><p><strong>Devices</strong></p><p>First of all, the variety of devices that Garmin has on the market is very extensive. It can go from watches, to computers for bicycles. As a developer, you should be able to support them all with Monkey C.</p><p>You must be aware that all devices have similar components, yet as technology keeps its course, newer devices will posses more powerful mechanisms that older versions won’t.</p><p>Also, some products are designed with a specific target and specialize in a different sport than others, thus we will encounter situations were our program will not be able to execute in a device.</p><p>So, it is important to make sure you choose the device you want to develop for and support. In my case, I will be working only with watches, more specific with the Gamin Vivo Active 3.</p><p>The Vivo Active 3 does not support music capabilities unless you have the music version, and so I will not be able to use the SDK in full, as music is one of the new features. But since this is the watch that I currently own and use, I am ok with this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cxzSApwWN3X0-KEeMPIwWw.png" /><figcaption>Some of the products from Garmin</figcaption></figure><p><strong>Setting up your computer</strong></p><p>Before we can actually begin, we will need to set up our computers and for this I will provide you the link to the Garmin’s website where you can download the SDK. Once you are there, simply follow the instructions.</p><p><a href="https://developer.garmin.com/connect-iq/programmers-guide/getting-started/">https://developer.garmin.com/connect-iq/programmers-guide/getting-started/</a></p><p>You can work on different platforms as it is explained on the website, but I will be using the plug-in for Eclipse on Microsoft. So, if you haven’t done this step, I highly recommend you to do it, so we can be on the same page.</p><p>For those of you who do not know what Eclipse is, it is an integrated development environment (IDE). It is basically the program where you write code to create other programs.</p><p>The plug-in contains a simulator, where we can see the device we chose to develop for and our program running on it. It is a nice feature because we don’t actually have to spend all our money buying different watches to try our program and we can check for errors before we make it available to the public.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*BJhLXlvnfpaZU3S6Of-cpA.png" /><figcaption>Simulator from Garmin</figcaption></figure><p><strong>Monkey C</strong></p><p>This is where I start getting a little more technical.</p><p>Monkey C is an Object-Oriented language. This being said, there is no primitive types like floats, integers or chars. They are all objects and as such, they can have methods as well.</p><p>Garmin calls this language Duck typed. “If it walks like a duck, and it quacks like a duck, then it must me a duck”, what this is saying is, it is dynamic. We will see how to create variables in the next section of code review.</p><p>Unlike Java, it doesn’t need to specify a parameter type in a function, neither does it need to specify a return. All functions return something.</p><p><strong>Basic Code Review</strong></p><p>Now that we are ready, lets look at some basic code that we will be able to use to program our applications.</p><p>As I mentioned before, if you have ever worked with a programming language, this should feel like a review to you. For those who haven’t, I recommend you to look for and understand the following concepts. They are pretty simple, and once you see what they do, I am sure everything will make sense.</p><p>For this section I will only provide some snapshots of the code Garmin uses. You will be able to see how they work in Monkey C and find the similarities and differences with the code you have used in the past in terms of syntax.</p><p>Classes and Functions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*GcY-Kq5Y16de1EuI1xtm3g.png" /></figure><p>In contrast with Java, Monkey C uses the word “using” for importing, and “function” to refer to a method. They still make use of extends for inheritance, and as I explained before, every method returns something even if it is not specified.</p><p>Variables and Constants</p><p>Variables in Monkey C are dynamic, you do not need to specify a type when you are initializing one. All types are supported, Integers, Floats, Longs, Doubles, Chars, Strings, Booleans, Objects.</p><p>To initialize a variable, you need the word “var” and to initialize a constant you need the word “const”. Then the name of the variable followed by an equal sign, the value you are initializing it to and finally a semicolon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*ngZH-NIcr2cO8XTOxmRCMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*0DDO4UzJRhunwsEMyRfqqA.png" /></figure><p>Monkey C will automatically understand which kind of variable you are using.</p><p>If and If Else statements</p><p>We still have our regular if statements to check if a condition is met.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*dw4EAZavcyIH1kz-jlwcow.png" /></figure><p>Switch statements</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*-XDyFlqiEhU392a_tLDfSg.png" /></figure><p>And Switch statements as a control statement where a case will be matched to our condition.</p><p>Loops</p><p>In Monkey C there are three kinds of loops. Do/While, While and For loops.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*Unisdgjd-9WuhlN-fdE_3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*Qqjakdl8yACpjfRjtv5P7A.png" /></figure><p>As you have already seen, the basic concepts from other languages are still applied in Monkey C. Since it was built from other languages, it is really easy for developers with some experience to pick up the concepts.</p><p>In later posts, I will be extending our knowledge base and actually going through how to create an application from the ground up. I will dive deeper into the libraries from Garmin IQ and how we can use them to our advantage. And I will touch briefly on some aspects of the virtual machine.</p><p>I hope you stay by my side until we reach the finish line, but for now, see you soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffe83eebb3fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>