<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Maiko Trindade</title>
    <link>https://maikotrindade.com</link>
    <atom:link href="https://maikotrindade.com/feed.xml" rel="self" type="application/rss+xml"/>
    <description>Technology, Mobile, Android, Artificial Intelligence, Jetpack Compose, React Native, Blockchain, ESG, Crypto, Solidity, Software Development, Open Source, and more.</description>
    <language>en-us</language>
    <lastBuildDate>Tue, 19 May 2026 20:02:04 -0700</lastBuildDate>
    <managingEditor>maikocharles@gmail.com (Maiko Trindade)</managingEditor>
    <webMaster>maikocharles@gmail.com (Maiko Trindade)</webMaster>
    
    <item>
      <title>Awesome React Native Skills: Claude Skills for Modern Mobile Dev</title>
      <link>https://maikotrindade.com/ai/agents/claude/react-native/2026/05/12/awesome-react-native-skills.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/ai/agents/claude/react-native/2026/05/12/awesome-react-native-skills.html</guid>
      <pubDate>Tue, 12 May 2026 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A curated collection of Claude Skills for building production-grade React Native apps in 2026, covering core, ecosystem, Expo, performance, and testing.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><a href="https://github.com/maikotrindade/awesome-react-native-skills">awesome-react-native-skills</a> is a curated set of Claude Skills for building production-grade React Native apps in 2026. Each skill is a self-contained folder with reference docs and conventions, so Claude can pick up the right context the moment you ask it for help on a navigation bug, a Reanimated transition, or an EAS build issue.</p>

<h3 id="why-this-exists">Why this exists</h3>

<p>I wrote about <a href="https://maikotrindade.com/ai/agents/claude/anthropic/2026/05/02/building-reusable-skills-for-claude.html">building reusable Skills for Claude</a> a few weeks ago. The same idea applies cleanly to React Native, maybe even more so. The ecosystem moves fast: the New Architecture is the default, Expo ships a new SDK every few months, and the “right” way to do navigation, state, or styling shifts often enough that stale answers are the norm. Packaging the current good practices as Skills means Claude loads the relevant slice on demand instead of guessing from training data.</p>

<h3 id="whats-inside">What’s inside</h3>

<p>Six skill groups, each focused on one part of the stack:</p>

<ul>
  <li><strong>React Native Core</strong> — native primitives, platform APIs, animations, gestures, accessibility.</li>
  <li><strong>React Native Ecosystem</strong> — navigation, state management, data fetching, and the libraries you actually ship.</li>
  <li><strong>React Native Expo</strong> — Router, EAS Build/Update/Submit, SDK upgrades.</li>
  <li><strong>React Native Reusables</strong> — shadcn/ui-style components built on NativeWind v4.</li>
  <li><strong>React Native Performance</strong> — profiling, measurement, and the optimizations that move the needle.</li>
  <li><strong>React Native Testing</strong> — Testing Library v13/v14 patterns for unit and integration tests.</li>
</ul>

<h3 id="tech-the-skills-cover">Tech the skills cover</h3>

<ul>
  <li>React Native 0.76+ with the New Architecture on by default</li>
  <li>Expo SDK 53 to 56</li>
  <li>React Navigation v7</li>
  <li>TanStack Query v5 for server state</li>
  <li>Zustand, Jotai, and Redux Toolkit for client state</li>
  <li>Reanimated v3 and Gesture Handler v2</li>
  <li>NativeWind v4 for styling</li>
  <li>Testing Library v13 and v14</li>
</ul>

<h3 id="how-to-use-it">How to use it</h3>

<p>Drop the skills into your local Claude skills folder:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/maikotrindade/awesome-react-native-skills.git ~/.claude/skills/awesome-react-native-skills
</code></pre></div></div>

<p>From there, Claude’s progressive disclosure does the rest. The frontmatter of each skill stays in the system prompt, and the body loads only when your question matches. You don’t have to remember which skill to invoke.</p>

<h3 id="where-it-goes-next">Where it goes next</h3>

<p>The repo is a starting point, not a finished thing. More skills are coming, and contributions are welcome if you’ve worked out a pattern that should be there. Check the project on <a href="https://github.com/maikotrindade/awesome-react-native-skills">GitHub</a> and open an issue or PR if something’s missing or out of date.</p>

]]></content:encoded>
      
      <category>AI</category>
      
      <category>agents</category>
      
      <category>Claude</category>
      
      <category>react-native</category>
      
      
      <category>claude</category>
      
      <category>ai-agents</category>
      
      <category>skills</category>
      
      <category>react-native</category>
      
      <category>expo</category>
      
      <category>mobile</category>
      
    </item>
    
    <item>
      <title>Jetpack Compose and React Native: More Similar Than You Think</title>
      <link>https://maikotrindade.com/android/react-native/2026/04/25/jetpack-compose-react-native-similarities.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/android/react-native/2026/04/25/jetpack-compose-react-native-similarities.html</guid>
      <pubDate>Sat, 25 Apr 2026 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>How Jetpack Compose concepts map directly to React Native — state, composables, navigation, and lifecycle for Android developers.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Android developers already fluent in Jetpack Compose will find React Native surprisingly familiar. Both share a declarative, component-driven model built around state — and if you’ve internalized the Compose mental model, the leap to React Native is much smaller than it looks from the outside.</p>

<h3 id="declarative-ui-composables-vs-components">Declarative UI: Composables vs. Components</h3>

<p>In Jetpack Compose, you build UI by writing <code class="language-plaintext highlighter-rouge">@Composable</code> functions that describe what the screen should look like for a given state. React Native uses function components that do exactly the same thing. The rendering philosophy — <em>describe, don’t impeach</em> — is identical.</p>

<p><strong>Jetpack Compose</strong></p>
<div class="language-kotlin highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nd">@Composable</span>
<span class="k">fun</span> <span class="nf">Greeting</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nc">String</span><span class="p">)</span> <span class="p">{</span>
    <span class="nc">Text</span><span class="p">(</span><span class="n">text</span> <span class="p">=</span> <span class="s">"Hello, $name!"</span><span class="p">)</span>
<span class="p">}</span>
</code></pre></div></div>

<p><strong>React Native</strong></p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">function</span> <span class="nx">Greeting</span><span class="p">({</span> <span class="nx">name</span> <span class="p">})</span> <span class="p">{</span>
  <span class="k">return</span> <span class="o">&lt;</span><span class="nx">Text</span><span class="o">&gt;</span><span class="nx">Hello</span><span class="p">,</span> <span class="p">{</span><span class="nx">name</span><span class="p">}</span><span class="o">!&lt;</span><span class="sr">/Text&gt;</span><span class="err">;
</span><span class="p">}</span>
</code></pre></div></div>

<p>Both frameworks re-run the function when inputs change and diff the result to update the UI. Compose calls this recomposition; React Native calls it re-rendering.</p>

<h3 id="state-management">State Management</h3>

<p>This is where the parallel is most striking. Compose’s <code class="language-plaintext highlighter-rouge">remember { mutableStateOf(...) }</code> maps almost one-to-one to React Native’s <code class="language-plaintext highlighter-rouge">useState()</code>. Both keep local state tied to the lifetime of the component and trigger a UI update on every change.</p>

<p><strong>Jetpack Compose</strong></p>
<div class="language-kotlin highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nd">@Composable</span>
<span class="k">fun</span> <span class="nf">Counter</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="py">count</span> <span class="k">by</span> <span class="nf">remember</span> <span class="p">{</span> <span class="nf">mutableStateOf</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="p">}</span>
    <span class="nc">Button</span><span class="p">(</span><span class="n">onClick</span> <span class="p">=</span> <span class="p">{</span> <span class="n">count</span><span class="p">++</span> <span class="p">})</span> <span class="p">{</span>
        <span class="nc">Text</span><span class="p">(</span><span class="s">"Tapped $count times"</span><span class="p">)</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<p><strong>React Native</strong></p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">function</span> <span class="nx">Counter</span><span class="p">()</span> <span class="p">{</span>
  <span class="kd">const</span> <span class="p">[</span><span class="nx">count</span><span class="p">,</span> <span class="nx">setCount</span><span class="p">]</span> <span class="o">=</span> <span class="nx">useState</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
  <span class="k">return</span> <span class="p">(</span>
    <span class="o">&lt;</span><span class="nx">TouchableOpacity</span> <span class="nx">onPress</span><span class="o">=</span><span class="p">{()</span> <span class="o">=&gt;</span> <span class="nx">setCount</span><span class="p">(</span><span class="nx">count</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)}</span><span class="o">&gt;</span>
      <span class="o">&lt;</span><span class="nx">Text</span><span class="o">&gt;</span><span class="nx">Tapped</span> <span class="p">{</span><span class="nx">count</span><span class="p">}</span> <span class="nx">times</span><span class="o">&lt;</span><span class="sr">/Text</span><span class="err">&gt;
</span>    <span class="o">&lt;</span><span class="sr">/TouchableOpacity</span><span class="err">&gt;
</span>  <span class="p">);</span>
<span class="p">}</span>
</code></pre></div></div>

<p>The concept of <strong>state hoisting</strong> — lifting state up to the nearest common ancestor and passing it down as props — is equally central to both. Compose documentation uses the term explicitly; the React ecosystem calls it “lifting state up” and the outcome is the same pattern.</p>

<h3 id="props-and-parameters">Props and Parameters</h3>

<p>Composable function parameters <em>are</em> props. Both systems use the same mechanism: data flows down from parent to child, and only the parent owns the state.</p>

<p><strong>Jetpack Compose</strong></p>
<div class="language-kotlin highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nd">@Composable</span>
<span class="k">fun</span> <span class="nf">UserCard</span><span class="p">(</span><span class="n">username</span><span class="p">:</span> <span class="nc">String</span><span class="p">,</span> <span class="n">avatarUrl</span><span class="p">:</span> <span class="nc">String</span><span class="p">,</span> <span class="n">onClick</span><span class="p">:</span> <span class="p">()</span> <span class="p">-&gt;</span> <span class="nc">Unit</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// ...</span>
<span class="p">}</span>
</code></pre></div></div>

<p><strong>React Native</strong></p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">function</span> <span class="nx">UserCard</span><span class="p">({</span> <span class="nx">username</span><span class="p">,</span> <span class="nx">avatarUrl</span><span class="p">,</span> <span class="nx">onClick</span> <span class="p">})</span> <span class="p">{</span>
  <span class="c1">// ...</span>
<span class="p">}</span>
</code></pre></div></div>

<p>Kotlin’s named arguments and default values map to React Native’s destructuring with default prop values. The ergonomics differ but the concept is the same.</p>

<h3 id="side-effects-and-lifecycle">Side Effects and Lifecycle</h3>

<p>Traditional Android had a full Activity/Fragment lifecycle — <code class="language-plaintext highlighter-rouge">onCreate</code>, <code class="language-plaintext highlighter-rouge">onResume</code>, <code class="language-plaintext highlighter-rouge">onPause</code>, <code class="language-plaintext highlighter-rouge">onDestroy</code>. Compose collapsed this into <code class="language-plaintext highlighter-rouge">LaunchedEffect</code> and <code class="language-plaintext highlighter-rouge">DisposableEffect</code>. React Native takes the same simplified view via <code class="language-plaintext highlighter-rouge">useEffect</code>.</p>

<p><strong>Jetpack Compose</strong></p>
<div class="language-kotlin highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// Runs on enter, cancels coroutine on leave</span>
<span class="nc">LaunchedEffect</span><span class="p">(</span><span class="n">userId</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">viewModel</span><span class="p">.</span><span class="nf">loadUser</span><span class="p">(</span><span class="n">userId</span><span class="p">)</span>
<span class="p">}</span>

<span class="c1">// Runs on enter, cleanup block runs on leave</span>
<span class="nc">DisposableEffect</span><span class="p">(</span><span class="nc">Unit</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">val</span> <span class="py">listener</span> <span class="p">=</span> <span class="nf">registerEventListener</span><span class="p">()</span>
    <span class="nf">onDispose</span> <span class="p">{</span> <span class="n">listener</span><span class="p">.</span><span class="nf">unregister</span><span class="p">()</span> <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<p><strong>React Native</strong></p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// Runs on mount and when userId changes</span>
<span class="nx">useEffect</span><span class="p">(()</span> <span class="o">=&gt;</span> <span class="p">{</span>
  <span class="nx">loadUser</span><span class="p">(</span><span class="nx">userId</span><span class="p">);</span>
<span class="p">},</span> <span class="p">[</span><span class="nx">userId</span><span class="p">]);</span>

<span class="c1">// Cleanup runs on unmount</span>
<span class="nx">useEffect</span><span class="p">(()</span> <span class="o">=&gt;</span> <span class="p">{</span>
  <span class="kd">const</span> <span class="nx">subscription</span> <span class="o">=</span> <span class="nx">subscribeToEvents</span><span class="p">();</span>
  <span class="k">return</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="nx">subscription</span><span class="p">.</span><span class="nx">remove</span><span class="p">();</span>
<span class="p">},</span> <span class="p">[]);</span>
</code></pre></div></div>

<p>The returned cleanup function in <code class="language-plaintext highlighter-rouge">useEffect</code> corresponds directly to <code class="language-plaintext highlighter-rouge">onDispose</code> in <code class="language-plaintext highlighter-rouge">DisposableEffect</code>. Even the dependency array in <code class="language-plaintext highlighter-rouge">useEffect</code> has a Compose analogue — the key you pass to <code class="language-plaintext highlighter-rouge">LaunchedEffect</code>.</p>

<h3 id="navigation">Navigation</h3>

<p>If you’ve internalized Android’s back stack, React Navigation will feel natural. Pushing a screen is conceptually the same as starting an Activity with an Intent, just expressed in JavaScript.</p>

<p><strong>Android (Intent with extras)</strong></p>
<div class="language-kotlin highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">val</span> <span class="py">intent</span> <span class="p">=</span> <span class="nc">Intent</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nc">DetailActivity</span><span class="o">::</span><span class="k">class</span><span class="p">.</span><span class="n">java</span><span class="p">)</span>
<span class="n">intent</span><span class="p">.</span><span class="nf">putExtra</span><span class="p">(</span><span class="s">"itemId"</span><span class="p">,</span> <span class="n">item</span><span class="p">.</span><span class="n">id</span><span class="p">)</span>
<span class="nf">startActivity</span><span class="p">(</span><span class="n">intent</span><span class="p">)</span>
</code></pre></div></div>

<p><strong>React Native (React Navigation)</strong></p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">navigation</span><span class="p">.</span><span class="nx">navigate</span><span class="p">(</span><span class="dl">'</span><span class="s1">Detail</span><span class="dl">'</span><span class="p">,</span> <span class="p">{</span> <span class="na">itemId</span><span class="p">:</span> <span class="nx">item</span><span class="p">.</span><span class="nx">id</span> <span class="p">});</span>
</code></pre></div></div>

<p>Both maintain a stack, both support passing parameters to the destination, and both expose a back-navigation mechanism. The underlying implementation differs (system Intents vs. a JS stack), but the mental model transfers directly.</p>

<h3 id="key-differences-to-keep-in-mind">Key Differences to Keep in Mind</h3>

<p>The similarities above are real, but a few structural differences matter:</p>

<ul>
  <li><strong>Language:</strong> Kotlin is statically typed with null safety built in. React Native typically uses JavaScript or TypeScript — TypeScript closes most of the gap.</li>
  <li><strong>Rendering:</strong> Compose draws UI onto a canvas managed by the Android runtime. React Native (since the New Architecture, default in v0.76) uses JSI to bridge JavaScript to actual platform widgets — UIView on iOS, Android Views on Android. The output looks native because it <em>is</em> native.</li>
  <li><strong>Tooling:</strong> Gradle, Android Studio, and <code class="language-plaintext highlighter-rouge">adb</code> are replaced by npm/yarn, Metro bundler, and the React Native CLI or Expo. The ecosystem is different even if the patterns are familiar.</li>
</ul>

<h3 id="the-takeaway">The Takeaway</h3>

<p>The shift from Jetpack Compose to React Native is not a paradigm shift — it is a syntax shift with a different language underneath. Composables, state, props, effects, and the navigation stack all have direct counterparts. If you already think declaratively about UI, you’re most of the way there.</p>

]]></content:encoded>
      
      <category>android</category>
      
      <category>react-native</category>
      
      
      <category>jetpack-compose</category>
      
      <category>react-native</category>
      
      <category>kotlin</category>
      
      <category>javascript</category>
      
      <category>declarative-ui</category>
      
      <category>cross-platform</category>
      
    </item>
    
    <item>
      <title>Building Reusable Skills for Claude: A Complete Guide</title>
      <link>https://maikotrindade.com/ai/agents/claude/anthropic/2026/03/27/building-reusable-skills-for-claude.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/ai/agents/claude/anthropic/2026/03/27/building-reusable-skills-for-claude.html</guid>
      <pubDate>Fri, 27 Mar 2026 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Learn how to build, configure, and share reusable Skills for Claude — markdown-based instruction folders that teach Claude your workflows once so you never repeat yourself again.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Claude Skills let you package your workflows, domain expertise, and preferences into reusable instruction folders that Claude loads automatically when relevant. The core philosophy: <strong>stop repeating yourself and start teaching Claude once</strong>. Instead of re-explaining your processes in every conversation, a skill captures that knowledge permanently — and applies it consistently across Claude.ai, Claude Code, and the API.</p>

<h3 id="what-is-a-claude-skill">What Is a Claude Skill?</h3>

<p>A skill is a folder containing a single required file — <code class="language-plaintext highlighter-rouge">SKILL.md</code> — plus optional supporting directories:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">scripts/</code> — executable Python or Bash code that runs without consuming context</li>
  <li><code class="language-plaintext highlighter-rouge">references/</code> — additional documentation loaded only as needed</li>
  <li><code class="language-plaintext highlighter-rouge">assets/</code> — templates, fonts, or icons used in outputs</li>
</ul>

<p>Skills are <strong>portable</strong>: the same skill works identically across Claude.ai, Claude Code, and the API without modification. They’re also <strong>composable</strong> — Claude can load multiple skills at once, each contributing specialized expertise without interfering with the others.</p>

<h3 id="the-three-level-progressive-disclosure-architecture">The Three-Level Progressive Disclosure Architecture</h3>

<p>Skills use a three-level loading system designed to minimize token usage while preserving deep expertise:</p>

<ul>
  <li><strong>Level 1 — YAML frontmatter</strong>: Always loaded into Claude’s system prompt. Contains just enough information for Claude to decide <em>when</em> the skill is relevant — without pulling the full content into context.</li>
  <li><strong>Level 2 — SKILL.md body</strong>: Loaded when Claude determines the skill is applicable. Contains the full workflow instructions, examples, and error handling.</li>
  <li><strong>Level 3 — Linked files</strong>: Additional documents inside the skill folder that Claude navigates and reads only as needed — API guides, reference docs, or detailed examples.</li>
</ul>

<p>This progressive approach means a skill library of dozens of entries adds minimal overhead until the right skill is needed.</p>

<h3 id="writing-the-skillmd-frontmatter">Writing the SKILL.md Frontmatter</h3>

<p>The YAML frontmatter is the most critical part of any skill — it determines whether Claude loads it at the right moment.</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">---</span>
<span class="na">name</span><span class="pi">:</span> <span class="s">sprint-planner</span>
<span class="na">description</span><span class="pi">:</span> <span class="s">Manages sprint planning workflows including task creation, velocity analysis, and capacity planning. Use when user mentions "sprint", "plan tasks", "create tickets", or "sprint planning".</span>
<span class="nn">---</span>
</code></pre></div></div>

<p>Key rules:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">name</code> must be <strong>kebab-case</strong>, no spaces, no capitals, matches the folder name</li>
  <li><code class="language-plaintext highlighter-rouge">description</code> must include <strong>both</strong> what the skill does and <strong>when to trigger it</strong> — include specific phrases users would actually say</li>
  <li>Keep description under 1024 characters; no XML angle brackets (security restriction)</li>
  <li>Optional fields: <code class="language-plaintext highlighter-rouge">allowed-tools</code> (restrict tool access), <code class="language-plaintext highlighter-rouge">license</code>, and <code class="language-plaintext highlighter-rouge">metadata</code> for author, version, and MCP server info</li>
</ul>

<p>A vague description like <code class="language-plaintext highlighter-rouge">"Helps with projects"</code> will never trigger reliably. A good description names file types, trigger phrases, and the concrete outcome the skill produces.</p>

<h3 id="three-categories-of-skills">Three Categories of Skills</h3>

<p>Anthropic’s guide identifies three common patterns in the wild:</p>

<p><strong>Document &amp; Asset Creation</strong> — Skills that produce consistent, high-quality output: frontend designs from specs, reports following team style guides, presentations from outlines. These rely only on Claude’s built-in capabilities with no external tools needed.</p>

<p><strong>Workflow Automation</strong> — Multi-step processes that benefit from consistent methodology. A sprint planning skill, for example, can fetch project status via MCP, analyze team velocity, suggest prioritization, and create tasks — all as a single guided workflow with validation gates between steps.</p>

<p><strong>MCP Enhancement</strong> — If you have a working MCP server, skills add the knowledge layer on top. Without a skill, users connect your MCP but don’t know what to do next and prompt inconsistently. With a skill, best practices are embedded: pre-built workflows activate automatically, reducing support burden and improving result consistency.</p>

<h3 id="testing-iteration-and-distribution">Testing, Iteration, and Distribution</h3>

<p>Effective skills testing covers three areas:</p>

<ul>
  <li><strong>Triggering tests</strong> — Run 10–20 queries that should activate the skill and verify it loads without explicit invocation. Target: 90% auto-trigger rate.</li>
  <li><strong>Functional tests</strong> — Verify correct outputs, successful API calls, and consistent structure across repeated runs.</li>
  <li><strong>Performance comparison</strong> — Compare the same task with and without the skill enabled; measure tool calls, token consumption, and user corrections required.</li>
</ul>

<p>The fastest path to a first skill is the <strong><code class="language-plaintext highlighter-rouge">skill-creator</code> skill</strong> — available in Claude.ai via the plugin directory or for Claude Code. Describe your top 2–3 workflows, and skill-creator generates a properly formatted <code class="language-plaintext highlighter-rouge">SKILL.md</code> with frontmatter, trigger phrases, and suggested structure. Expect 15–30 minutes to build and test your first working skill.</p>

<p>For distribution: host the folder on GitHub, upload it to Claude.ai via <strong>Settings &gt; Capabilities &gt; Skills</strong>, or deploy organization-wide through enterprise managed settings (available since December 2025). For programmatic use, the <code class="language-plaintext highlighter-rouge">/v1/skills</code> API endpoint enables skills in production pipelines and agent systems via the <code class="language-plaintext highlighter-rouge">container.skills</code> parameter on the Messages API.</p>

<p>Skills are published as an open standard — portable across tools and platforms by design. Explore Anthropic’s <a href="https://github.com/anthropics/skills">public skills repository</a> for production-ready examples across document creation, workflow automation, and partner integrations from Asana, Figma, Sentry, Zapier, and more. The <a href="https://resources.anthropic.com/hubfs/The-Complete-Guide-to-Building-Skill-for-Claude.pdf">complete guide</a> and the <a href="https://anthropic.skilljar.com/introduction-to-agent-skills/434525">introductory course</a> are the best starting points to go deeper.</p>

]]></content:encoded>
      
      <category>AI</category>
      
      <category>agents</category>
      
      <category>Claude</category>
      
      <category>Anthropic</category>
      
      
      <category>claude</category>
      
      <category>ai-agents</category>
      
      <category>skills</category>
      
      <category>anthropic</category>
      
      <category>productivity</category>
      
    </item>
    
    <item>
      <title>Capitol Trades Tracker: AI-Powered Investment Intelligence</title>
      <link>https://maikotrindade.com/artificial-intelligence/2026/01/18/introducing-capitol-trades-tracker.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/artificial-intelligence/2026/01/18/introducing-capitol-trades-tracker.html</guid>
      <pubDate>Sun, 18 Jan 2026 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>AI-powered Android app using agentic AI and multiple LLMs to track and analyze U.S. congressional stock trades, making political trading intelligence accessible to individual investors.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h2 id="introduction">Introduction</h2>

<p>What if you could see exactly what stocks members of Congress are buying and selling—before the market fully reacts? What if artificial intelligence could analyze these public transactions in real-time and identify patterns that might inform your investment strategy?</p>

<p>Welcome to <strong><a href="https://maikotrindade.com/capitol-trades-tracker/">Capitol Trades Tracker</a></strong>, a groundbreaking mobile application that combines the power of <strong>agentic AI</strong>, <strong>multiple large language models (LLMs)</strong>, and <strong>public government data</strong> to democratize access to political trading intelligence.</p>

<p>In an era where information asymmetry creates unfair advantages, Capitol Trades Tracker levels the playing field by making publicly disclosed congressional stock transactions not just visible, but <em>understandable</em> through cutting-edge AI analysis.</p>

<h2 id="the-problem-public-data-hidden-insights">The Problem: Public Data, Hidden Insights</h2>

<p>Federal law requires U.S. congressional members to disclose their stock transactions. This data is public, yet it remains largely inaccessible to everyday investors. The information exists in scattered government databases, difficult to parse, and nearly impossible to analyze at scale without sophisticated tools.</p>

<p>Meanwhile, institutional investors and hedge funds employ teams of analysts to monitor this exact data, looking for patterns that might indicate market-moving information. This creates a significant advantage for those with resources—until now.</p>

<h2 id="the-solution-ai-agents-meet-public-transparency">The Solution: AI Agents Meet Public Transparency</h2>

<p><img src="https://maikotrindade.com/public/img/capitol-trades-tracker-overview.png" alt="Capitol Trades Tracker" width="100%" /></p>

<p>Capitol Trades Tracker bridges this gap by combining three powerful elements:</p>

<h3 id="1-comprehensive-data-aggregation">1. <strong>Comprehensive Data Aggregation</strong></h3>
<p>Every publicly disclosed stock transaction made by congressional members is automatically collected, normalized, and made accessible through an intuitive mobile interface. Users can see:</p>
<ul>
  <li>Who traded (politician, office, district)</li>
  <li>What they traded (stock symbols, asset types)</li>
  <li>Transaction details (buy/sell, amount ranges, dates)</li>
  <li>Disclosure timing (transaction date vs. public filing date)</li>
</ul>

<h3 id="2-koog-powered-ai-agents">2. <strong>Koog-Powered AI Agents</strong></h3>
<p>At the heart of Capitol Trades Tracker is an intelligent AI agent built with <strong><a href="https://koog.ai">Koog</a></strong>, a cutting-edge framework for developing autonomous AI agents. This isn’t just simple data retrieval—it’s sophisticated, multi-layered analysis that:</p>

<ul>
  <li><strong>Continuously monitors</strong> official government disclosure databases in real-time</li>
  <li><strong>Processes and analyzes</strong> trading patterns using advanced algorithms</li>
  <li><strong>Generates actionable insights</strong> in human-readable format</li>
  <li><strong>Adapts and learns</strong> from market outcomes and political contexts</li>
</ul>

<h2 id="how-the-ai-technology-works">How the AI Technology Works</h2>

<h3 id="the-agentic-architecture">The Agentic Architecture</h3>

<p>Unlike traditional applications that simply display data, Capitol Trades Tracker employs <strong>agentic AI</strong>—autonomous intelligent systems that can:</p>

<ol>
  <li><strong>Perceive</strong>: Monitor multiple data sources continuously, including official disclosure records, market data, and news feeds</li>
  <li><strong>Reason</strong>: Apply complex analytical frameworks to identify unusual patterns, timing anomalies, and potential insider signals</li>
  <li><strong>Act</strong>: Generate daily insights, flag significant trades, and deliver personalized notifications</li>
  <li><strong>Learn</strong>: Improve analysis quality over time based on market outcomes</li>
</ol>

<h3 id="daily-intelligence-generation">Daily Intelligence Generation</h3>

<p>Every day, the AI agent generates fresh insights by:</p>

<ol>
  <li><strong>Scanning</strong> all new congressional trading disclosures</li>
  <li><strong>Analyzing</strong> patterns in transaction timing, volume, and assets</li>
  <li><strong>Correlating</strong> trades with pending legislation, industry trends, and market conditions</li>
  <li><strong>Assessing</strong> whether trades might indicate advance knowledge</li>
  <li><strong>Synthesizing</strong> findings into actionable investment intelligence</li>
</ol>

<p>Each insight is delivered in clear markdown format with:</p>
<ul>
  <li>Executive summary of key findings</li>
  <li>Detailed analysis of significant trades</li>
  <li>Potential investment implications</li>
  <li>Risk considerations</li>
  <li>Supporting context and reasoning</li>
</ul>

<h2 id="key-features-intelligence-at-your-fingertips">Key Features: Intelligence at Your Fingertips</h2>

<h3 id="-trading-feed">📊 <strong>Trading Feed</strong></h3>
<p>Comprehensive, continuously updated feed of congressional stock transactions with visual indicators (green for purchases, red for sales), detailed trade information, and powerful filtering capabilities.</p>

<h3 id="-ai-powered-insights-library">🤖 <strong>AI-Powered Insights Library</strong></h3>
<p>Complete archive of daily AI-generated analysis, showing:</p>
<ul>
  <li>Which LLM model performed each analysis</li>
  <li>Date and context of the insight</li>
  <li>Detailed reasoning and recommendations</li>
  <li>Historical performance tracking</li>
</ul>

<h3 id="-intelligent-dashboard">🏠 <strong>Intelligent Dashboard</strong></h3>
<p>Personalized home screen featuring:</p>
<ul>
  <li>Latest AI insight with key takeaways</li>
  <li>Most recent congressional transaction</li>
  <li>Relevant news and market updates</li>
  <li>Quick access to all features</li>
</ul>

<h3 id="-secure-profile-management">👤 <strong>Secure Profile Management</strong></h3>
<p>Google account integration for secure authentication, preference management, and personalized notifications.</p>

<h3 id="-mobile-first-design">📱 <strong>Mobile-First Design</strong></h3>
<p>Beautiful, responsive Android app built with modern Material Design, ensuring intuitive navigation and smooth performance.</p>

<h2 id="who-benefits-democratizing-investment-intelligence">Who Benefits: Democratizing Investment Intelligence</h2>

<h3 id="-individual-investors">📈 <strong>Individual Investors</strong></h3>
<p>Gain the same insights that institutional investors pay millions for. Make informed decisions based on what politicians are actually doing with their money.</p>

<h3 id="-researchers--academics">🎓 <strong>Researchers &amp; Academics</strong></h3>
<p>Access comprehensive historical data and AI analysis to study political trading patterns, market behavior, and governmental transparency.</p>

<h3 id="-financial-advisors">💼 <strong>Financial Advisors</strong></h3>
<p>Stay ahead of market-moving political activities to better serve clients with timely, data-driven advice.</p>

<h3 id="-transparency-advocates">🔍 <strong>Transparency Advocates</strong></h3>
<p>Monitor political accountability and potential conflicts of interest through accessible, AI-enhanced public data.</p>

<h2 id="real-world-impact-the-power-of-transparency--ai">Real-World Impact: The Power of Transparency + AI</h2>

<p>Capitol Trades Tracker represents a fundamental shift in how public data can serve public good:</p>

<p><strong>Leveling the Playing Field</strong>: What was once exclusive intelligence for well-resourced institutions is now available to anyone with a smartphone.</p>

<p><strong>Promoting Accountability</strong>: By making political trading patterns visible and understandable, we encourage greater scrutiny and responsibility.</p>

<p><strong>Enabling Better Decisions</strong>: AI-powered analysis transforms raw data into actionable intelligence, helping users understand not just <em>what</em> happened, but <em>why it matters</em>.</p>

<p><strong>Advancing Transparency</strong>: Making public data truly accessible furthers democratic ideals and informed citizenship.</p>

<h2 id="the-future-expanding-ai-powered-transparency">The Future: Expanding AI-Powered Transparency</h2>

<p>This is just the beginning. Future enhancements include:</p>

<ul>
  <li><strong>Predictive analytics</strong> using advanced machine learning</li>
  <li><strong>Portfolio tracking</strong> to compare your holdings against congressional trades</li>
  <li><strong>Custom alerts</strong> for specific politicians or sectors</li>
  <li><strong>Expanded coverage</strong> to state-level officials</li>
  <li><strong>Community insights</strong> where users can share analysis</li>
  <li><strong>API access</strong> for developers and researchers</li>
</ul>

<h2 id="conclusion-ai-for-good-intelligence-for-all">Conclusion: AI for Good, Intelligence for All</h2>

<p>Capitol Trades Tracker demonstrates how cutting-edge AI technology can serve the public interest. By combining Koog’s agentic AI framework with multiple large language models and publicly available data, we’ve created a tool that:</p>

<ul>
  <li>Makes government more transparent</li>
  <li>Empowers individual investors</li>
  <li>Advances democratic accountability</li>
  <li>Leverages AI for social good</li>
</ul>

<p>This isn’t about creating unfair advantages—it’s about eliminating them. It’s about using the most advanced AI technology to ensure that public information serves the public, not just those with resources to analyze it.</p>

<p><strong>The data is public. The AI is powerful. The insights are yours.</strong></p>
]]></content:encoded>
      
      <category>artificial-intelligence</category>
      
      
      <category>ai</category>
      
      <category>investing</category>
      
      <category>llm</category>
      
      <category>koog</category>
      
      <category>agentic-ai</category>
      
      <category>stocks</category>
      
    </item>
    
    <item>
      <title>AGSL: A Quick Introduction to Android Graphics Shading Language</title>
      <link>https://maikotrindade.com/android/graphics/2025/11/28/introduction-to-android-shading-language.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/android/graphics/2025/11/28/introduction-to-android-shading-language.html</guid>
      <pubDate>Fri, 28 Nov 2025 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A practical introduction to AGSL (Android Graphics Shading Language) — how to run custom GPU shaders within the Android rendering pipeline for rich visual effects in Compose.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h2 id="introduction">Introduction</h2>

<p>Modern mobile UIs increasingly rely on rich visual effects: gradients, blurs, distortions, ripple animations, and real-time visual feedback. On Android, <strong>AGSL (Android Graphics Shading Language)</strong> enables developers to create these effects efficiently by running custom GPU shaders directly within the Android rendering pipeline.</p>

<p>This article provides a <strong>quick, practical introduction to AGSL</strong>, explains <strong>where and how it is used</strong>, and compares it with <strong>similar technologies on iOS and other platforms</strong>, helping Android developers understand when AGSL is the right tool.</p>

<hr />

<h2 id="what-is-agsl">What is AGSL?</h2>

<p><strong>AGSL (Android Graphics Shading Language)</strong> is Android’s domain-specific shading language used to write <strong>fragment shaders</strong> that run on the GPU.</p>

<p>Key points:</p>

<ul>
  <li>Based on <strong>SkSL (Skia Shading Language)</strong></li>
  <li>Designed to be <strong>safe, portable, and optimized</strong> for Android</li>
  <li>Integrated with <strong>Skia</strong>, Android’s 2D graphics engine</li>
  <li>Primarily used for <strong>pixel-level visual effects</strong></li>
</ul>

<p>AGSL shaders operate on <strong>pixels</strong>, not geometry. This makes them ideal for:</p>
<ul>
  <li>Color transformations</li>
  <li>Distortions</li>
  <li>Gradients</li>
  <li>Blur and glow effects</li>
  <li>Procedural textures</li>
</ul>

<hr />

<h2 id="why-agsl-exists">Why AGSL Exists</h2>

<p>Historically, Android developers relied on:</p>
<ul>
  <li>XML drawables</li>
  <li>Canvas drawing</li>
  <li>RenderScript (now deprecated)</li>
  <li>OpenGL ES (powerful but complex)</li>
</ul>

<p>AGSL fills an important gap:</p>

<ul>
  <li>✅ Easier than OpenGL / Vulkan</li>
  <li>✅ More powerful than XML or Canvas</li>
  <li>✅ GPU-accelerated</li>
  <li>✅ First-class support in modern Android APIs</li>
</ul>

<p>It is especially relevant in the <strong>Jetpack Compose era</strong>, where expressive UI and animations are core expectations.</p>

<p><img src="https://maikotrindade.com/public/img/shaders.gif" width="340" height="290" alt="skia-shaders-example" /></p>

<p>Shaders example from <a href="https://shaders.skia.org/">https://shaders.skia.org/</a></p>

<hr />

<h2 id="a-simple-agsl-example">A Simple AGSL Example</h2>

<p>Here’s a minimal AGSL fragment shader that creates a time-based color animation:</p>

<div class="language-kotlin highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">uniform</span> <span class="n">float2</span> <span class="n">resolution</span><span class="p">;</span>
<span class="n">uniform</span> <span class="n">float</span> <span class="n">time</span><span class="p">;</span>

<span class="n">half4</span> <span class="nf">main</span><span class="p">(</span><span class="n">float2</span> <span class="n">fragCoord</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">float2</span> <span class="n">uv</span> <span class="p">=</span> <span class="n">fragCoord</span> <span class="p">/</span> <span class="n">resolution</span><span class="p">;</span>
    <span class="n">float</span> <span class="n">color</span> <span class="p">=</span> <span class="mf">0.5</span> <span class="p">+</span> <span class="mf">0.5</span> <span class="p">*</span> <span class="nf">sin</span><span class="p">(</span><span class="n">time</span> <span class="p">+</span> <span class="n">uv</span><span class="p">.</span><span class="n">x</span> <span class="p">*</span> <span class="mf">10.0</span><span class="p">);</span>
    <span class="k">return</span> <span class="nf">half4</span><span class="p">(</span><span class="n">color</span><span class="p">,</span> <span class="n">uv</span><span class="p">.</span><span class="n">y</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">);</span>
<span class="p">}</span>
</code></pre></div></div>

<p>This shader</p>

<ul>
  <li>Uses uniforms (resolution, time)</li>
  <li>Computes colors per pixel</li>
  <li>Runs entirely on the GPU</li>
  <li>Using AGSL in Android</li>
</ul>

<p><strong>AGSL with Jetpack Compose</strong></p>

<p>AGSL is most commonly used today via RuntimeShader in Jetpack Compose:</p>

<div class="language-kotlin highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">val</span> <span class="py">shader</span> <span class="p">=</span> <span class="nc">RuntimeShader</span><span class="p">(</span><span class="n">agslCode</span><span class="p">)</span>

<span class="nc">ShaderBrush</span><span class="p">(</span><span class="n">shader</span><span class="p">)</span>
</code></pre></div></div>

<p>You can then:</p>

<ul>
  <li>Pass uniforms (time, size, colors)</li>
  <li>Animate shaders using Compose animations</li>
  <li>Apply shaders to backgrounds, images, or custom layouts</li>
</ul>

<p>This integration makes AGSL extremely powerful for modern UI effects.</p>

<h3 id="performance-characteristics">Performance Characteristics</h3>

<p>AGSL shaders:</p>

<ul>
  <li>Run on the GPU</li>
  <li>Are compiled and optimized by Skia</li>
  <li>Avoid CPU-bound rendering</li>
</ul>

<p>However, AGSL offers excellent performance-to-complexity balance:</p>

<ul>
  <li>Complex shaders can still impact frame time</li>
  <li>Overuse can increase GPU load</li>
  <li>Always test on low-end devices</li>
</ul>

<h3 id="comparison-with-other-platforms">Comparison with Other Platforms</h3>
<p>On iOS, the closest equivalent is Metal Shading Language (MSL).
AGSL is UI-centric and constrained, while Metal is a general-purpose GPU API.
Flutter also supports custom shaders via SkSL-compatible fragment programs.</p>

<table>
  <thead>
    <tr>
      <th>Aspect</th>
      <th>AGSL (Android)</th>
      <th>Metal (iOS)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Level</td>
      <td>High-level, 2D-focused</td>
      <td>Low-level, full GPU</td>
    </tr>
    <tr>
      <td>Complexity</td>
      <td>Low–Medium</td>
      <td>High</td>
    </tr>
    <tr>
      <td>API Integration</td>
      <td>Skia / Compose</td>
      <td>Metal framework</td>
    </tr>
    <tr>
      <td>Use Case</td>
      <td>UI effects, 2D shaders</td>
      <td>UI, 3D, compute</td>
    </tr>
    <tr>
      <td>Learning Curve</td>
      <td>Gentle</td>
      <td>Steep</td>
    </tr>
  </tbody>
</table>

<h3 id="when-should-you-use-agsl">When Should You Use AGSL?</h3>

<p>Use AGSL when you need:</p>

<p>✨ Custom visual effects</p>

<p>🎨 Dynamic gradients or distortions</p>

<p>🌊 Shader-based animations</p>

<p>⚡ GPU-accelerated UI rendering</p>

<p><strong>Avoid AGSL when:</strong></p>

<ul>
  <li>A standard Compose modifier already exists</li>
  <li>The effect is static and simple</li>
  <li>Maintainability is more important than visual fidelity</li>
</ul>

<p><strong>Limitations of AGSL</strong></p>

<ul>
  <li>Fragment shaders only (no vertex shaders)</li>
  <li>Limited API surface (by design)</li>
  <li>Debugging can be harder than CPU code</li>
  <li>Not suitable for complex 3D rendering</li>
</ul>

<p><strong>AGSL is not a replacement for OpenGL, Vulkan, or Metal.</strong></p>
]]></content:encoded>
      
      <category>android</category>
      
      <category>graphics</category>
      
      
      <category>android</category>
      
      <category>agsl</category>
      
      <category>shaders</category>
      
      <category>graphics</category>
      
      <category>compose</category>
      
      <category>rendering</category>
      
    </item>
    
    <item>
      <title>Understanding AI Agents: Concepts, Architecture, and Tools</title>
      <link>https://maikotrindade.com/ai/agents/automation/agentic%20systems/llm/2025/10/02/understanding-ai-agents-concepts-architecture-tools.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/ai/agents/automation/agentic%20systems/llm/2025/10/02/understanding-ai-agents-concepts-architecture-tools.html</guid>
      <pubDate>Thu, 02 Oct 2025 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A comprehensive overview of AI agents — how they reason, plan, and act autonomously — covering architecture, key concepts, and popular tools including LangChain, CrewAI, and Koog.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>AI agents are a paradigm shift in how we design and interact with artificial intelligence. <a href="https://www.ibm.com/think/topics/ai-agents">AI agents</a> are programmed not only to respond to a single query but to reason, plan, act, and iterate on their own in order to reach a goal.</p>

<p>This piece will examine what AI agents are, how they function, what distinguishes them from traditional AI processes, the skills needed to excel at agentic AI, and the most popular tools you can currently utilize to build your own AI agents.</p>

<h3 id="what-is-an-ai-agent">What is an AI Agent?</h3>

<p>An <a href="https://www.ibm.com/think/topics/ai-agents">AI agent</a> is a smart system capable of:</p>

<ul>
  <li>
    <p>Obtain a high-level goal;</p>
  </li>
  <li>
    <p>Break it down into steps;</p>
  </li>
  <li>
    <p>Decide on the tools or actions to employ;</p>
  </li>
  <li>
    <p>Perform those actions;</p>
  </li>
  <li>
    <p>Observe the outcomes and make adjustments in strategy;</p>
  </li>
</ul>

<p>Unlike conventional AI models (e.g., chatbots), AI agents are goal-oriented. They do not merely respond to inquiries — they make decisions on what actions to take next. This renders the AI agent a very effective tool for automation, research, testing, software development, data analysis, and decision-making systems.</p>

<p>It is useful to distinguish between:</p>

<p><strong>LLMs</strong> → Responses to individual prompts;</p>

<p><strong>Workflows</strong> → Predefined, human-designed sequences of steps;</p>

<p><strong>Agents</strong> → Systems that choose and control the workflow themselves;</p>

<h3 id="core-components-of-an-ai-agent">Core Components of an AI Agent</h3>

<p>Most AI agents are based upon a few key elements:</p>

<p><strong>Reasoning Engine</strong></p>

<p>The reasoning layer is accountable for goal understanding, task breakdown, and determining the best possible next action. This is usually done with the help of an <a href="https://en.wikipedia.org/wiki/Large_language_model">LLM (Large Language Model)</a>.</p>

<p><strong>Planning</strong></p>

<p>Planning enables the agent to plan the sequence of actions rather than acting step by step. Some agents plan ahead, while others plan dynamically after the execution of each action.</p>

<p><strong>Memory</strong></p>

<p>Memory enables agents to store: Past behavior, Intermediate results and Long-term knowledge. The knowledge that can be maintained within long-term memory needs to be adequate for the character to progress appropriately in the story. The type of knowledge that should be stored in this region of memory is the ability to ride a bicycle. This skill requires practice, and the character should demonstrate that they have learned it.</p>

<p><strong>Tools &amp; Actions</strong></p>

<p>The agents interact with the world through tools such as: APIs, Databases, File systems or Browsers.</p>

<p><strong>Feedback &amp; Iteration</strong></p>

<p>The agents assess the outcome of their actions and make decisions on whether to continue, retry, or modify their strategy. This process is what gives the agents autonomy. In agentic systems, decision-making is entrusted to the AI itself and not hard-coded by programmers.</p>

<h3 id="skills-needed-to-master-agentic-ai">Skills Needed to Master Agentic AI</h3>

<p>Agentic AI requires more system design skill than prompt writing skill. The important skills are:</p>

<p><strong>Goal Decomposition</strong> — The capacity to decompose complex objectives into smaller, solvable tasks that the agent can reason about.</p>

<p><strong>Tool Design</strong> — Well-designed tools are essential. Agents work better when tools are: Clearly defined, Narrow in scope and Deterministic when possible.</p>

<p><strong>Evaluation &amp; Guardrails</strong> — Agents must have constraints to prevent infinite loops, hallucinations, or unsafe behaviors. These include: Success criteria, Step limits and Validation rules.</p>

<p><strong>Memory Management</strong> — How much the agent should remember, and for how long, is a major architectural choice.</p>

<p><strong>Human-in-the-Loop Design</strong> — In most practical scenarios, the agents would be working semi-autonomously with human approval checkpoints rather than full autonomy.</p>

<p><strong>Iterative Improvement</strong> — Performance is improved through experimentations, logging, and refinements rather than one-shot executions.</p>

<p><strong>Systems Thinking</strong> — In Agentic AI, one has to think beyond the response, including orchestration, observability, failure modes, and scalability.</p>

<h3 id="agent-frameworks-for-developers">Agent Frameworks for Developers</h3>

<p>The environment for developing AI agents is an ever-changing one. Some of the most popular tools being used currently are listed below.</p>

<p><strong><a href="https://www.langchain.com/">LangChain</a></strong> – A widely used framework that chains LLMs together using tools, memory, and control logic.</p>

<p><strong><a href="https://www.crewai.com/">CrewAI</a></strong> – Emphasizes the collaboration of multiple agents with defined roles.</p>

<p><strong>AutoGPT-like frameworks</strong> – Early autonomous agents that cycled between planning and execution loops.</p>

<p><strong><a href="https://platform.openai.com/">OpenAI Agent Builder / AgentKit</a></strong> – Tools for building structured, tool-driven agents with safety guardrails.</p>

<p><strong><a href="https://www.koog.ai/">Koog.ai</a></strong> – A Kotlin‑centric framework for developing AI agents, emphasizing strong typing, modular prompt executors, and a clean separation of reasoning, tools, and orchestration. Especially suited for backend and Android‑adjacent spaces.</p>
]]></content:encoded>
      
      <category>AI</category>
      
      <category>agents</category>
      
      <category>automation</category>
      
      <category>agentic systems</category>
      
      <category>llm</category>
      
      
      <category>AI</category>
      
      <category>agents</category>
      
      <category>automation</category>
      
      <category>agentic systems</category>
      
      <category>llm</category>
      
    </item>
    
    <item>
      <title>Building an Agentic AI Mobile Tester with Koog and Kotlin</title>
      <link>https://maikotrindade.com/ai/kotlin/android/development/agents/2025/08/19/building-agentic-ai-mobile-tester-koog-kotlin.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/ai/kotlin/android/development/agents/2025/08/19/building-agentic-ai-mobile-tester-koog-kotlin.html</guid>
      <pubDate>Tue, 19 Aug 2025 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>How to build an autonomous Android mobile testing agent using Koog and Kotlin, replacing repetitive manual test scripts with LLM-driven end-to-end test execution.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Testing Android apps is often repetitive, time-consuming, and hard to scale. Recently, I started experimenting with <strong>agentic AI</strong> to automate mobile testing—combining Kotlin, Koog, and LLMs to build a smart tester that can execute real end-to-end scenarios.</p>

<p>The result is my new project: <strong><a href="https://github.com/maikotrindade/mobile-tester-agent">Koog - Agentic Mobile Tester</a></strong>.</p>

<hr />

<h2 id="why-i-built-this">Why I Built This</h2>
<p>As an Android developer, I’ve used Espresso, UIAutomator, and other frameworks. They’re powerful, but still rigid: you need to write detailed test scripts and keep them updated. I wanted to explore whether an <strong>AI agent</strong> could take high-level goals like <em>“Log in and navigate to the profile screen”</em> and figure out the steps automatically.</p>

<hr />

<h2 id="how-it-works">How It Works</h2>
<p>The project is powered by <strong>Koog.ai</strong> and <strong>Kotlin</strong>, using an <strong>LLM as the reasoning engine</strong> (options include Gemini, Llama, GPT, or Gwen). Here’s the flow:</p>

<h3 id="ktor-api--koog-agent-backend"><a href="https://github.com/maikotrindade/mobile-tester-agent">Ktor API &amp; Koog Agent (Backend)</a></h3>

<p>The backend is built with <strong>Ktor</strong> in Kotlin and powered by a custom <strong>Koog agent</strong> (<code class="language-plaintext highlighter-rouge">MobileTestAgent</code>) plus a toolkit of device actions (<code class="language-plaintext highlighter-rouge">MobileTestTools</code>).</p>

<p><strong>Ktor API</strong>
The Ktor server exposes endpoints that receive test scenarios and configuration (LLM model, temperature, iterations). Each request is routed to the <code class="language-plaintext highlighter-rouge">MobileTestAgent</code>, which runs the scenario with the chosen parameters.</p>

<p><strong>MobileTestAgent (Koog Agent)</strong>
<code class="language-plaintext highlighter-rouge">MobileTestAgent</code> encapsulates the Koog agent setup. It translates high-level test goals into an iterative reasoning process, where the LLM plans actions like <em>“tap login button”</em> or <em>“enter text”</em>. The agent respects limits such as max iterations and temperature to balance creativity and determinism.</p>

<p><strong>MobileTestTools (Device Interaction)</strong>
<code class="language-plaintext highlighter-rouge">MobileTestTools</code> provides the executable layer via <strong>ADB commands</strong>. It includes functions for:</p>
<ul>
  <li>Interactions: <code class="language-plaintext highlighter-rouge">tap()</code>, <code class="language-plaintext highlighter-rouge">typeText()</code>, <code class="language-plaintext highlighter-rouge">scroll()</code>, <code class="language-plaintext highlighter-rouge">swipe()</code></li>
  <li>Checks: <code class="language-plaintext highlighter-rouge">assertTextVisible()</code>, <code class="language-plaintext highlighter-rouge">getUiHierarchy()</code></li>
  <li>Utilities: <code class="language-plaintext highlighter-rouge">launchApp()</code>, <code class="language-plaintext highlighter-rouge">installApk()</code>, <code class="language-plaintext highlighter-rouge">takeScreenshot()</code></li>
</ul>

<p>These functions are registered as tools within Koog, so when the agent plans an action, Koog calls the corresponding method directly.</p>

<p><strong>Execution Flow</strong></p>
<ul>
  <li>Ktor receives a scenario and sends it to the agent.</li>
  <li>Koog plans the next step using the LLM.</li>
  <li>The selected <code class="language-plaintext highlighter-rouge">MobileTestTools</code> method executes the action on the device.</li>
  <li>Feedback (UI state, success/failure) is fed back into the agent.</li>
  <li>This loop continues until the scenario ends or max iterations are hit.</li>
</ul>

<p>At the end, a structured report is generated with actions, results, and optional artifacts (like screenshots), and returned to the frontend dashboard.</p>

<h3 id="user-input-frontend-dashboard"><a href="https://github.com/maikotrindade/mobile-tester-agent-frontend">User Input (Frontend Dashboard)</a></h3>
<ul>
  <li>Users create test scenarios (goals &amp; steps) via a ReactJS dashboard.</li>
  <li>The site was designed with <a href="https://stitch.withgoogle.com/">Stitch</a> and stores data in <strong>Cloud Firestore</strong>.</li>
  <li>Users can also tweak AI agent parameters like:
    <ul>
      <li>Model (Gemini, GPT, etc.)</li>
      <li>Temperature</li>
      <li>Max iterations</li>
    </ul>
  </li>
</ul>

<h3 id="sample-android-app"><a href="https://github.com/maikotrindade/mobile-tester-agent-sample-app">Sample Android App</a></h3>
<ul>
  <li>To showcase the system, I created a simple demo Android app.</li>
  <li>The agent can interact with it and validate flows end-to-end.</li>
</ul>

<hr />

<h2 id="example-flow">Example Flow</h2>
<ul>
  <li>
    <p>User defines a scenario:<br />
<em>“Tap Add Post button → Input “some text” in the Description → Tap Create Post button”</em></p>
  </li>
  <li>The AI agent receives it, plans the steps, and uses <strong>ADB actions</strong> (tap, type, scroll, assert text).</li>
  <li>A report is generated with success/failure details.</li>
</ul>

<p>No need to maintain test scripts—just provide the goal.</p>

<p><img src="https://maikotrindade.com/public/img/ai-agentic-mobile-tester-koog.gif" width="390" height="240" alt="AI Agentic Mobile Tester" /></p>

<hr />

<h3 id="why-kotlin--koog">Why Kotlin + Koog?</h3>
<p>Kotlin gave me the flexibility to build a clean API with Ktor and manage complex agent logic easily. Koog.ai, with its <strong>Model Context Protocol (MCP)</strong> integration and agentic design, allowed me to connect the LLM with Android tooling like ADB seamlessly.</p>

<p>This mix of <strong>Kotlin, LLMs, and Android dev tools</strong> opens a new way of thinking about mobile testing: instead of scripting, you describe intentions.</p>

<hr />

<h3 id="whats-next">What’s Next</h3>
<ul>
  <li>Improving reporting (screenshots, videos, structured logs).</li>
  <li>Expanding to iOS and Web end-to-end testing.</li>
  <li>Exploring CI/CD integration for real-world teams.</li>
</ul>

<hr />

<h3 id="links">Links</h3>
<ul>
  <li>🔗 <a href="https://github.com/maikotrindade/mobile-tester-agent">Koog - Agentic Mobile Tester (Agent)</a></li>
  <li>🔗 <a href="https://github.com/maikotrindade/mobile-tester-agent-frontend">Frontend Dashboard</a></li>
  <li>🔗 <a href="https://github.com/maikotrindade/mobile-tester-agent-sample-app">Sample Android App</a></li>
  <li>🔗 <a href="https://www.linkedin.com/posts/maikotrindade_ai-aiagents-android-activity-7362894658969985025-02Jw?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAAAUawAwBJqLuU627P_RUiatzkteEsE66KbY">LinkedIn post</a></li>
</ul>

<hr />

<p>This was a fun experiment mixing <strong>Kotlin + AI agents + Android testing</strong>. If you’re curious about agentic AI, Koog, or just want to rethink mobile testing, I’d love feedback, feel free to DM on LinkedIn! 🚀</p>
]]></content:encoded>
      
      <category>AI</category>
      
      <category>Kotlin</category>
      
      <category>Android</category>
      
      <category>Development</category>
      
      <category>Agents</category>
      
      
      <category>Koog</category>
      
      <category>Kotlin</category>
      
      <category>AI</category>
      
      <category>Android</category>
      
      <category>Agentic</category>
      
      <category>Testing</category>
      
      <category>Compose</category>
      
    </item>
    
    <item>
      <title>Unleashing the Power of AI Agents with Koog</title>
      <link>https://maikotrindade.com/ai/kotlin/development/agents/2025/06/18/koog-ai-framework-agents.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/ai/kotlin/development/agents/2025/06/18/koog-ai-framework-agents.html</guid>
      <pubDate>Wed, 18 Jun 2025 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Introduction to Koog, JetBrains&apos; open-source agentic AI framework for Kotlin developers, covering how to build and run autonomous AI agents entirely within the JVM ecosystem.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><strong>Koog</strong> is an innovative, open-source <strong>agentic framework</strong> built by JetBrains. It empowers Kotlin developers to create and run AI agents entirely within the <strong>JVM ecosystem</strong>, leveraging a modern <strong>Kotlin DSL</strong>. This means you can build intelligent, autonomous agents with the same ease and productivity that Kotlin brings to everyday development.</p>

<p><img src="https://maikotrindade.com/public/img/koog-ai-agent.png" width="350" height="350" alt="koog-ai-agent" /></p>

<h3 id="the-benefits-of-koog-for-your-ai-agentic-projects">The Benefits of Koog for Your AI Agentic Projects</h3>

<p>Koog offers a compelling set of features and advantages that make it an excellent choice for anyone looking to dive into AI agent development with Kotlin:</p>

<ul>
  <li><strong>Pure Kotlin Implementation:</strong> Build and run your AI agents entirely in idiomatic Kotlin. This means leveraging all the benefits of Kotlin – conciseness, null safety, and excellent tooling – for your AI projects.</li>
  <li><strong>Modular Feature System:</strong> Extend your agent’s capabilities through a highly composable feature system. This allows for flexible and scalable agent design.</li>
  <li><strong>Tool Integration:</strong> Koog allows you to create and integrate custom tools, giving your agents access to external systems and resources. This is crucial for agents that need to interact with the real world or specific APIs.</li>
  <li><strong>Powerful Streaming API:</strong> Process responses from Large Language Models (LLMs) in real-time. This is essential for responsive user interfaces and efficient handling of large outputs. It even supports invoking multiple tools on the fly from a single LLM request.</li>
  <li><strong>Intelligent History Compression:</strong> Optimize token usage while maintaining conversation context through various pre-built strategies. This helps manage costs and improves efficiency when dealing with long conversations.</li>
  <li><strong>Persistent Agent Memory:</strong> Enable knowledge retention across different sessions and even between different agents, leading to more robust and capable AI.</li>
  <li><strong>Comprehensive Tracing:</strong> Debug and monitor agent execution with detailed and configurable tracing of LLM calls, tools, and agent stages. This provides invaluable insight into your agent’s behavior.</li>
  <li><strong>Support for Various LLM Providers:</strong> Koog integrates with popular LLM providers like Google, OpenAI, Anthropic, OpenRouter, and Ollama, giving you flexibility in choosing your underlying AI models.</li>
</ul>

<h3 id="my-experience-with-koog">My Experience with Koog</h3>

<p>As someone who is currently working on an <strong>AI agentic project</strong> and, honestly, without previous AI code experience, I can confidently say that Koog (version 0.2.1) is <strong>super good for it</strong>. The framework’s design is incredibly intuitive, making it easy to grasp the core concepts of building AI agents. The clear documentation and the idiomatic Kotlin approach meant that I could quickly get started and see tangible results. The ability to integrate tools and design complex workflows without getting bogged down in low-level AI complexities has been a game-changer for my project.</p>

<h3 id="conclusion">Conclusion</h3>

<p><strong>Koog</strong> is truly a game-changer for Kotlin developers venturing into the exciting field of AI agents. Its pure Kotlin implementation, comprehensive features, and developer-friendly design make it an exceptionally powerful and enjoyable framework to work with. It’s clear that JetBrains has put a lot of thought into making AI agent development accessible and efficient. Even for someone like me, who previously lacked extensive AI coding experience, <strong>Koog has proven to be incredibly easy to work with</strong> and an excellent foundation for building sophisticated AI agentic projects. If you’re a Kotlin developer looking to build AI agents, I highly recommend giving Koog a try – you won’t be disappointed!</p>
]]></content:encoded>
      
      <category>AI</category>
      
      <category>Kotlin</category>
      
      <category>Development</category>
      
      <category>Agents</category>
      
      
      <category>Koog</category>
      
      <category>Kotlin</category>
      
      <category>AI</category>
      
      <category>Agents</category>
      
      <category>JetBrains</category>
      
      <category>JVM</category>
      
      <category>AI Agentic Projects</category>
      
    </item>
    
    <item>
      <title>Exploring Android Studio&apos;s Gemini Journeys: AI-Powered Testing Revolution</title>
      <link>https://maikotrindade.com/android/ai/testing/2025/05/20/exploring-android-studio-gemini-journeys-ai-testing.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/android/ai/testing/2025/05/20/exploring-android-studio-gemini-journeys-ai-testing.html</guid>
      <pubDate>Tue, 20 May 2025 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>How Android Studio&apos;s Gemini Journeys feature uses AI to generate end-to-end tests from natural language prompts, transforming how developers approach mobile test automation.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Android development just got a significant upgrade with the introduction of <strong>Gemini Journeys</strong> in Android Studio. This innovative AI-powered feature promises to transform how we approach end-to-end testing by leveraging natural language prompts instead of traditional manual test creation.</p>

<h2 id="what-is-gemini-journeys">What is Gemini Journeys?</h2>

<p>Gemini Journeys represents a paradigm shift in mobile testing methodology. Instead of writing complex test scripts line by line, developers can now describe their testing intentions in plain English, and Gemini AI translates these prompts into comprehensive end-to-end tests.</p>

<p>The feature integrates seamlessly with Android Studio’s preview environment, offering developers an intuitive way to:</p>

<ul>
  <li>Generate automated UI tests through conversational prompts</li>
  <li>Create comprehensive test scenarios without deep testing framework knowledge</li>
  <li>Accelerate the testing workflow significantly</li>
  <li>Reduce the barrier to entry for comprehensive mobile testing</li>
</ul>

<h2 id="hands-on-experience-building-with-koinbase">Hands-On Experience: Building with KoinBase</h2>

<p>To explore Gemini Journeys’ capabilities, I created a demo project called <a href="https://github.com/maikotrindade/koinbase">KoinBase</a> - a simple cryptocurrency tracking application built with Jetpack Compose. The app showcases modern Android development practices while serving as a perfect testing ground for AI-assisted test generation.</p>

<video controls="" width="100%">
  <source src="https://github.com/maikotrindade/koinbase/raw/main/journeysDemo.mp4" type="video/mp4" />
  <p>Your browser doesn't support HTML5 video. <a href="https://github.com/maikotrindade/koinbase/raw/main/journeysDemo.mp4">Download the video</a> instead.</p>
</video>

<h3 id="key-features-of-the-demo">Key Features of the Demo:</h3>
<ul>
  <li><strong>Clean Architecture</strong>: Implementing MVVM pattern with proper separation of concerns</li>
  <li><strong>Jetpack Compose UI</strong>: Modern declarative UI framework</li>
  <li><strong>Dependency Injection</strong>: Using Koin for lightweight DI</li>
  <li><strong>Network Integration</strong>: RESTful API consumption for crypto data</li>
  <li><strong>Material 3 Design</strong>: Following latest design guidelines</li>
</ul>

<h2 id="first-impressions-a-game-changer">First Impressions: A Game Changer</h2>

<p>After experimenting with Gemini Journeys on the KoinBase project, here are my initial thoughts:</p>

<p><strong>The Good:</strong></p>
<ul>
  <li><strong>Intuitive Workflow</strong>: Describing test scenarios in natural language feels remarkably natural</li>
  <li><strong>Productivity Boost</strong>: Test creation time reduced significantly compared to manual approaches</li>
  <li><strong>Intelligent Context</strong>: Gemini understands app structure and suggests relevant test scenarios</li>
  <li><strong>Quality Output</strong>: Generated tests are comprehensive and well-structured</li>
</ul>

<p><strong>The Promise:</strong>
This technology represents a fundamental shift toward more accessible and efficient mobile testing. For teams struggling with testing coverage or developers new to automated testing, Gemini Journeys could be transformational.</p>

<h2 id="looking-forward">Looking Forward</h2>

<p>Gemini Journeys appears to be more than just another AI tool - it’s positioning itself as a genuine game changer for mobile testing workflows. The ability to generate robust E2E tests through conversational prompts could democratize comprehensive testing practices across development teams of all skill levels.</p>

<p>As AI continues to integrate deeper into development workflows, features like Gemini Journeys demonstrate how machine learning can augment human creativity rather than replace it. The future of Android development looks increasingly collaborative between human insight and artificial intelligence capabilities.</p>

<h2 id="try-it-yourself">Try It Yourself</h2>

<p>Interested in exploring Gemini Journeys? Check out the <a href="https://developer.android.com/studio/preview/gemini/journeys">official documentation</a> and consider experimenting with your own projects. The <a href="https://github.com/maikotrindade/koinbase">KoinBase demo</a> is also available as a reference implementation.</p>

<p>The intersection of AI and mobile development continues to evolve rapidly, and Gemini Journeys represents an exciting step toward more intelligent, efficient development practices.</p>
]]></content:encoded>
      
      <category>android</category>
      
      <category>ai</category>
      
      <category>testing</category>
      
      
      <category>AndroidStudio</category>
      
      <category>Gemini</category>
      
      <category>AI</category>
      
      <category>ArtificialIntelligence</category>
      
      <category>E2ETesting</category>
      
      <category>JetpackCompose</category>
      
      <category>MobileDevelopment</category>
      
    </item>
    
    <item>
      <title>Untangling State - Easier Android App Management with Compose</title>
      <link>https://maikotrindade.com/android/compose/development/2025/03/08/untangling-state-android-app-management.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/android/compose/development/2025/03/08/untangling-state-android-app-management.html</guid>
      <pubDate>Sat, 08 Mar 2025 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A practical guide to state management in Jetpack Compose, covering state hoisting, ViewModel integration, and patterns for keeping Android app state clean and maintainable.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Building Android apps today is a lot about managing “state.” Think of state as all the information that makes your app tick: the text a user typed, whether a button is enabled, a list of items to display. As your app grows, managing this state can get tricky, making your code messy and hard to maintain.</p>

<p>Thankfully, Jetpack Compose, Android’s modern UI toolkit, offers some elegant patterns to keep your state under control. Let’s break down some of the key ideas, making them easier to understand than a complex technical paper.</p>

<h3 id="the-core-idea-state-hoisting">The Core Idea: State Hoisting</h3>

<p>Imagine you have a <code class="language-plaintext highlighter-rouge">Checkbox</code> in your app. It has two states: checked or unchecked. If the <code class="language-plaintext highlighter-rouge">Checkbox</code> manages its own state, it’s called “internal state.” But what if another part of your app needs to know if it’s checked?</p>

<p>This is where <strong>State Hoisting</strong> comes in. Instead of the <code class="language-plaintext highlighter-rouge">Checkbox</code> holding its own “checked” status, we “hoist” that status up to a parent component. The <code class="language-plaintext highlighter-rouge">Checkbox</code> then becomes a “dumb” component. It just shows what it’s told to show and tells its parent when it’s clicked.</p>

<p>Think of it like a child asking a parent for permission. The child (our <code class="language-plaintext highlighter-rouge">Checkbox</code>) doesn’t decide if it can have a cookie (change its state). It asks the parent (the higher-level component), and the parent makes the decision and tells the child what to do.</p>

<p>In Compose, this often looks like:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@Composable
fun MyFancyCheckbox(
    isChecked: Boolean, // The state is passed in
    onCheckedChange: (Boolean) -&gt; Unit // An event is passed out
) {
    Checkbox(
        checked = isChecked,
        onCheckedChange = onCheckedChange // The parent handles the actual state update
    )
}

@Composable
fun ParentScreen() {
    var checkedState by rememberSaveable { mutableStateOf(false) } // Parent manages the state
    MyFancyCheckbox(
        isChecked = checkedState,
        onCheckedChange = { newCheckedState -&gt; checkedState = newCheckedState }
    )
}
</code></pre></div></div>

<p>This makes MyFancyCheckbox reusable and testable because it doesn’t care how its state is managed, only what its state is and when it’s interacted with.</p>

<h3 id="state-holders-your-state-organizers">State Holders: Your State Organizers</h3>
<p>As your app gets more complex, you’ll have more and more state. Just having a bunch of vars in your @Composable function can get unwieldy. This is where State Holders come in handy.</p>

<p>A State Holder is essentially a plain old Kotlin class that holds and manages a piece of your UI’s state. It centralizes all the logic related to that state.</p>

<p>Imagine a user profile screen. It might have the user’s name, email, and a “save” button. Instead of managing all these bits of information directly in your ProfileScreen Composable, you could have a ProfileScreenStateHolder (or ViewModel if it’s lifecycle-aware).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>// A simple example of a State Holder
class MyLoginScreenStateHolder {
    var username by mutableStateOf("")
    var password by mutableStateOf("")

    fun onUsernameChanged(newUsername: String) {
        username = newUsername
    }

    fun onPasswordChanged(newPassword: String) {
        password = newPassword
    }

    fun login() {
        // Perform login logic using username and password
        println("Attempting to log in with username: $username")
    }
}

@Composable
fun LoginScreen(stateHolder: MyLoginScreenStateHolder = remember { MyLoginScreenStateHolder() }) {
    Column {
        TextField(
            value = stateHolder.username,
            onValueChange = stateHolder::onUsernameChanged,
            label = { Text("Username") }
        )
        TextField(
            value = stateHolder.password,
            onValueChange = stateHolder::onPasswordChanged,
            label = { Text("Password") }
        )
        Button(onClick = stateHolder::login) {
            Text("Login")
        }
    }
}
</code></pre></div></div>

<p>This separates the UI (LoginScreen) from the logic and state management (MyLoginScreenStateHolder), making your code cleaner and easier to understand.</p>

<p><strong>ViewModels</strong>: The Android-Aware State Holders
When your State Holder needs to survive configuration changes (like rotating your phone) or interact with data from your app’s deeper layers (like a database or network), you often use a ViewModel.</p>

<p>A <strong>ViewModel</strong> is a special kind of State Holder provided by Android Architecture Components. It’s designed to hold UI-related data in a way that survives app lifecycle events. It’s often where you’ll find your network calls, database operations, and other business logic that feeds into your UI.</p>

<p>Think of it as the brain of your screen or feature. It fetches data, processes it, and then exposes that data to your Composables.</p>

<h3 id="when-to-choose-what">When to Choose What?</h3>
<ul>
  <li>State Hoisting: For simple UI elements where the parent needs to control the state. It makes components reusable and less coupled.</li>
  <li>Simple State Holders (Plain Kotlin classes): When you have a group of related UI state that needs to be managed together within a single Composable, and it doesn’t need to survive lifecycle changes or interact with deeper app layers.</li>
  <li>ViewModels: For complex screens or features where you need to manage state that survives configuration changes, interacts with data sources (like network or database), or requires more complex business logic. They are typically used for a whole screen or a significant portion of it.</li>
</ul>

<h3 id="the-benefits-of-good-state-management">The Benefits of Good State Management</h3>
<p>By applying these patterns, you gain:</p>

<ul>
  <li>Cleaner Code: Your UI code focuses solely on how things look, not what data they hold or how that data changes.</li>
  <li>Easier Testing: You can test your State Holders and ViewModels independently of your UI.</li>
  <li>Better Reusability: Components become generic and can be used in different parts of your app.</li>
  <li>Improved Maintainability: When something breaks, it’s easier to pinpoint where the issue lies.</li>
</ul>

<p>Understanding and applying these state management patterns in Jetpack Compose will significantly improve the quality and maintainability of your Android applications. It’s a fundamental concept that will serve you well as you build more complex and robust experiences.</p>
]]></content:encoded>
      
      <category>android</category>
      
      <category>compose</category>
      
      <category>development</category>
      
      
    </item>
    
    <item>
      <title>Execution Order in Jetpack Compose Explained with Analogies</title>
      <link>https://maikotrindade.com/2025/01/28/execution-order-in-jetpack-compose.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2025/01/28/execution-order-in-jetpack-compose.html</guid>
      <pubDate>Tue, 28 Jan 2025 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A clear explanation of how LaunchedEffect, DisposableEffect, and composables execute in Jetpack Compose, using real-world analogies to demystify the rendering lifecycle.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Understanding when <code class="language-plaintext highlighter-rouge">LaunchedEffect</code>, <code class="language-plaintext highlighter-rouge">DisposableEffect</code>, and composables run in Jetpack Compose can be tricky. Let’s simplify with a few real-world analogies.</p>

<h3 id="-composables--stage-actors">🎭 Composables = Stage Actors</h3>

<p>Composables are like actors:</p>

<ul>
  <li>
    <p>They enter when the screen appears.</p>
  </li>
  <li>
    <p>They update their lines when state changes (recomposition).</p>
  </li>
  <li>
    <p>They exit when removed from the UI.</p>
  </li>
</ul>

<h3 id="️-launchedeffect--candle-in-a-room">🕯️ LaunchedEffect = Candle in a Room</h3>

<ul>
  <li>
    <p>You light a candle when entering a room → <code class="language-plaintext highlighter-rouge">LaunchedEffect</code> runs.</p>
  </li>
  <li>
    <p>If the room changes (key changes), you blow it out and light a new one.</p>
  </li>
  <li>
    <p>If you leave, the candle is blown out.</p>
  </li>
  <li>
    <p>Use it for one-time effects or state collection.</p>
  </li>
</ul>

<h3 id="-disposableeffect--hotel-housekeeping">🧹 DisposableEffect = Hotel Housekeeping</h3>
<ul>
  <li>
    <p>Housekeeper sets up the room → <code class="language-plaintext highlighter-rouge">DisposableEffect</code> runs.</p>
  </li>
  <li>
    <p>When you check out (or key changes), the room is cleaned → onDispose is called.</p>
  </li>
  <li>
    <p>Perfect for listeners or subscriptions that need cleanup.</p>
  </li>
</ul>

<h3 id="-recomposition--changing-actors-lines">🔄 Recomposition = Changing Actor’s Lines</h3>
<p>If the script (state) changes, actors stay on stage but adjust their lines. No need to re-run effects unless keys change.</p>

<h3 id="quick-comparison">Quick Comparison</h3>

<table>
  <thead>
    <tr>
      <th>Concept</th>
      <th>Analogy</th>
      <th>When It Runs</th>
      <th>When It Cleans Up</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Composable</td>
      <td>Actor</td>
      <td>On screen draw/state</td>
      <td>On removal</td>
    </tr>
    <tr>
      <td>LaunchedEffect</td>
      <td>Candle</td>
      <td>On enter/key change</td>
      <td>On key change/removal</td>
    </tr>
    <tr>
      <td>DisposableEffect</td>
      <td>Housekeeping</td>
      <td>On enter/key change</td>
      <td>On key change/removal</td>
    </tr>
  </tbody>
</table>

<h3 id="-final-tip">✅ Final Tip</h3>
<p>So next time you add a <code class="language-plaintext highlighter-rouge">LaunchedEffect</code> or a <code class="language-plaintext highlighter-rouge">DisposableEffect</code>, ask yourself:</p>

<ul>
  <li>
    <p>Is this a one-time action? → Use <code class="language-plaintext highlighter-rouge">LaunchedEffect</code>.</p>
  </li>
  <li>
    <p>Does it need cleanup? → Use <code class="language-plaintext highlighter-rouge">DisposableEffect</code>.</p>
  </li>
  <li>
    <p>Thinking this way makes Compose easier and your code cleaner.</p>
  </li>
  <li>
    <p><a href="https://developer.android.com/jetpack/compose/side-effects">Side-Effect</a> official docs.</p>
  </li>
  <li>
    <p><a href="https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#LaunchedEffect">LaunchedEffect</a> official docs.</p>
  </li>
</ul>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Exploring Android XR</title>
      <link>https://maikotrindade.com/2024/12/14/exploring-Android-XR.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/12/14/exploring-Android-XR.html</guid>
      <pubDate>Sat, 14 Dec 2024 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>An introduction to Android XR development — how to build augmented and virtual reality applications on Android using the XR platform, covering AR, VR, and spatial computing fundamentals.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>The world of extended reality (XR) is expanding rapidly, merging physical and digital realms to create immersive experiences. Android XR offers a versatile platform for developers to build applications that blend augmented reality (AR) and virtual reality (VR) into everyday life. In this post, we’ll explore the essentials of Android XR and provide you with a starting point to dive into this exciting technology.</p>

<h3 id="what-is-android-xr">What is Android XR?</h3>

<ul>
  <li>
    <p>XR (Extended Reality) encompasses all immersive technologies—AR, VR, and mixed reality (MR). Android XR integrates these experiences seamlessly into Android devices, allowing developers to create cutting-edge applications that:</p>
  </li>
  <li>
    <p>Overlay digital objects on the real world (AR).</p>
  </li>
  <li>
    <p>Fully immerse users in virtual environments (VR).</p>
  </li>
  <li>
    <p>Combine real and virtual objects that interact in real-time (MR).</p>
  </li>
  <li>
    <p>Android’s XR ecosystem is built on frameworks like ARCore and leverages powerful hardware capabilities available in modern devices.</p>
  </li>
</ul>

<h3 id="key-components-of-android-xr">Key Components of Android XR</h3>

<p><strong>1. ARCore</strong></p>

<p>ARCore is Android’s primary SDK for building AR applications. It provides tools to:</p>

<ul>
  <li>
    <p>Track motion in 3D space.</p>
  </li>
  <li>
    <p>Understand environmental features like flat surfaces.</p>
  </li>
  <li>
    <p>Estimate lighting conditions for realistic AR rendering.</p>
  </li>
</ul>

<p><strong>2. XR Interaction Tools</strong></p>

<p>Android XR provides APIs and libraries to simplify interactions, such as detecting gestures or recognizing physical objects. Developers can use Unity or Unreal Engine to create rich 3D experiences or integrate ARCore directly into Android apps for custom solutions.</p>

<p><strong>3. Cross-Platform Development</strong></p>

<p>Android XR supports frameworks like OpenXR, making it easier to build applications that work across multiple devices, from smartphones to head-mounted displays (HMDs).</p>

<h3 id="getting-started-with-android-xr-development">Getting Started with Android XR Development</h3>

<p><strong>1. Set Up Your Development Environment</strong></p>

<p>Start by installing Android Studio and configuring it for XR development:</p>

<ul>
  <li>
    <p>Install the latest version of Android Studio.</p>
  </li>
  <li>
    <p>Add the ARCore dependency to your project.</p>
  </li>
  <li>
    <p>Use a physical device with ARCore support for testing.</p>
  </li>
</ul>

<p><strong>2. Learn the Basics</strong></p>

<p>Explore Android XR’s official documentation:</p>

<ul>
  <li>
    <p><a href="https://developer.android.com/xr">Android XR Overview</a></p>
  </li>
  <li>
    <p><a href="https://developer.android.com/develop/xr">Developing XR Applications</a></p>
  </li>
</ul>

<p><strong>3. Build Your First App</strong></p>

<p>Try creating a simple AR app that displays a 3D object on a flat surface. ARCore’s Plane Detection API can help you get started quickly.</p>

<h3 id="my-android-xr-demo-project">My Android XR Demo Project</h3>

<p>To help you jumpstart your journey, I’ve created a simple demo app showcasing basic XR features using ARCore and Jetpack Compose. This project serves as a practical example to learn XR development fundamentals.</p>

<p><img src="https://maikotrindade.com/public/img/AndroidXR.gif" width="380" height="240" alt="android-xr-bitcoin-ethereum" /></p>

<p>Check it out on GitHub: <a href="https://github.com/maikotrindade/android-XR-demo">Android XR Demo</a></p>

<p>Notice that you can also check some <a href="https://github.com/android/xr-samples">samples from Google team</a>.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>A Guide to Accessibility in Android Apps with Jetpack Compose</title>
      <link>https://maikotrindade.com/2024/12/03/a-guide-to-accessibiliy-in-android-apps-jetpack-compose.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/12/03/a-guide-to-accessibiliy-in-android-apps-jetpack-compose.html</guid>
      <pubDate>Tue, 03 Dec 2024 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Comprehensive guide to Android accessibility with Jetpack Compose — TalkBack, Switch Access, touch targets, color contrast, and automated accessibility testing using semantics.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Last week, I had the privilege of presenting at <a href="https://www.meetup.com/the-test-tribe-calgary-meetup/">The Test Tribe 12th Calgary Meetup</a>, hosted at the Neo Financial office in Calgary. The event, held on November 28, 2024, brought together an amazing community of testers and developers passionate about creating better user experiences.</p>

<p>During the session, titled “Creating Inclusive Experiences: A Guide to Accessibility in Android Apps with Jetpack Compose,” I delved into the vital role accessibility plays in shaping a truly universal user experience. We explored topics such as:</p>

<p>The challenges faced by users with disabilities, including visual, mobility, cognitive, and hearing impairments.
The accessibility services provided by Android, like <a href="https://support.google.com/accessibility/android/answer/6283677?hl=en">TalkBack</a>, Switch Access, and Voice Access.
Practical guidelines for creating inclusive designs, such as optimizing touch targets, simplifying gestures, and ensuring sufficient color contrast.
Tools and methods for testing accessibility, including manual testing with TalkBack and automated testing using semantics in Jetpack Compose.
The presentation also included practical demonstrations of accessibility testing, featuring examples from an app I created specifically to highlight accessibility issues and solutions (<a href="https://github.com/maikotrindade/InaccessibleApp">InaccessibleApp</a>).</p>

<p><img src="https://maikotrindade.com/public/img/accessibility-dog.jpeg" width="380" height="370" alt="Accessibility pet" /></p>

<h3 id="why-accessibility-matters">Why Accessibility Matters</h3>
<p>As the <a href="https://www.who.int/">World Health Organization</a> notes, over 1.3 billion people live with some form of disability. Accessibility isn’t just about compliance; it’s about empathy and inclusion. By leveraging Jetpack Compose’s accessibility tools, we can build Android apps that make everyone feel welcome and empowered.</p>

<h3 id="thank-you-to-the-community">Thank You to the Community</h3>
<p>I want to extend a heartfelt thank you to the organizers, attendees, and everyone who made this event possible. The energy in the room was fantastic, with engaging questions and thoughtful discussions. It was a delightful evening where we all learned so much about building better, more inclusive experiences.</p>

<p>Looking forward to more opportunities to share knowledge and grow together with this vibrant community!</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Gemini AI in Android Studio » Faster, Smarter, Better</title>
      <link>https://maikotrindade.com/2024/10/20/gemini-ai-in-android-studio.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/10/20/gemini-ai-in-android-studio.html</guid>
      <pubDate>Sun, 20 Oct 2024 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>How Gemini AI integrated into Android Studio boosts developer productivity through code writing, refactoring, documentation, commit messages, and intelligent suggestions.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Android development just got smarter with the introduction of Gemini, an AI-powered assistant integrated into Android Studio. Gemini is designed to enhance productivity, reduce repetitive tasks, and support developers throughout the app lifecycle. Here’s a closer look at how <a href="https://gemini.google.com/app">Gemini</a> transforms your coding experience.</p>

<p><img src="https://maikotrindade.com/public/img/gemini-android.gif" width="340" height="200" alt="gemini-ai" /></p>

<h3 id="1-code-writing-and-refactoring-made-easy">1. Code Writing and Refactoring Made Easy</h3>
<p>Gemini doesn’t just suggest code snippets—it can write, refactor, and document code. With Gemini, you can:</p>

<p>Generate commit messages: Analyze your code changes and get suggested descriptions for version control.
Refactor code with ease: Rename variables, classes, and methods using intuitive AI-driven suggestions.
Streamline prototypes to production: Implement common design patterns and iterate faster than ever.</p>

<h3 id="2-ui-automation-for-jetpack-compose">2. UI Automation for Jetpack Compose</h3>
<p>Visualizing and fine-tuning UI designs can be tedious. Gemini enhances Compose workflows by:</p>

<p>Auto-generating UI previews: Use AI to create relevant mock data and preview your Composables without manual setup.
Simplifying multimodal design: Gemini can <a href="https://medium.com/@monpraon/google-gemini-advanced-6e65b96a75c8">process contextual image</a> attachments to assist in crafting visually engaging user interfaces.</p>

<h3 id="3-improving-app-quality-with-ai-insights">3. Improving App Quality with AI Insights</h3>
<p>Gemini integrates directly with the App Quality Insights tool, leveraging local code context to:</p>

<p>Suggest fixes for crashes reported via Firebase Crashlytics or Google Play Console.
Generate unit test scenarios based on your codebase, helping ensure robustness.
Provide insights into build and sync errors for faster troubleshooting.</p>

<h3 id="4-streamlined-documentation">4. Streamlined Documentation</h3>
<p>With Gemini, generating documentation is no longer a chore. Simply highlight your code, and Gemini will produce clear, comprehensive comments, making it easier to onboard new team members and maintain codebases.</p>

<h3 id="5-why-gemini-matters">5. Why Gemini Matters</h3>
<p>AI tools like Gemini represent the future of app development. By automating routine tasks, developers can focus on solving complex problems and innovating in their projects. With features like commit message generation and error analysis, Gemini ensures your codebase is not only efficient but also of high quality.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Improving accessibility of Android app</title>
      <link>https://maikotrindade.com/2024/09/11/improving-accessibility-android-app.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/09/11/improving-accessibility-android-app.html</guid>
      <pubDate>Wed, 11 Sep 2024 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>An overview of Android accessibility tools — TalkBack, Select to Speak, font size, and high contrast text — and practical steps developers can take to build more inclusive apps.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="accessibility-tooling-on-android">Accessibility tooling on Android</h3>

<p>Android has a collection of tools which can help people with disability and the following list has the most important features in my opnion:</p>

<h4 id="-talkback-screen-reader-and-select-to-speak">✨ Talkback screen reader and Select to Speak</h4>

<p>This feature helps you as you navigate your smartphone. On a given screen, it will tell you what kind of screen it is, and what’s on it. For example, if you’re on a settings page, Talkback will read out the section name (such as notifications). When you tap an icon or item, your selection gets a green outline, and the assistant identifies it. Double tapping the same icon opens it. Talkback reminds you to double-tap when you tap on an item.</p>

<h4 id="-font-size-and-high-contrast-text">✨ Font Size and High Contrast Text</h4>

<p>This setting lets you change the font size on your device from the default. You can make the text smaller than the default, or various levels larger. As you make adjustments, you can see how it will look.</p>

<h4 id="-magnification-">✨ Magnification 🔍</h4>

<p>The user can use a gesture to zoom in on certain parts of your screen. Once you enable the feature in settings, you can zoom in by tapping the screen three times with your finger.</p>

<h4 id="switch-access">✨Switch Access</h4>

<p>Users can Interact with Android app using one or more switches or a keyboard instead of the touch screen. It is also possible to use Camera Switches to navigate with facial gestures.</p>

<h3 id="jetpack-compose--accessibility">Jetpack Compose &amp; Accessibility</h3>

<p>Jetpack Compose is great when it comes <a href="https://developer.android.com/develop/ui/compose/accessibility">accessibility</a> - it uses semantics properties to pass information to Accessibility services to transform what’s shown on screen to a more fitting format for a user with a specific need.</p>

<p>Most built-in composables like Text and Button fill these semantics properties with information inferred from the composable and its children. Some modifiers like toggleable and clickable will also set certain semantics properties.</p>

<p>However, sometimes the framework needs more information to understand how to describe a UI element to the user.</p>

<p><img src="https://maikotrindade.com/public/img/mobile-accessibility.png" width="350" height="220" alt="Jetpack compose accessibility" /></p>

<h3 id="improving-accessibility-using-jetpack-compose">Improving accessibility using Jetpack compose</h3>

<p>This list is mainly focused on some approaches you should think about while developing the app.</p>

<p>There are a bunch of other items related to UI/UX which weren’t included on this list (eg. Colour contrast ratios, minimum touch target sizes, High Contrast theme, etc).</p>

<p>The following items are meant to help people with accessibility needs use the app successfully:</p>

<p><strong>Describe visual elements</strong></p>

<p>Pass a textual description of the visual element whenever is relevant.</p>

<p><strong>Describe click labels</strong></p>

<p>You can use a click label to add semantic meaning to the click behavior of a composable. This way, accessibility services can explain to the user what will happen when the user interacts with the component.</p>

<p><strong>Describe an element’s state</strong></p>

<p>You can describe the state of a component in order to Android to read out the state that the component is in. For example, a toggleable checkbox can be in either a “Checked” or an “Unchecked” state.</p>

<p><strong>Merge visual elements</strong></p>

<p>Sometimes you need to merge elements to make Talkback and Switch Access more efficient.
For example if every single low-level visual element in your screen is focused independently, a user will have to interact a lot to move across the screen. Other issue you may face is a user not being able to understand lists of the app because each element of the list will be focused independently (instead of the item itself).</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Build Better Apps with Kotlin Multiplatform for Android &amp; iOS</title>
      <link>https://maikotrindade.com/2024/09/04/build-better-apps-with-kotlin-multiplatform.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/09/04/build-better-apps-with-kotlin-multiplatform.html</guid>
      <pubDate>Wed, 04 Sep 2024 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>How Kotlin Multiplatform (KMP) enables sharing business logic between Android and iOS while keeping native UIs, compared with React Native, Flutter, and Xamarin.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>In the ever-evolving world of mobile app development, creating seamless experiences across Android and iOS is no small feat. Traditionally, developers have had to choose between platform-specific native development, which provides the best performance and user experience but involves duplicate efforts, or cross-platform solutions like <a href="https://reactnative.dev/">React Native</a>, <a href="https://flutter.dev/">Flutter</a>, or Xamarin, which promise “write once, run everywhere” with some compromises.</p>

<p><a href="https://kotlinlang.org/docs/multiplatform.html">Kotlin Multiplatform</a> (KMP) takes a unique approach by enabling code sharing while retaining native capabilities, making it a compelling choice for modern developers. Let’s dive into the benefits of KMP for <a href="https://www.android.com/intl/en_ca/phones-tablets/">Android</a> and <a href="https://www.apple.com/ca/ios">iOS</a> development, compare it with other alternatives, and explore why KMP might be the right fit for your next project.</p>

<h3 id="what-is-kotlin-multiplatform">What is Kotlin Multiplatform?</h3>
<p>Kotlin Multiplatform (KMP) is a feature of Kotlin, a programming language developed by JetBrains and widely adopted for Android development. Unlike other cross-platform tools that require you to build the entire application using their framework, KMP focuses on sharing business logic, network code, and data layers while allowing you to write platform-specific UI code. This balance provides a unique blend of code reusability and platform fidelity.</p>

<h3 id="key-benefits-of-kmp">Key Benefits of KMP</h3>
<ol>
  <li>
    <p>Code Reuse with Platform Flexibility
KMP allows you to write common business logic once and share it across platforms, reducing duplication and development time. At the same time, you can implement platform-specific UI and interactions, ensuring that your app feels native on both Android and iOS.</p>
  </li>
  <li>
    <p>Native Performance
Unlike JavaScript-based frameworks, KMP compiles shared code to native binaries using Kotlin/Native for iOS and the JVM for Android. This results in high-performance apps that leverage each platform’s full capabilities.</p>
  </li>
  <li>
    <p>Leverage Existing Ecosystems
KMP integrates seamlessly with native development tools:</p>
  </li>
</ol>

<p>For Android: KMP works directly with Android Studio, Gradle, and Kotlin extensions.
For iOS: You can use Xcode and Swift alongside KMP-generated binaries.</p>
<ol>
  <li>
    <p>Interoperability
KMP provides robust interoperability with both Java on Android and Swift/Objective-C on iOS, enabling you to integrate shared and native code effortlessly.</p>
  </li>
  <li>
    <p>Future-Proof Solution
As Kotlin is officially supported by Google and widely adopted for Android, KMP aligns with the long-term direction of modern Android development. Its active community and JetBrains’ backing ensure continued innovation.</p>
  </li>
</ol>

<h3 id="why-kmp-is-better-for-modern-teams">Why KMP is Better for Modern Teams</h3>

<ol>
  <li>
    <p>Focus on Native-Like User Experiences
Unlike Flutter and React Native, which use custom rendering engines, KMP encourages developers to craft native UIs for each platform. This ensures the app feels truly native, aligning with platform-specific design guidelines.</p>
  </li>
  <li>
    <p>Incremental Adoption
You don’t need to rewrite your app to use KMP. It’s easy to adopt incrementally, sharing only selected modules like data access or networking while leaving existing code intact.</p>
  </li>
  <li>
    <p>Shared Code Without Compromising Control
KMP provides the best of both worlds: code reuse where it matters (business logic) and full control over platform-specific implementations. This is ideal for teams that prioritize user experience.</p>
  </li>
  <li>
    <p>Fewer External Dependencies
KMP uses Kotlin, which is already a familiar and powerful language for Android developers. There’s no need to learn a new framework or deal with third-party dependencies for basic functionality.</p>
  </li>
</ol>

<h3 id="when-to-choose-kmp">When to Choose KMP</h3>
<p>KMP is ideal if:</p>

<ul>
  <li>You already have an Android development team familiar with Kotlin.</li>
  <li>You need a shared codebase for business logic but want platform-specific UIs.</li>
  <li>Performance is critical, and you can’t compromise with JavaScript-based solutions.</li>
  <li>You’re migrating an existing codebase and prefer incremental adoption.</li>
</ul>

<h3 id="conclusion">Conclusion</h3>
<p>Kotlin Multiplatform offers a pragmatic approach to cross-platform development, empowering developers to share code where it matters while crafting tailored, high-performance native experiences. Its seamless integration with native ecosystems, native performance, and incremental adoption make it a future-ready choice for teams looking to optimize their development processes. If you’re building a new app or looking to reduce technical debt in an existing one, Kotlin Multiplatform might just be the game-changer you need.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Kotlin 2.0 – A New Era for Android Development</title>
      <link>https://maikotrindade.com/2024/07/02/kotlin-2.0-a-new-era-for-android-development.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/07/02/kotlin-2.0-a-new-era-for-android-development.html</guid>
      <pubDate>Tue, 02 Jul 2024 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>What&apos;s new in Kotlin 2.0 for Android development — improved compiler performance, optimized bytecode generation, enhanced garbage collection, and new language features.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Kotlin 2.0 is a significant milestone in the evolution of the Kotlin programming language. This major release brings forth a host of performance enhancements, innovative language features, and robust tooling support, solidifying Kotlin’s position as a premier choice for Android development.</p>

<p><img src="https://maikotrindade.com/public/img/kotlin-2-future.png" width="320" height="320" alt="kotlin-2" /></p>

<h3 id="performance-optimization">Performance Optimization</h3>
<p>One of the core focuses of <a href="https://kotlinlang.org/docs/whatsnew20.html">Kotlin 2.0</a> is to enhance performance. The compiler has been meticulously refined to generate highly optimized bytecode, resulting in faster application startup times and smoother overall execution.</p>

<ul>
  <li><strong>Optimized Bytecode Generation:</strong> The compiler diligently produces more efficient bytecode, minimizing instruction count and memory footprint.</li>
  <li><strong>Enhanced Garbage Collection:</strong> The garbage collector has been meticulously tuned to reduce pause times and improve overall performance.</li>
</ul>

<h3 id="innovative-language-features">Innovative Language Features</h3>
<p>Kotlin 2.0 introduces a suite of new language features that empower developers to write more concise, expressive, and type-safe code.</p>

<ul>
  <li><strong>Value Classes</strong>: Value classes provide a lightweight and efficient mechanism to represent immutable data. They are akin to data classes but offer a more streamlined and performant implementation.</li>
  <li><strong>Inline Classes</strong>: Inline classes enable the creation of custom types that are seamlessly integrated with primitive types, enhancing type safety and expressiveness.</li>
  <li><strong>Sealed Interfaces</strong>: Sealed interfaces offer a powerful tool for defining a set of related classes, aiding in the construction of type-safe state machines and intricate data structures.</li>
</ul>

<h3 id="robust-tooling-support">Robust Tooling Support</h3>
<p>Kotlin 2.0 is accompanied by substantial improvements in tooling support, ensuring a seamless development experience.</p>

<ul>
  <li><strong>IntelliJ IDEA</strong>: The <a href="https://www.jetbrains.com/idea/">IntelliJ IDEA</a> Kotlin plugin has been fortified with cutting-edge features and enhancements, including advanced code completion, refactoring, and navigation capabilities.</li>
  <li><strong>Android Studio</strong>: The <a href="https://developer.android.com/studio">Android Studio</a> Kotlin plugin has likewise been bolstered with new features and optimizations, such as refined code analysis, debugging, and testing tools.</li>
</ul>

<h3 id="why-kotlin-20-is-a-game-changer-for-android-development">Why Kotlin 2.0 is a Game-Changer for Android Development</h3>
<p>Kotlin 2.0 represents a quantum leap for Kotlin, making it an even more compelling choice for Android development. With its performance optimizations, innovative language features, and robust tooling support, Kotlin 2.0 empowers developers to build more efficient, reliable, and maintainable Android applications.</p>

<p>To delve deeper into Kotlin 2.0, explore the official documentation and tutorials.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Deep Dive into DeFi – Liquidity Pools and Aave Explained</title>
      <link>https://maikotrindade.com/2024/04/03/liquidity-pools-aave-explained.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/04/03/liquidity-pools-aave-explained.html</guid>
      <pubDate>Wed, 03 Apr 2024 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A beginner-friendly explanation of how DeFi liquidity pools work and how the Aave protocol uses them for decentralized lending, borrowing, and yield generation.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>The world of <a href="https://www.investopedia.com/decentralized-finance-defi-5113835">Decentralized Finance</a> (DeFi) offers exciting new opportunities for cryptocurrency users. But how does it all work? A key concept in DeFi is the liquidity pool, and platforms like Aave are built around them. Let’s dive in and explore what liquidity pools are, how Aave utilizes them, and the benefits and drawbacks of this innovative platform.</p>

<h3 id="understanding-liquidity-pools">Understanding Liquidity Pools</h3>

<p>Imagine a giant pot of crypto assets. Anyone can add funds (deposit), and anyone can borrow from this pot (withdraw). This pot is essentially a liquidity pool. They fuel DeFi by providing the necessary assets for lending and borrowing activities. Users who deposit their crypto into the pool earn interest on their holdings, while borrowers can access funds at market-determined rates.</p>

<h3 id="aave-a-liquidity-powerhouse">Aave: A Liquidity Powerhouse</h3>

<p><a href="https://coinmarketcap.com/currencies/aave/">Aave</a> is a prominent DeFi platform that leverages liquidity pools. Here’s how it works:</p>

<ul>
  <li><strong>Supplying Crypto</strong>: Users can deposit various cryptocurrencies into Aave’s liquidity pools. These deposits earn interest as borrowers pay back their loans.</li>
  <li><strong>Borrowing Crypto</strong>: Users can borrow crypto from the pool by putting up collateral (another cryptocurrency). The interest rate on these loans depends on various factors like supply and demand for the specific crypto.</li>
  <li><strong>Earning <a href="https://coinmarketcap.com/currencies/aave/">AAVE</a></strong>: Aave has its own governance token, AAVE. By holding <a href="https://coinmarketcap.com/currencies/aave/">AAVE</a>, users can participate in the platform’s governance and potentially earn additional rewards.</li>
</ul>

<p><img src="https://maikotrindade.com/public/img/aave-ghost-bitcoin.jpeg" width="320" height="320" alt="aave-liquidity-bitcoin-crypto" /></p>

<h3 id="benefits-of-aave">Benefits of Aave</h3>

<ul>
  <li><strong>Passive Income</strong>: Supplying crypto to Aave’s pools offers a way to earn interest on your holdings without actively trading.</li>
  <li><strong>Flexible Borrowing</strong>: Borrowers can access various cryptocurrencies at competitive rates.</li>
  <li><strong>Transparency &amp; Security</strong>: Aave is an open-source platform, meaning its code is publicly available for scrutiny.</li>
</ul>

<p>Additionally, smart contracts automate transactions, reducing the risk of human error or manipulation.
Drawbacks to Consider</p>

<ul>
  <li><strong>Volatility</strong>: Cryptocurrency prices can fluctuate significantly. Supplying crypto to liquidity pools exposes you to potential impermanent loss, where the value of your deposit might be lower when you withdraw compared to simply holding the asset.</li>
  <li><strong>Smart Contract Risk</strong>: Smart contracts, while generally secure, can have vulnerabilities. A successful exploit could lead to loss of funds deposited in the pool.</li>
  <li><strong>Complexity</strong>: DeFi can be complex for beginners. Understanding interest rates, collateralization ratios, and potential risks is crucial before diving in.
Conclusion</li>
</ul>

<p>Liquidity pools are the backbone of DeFi, and <a href="https://coinmarketcap.com/currencies/aave/">Aave</a> is a leading platform that utilizes them effectively. While Aave offers attractive opportunities for earning interest and borrowing crypto, it’s important to be aware of the potential risks involved. As with any investment, careful research and understanding the underlying technology are crucial before participating in DeFi.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Decoding Meme Coins – Hype, Risks, and Reality</title>
      <link>https://maikotrindade.com/2024/03/18/decoding-meme-coins.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/03/18/decoding-meme-coins.html</guid>
      <pubDate>Mon, 18 Mar 2024 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A critical look at meme coins — how social media hype drives their value, why they lack real utility, and the risks investors should understand before buying.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="introduction-to-meme-coins">Introduction to Meme Coins</h3>
<p>Meme coins, as highlighted in the article from <a href="https://www.investopedia.com/meme-coin-6750312">Investopedia</a> are a unique category of cryptocurrencies that have gained popularity through social media trends and viral marketing. Unlike traditional cryptocurrencies driven by technological advancements or real-world utility, meme coins derive their value primarily from community involvement and social media excitement. These digital assets have become a cultural phenomenon, offering emotional support or recognition to specific communities despite lacking substantial economic value.</p>

<p><img src="https://maikotrindade.com/public/img/memecoins.webp" width="320" height="192" alt="memecoins_frenzy_risk" /></p>

<h3 id="why-meme-coins-lack-utility">Why Meme Coins Lack Utility</h3>
<p>While meme coins can provide emotional backing to certain groups, they are often criticized for their lack of real-world application and limited utility. These coins are primarily driven by hype and social media trends rather than fundamental value or technological innovation. Critics argue that meme coins do not contribute significantly to the cryptocurrency ecosystem in terms of solving real-world problems or advancing blockchain technology.</p>

<h3 id="criticizing-the-meme-coin-frenzy">Criticizing the Meme Coin Frenzy</h3>
<p>Vitalik Buterin’s critique of meme coins, sheds light on the investment frenzy surrounding these digital assets. Buterin emphasizes the need for more meaningful engagement and support within the crypto infrastructure, highlighting the importance of balancing investment to foster a more equitable and functional ecosystem. The criticism points towards the speculative nature of meme coins and the risks associated with investing in assets driven primarily by social media influence rather than intrinsic value.</p>

<p>In conclusion, while meme coins offer a unique avenue for high-risk, high-reward investments and have captured significant attention in the cryptocurrency landscape, it is essential for investors to approach them with caution. Understanding the limitations of meme coins in terms of utility and being aware of the potential risks associated with market speculation is crucial for making informed investment decisions in this dynamic sector. Conducting thorough research, staying updated on market trends, and diversifying investments are key strategies to navigate the meme coin market responsibly.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Enhancing Ethereum Security Through AI-Based Code Audits</title>
      <link>https://maikotrindade.com/2024/02/29/enhancing-ethereum-security-through-ai-based-code-audits.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/02/29/enhancing-ethereum-security-through-ai-based-code-audits.html</guid>
      <pubDate>Thu, 29 Feb 2024 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>How Vitalik Buterin&apos;s proposal to integrate AI into Ethereum smart contract code audits could reduce bugs, detect vulnerabilities, and improve overall blockchain security.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>In recent developments within the Ethereum community, Vitalik Buterin, the co-founder of Ethereum, has proposed an innovative approach to bolstering security in blockchain projects. Buterin’s idea revolves around leveraging artificial intelligence (AI) for code audits, aiming to reduce bugs and enhance the overall integrity of Ethereum projects.</p>

<h3 id="vitalik-buterins-vision-for-ai-assisted-code-audits">Vitalik Buterin’s Vision for AI-Assisted Code Audits</h3>
<p>Vitalik Buterin’s proposal suggests integrating AI into the code auditing process to improve efficiency and effectiveness. By harnessing AI capabilities, developers can enhance their ability to detect vulnerabilities and ensure the robustness of smart contracts within the Ethereum ecosystem</p>

<h3 id="the-role-of-ai-in-smart-contract-audits">The Role of AI in Smart Contract Audits</h3>
<p>AI-assisted code audits offer a unique advantage over traditional automated tools by adapting and learning from new information. This adaptability is crucial in the dynamic landscape of smart contract security, where emerging vulnerabilities require swift detection and mitigation strategies</p>

<h3 id="industry-response-and-potential-benefits">Industry Response and Potential Benefits</h3>
<p>Ethereum project developers have shown support for Buterin’s idea, emphasizing the potential of combining human expertise with AI systems to create a comprehensive security framework. The collaboration between AI and human inspection could significantly strengthen code integrity and mitigate risks associated with bugs and exploits</p>

<h3 id="addressing-security-challenges-in-blockchain-projects">Addressing Security Challenges in Blockchain Projects</h3>
<p>The increasing complexity of blockchain projects necessitates advanced security measures to safeguard user funds and maintain trust within the ecosystem. By exploring AI-based solutions for code audits, Ethereum aims to proactively address security challenges and enhance the resilience of its decentralized applications</p>

<p>In conclusion, Vitalik Buterin’s proposal to incorporate AI into code audits represents a significant step towards fortifying Ethereum’s security infrastructure. By embracing innovative technologies like AI, Ethereum demonstrates its commitment to advancing blockchain security standards and fostering a more secure environment for decentralized applications.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Elevating Android Development – Insights into Compose UI Testing</title>
      <link>https://maikotrindade.com/2024/01/26/insights-into-compose-ui-testing.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2024/01/26/insights-into-compose-ui-testing.html</guid>
      <pubDate>Fri, 26 Jan 2024 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A practical guide to Jetpack Compose UI testing — setup, ComposeTestRule, semantic assertions, and best practices for writing reliable and maintainable Android UI tests.</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Jetpack Compose has introduced a modern way of building user interfaces for Android applications, and part of its appeal lies in its robust testing capabilities. Let’s delve into the world of Jetpack Compose UI testing in Android, exploring insights from various sources to understand the importance and implementation of testing in Jetpack Compose.</p>

<h3 id="easy-setup">Easy Setup</h3>
<p>Jetpack Compose provides a streamlined approach to setting up UI tests. By adding the necessary dependencies to the <code class="language-plaintext highlighter-rouge">build.gradle</code> file, developers can easily incorporate Compose testing libraries into their projects. This simplified setup ensures that developers can focus on writing effective tests without the hassle of complex configurations.</p>

<h3 id="enhanced-test-implementation">Enhanced Test Implementation</h3>
<p>Jetpack Compose UI testing allows developers to write tests that focus on specific UI components and interactions. By following best practices and structuring tests around states and events, developers can ensure that their UI composable functions are thoroughly tested. This approach enhances the reliability and robustness of UI components, leading to a more stable and user-friendly application.</p>

<h3 id="comprehensive-test-rule-integration">Comprehensive Test Rule Integration</h3>
<p>Jetpack Compose offers test rule integration that simplifies the process of writing and executing UI tests. Developers can leverage test rules like createComposeRule() or createAndroidComposeRule() to set up test environments and interact with UI components effectively. These test rules provide a structured framework for writing test functions and validating UI behavior.</p>

<h3 id="real-time-testing-feedback">Real-time Testing Feedback</h3>
<p>Jetpack Compose UI testing provides real-time feedback on UI interactions, allowing developers to validate changes and ensure that the app behaves as expected. By utilizing features like assertExists(), performClick(), and assertDoesNotExist(), developers can simulate user interactions and verify the responsiveness of their UI components. This real-time feedback loop accelerates the testing process and aids in identifying potential issues early on.</p>

<h3 id="test-tag-implementation">Test Tag Implementation</h3>
<p>Jetpack Compose introduces the concept of test tags, which serve as references for making specific components detectable in tests. By assigning test tags to composable functions, developers can easily locate and interact with UI elements during testing. This approach enhances test readability and maintainability, making it easier to identify and troubleshoot issues within the UI. 
Don’t overuse testTag once it may pollute your production code. Instead of that, you can use semantics to interact with the UI on your tests. Using semanatics improves your app’s accessibility once Android utilizes semantics to offer alternative interaction methods for users with special needs, such as TalkBack, a screen reader, or Switch Access.</p>

<p><img src="https://maikotrindade.com/public/img/android-ui-testing.png" width="380" height="380" alt="android-ui-testing" /></p>

<p>In conclusion, Jetpack Compose UI testing in Android offers a comprehensive framework for validating UI components, interactions, and behaviors. By leveraging the testing capabilities provided by Jetpack Compose, developers can ensure the quality, reliability, and performance of their Android applications, leading to enhanced user experiences and increased app stability.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Exploring the Benefits of Android Jetpack Compose II</title>
      <link>https://maikotrindade.com/2023/11/15/benefits-of-compose-part-2.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2023/11/15/benefits-of-compose-part-2.html</guid>
      <pubDate>Wed, 15 Nov 2023 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Android Jetpack Compose stands out as a powerful toolkit that empowers developers to build modern and engaging user interfaces for Android applications. Let’s continue exploring the benefits of Jet...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Android Jetpack Compose stands out as a powerful toolkit that empowers developers to build modern and engaging user interfaces for Android applications. Let’s continue exploring the benefits of Jetpack Compose based on the insights gathered from various sources.</p>

<p><img src="https://maikotrindade.com/public/img/android-compose-jetpack-2.jpeg" width="380" height="380" alt="android-compose-benefits-jetpack" /></p>

<h3 id="seamless-integration-with-existing-code">Seamless Integration with Existing Code</h3>
<p>Jetpack Compose is designed to be compatible with existing codebases, allowing developers to adopt it gradually and integrate it seamlessly into their projects. This compatibility ensures that developers can leverage the power of Compose without the need for a complete overhaul of their existing codebase, enabling a smooth transition to modern UI development practices.</p>

<h3 id="live-previews-and-full-android-studio-support">Live Previews and Full Android Studio Support</h3>
<p>Jetpack Compose accelerates development by providing live previews and full support within Android Studio. Developers can visualize changes to the UI in real-time, iterate quickly, and ensure a consistent user experience across different screen sizes and orientations. The robust tooling support offered by Compose enhances developer productivity and facilitates a more efficient development workflow.</p>

<h3 id="direct-access-to-android-platform-apis">Direct Access to Android Platform APIs</h3>
<p>Jetpack Compose offers direct access to Android platform APIs, enabling developers to create feature-rich and visually appealing apps with ease. By leveraging built-in support for Material Design, Dark theme, animations, and more, developers can create apps that adhere to Android design guidelines and provide a seamless user experience.</p>

<h3 id="adaptive-ui-development">Adaptive UI Development</h3>
<p>Compose for large screens and Wear OS extends the capabilities of Jetpack Compose to cater to different form factors and screen sizes. The adaptive layout ensures that the UI of the app responds effectively to varying screen dimensions, orientations, and device types, providing a consistent and optimized user experience across all platforms.</p>

<p>In conclusion, Android Jetpack Compose emerges as a game-changer in the realm of Android UI development, offering a plethora of benefits that enhance developer productivity, streamline UI creation, and elevate the user experience of Android applications. By embracing Jetpack Compose, developers can unlock new possibilities in UI design and development, leading to the creation of visually stunning and feature-rich Android apps.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Exploring the Benefits of Android Jetpack Compose I</title>
      <link>https://maikotrindade.com/2023/10/05/benefits-of-compose-part-1.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2023/10/05/benefits-of-compose-part-1.html</guid>
      <pubDate>Thu, 05 Oct 2023 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroductionAndroid Jetpack Compose has revolutionized the way developers create user interfaces for Android applications. By leveraging this modern toolkit, developers can streamline UI developmen...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>
<p>Android Jetpack Compose has revolutionized the way developers create user interfaces for Android applications. By leveraging this modern toolkit, developers can streamline UI development, enhance user experience, and boost productivity. Let’s delve into the benefits of Android Jetpack Compose based on insights from various sources.
Simplified UI Development
Jetpack Compose simplifies UI development by allowing developers to describe the UI using Kotlin code. This declarative approach eliminates the need for XML layouts, reducing boilerplate code and making UI development more intuitive and efficient with Compose, developers can create custom and non-standardized components with ease, enabling them to build visually appealing interfaces for their apps.</p>

<h3 id="enhanced-developer-satisfaction">Enhanced Developer Satisfaction</h3>
<p>One of the key benefits highlighted by developers using Jetpack Compose is the satisfaction it brings. The technology is well-received among developers, who appreciate the modern approach to UI development and the ease of creating interactive and dynamic interfaces. By adopting Compose, developers can work more efficiently, leading to a more motivated and engaged team.</p>

<p><img src="https://maikotrindade.com/public/img/android-compose-jetpack.jpeg" width="380" height="380" alt="android-compose-benefits-jetpack" /></p>

<h3 id="reduced-technological-debt">Reduced Technological Debt</h3>
<p>Jetpack Compose offers a lower risk of technological debt compared to traditional UI development approaches. Google’s emphasis on the adaptation and development of Compose, along with positive feedback from developers, positions it as a safer choice for long-term project development.
Additionally, being part of the Jetpack package means that Compose is well-integrated with other Google solutions, paving the way for future enhancements and integrations.</p>

<h3 id="faster-software-development">Faster Software Development</h3>
<p>Despite being a relatively new technology, Jetpack Compose enables faster native Android UI development compared to traditional XML-based approaches. By leveraging Compose’s capabilities, developers can iterate quickly, build UI components efficiently, and create visually appealing apps with less code. The intuitive nature of Compose allows for rapid prototyping and iteration, leading to shorter software development cycles.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Integrate your Android app with a ERC20 smart contract</title>
      <link>https://maikotrindade.com/2023/08/02/integrate-android-app-with-erc20-token.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2023/08/02/integrate-android-app-with-erc20-token.html</guid>
      <pubDate>Wed, 02 Aug 2023 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Ethereum is a decentralized, open-source blockchain platform that enables the creation of smart contracts and decentralized applications (dApps). ERC20 is a standard for fungible tokens on the Ethe...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Ethereum is a decentralized, open-source blockchain platform that enables the creation of smart contracts and decentralized applications (dApps). ERC20 is a standard for fungible tokens on the Ethereum blockchain. In this blog post, I will guide you through the process of creating a GraphQL(it could Rest too 🤷) app that connects with Ethereum networking to communicate with ERC20 tokens.</p>

<p><strong>Step 1: Setting up the Development Environment</strong>
Before we begin, make sure you have the following tools installed:
Node.js and npm (Node Package Manager)
A code editor or IDE (Integrated Development Environment) such as Visual Studio Code or IntelliJ IDEA
A web3 library for JavaScript, such as Web3.js or ethers.js</p>

<p><strong>Step 2: Creating a GraphQL Schema</strong>
A GraphQL schema is a definition of the types of data that can be queried and the relationships between them. To create a GraphQL schema for our app, we will use the GraphQL schema language.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>`type Query {
  token(id: ID!): Token
}

type Token {
  id: ID!
  name: String!
  symbol: String!
  totalSupply: Int!
  balanceOf(address: String!): Int!
}`
</code></pre></div></div>

<p>In this schema, we have defined a Query type that has a single field called token. The token field takes an id argument of type ID!, which means that it is a required field. The token field returns a Token type, which has several fields: <code class="language-plaintext highlighter-rouge">id</code>, <code class="language-plaintext highlighter-rouge">name</code>, <code class="language-plaintext highlighter-rouge">symbol</code>, <code class="language-plaintext highlighter-rouge">totalSupply</code>, and <code class="language-plaintext highlighter-rouge">balanceOf</code>. The <code class="language-plaintext highlighter-rouge">balanceOf</code> field takes an address argument of type <code class="language-plaintext highlighter-rouge">String!</code>, which means that it is a required field.</p>

<p><strong>Step 3: Creating a GraphQL Resolver</strong>
A GraphQL resolver is a function that is called when a query is executed. The resolver is responsible for fetching the data for the query and returning it in the correct format. To create a GraphQL resolver for our app, we will use the graphql-tools library.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>const { graphqlHTTP } = require('express-graphql');
const { buildSchema } = require('graphql');

const schema = buildSchema(`
  type Query {
    token(id: ID!): Token
  }

  type Token {
    id: ID!
    name: String!
    symbol: String!
    totalSupply: Int!
    balanceOf(address: String!): Int!
  }
`);

const rootValue = {
  token: async (parent, { id }) =&gt; {
    const token = await getToken(id);
    return token;
  },
};

const app = express();
app.use('/graphql', graphqlHTTP({
  schema: schema,
  rootValue: rootValue,
  graphiql: true,
}));

app.listen(4000, () =&gt; {
  console.log('GraphQL server running on port 4000');
});
</code></pre></div></div>
<p>In this code, we have defined a schema object that contains our GraphQL schema. We have also defined a rootValue object that contains the resolver functions for our schema. The token resolver function takes an id argument and returns a Token object.</p>

<p><strong>Step 4: Connecting to Ethereum Networking</strong>
To connect to the Ethereum network, we will use the web3 library.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>const Web3 = require('web3');

const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/v3/YOUR_PROJECT_ID'));
</code></pre></div></div>
<p>In this code, we have created a new Web3 object and passed it a HttpProvider object that connects to the Ethereum mainnet through Infura/Alchemy.</p>

<p><strong>Step 5: Querying ERC20 Tokens</strong>
To query ERC20 tokens, we will use the web3.eth.getToken method.
const token = await web3.eth.getToken(tokenAddress);</p>

<p>In this code, we have called the getToken method on the web3.eth object and passed it the address of the ERC20 token we want to query.</p>

<p><strong>Step 6: Returning the Token Data</strong>
Once we have queried the ERC20 token, we can return the data to the client.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>return {
  id: token.id,
  name: token.name,
  symbol: token.symbol,
  totalSupply: token.totalSupply,
  balanceOf: token.balanceOf,
};
</code></pre></div></div>
<p>In this code, we have returned an object that contains the id, name, symbol, totalSupply, and balanceOf fields of the ERC20 token.</p>

<p><strong>Conclusion</strong>
In this blog post, we have covered the basics of creating a GraphQL app that connects with Ethereum networking to communicate with ERC20 tokens. We have learned how to create a GraphQL schema, create a GraphQL resolver, connect to Ethereum networking, query ERC20 tokens, and return the token data to the client. With this knowledge, you can build your own GraphQL app that interacts with the Ethereum blockchain.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Nomad token - Chainlink Spring 2023 Hackathon</title>
      <link>https://maikotrindade.com/2023/06/28/nomad-token-chainlink-hackathon.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2023/06/28/nomad-token-chainlink-hackathon.html</guid>
      <pubDate>Wed, 28 Jun 2023 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroductionNo significant change happened to the $1.9 trillion travel industry. The pandemic led to unprecedented low travel volumes and financial strain, and all those business trips year-round a...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>
<p>No significant change happened to the $1.9 trillion travel industry. The pandemic led to unprecedented low travel volumes and financial strain, and all those business trips year-round are now 30-minute Zoom meetings.
The travel and hospitality industries (and their customers) are stuck with dated solutions, where online booking, cheap flight platforms, and lousy loyalty mechanics are not sufficing modern travelers and modern challenges and needs. Nomad rethinks the role of blockchain, empowering travelers and companies alike with unprecedented opportunities and creating a harmonious ecosystem that fosters trust, transparency, and unforgettable experiences.</p>

<h3 id="what-it-does">What it does</h3>
<p>The user’s journey starts when he/she decides to book a flight. To do so, the user can install the Nomad App and check the flights available. Due to the hackathon, we are using a specific flight (YYC - SEA) as a use case but the project can be more flexible and include more flight legs.</p>

<p>The app’s home screen integrates with Nomad core (NodeJs app - Backend) which provides a list of flights based on Flights API (Aviation stack API). Our Backend is hosted on [Heroku platform] Nomad Backend.</p>

<p>The user can go through the sign-in flow and create an account. For this step, the Nomad app integrates with Firebase Authentication (Firebase Authentication) and lets the user choose a Google account. This step is crucial because it is part of the Seamless Web3 wallet creation - the user creates a Web3 wallet with 3 clicks and does not need to worry about the bureaucratic Web3 wallet creation. During this process, the Backend will store the user’s credentials on MongoDB (MongoDB Atlas). It will automagically ether.js create the user’s Ethereum wallet and store the private key on the MongoDB. We are not really concerned about security here since the wallet will not store a huge number of tokens/rewards initially.</p>

<p><img src="https://maikotrindade.com/public/img/nomad-smartcontract.png" width="380" height="180" alt="nomad-smartcontract" /></p>

<p>The app also has two other screens: Admin and Profile. Admin screen provides triggers to the Backend force interactions with the smart contract <a href="https://github.com/maikotrindade/nomad-token">NomadBadge</a> and the Flights API for only testing purposes. The Profile gives some information about User’s data on the MongoDB database and also exposes the user’s private key for testing purposes.</p>

<p>A flight can be booked on the Home screen. The user can tap the Buy ticket button which will trigger the Backend to add a Flight (scheduled flight status) entry on the blockchain. Notice the user has to have Funds in his wallet in order to buy a flight ticket. After the flight is added on-chain, the user has an eligible flight and can get rewards from it. The Backend will update all the scheduled flight statuses and also update the smart contract.</p>

<p>Chainlink Automation executes the rewarding process for <a href="https://github.com/maikotrindade/nomad-token">NomadBadge</a> automatically. Once per pay, Chainlink Automation triggers the rewarding process for all the ACTIVE flights. The NomadBadge mints an NBG token if the user does not have an NBG token according to the Soulbound token specification.</p>

<p>We used a Soulbound token as a reference to a user’s non-transferable experience with the airline/flight. This and in conjunction with the reward system offers airlines a unique and dynamic loyalty system that engages users with their experience/status and rewards them with points they can use or transfer to others.</p>

<p>After that, the <a href="https://github.com/maikotrindade/nomad-token">NomadBadge</a> attributes rewards points to the user token and also transfers ERC20 tokens (NomadRewardToken - NRT) to the user’s wallet. The ERC20 tokens can be transferred at any time by the user. By the end of the process, <a href="https://github.com/maikotrindade/nomad-token">NomadBadge</a> changes the flight status to REWARDED.</p>

<h3 id="built-with">Built With</h3>
<ul>
  <li>alchemyapi</li>
  <li>chainlink</li>
  <li>ethersjs</li>
  <li>express.js</li>
  <li>firebase</li>
  <li>heroku</li>
  <li>javascript</li>
  <li>kotlin</li>
  <li>mongodb</li>
  <li>node.js</li>
  <li>openzeppelin</li>
  <li>solidity</li>
  <li>typescript</li>
</ul>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Exploring Material3 for Android with Jetpack Compose</title>
      <link>https://maikotrindade.com/2023/04/21/explore-material3-jetpack-compose.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2023/04/21/explore-material3-jetpack-compose.html</guid>
      <pubDate>Fri, 21 Apr 2023 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Material3 is the latest design system from Google that brings a fresh look and feel to Android apps. When combined with Jetpack Compose, Google’s modern UI toolkit for building native Android apps,...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><a href="https://m3.material.io/">Material3</a> is the latest design system from Google that brings a fresh look and feel to Android apps. When combined with Jetpack Compose, Google’s modern UI toolkit for building native Android apps, developers have a powerful combination at their disposal. Let’s delve into the main components of Material3 for Android and how they integrate with Jetpack Compose.</p>

<h3 id="material3-components">Material3 Components</h3>

<ol>
  <li><strong>Typography</strong>
Typography in Material3 focuses on readability and hierarchy. It includes a range of text styles and weights to help developers create visually appealing and accessible interfaces.</li>
  <li><strong>Color System</strong>
Material3 introduces a new color system that offers a wider palette and more flexibility for customizing app themes. It includes primary, secondary, surface, and on-surface colors to ensure consistency across the app.</li>
  <li><strong>Shape</strong>
The shape system in <a href="https://m3.material.io/">Material3</a> defines the corner radius for components like buttons, cards, and dialogs. It allows for consistent and visually pleasing rounded corners throughout the app.</li>
  <li><strong>Elevation</strong>
Elevation helps create a sense of depth and hierarchy in the UI. <a href="https://m3.material.io/">Material3</a> provides a standardized elevation system for components, making it easier to design interfaces with consistent shadows and overlays.</li>
  <li><strong>Motion</strong>
Motion in <a href="https://m3.material.io/">Material3</a> adds fluidity and responsiveness to app interactions. It includes predefined animations for common UI transitions, enhancing the user experience and making the app feel more dynamic.</li>
</ol>

<h3 id="integrating-material3-with-jetpack-compose">Integrating Material3 with Jetpack Compose</h3>

<p>Jetpack Compose simplifies UI development by using a declarative approach to building interfaces. When integrating Material3 with Jetpack Compose, developers can leverage the following:</p>
<ol>
  <li>
    <p><strong>MaterialTheme</strong>
The MaterialTheme composable allows developers to apply Material3 styles and components to their UI elements. It provides easy access to typography, colors, shapes, and other design elements defined in Material3.</p>
  </li>
  <li>
    <p><strong>Material3 Components</strong>
Material3 components like Button, TextField, Card, and BottomSheet are designed to work seamlessly with Jetpack Compose. Developers can use these components to create modern and consistent UIs that follow Material Design guidelines.</p>
  </li>
  <li>
    <p><strong>Theming</strong>
Jetpack Compose makes theming easy by allowing developers to define custom themes and apply them to different parts of the app. By combining Material3’s design system with Jetpack Compose’s theming capabilities, developers can create visually appealing and cohesive user interfaces.</p>
  </li>
</ol>

<p>In conclusion, <a href="https://m3.material.io/">Material3</a> for Android and Jetpack Compose offer a powerful combination for building modern and visually engaging apps. By understanding the main components of Material3 and how they integrate with Jetpack Compose, developers can create UIs that are not only beautiful but also user-friendly and consistent.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Comparing Jetpack Compose and Reactive JS</title>
      <link>https://maikotrindade.com/2023/03/22/comparing-jetpack-compose-reactive-js.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2023/03/22/comparing-jetpack-compose-reactive-js.html</guid>
      <pubDate>Wed, 22 Mar 2023 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Title: Jetpack Compose vs. Reactive JS: Battle of the UI TitansIn the realm of modern UI development, two prominent technologies have emerged as game-changers: Jetpack Compose for Android app devel...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Title: Jetpack Compose vs. Reactive JS: Battle of the UI Titans</p>

<p>In the realm of modern UI development, two prominent technologies have emerged as game-changers: Jetpack Compose for Android app development and Reactive JS for web development. As a software engineer specializing in Android app development and interested in web technologies, you’ll find this comparison insightful. In this blog post, we’ll explore the key features, benefits, and use cases of Jetpack Compose and Reactive JS, shedding light on their similarities and differences.</p>

<h3 id="jetpack-compose-unleash-the-android-magic">Jetpack Compose: Unleash the Android Magic</h3>

<p>If you’re all about crafting pixel-perfect Android apps that dazzle users, Jetpack Compose is your new best friend. This Google-born toolkit is like a breath of fresh air in the Android development scene. With Kotlin as its wingman, Compose lets you conjure up UIs using a super cool declarative style. You’re basically telling your app what you want it to look like, and boom, it works its magic!</p>

<h3 id="key-features-and-perks">Key Features and Perks:</h3>

<ol>
  <li>
    <p>Declarative UI: Jetpack Compose allows developers to describe UI components using a declarative syntax, which eliminates the need for manually managing UI updates and simplifies the codebase.</p>
  </li>
  <li>
    <p>Reactive Data Flow: Jetpack Compose utilizes a reactive programming model, ensuring that UI updates are automatically triggered when the underlying data changes.</p>
  </li>
  <li>
    <p>Compose UI Elements: UI components in Jetpack Compose are themselves functions, enabling developers to create complex UIs by composing smaller, reusable building blocks.</p>
  </li>
  <li>
    <p>State Management: Jetpack Compose provides built-in tools for managing UI state, reducing the complexity associated with state management in traditional Android development.</p>
  </li>
</ol>

<h3 id="reactive-js-web-wizardry-at-its-best">Reactive JS: Web Wizardry at Its Best</h3>

<p>But hey, let’s not forget the web realm! Reactive JS, the rockstar of web development, is all about building those slick and responsive web apps. It’s the magic wand for creating dynamic user interfaces that dance to the tune of data and events.</p>

<h3 id="key-features-and-cool-stuff">Key Features and Cool Stuff:</h3>

<ol>
  <li>
    <p>Component-Based Architecture: Reactive JS frameworks promote component-based development, enabling developers to create modular UI components that can be reused and managed more efficiently.</p>
  </li>
  <li>
    <p>Virtual DOM: Reactive JS frameworks employ a Virtual DOM, which optimizes UI updates by calculating the minimal set of changes needed to update the actual DOM, leading to improved performance.</p>
  </li>
  <li>
    <p>One-Way Data Flow: Reactive JS follows a unidirectional data flow, where data flows from parent components to child components, simplifying the debugging process.</p>
  </li>
  <li>
    <p>Efficient Updates: By tracking changes in data and events, Reactive JS frameworks only update the UI elements that require changes, minimizing unnecessary re-renders.</p>
  </li>
</ol>

<h3 id="the-ultimate-face-off-what-to-choose">The Ultimate Face-Off: What to Choose?</h3>

<p>So, which path should you tread? If you’re all about crafting Android apps that feel like a dream, Jetpack Compose is calling your name. With your Android expertise and Kotlin superpowers, it’s a match made in UI heaven. However if your heart beats for the web and you want to create dynamic, kickass web apps, Reactive JS is your ticket to the web wonderland. With its component party and data flow dance, you’ll be the life of the web development bash.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Migration from XML-based UI to Jetpack Compose</title>
      <link>https://maikotrindade.com/2023/02/12/migration-from-jetpack-compose.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2023/02/12/migration-from-jetpack-compose.html</guid>
      <pubDate>Sun, 12 Feb 2023 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Jetpack Compose is a modern UI toolkit by Google that simplifies and accelerates Android app development. With its declarative approach, Jetpack Compose allows developers to build beautiful and res...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Jetpack Compose is a modern UI toolkit by Google that simplifies and accelerates Android app development. With its declarative approach, Jetpack Compose allows developers to build beautiful and responsive user interfaces with less code. For developers who have been working with XML-based UI in Android, migrating to Jetpack Compose might seem like a daunting task. However, with some understanding of the process and best practices, the migration can be smooth and rewarding. In this blog post, we will explore the process of migrating existing XML-based UI code to Jetpack Compose, along with some best practices and common challenges.</p>

<h2 id="understanding-the-basics">Understanding the Basics</h2>

<p>Before diving into the migration process, it’s important to understand the basics of Jetpack Compose. Jetpack Compose uses a completely different approach to building UI compared to XML-based UI. Instead of defining UI elements in XML files, Jetpack Compose uses composable functions to create the user interface. Composable functions are lightweight and modular, allowing for easier composition and reuse. With Jetpack Compose, UI elements are defined using simple Kotlin functions that return UI components, making the code more concise and readable.</p>

<h2 id="step-by-step-migration-process">Step-by-Step Migration Process</h2>

<ol>
  <li><strong>Identify the Scope of Migration</strong>: Start by determining the scope of the migration. Analyze your XML-based UI code and identify the screens or components that you want to migrate to Jetpack Compose. It’s a good idea to start with smaller, less complex screens for the initial migration.</li>
  <li><strong>Create a Composable Function</strong>: For each screen or component you want to migrate, start by creating a new composable function in your Jetpack Compose code. This function will replace the XML file and will be responsible for defining the UI elements and layout.</li>
  <li><strong>Translate XML Elements to Compose</strong>: Analyze the XML code and translate each XML element and its attributes to the equivalent Jetpack Compose code. For example, if you have a TextView in XML, you would replace it with a Text composable function in Jetpack Compose.</li>
  <li><strong>Refactor Layouts</strong>: XML-based layouts often use LinearLayout, RelativeLayout, or ConstraintLayout for positioning UI elements. In Jetpack Compose, you can use the powerful layout composable functions like Column, Row, and Box to achieve the desired layout. Refactor your layout code accordingly.</li>
  <li><strong>Handle Styling</strong>: XML-based UI often relies on styles and themes for consistent styling. In Jetpack Compose, you can use the Material Design Components library to apply styles and themes. Refactor your styling code to use the appropriate Compose functions and APIs.</li>
  <li><strong>Migrate Business Logic</strong>: Along with the UI code, you’ll also need to migrate any associated business logic. This could include event handling, data binding, or any other logic related to the UI. Update your code to use the Jetpack Compose equivalents, such as using onClick instead of onClickListener for handling click events.</li>
  <li><strong>Gradual Migration</strong>: Consider adopting a gradual migration approach. Instead of migrating all screens at once, you can start by migrating individual screens or components and gradually expand the migration. This allows you to validate the changes, adapt to the new workflow, and measure the impact before fully migrating your entire application.</li>
</ol>

<h2 id="best-practices">Best Practices</h2>

<p>Here are some best practices to keep in mind during the migration process:</p>

<ul>
  <li><strong>Start with Small Screens</strong> - Begin the migration process with smaller, less complex screens or components. This will help you learn and understand the Compose syntax and concepts before moving on to more complex parts of your application.</li>
  <li><strong>Refactor Incrementally</strong> - Instead of rewriting your entire XML-based UI codebase, refactor and migrate sections incrementally. This ensures that your app remains functional during the migration and reduces the chances of introducing bugs.</li>
  <li><strong>Leverage Compatibility Libraries</strong> - Jetpack Compose provides compatibility libraries that allow you to use Compose alongside your existing XML-based UI code. You can gradually start using Compose in existing activities or fragments before fully migrating them.</li>
  <li><strong>Validate and Test</strong> - Thoroughly test and validate your migrated screens or components to ensure they are visually and functionally equivalent to the XML-based UI. Writing unit tests and UI tests for your Compose code is crucial to catch any potential issues.</li>
</ul>

<h2 id="common-challenges">Common Challenges</h2>

<p>Migrating from XML-based UI to Jetpack Compose can come with its fair share of challenges. Here are a few common challenges you might encounter:</p>

<ul>
  <li><strong>Learning Curve</strong> - Jetpack Compose introduces a new syntax and concept. It takes time to get familiar with the Compose way of building UI, especially if you are coming from an XML-based UI background.</li>
  <li><strong>Interoperability with Existing Code</strong> - Integrating Jetpack Compose with existing XML-based UI code can be challenging. You might need to find workarounds or use compatibility libraries to bridge the gap between the two approaches.</li>
  <li><strong>Integrating with 3rd Party Libraries</strong> - Some 3rd party libraries might not have built-in support for Jetpack Compose. You might need to find alternative libraries or write custom wrappers to integrate them seamlessly.</li>
  <li><strong>Limited Documentation and Resources</strong> - Since Jetpack Compose is still relatively new, you might find limited documentation and resources compared to XML-based UI. However, the Jetpack Compose documentation and community are continuously growing.</li>
</ul>

<h3 id="additional-information">Additional Information</h3>

<p><a href="https://developer.android.com/jetpack/compose">Jetpack Compose official documentation</a></p>

<p><a href="https://developer.android.com/jetpack/compose/migration">Migrating an app to use Jetpack Compose</a></p>

<p><a href="https://material.io/develop/android/docs/getting-started">Material Design Components for Jetpack Compose</a></p>

<p><a href="https://github.com/android/compose-samples">Jetpack Compose Samples GitHub repository</a></p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Send private transactions on private Ethereum networks</title>
      <link>https://maikotrindade.com/2023/01/16/send_private_transaction_ethereum.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2023/01/16/send_private_transaction_ethereum.html</guid>
      <pubDate>Mon, 16 Jan 2023 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>sendTransaction and eth_sendPrivateTransaction are both methods for sending transactions on the Ethereum blockchain, but there are some significant differences between them.sendTransaction is a met...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><code class="language-plaintext highlighter-rouge">sendTransaction</code> and <code class="language-plaintext highlighter-rouge">eth_sendPrivateTransaction</code> are both methods for sending transactions on the Ethereum blockchain, but there are some significant differences between them.</p>

<p><code class="language-plaintext highlighter-rouge">sendTransaction</code> is a method that is used to send transactions on the public Ethereum network. It is a standard method that is available in all Ethereum clients and is used to send transactions from one public account to another public account. The transaction details, such as sender address, recipient address, transaction amount, gas price, and gas limit, are publicly visible on the blockchain.</p>

<p>On the other hand, <code class="language-plaintext highlighter-rouge">eth_sendPrivateTransaction</code> is a method that is used to send private transactions on a <strong>private Ethereum network</strong>. Private networks are typically used in enterprise settings where transactions need to be kept confidential. The transaction details, including the smart contract code, are visible only to the parties involved in the transaction. This is achieved using private contracts and private transactions that are only visible to a subset of nodes on the private Ethereum network.</p>

<p><code class="language-plaintext highlighter-rouge">eth_sendPrivateTransaction</code> is relevant because it provides a way for enterprises to use the Ethereum blockchain to conduct business in a private and secure manner. By keeping transactions confidential, companies can protect their proprietary information and maintain the privacy of their customers. Additionally, private Ethereum networks can provide faster transaction times and lower transaction costs than the public Ethereum network.</p>

<p>Private Ethereum networks are important because they allow organizations to take advantage of the benefits of blockchain technology while tailoring the network to their specific needs. By offering greater privacy, customization, control, scalability, and cost-effectiveness, private Ethereum networks are an excellent choice for businesses looking to leverage blockchain technology to achieve their strategic goals.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>The Future of Gaming</title>
      <link>https://maikotrindade.com/2022/12/26/future-gamiing-crypto.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2022/12/26/future-gamiing-crypto.html</guid>
      <pubDate>Mon, 26 Dec 2022 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>The future of gaming in the world of cryptocurrency is an exciting and rapidly evolving space. As the use of cryptocurrency and blockchain technology continues to grow and gain mainstream acceptanc...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><img src="https://maikotrindade.com/public/img/gaming-crypto.webp" width="300" height="190" alt="The Future of Gaming" /></p>

<p>The future of gaming in the world of cryptocurrency is an exciting and rapidly evolving space. As the use of cryptocurrency and blockchain technology continues to grow and gain mainstream acceptance, it’s likely that we’ll see more and more game developers integrating these technologies into their products.</p>

<p>One potential use for cryptocurrency in gaming is as a means of in-game currency. In many games, players can earn or purchase virtual currency that can be used to buy in-game items or unlock new content. By using cryptocurrency as the medium of exchange, players could potentially buy and sell these virtual items on external marketplaces, potentially even making real-world profits from their in-game activities.</p>

<p>Another possibility is the use of cryptocurrency and blockchain technology to enable cross-game item interoperability. Currently, items and currency earned in one game are often not transferable to other games. By using blockchain technology to create a shared, decentralized ledger of in-game items, players could potentially take their hard-earned virtual items with them from game to game, creating a more immersive and persistent gaming experience.</p>

<p>In addition to these potential uses, we could also see the emergence of entirely new types of games built on blockchain technology. For example, some developers are already working on creating blockchain-based games that use non-fungible tokens (NFTs) to represent unique in-game items or assets. These NFTs could potentially be bought, sold, and traded on external marketplaces, adding a whole new level of value and ownership to in-game items.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Kotlin – Interfaces, Inline and Higher-Order Functions</title>
      <link>https://maikotrindade.com/2022/11/15/kotlin-interfaces-annontations.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2022/11/15/kotlin-interfaces-annontations.html</guid>
      <pubDate>Tue, 15 Nov 2022 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Kotlin is a modern, statically typed programming language that runs on the Java Virtual Machine and can also be compiled to JavaScript. It is expressive, concise, and powerful, and has quickly beco...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Kotlin is a modern, statically typed programming language that runs on the Java Virtual Machine and can also be compiled to JavaScript. It is expressive, concise, and powerful, and has quickly become a popular choice for Android development. In this blog post, we will take a look at some of the advanced features of Kotlin that can make your code more concise, readable, and efficient.</p>

<h3 id="type-inference">Type Inference</h3>
<p>Type inference is a feature that allows the Kotlin compiler to infer the type of a variable or expression based on the context in which it is used. This means that you don’t always have to specify the type explicitly, and the compiler will fill it in for you.</p>

<p>For example, consider the following code:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>val x = 1
val y = 2
val z = x + y
</code></pre></div></div>

<p>In this code, the variables x, y, and z are all inferred to be of type Int, because they are all assigned integer values. This is convenient because it saves you from having to specify the type explicitly, and it also makes the code more readable because it is less cluttered with type annotations.</p>

<p>Type inference can also be used with generic types. For example, consider the following code:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>val list = listOf(1, 2, 3)
</code></pre></div></div>

<p>Here, the type of the list variable is inferred to be List<Int>, because it is assigned a list of integers.</Int></p>

<h3 id="inline-functions">Inline Functions</h3>
<p>In Kotlin, you can use the inline keyword to annotate a function as inline. This means that the function will be inlined at the call site, which can improve the performance of your code by avoiding the overhead of function calls.</p>

<p>For example, consider the following code:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>inline fun foo(block: () -&gt; Unit) {
    println("Before")
    block()
    println("After")
}

foo {
    println("Inside")
}
</code></pre></div></div>

<p>In this code, the foo function is annotated as inline, which means that the code inside the function will be inlined at the call site. The output of this code will be:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Before
Inside
After
</code></pre></div></div>

<p>Inlining functions can be especially useful when working with higher-order functions, which we will discuss next.</p>

<h3 id="higher-order-functions">Higher-Order Functions</h3>
<p>A higher-order function is a function that takes one or more functions as arguments or returns a function as a result. Kotlin has excellent support for higher-order functions, which can be used to write concise and expressive code.</p>

<p>For example, consider the following code:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>fun foo(list: List&lt;Int&gt;, predicate: (Int) -&gt; Boolean): List&lt;Int&gt; {
    return list.filter(predicate)
}

val result = foo(listOf(1, 2, 3, 4, 5), { it % 2 == 0 })
</code></pre></div></div>

<p>In this code, the foo function is a higher-order function because it takes a function (predicate) as an argument. The predicate function is a lambda expression that takes an Int and returns a Boolean. The foo function uses the filter higher-order function to filter the list based on the predicate.</p>

<p>Higher-order functions can be used in combination with inline functions to write even more concise and expressive code. For example, consider the following code:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>inline fun &lt;T&gt; Iterable&lt;T
</code></pre></div></div>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Let&apos;s talk about Jetpack Compose again</title>
      <link>https://maikotrindade.com/2022/08/25/jetpack-compose-lets-talk.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2022/08/25/jetpack-compose-lets-talk.html</guid>
      <pubDate>Thu, 25 Aug 2022 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>If you’re using Jetpack Compose in your Android app development, you’ve likely encountered the concept of “collections”. In this blog post, we’ll explore what collections are in Jetpack Compose, ho...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>If you’re using Jetpack Compose in your Android app development, you’ve likely encountered the concept of “collections”. In this blog post, we’ll explore what collections are in Jetpack Compose, how to work with them, and some best practices for using them effectively.</p>

<p><img src="https://maikotrindade.com/public/img/androidjetpackcompose.png" width="300" height="220" alt="Android Jetpack Compose" /></p>

<p>First, let’s define what collections are in <a href="https://developer.android.com/jetpack/compose?gclsrc=ds&amp;gclsrc=ds">Jetpack Compose</a>. Collections are simply groups of data that can be iterated over and manipulated. This can include lists, sets, and maps. In Jetpack Compose, you can use collections to build UI elements that display multiple items, such as lists or grids.</p>

<p>One of the most useful ways to work with collections in <strong>Jetpack Compose</strong> is through the use of the <a href="https://developer.android.com/jetpack/compose/mental-model">@Composable</a> function For. This function allows you to iterate over a collection and build a UI element for each item in the collection. For example, you could use For to build a list of items like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@Composable

fun MyList(items: List&lt;Item&gt;) {
    Column {
        For(items) { item -&gt;
            Text(text = item.name)
        }
    }
}
</code></pre></div></div>

<p>This will create a <code class="language-plaintext highlighter-rouge">Text</code> element for each item in the items list, displaying the name property of each Item.</p>

<p>There are a few best practices to keep in mind when using collections in Jetpack Compose. Firstly, try to minimize the number of times you iterate over a collection. This can help improve the performance of your app, as each iteration can take time. Secondly, be mindful of the size of your collections. Large collections can lead to slower rendering times, so try to keep your collections as small as possible.</p>

<p>In summary, collections in Jetpack Compose are groups of data that can be iterated over and manipulated to build UI elements. The For function is a useful tool for working with collections, and it’s important to keep performance in mind when using them. By following these best practices, you can effectively use collections in your Jetpack Compose projects to build dynamic and efficient UI elements.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Supply chain on blockchains</title>
      <link>https://maikotrindade.com/2022/06/12/supply-chain-blockchain.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2022/06/12/supply-chain-blockchain.html</guid>
      <pubDate>Sun, 12 Jun 2022 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Supply chain management is a critical function in any business, as it involves the procurement, production, and distribution of goods and services. It is a complex process that requires coordinatio...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Supply chain management is a critical function in any business, as it involves the procurement, production, and distribution of goods and services. It is a complex process that requires coordination and collaboration between multiple stakeholders, including suppliers, manufacturers, distributors, and customers.</p>

<p>Blockchain technology has the potential to revolutionize supply chain management by providing a decentralized, transparent, and secure platform for managing and tracking the flow of goods and services. Here are some key ways that blockchain can improve supply chain management:</p>

<p>Increased transparency: Blockchain allows for the creation of a shared, immutable record of transactions that can be accessed by all stakeholders in the supply chain. This increased transparency can help to reduce fraud and errors, and improve trust and collaboration between partners.</p>

<p>Improved traceability: With blockchain, it is possible to track the movement of goods from the point of origin to the final destination. This can help to improve the efficiency and accuracy of the supply chain, and reduce the risk of counterfeiting or other types of fraud.</p>

<p>Enhanced security: Blockchain provides a secure and decentralized platform for storing and sharing data, making it difficult for hackers to access or alter information. This can help to protect sensitive data and reduce the risk of data breaches.</p>

<p>Improved efficiency: By automating many of the processes involved in supply chain management, blockchain technology can help to streamline operations and reduce the need for manual intervention. This can lead to cost savings and improved efficiency.</p>

<p><img src="https://maikotrindade.com/public/img/supplychainblockchain.jpeg" width="300" height="190" alt="Supply chain blockchain" /></p>

<p>In conclusion, blockchain technology has the potential to significantly improve supply chain management by increasing transparency, improving traceability, enhancing security, and improving efficiency. As more and more businesses adopt blockchain technology, it is likely that we will see a transformation in the way supply chains are managed and operated.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Ethereum governance</title>
      <link>https://maikotrindade.com/2022/05/27/ethereum-governance.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2022/05/27/ethereum-governance.html</guid>
      <pubDate>Fri, 27 May 2022 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>As Ethereum continues to grow and mature, it will be important to continue to refine and improve its governance model in order to ensure that it remains a decentralized and transparent platform tha...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>As Ethereum continues to grow and mature, it will be important to continue to refine and improve its governance model in order to ensure that it remains a decentralized and transparent platform that serves the needs of its users. This will require ongoing collaboration and dialogue between all stakeholders, including developers, users, and investors, to ensure that the platform remains aligned with the values and goals of the Ethereum community.</p>

<p>One of the main challenges facing Ethereum governance is balancing the needs of the different stakeholders involved. This includes developers, users, investors, and the Ethereum Foundation itself. Ensuring that the needs of all of these groups are taken into account can be difficult, and it requires ongoing communication and collaboration to ensure that the platform is able to meet the needs of all of these groups.</p>

<p>Another challenge is ensuring that the Ethereum governance process is transparent and accountable. This is especially important given the decentralized nature of the platform, as it is critical that all stakeholders have the ability to have their voices heard and their concerns addressed.</p>

<p><img src="https://maikotrindade.com/public/img/ethreum-governance.jpeg" width="300" height="190" alt="Ethreum Governance" /></p>

<p>One way that Ethereum is addressing these challenges is through the use of voting mechanisms, such as the ECF, which allow for more democratic decision-making processes. In addition, the Ethereum Foundation has implemented a number of transparency initiatives, such as open meetings and the creation of a transparency portal, to ensure that stakeholders are able to stay informed about the latest developments and decisions being made within the Ethereum community.</p>

<p>Despite these challenges, Ethereum governance has been largely successful in ensuring that the platform is able to adapt and evolve over time. It has been able to successfully navigate significant challenges, such as the DAO hack, and has continued to grow and thrive as a result.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Best practices and design patterns for Ethereum development</title>
      <link>https://maikotrindade.com/2022/04/22/best-practices-design-patterns-ethereum.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2022/04/22/best-practices-design-patterns-ethereum.html</guid>
      <pubDate>Fri, 22 Apr 2022 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>As Ethereum continues to gain popularity as a platform for decentralized applications (dApps), it is important for developers to adhere to best practices and utilize design patterns in order to cre...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>As Ethereum continues to gain popularity as a platform for decentralized applications (dApps), it is important for developers to adhere to best practices and utilize design patterns in order to create robust and secure dApps.</p>

<p>One key best practice for Ethereum development is to use a modular architecture. This involves breaking down the dApp into smaller, more manageable components that can be tested and developed independently. This not only makes the development process more efficient, but it also makes it easier to identify and fix issues.</p>

<p>Another important best practice is to use version control systems such as Git to track changes to the dApp’s codebase. This allows developers to easily revert to previous versions if necessary and collaborate with other team members.</p>

<p>Design patterns are also essential for Ethereum development. One commonly used pattern is the factory pattern, which allows developers to create new instances of a contract without having to hardcode its address. This is useful for deploying contracts to different networks or for testing purposes.</p>

<p>Another useful design pattern is the upgradable contract pattern, which allows developers to make changes to a contract without having to deploy a new version. This is particularly useful for bug fixes or feature updates, as it avoids the need to migrate users to a new contract.</p>

<p>Overall, adhering to best practices and utilizing design patterns can help ensure the success of an Ethereum dApp. By following these guidelines, developers can create more efficient and secure dApps that are better able to meet the needs of users.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Different types of Consensus mechanisms</title>
      <link>https://maikotrindade.com/2022/03/12/consensus-types.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2022/03/12/consensus-types.html</guid>
      <pubDate>Sat, 12 Mar 2022 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Consensus mechanisms are an essential component of any decentralized system or blockchain. They are the process by which a group of participants in a network reach agreement on a single version of ...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Consensus mechanisms are an essential component of any decentralized system or blockchain. They are the process by which a group of participants in a network reach agreement on a single version of the truth. In a decentralized system, there is no central authority to enforce rules or make decisions, so the consensus mechanism is what ensures that the network operates smoothly and fairly.</p>

<p>There are several different types of consensus mechanisms, each with its own strengths and weaknesses. Here are some of the most common ones:</p>

<h3 id="proof-of-work-pow">Proof of Work (PoW)</h3>
<p><a href="https://ethereum.org/en/developers/docs/consensus-mechanisms/pow/#:~:text=The%20Ethereum%20network%20began%20by,certain%20kinds%20of%20economic%20attacks.">Proof of Work</a> is the consensus mechanism that is used by the Bitcoin blockchain. It works by requiring participants (miners) to solve complex mathematical puzzles in order to validate transactions and add them to the blockchain. The first miner to solve the puzzle gets to add the block to the chain and is rewarded with a small amount of cryptocurrency.</p>

<h3 id="proof-of-stake-pos">Proof of Stake (PoS)</h3>
<p>Proof of Stake is a consensus mechanism that uses a different approach to validate transactions. Instead of requiring miners to solve complex puzzles, it relies on a group of validators who are chosen based on the amount of cryptocurrency they hold (their stake). The more cryptocurrency a validator has, the more likely they are to be chosen to validate a transaction. This system is less resource-intensive than Proof of Work, but it has its own set of potential problems, such as the potential for validators with a large stake to dominate the process.</p>

<h3 id="delegated-proof-of-stake-dpos">Delegated Proof of Stake (DPoS)</h3>
<p>Delegated Proof of Stake is a variation of Proof of Stake that involves a group of elected representatives who are responsible for validating transactions. The representatives are chosen by the network participants through a voting process. This system is meant to be more democratic and efficient than Proof of Work, but it has faced criticism for being susceptible to centralization and bribery.</p>

<h3 id="federated-byzantine-agreement-fba">Federated Byzantine Agreement (FBA)</h3>
<p>Federated Byzantine Agreement is a consensus mechanism that is used by the Stellar blockchain. It works by having a group of trusted nodes (called validators) that are responsible for verifying transactions. The validators reach consensus by communicating with each other and agreeing on the validity of the transaction. This system is faster and more efficient than Proof of Work, but it relies on the trustworthiness of the validators.</p>

<h3 id="proof-of-authority-poa">Proof of Authority (PoA)</h3>
<p>Proof of Authority is a consensus mechanism that is used by private blockchains or those that require a high level of security. It works by having a group of trusted individuals or organizations (called validators) that are responsible for verifying transactions. This system is more efficient and secure than Proof of Work, but it relies on the trustworthiness and integrity of the validators.</p>

<p>Consensus mechanisms are an important part of any decentralized system, as they ensure that the network is secure, efficient, and fair. It’s important to carefully consider the pros and cons of different consensus mechanisms before choosing one for your project.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Getting started with Chainlink development using Truffle and Infura</title>
      <link>https://maikotrindade.com/2021/06/28/getting-started-with-chainlink-development-using-truffle-and-infura.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2021/06/28/getting-started-with-chainlink-development-using-truffle-and-infura.html</guid>
      <pubDate>Mon, 28 Jun 2021 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>ChainlinkChainlink is a decentralized network of nodes that provide data andinformation from off-blockchain sources to on-blockchain smartcontracts via oraclesChainlink greatly expands the capabili...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="chainlink">Chainlink</h3>
<p>Chainlink is a decentralized network of nodes that provide data and
information from off-blockchain sources to on-blockchain smart
contracts via oracles</p>

<p>Chainlink greatly expands the capabilities of smart contracts by enabling access to real-world data and off-chain computation while maintaining the security and reliability guarantees inherent to blockchain technology.</p>

<p>This tutorial will be based on this <a href="https://github.com/smartcontractkit/truffle-starter-kit">repo</a> and we will use <a href="https://www.trufflesuite.com">Truffle</a> – a development environment, testing framework and asset pipeline for Ethereum</p>

<h3 id="prerequisite">Prerequisite</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1. Install NodeJS
2. Install Truffle: npm install -g truffle
3. Install Metamask
4. Install Ganache
5. Install VSCode
6. Install Solidity Plugin
</code></pre></div></div>

<h3 id="hands-on-truffle--chainlink">Hands on: Truffle + Chainlink</h3>
<p><code class="language-plaintext highlighter-rouge">npm install --global yarn</code></p>

<p><code class="language-plaintext highlighter-rouge">mkdir Chainlink</code></p>

<p><code class="language-plaintext highlighter-rouge">cd Chainlink</code></p>

<p><code class="language-plaintext highlighter-rouge">truffle unbox smartcontractkit/box</code></p>

<p><code class="language-plaintext highlighter-rouge">yarn</code></p>

<p><strong>Running tests</strong>
Run Ganache or enable/integrate
<em>Kovan</em> testnet
<code class="language-plaintext highlighter-rouge">npm test</code></p>

<p>All tests of <code class="language-plaintext highlighter-rouge">/test</code> will be executed.
There are tests about creating requests with and without Link tokens, sending these requests to oracle contract addresses, and testing contract ownership.</p>

<p><img src="https://maikotrindade.com/public/img/kovan-npm-tests-chainlink.png" height="540" width="360" alt="Kovan npm tests chainlink" /></p>

<p><strong>Note</strong> 
You must acquire some <code class="language-plaintext highlighter-rouge">LINK</code> for interact with you smart contract. 
Get some <code class="language-plaintext highlighter-rouge">LINK</code> via <a href="https://kovan.chain.link/">Chainlink Kovan Faucet website</a> 🤑 🤑 🤑</p>

<p><strong>Ganache deployment</strong></p>

<p><code class="language-plaintext highlighter-rouge">truffle migrate --network ganache --reset</code></p>

<p><strong>Kovan deployment</strong></p>
<ol>
  <li>Setup Metamask and connect to Kovan network</li>
  <li>Faucet: faucet.kovan.network</li>
  <li>Create account and a project using Infura.io – <a href="https://walkingtree.tech/deploying-a-smart-contract-in-rinkeby-using-infura/">step-by-step tutorial</a></li>
  <li>Infura setup and “env.sample” file configuration</li>
</ol>

<p><code class="language-plaintext highlighter-rouge">truffle migrate --network kovan --reset</code></p>

<p><img src="https://maikotrindade.com/public/img/kovan-truffle-chainlink-deploy.jpeg" height="170" width="360" alt="Android great again" /></p>

<h3 id="helper-scripts">Helper scripts</h3>
<p>Scripts to interact with deployed smart contract without any frontend implementation:</p>
<ol>
  <li>fund-contract.js</li>
</ol>

<p><code class="language-plaintext highlighter-rouge">npx truffle exec scripts/fund-contract.js --network kovan</code></p>

<ol>
  <li>request-data.js</li>
</ol>

<p><code class="language-plaintext highlighter-rouge">npx truffle exec scripts/request-data.js --network kovan</code></p>

<ol>
  <li>read-contract.js</li>
</ol>

<p><code class="language-plaintext highlighter-rouge">npx truffle exec scripts/read-contract.js --network kovan</code></p>

<p>● fund-contract.js</p>

<p>➢ Send 1 LINK to requesting contract</p>

<p>● request-data.js</p>

<p>➢ Chainlink request to be created from the requesting contract</p>

<p>● read-contract.js</p>

<p>➢ Read the data variable of the requesting contract (current price of pair ETH/USD)</p>

<h3 id="additional-information">Additional Information</h3>
<p><a href="https://docs.chain.link/docs/tutorials">Chainlink docs</a></p>

<p><a href="https://chain.link">Chainlink official website</a></p>

<p><a href="https://github.com/CryptoDevBR/crypto-feed-chainlink-oracle">Truffle Starter kit impl</a></p>

<p><a href="https://www.youtube.com/watch?v=YLmMNocc1ys&amp;t=1281s44-ways-to-enhance-your-smart-contract-with-chainlink/">Code a REAL WORLD dApp with Chainlink - Ethereum, Solidity, Web3.js</a></p>

<p><a href="https://www.gemini.com/cryptopedia/what-is-chainlink-and-how-does-it-work">What Is Chainlink in 5 Minutes</a></p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>What is Chainlink and why it is important for crypto-ecosystem?</title>
      <link>https://maikotrindade.com/2021/06/12/what-is-chainlink-and-why-it-is-important-for-crypto-ecosystem.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2021/06/12/what-is-chainlink-and-why-it-is-important-for-crypto-ecosystem.html</guid>
      <pubDate>Sat, 12 Jun 2021 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>WhyBlockchain’s inability to fetch reliable information from the real world● Huge vulnerability in decentralized applications when Blockchain wants to take advantage of off-chain data● Origins of d...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="why">Why</h3>

<p>Blockchain’s inability to fetch reliable information from the real world</p>

<p>● Huge vulnerability in decentralized applications when Blockchain wants to take advantage of off-chain data</p>

<p>● Origins of data are also the points where data can be manipulated, compromised, or simply falsified</p>

<p>● Chainlink started on Ethereum but it’s also available on Polkadot, Hyperledger, etc…</p>

<h3 id="chainlink">Chainlink</h3>

<p>Decentralized network of nodes that provide data and information from off-blockchain sources to on-blockchain smart contracts via oracles.
LINK is built on Ethereum in accordance with the ERC-20 standard for tokens</p>

<p>❏ Sep 2017 – Chainlink raises $32 million in an ICO creating 1 billion LINK tokens</p>

<p>❏ Nov 2018 – Chainlink acquires TownCrier</p>

<p>❏ May 2019 – Chainlink is launched on Ethereum mainnet</p>

<p>❏ May 2021 – Chainlink 2.0 whitepaper</p>

<h3 id="the-chainlinks-oracle">The Chainlink’s oracle</h3>
<p><em>Oracle</em> – Middleware that acts as an intermediary, translating data from the real world to smart contracts on the blockchain and back again</p>

<p><em>Chainlink</em> – Decentralized network of nodes that provide data and information from off-blockchain sources to on-blockchain smart contracts via oracles</p>

<p>🥇 Market standard for decentralized oracles</p>

<p>✅ Enhance and extend the capabilities of smart contracts on a target
blockchain through functions that are not available natively</p>

<p>✅ To minimize the potential failure of oracles: Distribution of data sources,
Distribution of oracles and Use of trusted hardware</p>

<p>✅ The Chainlink Reputation Contract</p>

<h3 id="chainlink-20">Chainlink 2.0</h3>

<p>Chainlink 2.0: Next Steps in the Evolution of Decentralized Oracle Networks</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Oracle networks go far beyond delivering highly validated data, they provide the various decentralized
services that are combined with smart contracts to create real world outcomes. These hybrid smart
contracts are already redefining our industry as DeFi.
</code></pre></div></div>

<p>🔥 Hybrid Smart Contracts that are seamlessly connected to all necessary off-chain resources, while
retaining increased levels of privacy and being secured</p>

<p>🔥 New “architecture” enables more advanced off-chain computation</p>

<p>🔥 Increase number of services since ecosystem is more flexible and enhance its capabilities. Chainlink
is the future of DeFi</p>

<h3 id="glossary">Glossary</h3>

<p>ERC-20: technical standard used to issue and implement tokens on the Ethereum blockchain. It makes
easier for developers to predict with more accuracy the interaction between different tokens and
applications</p>

<p>Faucet: website that distributes small amounts of crypto</p>

<p>ICO: An Initial coin offering occurs when company looking to raise money to create a new coin, app, or
service launches an ICO as a way to raise funds. Similar to an IPO</p>

<p>Middleware: software that acts as a bridge between an operating system or database and applications,
especially on a network</p>

<p>Off-chain: Transactions which agree to happen outside the blockchain</p>

<p>On-chain: normally refer to as blockchain transactions which happens inside the blockchain</p>

<h3 id="additional-information">Additional Information</h3>
<p><a href="https://coinmarketcap.com/view/oracles/">Top Oracles Tokens by Market Capitalization</a></p>

<p><a href="https://blog.chain.link/44-ways-to-enhance-your-smart-contract-with-chainlink/">77 Smart Contract Use Cases Enabled By Chainlink</a></p>

<p><a href="https://www.youtube.com/watch?v=yNdS2A676TU">Expanding Beyond Data Delivery With Chainlink 2.0</a></p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Inheritance in Solidity explained</title>
      <link>https://maikotrindade.com/2020/09/29/inheritance-in-solidity-explained.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2020/09/29/inheritance-in-solidity-explained.html</guid>
      <pubDate>Tue, 29 Sep 2020 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroSolidity supports multiple inheritance including polymorphism. Inheritance is the process of defining multiple contracts that are related to each other through parent-child relationships. The ...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="intro">Intro</h3>

<p>Solidity supports multiple inheritance including polymorphism. Inheritance is the process of defining multiple contracts that are related to each other through parent-child relationships. The contract that is inherited is called the parent contract and the contract that inherits is called the child contract.</p>

<p>When a contract inherits from other contracts, only a single contract is created on the blockchain, and the code from all the base contracts is compiled into the created contract. This means that all internal calls to functions of base contracts also just use internal function calls.</p>

<p>The benefits of using inheritance are: Ability to change one contract and have those modifications reflected in others, Reducement of dependency nad Ability to reuse existing code more.</p>

<h3 id="example-of-inheritance">Example of Inheritance</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pragma solidity ^0.8.0;

contract Grandparent {
    function myFunction() public pure virtual returns (string memory) {
        return "Contract Grandparent";
    }
}

// Contracts inherit other contracts by using the keyword 'is'.
contract Parent is Grandparent {
    // Override Grandparent.myFunction()
    function myFunction() public pure virtual override returns (string memory) {
        return "Contract Parent";
    }
}

contract Uncle is Grandparent {
    // Override Grandparent.myFunction()
    function myFunction() public pure virtual override returns (string memory) {
        return "Contract Uncle";
    }
}
</code></pre></div></div>

<p><em>Note:</em> Solidity copies the base contracts into the derived contract and a single contract is created with inheritance. A single address is generated that is shared between contracts in a parent-child relationship.</p>

<h3 id="-gotchas">💡 Gotchas</h3>

<ul>
  <li>In the case of multiple inheritances, function calls using super gives preference to most derived contracts;</li>
  <li>There are different types of inheritances: Single, Multi-level, Multiple and Hierarchical;</li>
  <li>A derived contract can access all non-private members including state variables and internal methods. But using this is not allowed;</li>
  <li>We can call a super contract’s function using a <code class="language-plaintext highlighter-rouge">super</code> keyword or using a super contract name;</li>
</ul>

<h3 id="additional-information">Additional Information</h3>

<p><a href="https://docs.soliditylang.org/en/v0.6.2/contracts.html#inheritance">Inheritance in Solidity</a> – Solidity docs</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Basic of Mappings in Solidity</title>
      <link>https://maikotrindade.com/2020/07/14/basic-of-solidity-mappings.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2020/07/14/basic-of-solidity-mappings.html</guid>
      <pubDate>Tue, 14 Jul 2020 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Mappings are one of the most used complex data types in Solidity. Mappings act as hash tables which consist of key types and corresponding value type pairs – pretty similar to hash tables or dictio...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Mappings are one of the most used complex data types in Solidity. Mappings act as hash tables which consist of key types and corresponding value type pairs – pretty similar to hash tables or dictionaries in other languages. They help in storing key-value pairs and enable retrieving values based on the supplied key.</p>

<p>Mappings are declared using the <code class="language-plaintext highlighter-rouge">mapping</code> keyword followed by data types for both key and value separated by the <code class="language-plaintext highlighter-rouge">=&gt;</code> notation. Mappings have identifiers like any other data type and they can be used to access the mapping and can only have type of storage and are generally used for state variables. Solidity automatically creates a getter function for it.</p>

<p>Although it is similar to a hash table and dictionary, Solidity does not allow iterating through mapping. A value from mapping can be retrieved if the key is known. The next example illustrates working with mapping.</p>

<p>Another characteristic about mapping is the absence of iteration support but there are ways to work round this limitation. Notice that iterating and looping are an expensive operation in Ethereum in terms of gas usage and should generally be avoided.</p>

<h3 id="-gotchas">💡 Gotchas</h3>

<ul>
  <li>Mappings do not have a length, nor do they have a concept of a key or a value being set</li>
  <li>It is also possible to have nested mapping, that is mapping consisting of mappings</li>
  <li>Mappings can only be used for state variables that act as storage reference types</li>
  <li>Mapping cannot be declared within functions as memory mappings</li>
  <li>When mappings are initialized every possible key exists in the mappings and are mapped to values whose byte-representations are all zeros</li>
</ul>

<h3 id="additional-information">Additional Information</h3>

<p><a href="https://docs.soliditylang.org/en/v0.4.21/types.html">Types in Solidity</a> – Solidity Docs v0.4.21</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>How is the structure of a smart contract</title>
      <link>https://maikotrindade.com/2020/05/01/structure-of-smart-contract.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2020/05/01/structure-of-smart-contract.html</guid>
      <pubDate>Fri, 01 May 2020 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Smart contracts are the basic unit of deployment and execution for EVMs. A contract contains state variables, functions, function modifiers, events, structures, and enums. Contracts also support in...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Smart contracts are the basic unit of deployment and execution for EVMs. A contract contains state variables, functions, function modifiers, events, structures, and enums. Contracts also support inheritance. Inheritance is implemented by copying code at the time of compiling. Smart contracts also support polymorphism.</p>

<p>Every transaction on Ethereum Virtual Machine costs us some amount of Gas. The lower the Gas consumption the better is your Solidity code. The Gas consumption of Memory is not very significant as compared to the gas consumption of Storage. Therefore, it is always better to use Memory for intermediate calculations and store the final result in Storage.</p>

<h3 id="state-variables">State variables</h3>

<p>The variable can be used at multiple places within code and they will all refer to the value stored within it. Solidity provides two types of variable: <em>state and memory</em>.</p>

<p>The default for function parameters (including return parameters of functions) is <em>memory</em>, the default for local variables is storage.</p>

<h3 id="storage">Storage</h3>

<p>Persistent data is referred to as storage and is represented by state variables. These values get stored permanently on the blockchain. You need to declare the type so that the contract can keep track of how much storage on the blockchain it needs when it compiles.</p>

<h3 id="structure">Structure</h3>
<p>Structures or structs helps implement custom user-defined data types. A structure is a composite data type, consisting of multiple variables of different data types. They are very similar to contracts; however, they do not contain any code within them. They consist of only variables.</p>

<h3 id="additional-information">Additional Information</h3>

<p><a href="https://ethereum.org/en/developers/docs/smart-contracts/anatomy/">ANATOMY OF SMART CONTRACTS</a> by Ethereum.org</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>EVM – Ethereum Virtual Machine</title>
      <link>https://maikotrindade.com/2020/04/11/the-ethereum-virtual-machine.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2020/04/11/the-ethereum-virtual-machine.html</guid>
      <pubDate>Sat, 11 Apr 2020 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroSolidity is a programming language targeting Ethereum Virtual Machine (EVM). Ethereum blockchain helps extend its functionality by writing and executing code known as smart contracts. Ethereum...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="intro">Intro</h3>

<p>Solidity is a programming language targeting Ethereum Virtual Machine (EVM). 
Ethereum blockchain helps extend its functionality by writing and executing code known as smart contracts. Ethereum Virtual Machines have been successfully implemented in various programming languages including C++, Java, JavaScript, Python, Ruby, and many others.</p>

<p>EVM executes code that is part of smart contracts. Smart contracts are written in Solidity; however, EVM does not understand the high-level constructs of Solidity. EVM understands lower-level instructions called bytecode. Solidity code needs a compiler to take its code and convert it into bytecode that is understandable by EVM.</p>

<p>For every instruction implemented on the EVM, a system that keeps track of execution cost, assigns to the instruction an associated cost in Gas units (See our What is Gas? article). When a user wants to initiate an execution, they reserve some Ether, which they are willing to pay for this gas cost.</p>

<p>In order to facilitate Keccak-256 cryptographic hash scheme, the EVM is a stack-based architecture with a word size of 256-bits. This architecture also allows for the use of elliptic-curve cryptography in Ethereum’s signature scheme for validating the origin and integrity of transactions.</p>

<p><img src="https://maikotrindade.com/public/img/evm.png" width="340" height="160" alt="EVM" /></p>

<h3 id="additional-information">Additional Information</h3>

<p><a href="https://ethereum.org/en/developers/docs/evm/">ETHEREUM VIRTUAL MACHINE (EVM)</a> by Ethereum.org</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Simplify your Android code with Coroutines</title>
      <link>https://maikotrindade.com/2020/02/20/coroutines-android-simplify-code.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2020/02/20/coroutines-android-simplify-code.html</guid>
      <pubDate>Thu, 20 Feb 2020 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Kotlin Coroutines in an Android app—a new way of managing background threads that can simplify code by reducing the need for callbacks. Coroutines are a Kotlin feature that converts async callbacks...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>Kotlin Coroutines in an Android app—a new way of managing background threads that can simplify code by reducing the need for callbacks. Coroutines are a Kotlin feature that converts async callbacks into sequential code. Code written sequentially is typically easier to read, and can even use language features such as exceptions.</p>

<p>In the end, they do the exact same thing: wait until a result is available from a long-running task and continue execution. However, in code they look very different.</p>

<p>The keyword <code class="language-plaintext highlighter-rouge">suspend</code> is Kotlin’s way of marking a function, or function type, available to coroutines. When a coroutine calls a function marked <code class="language-plaintext highlighter-rouge">suspend</code>, instead of blocking until that function returns like a normal function call, it suspends execution until the result is ready then it resumes where it left off with the result. While it’s suspended waiting for a result, it unblocks the thread that it’s running on so other functions or coroutines can run.</p>

<p><em>Note</em></p>
<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>The pattern of async and await in other languages is based on coroutines. If you're familiar with this pattern, the suspend keyword is similar to async. However in Kotlin, await() is implicit when calling a suspend function.
</code></pre></div>  </div>
</blockquote>

<h3 id="scopes">Scopes</h3>

<p>All coroutines run inside a CoroutineScope. A scope controls the lifetime of coroutines through its job. When you cancel the job of a scope, it cancels all coroutines started in that scope. On Android, you can use a scope to cancel all running coroutines when, for example, the user navigates away from an Activity. Scopes also allow you to specify a default dispatcher. A dispatcher controls which thread runs a coroutine.</p>

<p><em>GlobalScope</em> - Lifetime of the new coroutine is limited only by the lifetime of the whole application</p>

<p><em>CoroutineScope</em> - Is destroyed after all launched children are completed</p>

<p><em>MainScope</em> - Scope for UI applications and uses Dispatchers.Main</p>

<p><em>Note</em></p>
<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Libraries like Room and Retrofit offer main-safety out of the box when using coroutines, so you don't need to manage threads to make network or database calls. This can often lead to substantially simpler code.
</code></pre></div>  </div>
</blockquote>

<h3 id="channels">Channels</h3>

<p><code class="language-plaintext highlighter-rouge">Channels</code>  are a way to communicate (transfer data) between coroutines similar to a blocking queue.
It Uses <code class="language-plaintext highlighter-rouge">send</code> and <code class="language-plaintext highlighter-rouge">receive</code> for normal values, produce and consume for streams. Moreover, <code class="language-plaintext highlighter-rouge">Channels</code> can be closed to indicate no more elements are coming.</p>

<h3 id="exception-handling">Exception handling</h3>
<p>Coroutines will delegate uncaught exceptions to the system’s uncaught exception handler. On Android, the handler will output the exception and crash the app.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>try {
    GlobalScope.launch {
        throw NullPointerException()
    }
} catch (e: Exception) {
    // Exceptions will never land here because `launch` propagates uncaught exceptions
    // to the default handler and will never pass them to the outer scope.
    System.err.println("Caught exception! $e")
}
</code></pre></div></div>

<h3 id="additional-information">Additional Information</h3>

<p><a href="https://codelabs.developers.google.com/codelabs/kotlin-coroutines/#0">Use Kotlin Coroutines in your Android App</a> by Google</p>

<p><a href="https://codelabs.developers.google.com/codelabs/kotlin-android-training-coroutines-and-room/#0">Android Kotlin Fundamentals 06.2: Coroutines and Room</a> by Google</p>

<p><a href="https://www.youtube.com/watch?v=BOHK_w09pVA">Understand Kotlin Coroutines on Android</a> at Google/IO 19</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Coroutines basics</title>
      <link>https://maikotrindade.com/2019/12/05/coroutines-basics.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2019/12/05/coroutines-basics.html</guid>
      <pubDate>Thu, 05 Dec 2019 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroKotlin, as a language, provides only minimal low-level APIs in its standard library to enable various other libraries to utilize coroutines. Unlike many other languages with similar capabiliti...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="intro">Intro</h3>

<p>Kotlin, as a language, provides only minimal low-level APIs in its standard library to enable various other libraries to utilize <a href="https://github.com/Kotlin/kotlinx.coroutines">coroutines</a>. Unlike many other languages with similar capabilities, <em>async</em> and <em>await</em> are not keywords in Kotlin and are not even part of its standard library. Moreover, Kotlin’s concept of suspending function provides a safer and less error-prone abstraction for asynchronous operations than futures and promises.</p>

<p>On Android, coroutines help to solve two primary problems:</p>

<ul>
  <li>Manage long-running tasks that might otherwise block the main thread and cause your app to freeze.</li>
  <li>Providing main-safety, or safely calling network or disk operations from the main thread.</li>
</ul>

<h3 id="get-started">Get Started</h3>

<p>Essentially, coroutines are light-weight threads. They are launched with launch coroutine builder in a context of some <code class="language-plaintext highlighter-rouge">CoroutineScope</code>. Here we are launching a new coroutine in the <code class="language-plaintext highlighter-rouge">GlobalScope</code>, meaning that the lifetime of the new coroutine is limited only by the lifetime of the whole application.</p>

<p>See this example:</p>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import kotlinx.coroutines.*

fun main() {
    GlobalScope.launch { // launch a new coroutine
	delay(1000L) // non-blocking delay
	println("World!")
}

	println("Hello,") // main thread continues
	Thread.sleep(2000L) // block main thread
}
</code></pre></div>  </div>
</blockquote>

<p>Coroutines allows us to mix <em>blocking</em> and <em>non-blocking</em> code in the same place. See the following example which has two delays. The first one is a <em>non-blocking</em> code inside a courotine and the second is <em>blocking</em>. Both work correctly once they are wrapped bt another courotine.</p>

<p><em>Note</em>: Delaying for a time while another coroutine is working is not a good approach.</p>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import kotlinx.coroutines.*

fun main() = runBlocking&lt;Unit&gt; { // start main coroutine
	GlobalScope.launch { // launch a new coroutine
	delay(1000L)
	println("World!")
}
    
	println("Hello,") // main coroutine continues
	delay(2000L)      // delaying
}
</code></pre></div>  </div>
</blockquote>

<h3 id="designate-a-coroutinescope">Designate a CoroutineScope</h3>

<p>When defining a coroutine, you must also designate its <code class="language-plaintext highlighter-rouge">coroutineScope</code>. A <code class="language-plaintext highlighter-rouge">coroutineScope</code> manages one or more related coroutines. You can also use a <code class="language-plaintext highlighter-rouge">coroutineScope</code> to start a new coroutine within that scope. Unlike a dispatcher, however, a <code class="language-plaintext highlighter-rouge">coroutineScope</code> doesn’t run the coroutines.</p>

<p>One important function of <code class="language-plaintext highlighter-rouge">coroutineScope</code> is stopping coroutine execution when a user leaves a content area within your app. Using <code class="language-plaintext highlighter-rouge">coroutineScope</code>, you can ensure that any running operations stop correctly.</p>

<p><code class="language-plaintext highlighter-rouge">runBlocking</code> and <code class="language-plaintext highlighter-rouge">coroutineScope</code> may look similar because they both wait for its body and all its children to complete. The main difference between these two is that the <code class="language-plaintext highlighter-rouge">runBlocking</code> method blocks the current thread for waiting, while <code class="language-plaintext highlighter-rouge">coroutineScope</code> just suspends, releasing the underlying thread for other usages. Because of that difference, <code class="language-plaintext highlighter-rouge">runBlocking</code> is a regular function and <code class="language-plaintext highlighter-rouge">coroutineScope</code> is a suspending function.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Blockchain decentralizing the financial system</title>
      <link>https://maikotrindade.com/2019/11/11/blockchain-decentralizing-the-financial-system.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2019/11/11/blockchain-decentralizing-the-financial-system.html</guid>
      <pubDate>Mon, 11 Nov 2019 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Traditional vs. Decentralized FinanceThe current global financial system has proved to be inefficient in multiple aspects. With so many financial intermediaries present in the system, the users fac...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="traditional-vs-decentralized-finance">Traditional vs. Decentralized Finance</h3>

<p>The current global financial system has proved to be inefficient in multiple aspects. With so many financial intermediaries present in the system, the users face countless security risks. According to CIODIVE, cyber criminals target financial services 300 times more than other sectors. PWC analysts claim that 45% of financial intermediaries such as money transfers and stock exchanges suffer from serious cyber crimes every year.</p>

<p>The growing number of cyber attacks leaves the public at risk of financial loss and data exploitation. The existing financial system deprives millions of people from basic financial services because of barriers such as location, wealth, and status.</p>

<p>A decentralized financial system based on a public blockchain would provide access to financial services to everyone, regardless of their location and status. Numerous startups and companies have recognized the potential of open source networks to change and decentralize economic activity. Networks such as Bitcoin and Ethereum could solve the issues of the traditional financial system because of their permissionless nature. Blockchain could replace the current financial system because it is permissionless, decentralized and transparent.</p>

<p>Here’s what all of this means:</p>

<ul>
  <li>
    <p>Blockchain is permissionless, which means that anyone in the world can connect to it. This kind of accessibility on a global level would solve the issue of inequality posed by the current centralized financial system.</p>
  </li>
  <li>
    <p>Blockchain is decentralized. This means that its records are kept scattered across thousands of devices. There is no centralized server or body of authority that controls the blockchain.</p>
  </li>
  <li>
    <p>Blockchain is completely transparent, since all transaction records are publicly auditable.</p>
  </li>
</ul>

<h3 id="first-things-first-blockchain">First Things First: Blockchain</h3>

<p>With a blockchain, many people can write entries into a record of information, and a community of users can control how the record of information is amended and updated. Likewise, Wikipedia entries are not an article of a single publisher. No one person controls the information.</p>

<p>Blockchain is based on distributed ledger technology, which securely records information across a peer-to-peer network.</p>

<p>A distributed ledger is a database of transactions that is shared and synchronized across multiple computers and locations – without centralized control. Each party owns an identical copy of the record, which is automatically updated as soon as any additions are made. The distributed database created by blockchain technology has a fundamentally different digital backbone. This is also the most distinct and important feature of blockchain technology.</p>

<p>A blockchain records data across a peer-to-peer network. Every participant can see the data and verify or reject it using consensus algorithms. Approved data is entered into the ledger as a collection of “blocks” and stored in a chronological “chain” that cannot be altered.</p>

<p><img src="https://maikotrindade.com/public/img/peer-to-peer-network.jpg" width="320" height="215" alt="Peer to peer network" /></p>

<h3 id="ethreum-and-the-smart-contracts">Ethreum and the Smart Contracts</h3>

<p>A smart contract is a set of computer code between two or more parties that run on the top of a blockchain and constitutes of a set of rules which are agreed upon by the involved parties. Upon execution, if these set of pre-defined rules are met, the smart contract executes itself to produce the output. This piece of code allows decentralized automation by facilitating, verifying, and enforcing the conditions of an underlying agreement.</p>

<p>The Ethereum blockchain enables more open, inclusive, and secure business networks, shared operating models, more efficient processes, reduced costs, and new products and services in banking and finance. It enables digital securities to be issued within shorter periods of time, at lower unit costs, with greater levels of customization.</p>

<ol>
  <li><em>Security</em>: Its distributed consensus based architecture eliminates single points of failure and reduces the need for data intermediaries such as transfer agents, messaging system operators and inefficient monopolistic utilities. Ethereum also enables implementation of secure application code designed to be tamper-proof against fraud and malicious third parties— making it virtually impossible to hack or manipulate.</li>
  <li><em>Transparency</em>: It employs mutualized standards, protocols, and shared processes, acting as a single shared source of truth for network participants</li>
  <li><em>Trust</em>: Its transparent and immutable ledger makes it easy for different parties in a business network to collaborate, manage data, and reach agreements</li>
  <li><em>Programmability</em>: It supports the creation and execution of smart contracts— tamper proof, deterministic software that automates business logic – creating increased trust and efficiency</li>
  <li><em>Privacy</em>: It provides market-leading tools for granular data privacy across every layer of the software stack, allowing selective sharing of data in business networks. This dramatically improves transparency, trust and efficiency while maintaining privacy and confidentiality.</li>
  <li><em>High-Performance</em>: It’s private and hybrid networks are engineered to sustain hundreds of transactions per second and periodic surges in network activity</li>
  <li><em>Scalability</em>: It supports interoperability between private and public chains, offering each enterprise solution the global reach, tremendous resilience, and high integrity of the mainnet</li>
</ol>

<h3 id="the-state-of-the-art-of-main-decentralized-finance-projects">The state of the art of main Decentralized Finance projects</h3>

<ul>
  <li>
    <p>PAYMENTS</p>

    <ul>
      <li>OmiseGO
  Interoperability and scaling solutions for payments over Ethereum</li>
    </ul>
  </li>
  <li>
    <p>STABLECOINS</p>

    <ul>
      <li>
        <p>Dai
  A USD-pegged stablecoin built on the Ethereum and governed by the MakerDAO system</p>
      </li>
      <li>
        <p>Digix
  Physical gold with DGX tokens, where 1 DGX represents 1 gram of gold on Ethereum.</p>
      </li>
    </ul>
  </li>
  <li>
    <p>INFRASTRUCTURE</p>

    <ul>
      <li>
        <p>0x
  An open protocol for the peer-to-peer, decentralized exchange of digital assets</p>
      </li>
      <li>
        <p>0xcert
  Open source framework for creating, managing, and swapping NFTs and tokens</p>
      </li>
    </ul>
  </li>
  <li>
    <p>EXCHANGES &amp; LIQUIDITY</p>

    <ul>
      <li>
        <p>Bancor
  A decentralized liquidity network</p>
      </li>
      <li>
        <p>Airswap
  Peer-to-peer trading on Ethereum</p>
      </li>
    </ul>
  </li>
  <li>
    <p>INVESTMENT</p>

    <ul>
      <li>
        <p>Meridio
  A platform for fractional ownership shares in real estate assets</p>
      </li>
      <li>
        <p>Polymath Network
  A platform for the creation of tokenized securities</p>
      </li>
    </ul>
  </li>
  <li>
    <p>KYC &amp; IDENTITY</p>

    <ul>
      <li>
        <p>uPort
  The open identity system for the decentralized web</p>
      </li>
      <li>
        <p>Civic
  Secure blockchain identity toolbox and ecosystem</p>
      </li>
      <li>
        <p>Sovrin
  Open source, self-sovereign identity network</p>
      </li>
    </ul>
  </li>
  <li>
    <p>DERIVATIVES</p>

    <ul>
      <li>
        <p>dYdX
 Open-Source Protocols for decentralized margin trading and derivatives</p>
      </li>
      <li>
        <p>bZx (b0x)
 A decentralized margin lending protocol on Ethereum</p>
      </li>
    </ul>
  </li>
  <li>
    <p>MARKETPLACES</p>

    <ul>
      <li>
        <p>Gitcoin
  A marketplace for open source development work</p>
      </li>
      <li>
        <p>OpenSea
  A peer to peer trading market for crypto collectibles and rare digital items</p>
      </li>
      <li>
        <p>District0x
  A network of decentralized markets on Ethereum that operate via DAOs by utilizing Aragon</p>
      </li>
      <li>
        <p>Ethlance
  A marketplace for freelance work in the Ethereum space</p>
      </li>
      <li>
        <p>Origin
  A protocol for creating peer-to-peer marketplaces utilizing Ethereum and IPFS</p>
      </li>
    </ul>
  </li>
  <li>
    <p>PREDICTION MARKETS</p>

    <ul>
      <li>
        <p>Augur
  Prediction market protocol built on Ethereum</p>
      </li>
      <li>
        <p>Gnosis
  Open platform for creating prediction market applications on the Ethereum protocol</p>
      </li>
      <li>
        <p>Helena
  Prediction markets platform for forecasting blockchain developments, events, and projects</p>
      </li>
    </ul>
  </li>
  <li>
    <p>CREDIT &amp; LENDING</p>

    <ul>
      <li>
        <p>SALT
  A lending and borrowing platform that allows users to leverage their crypto-assets to secure loans.</p>
      </li>
      <li>
        <p>Dharma
  A suite of smart contracts and developer tools that make it possible to borrow and lend crypto-assets on blockchains like Ethereum</p>
      </li>
      <li>
        <p>Compound Finance
  Open source protocol for algorithmic, efficient money markets on the Ethereum.</p>
      </li>
    </ul>
  </li>
  <li>
    <p>INSURANCE</p>

    <ul>
      <li>Etherisc
  A decentralized insurance protocol to collectively build risk transfer solutions</li>
    </ul>
  </li>
  <li>
    <p>CUSTODIAL SERVICES</p>

    <ul>
      <li>
        <p>MetaMask
  A browser extension that allows users to run Ethereum dApps</p>
      </li>
      <li>
        <p>MyEtherWallet
  A free, open-source, client-side interface for generating Ethereum wallets and more</p>
      </li>
      <li>
        <p>Trust Wallet
  Ethereum wallet and multi cryptocurrency wallet to store your favorite ERC721 &amp; ERC20 tokens</p>
      </li>
    </ul>
  </li>
  <li>
    <p>DE-FI DATA &amp; ANALYTICS</p>

    <ul>
      <li>
        <p>Prediction Global
  Shows a list of all the markets on Augur.</p>
      </li>
      <li>
        <p>Stablecoin Index
  Tracks and monitors the price, volume, and stability of stablecoins</p>
      </li>
      <li>
        <p>Augur Leaderboard
  Number of trades and profits on Augur by ethereum address</p>
      </li>
    </ul>
  </li>
  <li>
    <p>DECENTRALIZED FINANCE SOLUTIONS</p>

    <ul>
      <li>
        <p>Adhara
  A real-time gross settlement platform providing liquidity management and international payments for decentralized financial networks</p>
      </li>
      <li>
        <p>Kaleido
  An all-in-one SaaS blockchain business cloud</p>
      </li>
    </ul>
  </li>
</ul>

<h3 id="references">References</h3>
<ul>
  <li><a href="https://www.forbes.com/sites/ilkerkoksal/2019/09/29/the-shift-toward-decentralized-finance-why-are-financial-firms-turning-to-crypto/#46f1d6a6392f">forbes</a> - The Shift Toward Decentralized Finance: Why Are Financial Firms Turning To Crypto?</li>
  <li><a href="https://www.coindesk.com/information/what-is-blockchain-technology">coindesk</a> - What is Blockchain Technology?</li>
  <li><a href="https://consensys.net/enterprise-ethereum/use-cases/banking-and-finance">consensys</a> - Blockchain in Banking and Financial Services</li>
</ul>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Koin – Dependency Injection for Kotlin</title>
      <link>https://maikotrindade.com/2019/07/09/koin-android-kotlin-dependency-injection.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2019/07/09/koin-android-kotlin-dependency-injection.html</guid>
      <pubDate>Tue, 09 Jul 2019 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroKoin is a lightweight dependency injection library for Kotlin and written in pure Kotlin. using functional resolution only: no proxy, no code generation, no reflection. Koin is a DSL, using Ko...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="intro">Intro</h3>
<p><a href="https://insert-koin.io/">Koin</a> is a lightweight dependency injection library for Kotlin and written in pure Kotlin. using functional resolution only: no proxy, no code generation, no reflection. Koin is a DSL, using Kotlin’s DSLs, that describes your dependencies into modules and sub-modules. You describe your definitions with certain key functions that mean something in the Koin context.</p>

<p><img src="https://maikotrindade.com/public/img/koin.png" width="320" height="233" alt="Koin DI" /></p>

<p>In this article, we are going to pass through the basic steps to setup and take advantage of dependency injection with Koin for a simple project.</p>

<h3 id="1-setup">1. Setup</h3>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>// Add Jcenter to your repositories if needed
repositories {
    jcenter()
}
dependencies {
    // Koin for Android
    implementation 'org.koin:koin-android:{revnumber}'
}
</code></pre></div>  </div>
</blockquote>

<h3 id="2-declare-a-module">2. Declare a module</h3>
<p>Defines those entities which will be injected in the app.</p>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>val appModule = module {
	single { DataRepository }
}
</code></pre></div>  </div>
</blockquote>

<h3 id="3-use-application-layer-to-initialize-koin-injection">3. Use Application layer to initialize Koin injection</h3>
<p>Trigger the DI process and indicate which modules will be available when needed</p>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>class BaseApplication : Application() {

  override fun onCreate() {
    super.onCreate()
    startKoin(this, appModule)
  }

}
</code></pre></div>  </div>
</blockquote>

<h3 id="4-use-the-actual-injection">4. Use the actual injection</h3>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>class MainActivity : AppCompatActivity() {
  private val repository: DataRepository by inject()
  ...
}
</code></pre></div>  </div>
</blockquote>

<p>This was the basic usage of koin which has much more power/features available in its framework. Another great Koin feature is the integration with the Architecture Component View Model. Koin has a specif project called <code class="language-plaintext highlighter-rouge">koin-android-viewmodel</code> project is dedicated to inject Android Architecture ViewModel.</p>

<h3 id="architecture-components-with-koin-viewmodel">Architecture Components with Koin: ViewModel</h3>

<h3 id="1-setup-1">1. Setup</h3>
<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>// Add Jcenter to your repositories if needed
repositories {
    jcenter()
}
dependencies {
    // ViewModel for Android
    implementation 'org.koin:koin-android-viewmodel:{revnumber}'
    // or ViewModel for AndroidX
    implementation 'org.koin:koin-androidx-viewmodel:{revnumber}'
}
</code></pre></div>  </div>
</blockquote>

<h3 id="2-declare-a-module-for-your-viewmodule">2. Declare a module for your viewModule</h3>
<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>val appModule = module {
    // ViewModel for News View with a dependency in its constructor
    viewModel { NewsViewModel(get()) }
}
</code></pre></div>  </div>
</blockquote>

<h3 id="3-use-the-actual-injection">3. Use the actual injection</h3>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>class MainActivity() : AppCompatActivity() {

  // lazy inject MyViewModel
  val viewModel : NewsViewModel by viewModel()
}
</code></pre></div>  </div>
</blockquote>

<h3 id="koin-key-functions">Koin Key Functions</h3>

<ul>
  <li><code class="language-plaintext highlighter-rouge">module { }</code> - create a Koin Module or a submodule (inside a module)</li>
  <li><code class="language-plaintext highlighter-rouge">factory { }</code> - provide a factory bean definition</li>
  <li><code class="language-plaintext highlighter-rouge">single { }</code> - provide a bean definition</li>
  <li><code class="language-plaintext highlighter-rouge">get()</code> - resolve a component dependency</li>
  <li><code class="language-plaintext highlighter-rouge">bind</code> - additional Kotlin type binding for given bean definition</li>
  <li><code class="language-plaintext highlighter-rouge">getProperty()</code> - resolve a property</li>
</ul>

<h3 id="futher-details">Futher Details</h3>
<p>I highly recommend the <a href="https://insert-koin.io/docs/2.0/documentation/koin-android/index.html">official docs</a> and the following articles: <a href="https://android.jlelse.eu/koin-simple-android-di-a47827a707ce">Koin - Simple Android DI</a> and <a href="https://medium.com/koin-developers/ready-for-koin-2-0-2722ab59cac3">Ready for Koin 2.0</a> by <a href="https://github.com/arnaudgiuliani">Arnaud Giuliani</a></p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Converting Java to Kotlin</title>
      <link>https://maikotrindade.com/2019/05/03/java-to-kotlin-converting.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2019/05/03/java-to-kotlin-converting.html</guid>
      <pubDate>Fri, 03 May 2019 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroductionGoogle announced official support for the Kotlin language at Google I/O 2017. Many developers started migrating the code base away from Java and learning Kotlin on the way. We are going...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>

<p>Google announced official support for the Kotlin language at Google I/O 2017. Many developers started migrating the code base away from Java and learning Kotlin on the way. We are going to discuss how you can go from Java to Kotlin and also talk about some tips about this process.</p>

<h3 id="getting-started">Getting started</h3>

<p>The very easy/initial thing you could do: use the Android Studio IDE to starting the convertion:</p>

<p>In the IDE, go to <code class="language-plaintext highlighter-rouge">Android Studio -&gt; Code -&gt; Convert Java File to Kotlin File</code>:
The converter is really nice, it is smart and does the most of job gracefully. However during the automated process the converter would choose not the most appropriate choice, so you must look into the code and figure out if the converter was right in all the scenarios. Probably the most interesting issue you may face is the nullability, because by default, all the converted object will be non-nullable and you will have to explicitly specified them to be nullable or change your logic. Another issue is about usage of android-annontations will most likely break. There is a shortcut to access the converter: <code class="language-plaintext highlighter-rouge">CMD+SHFT+ALT+K</code> or <code class="language-plaintext highlighter-rouge">CTRL+SHIFT+ALT+K</code> depending of your operational system.</p>

<p>Another option of converting the code is using the online tool <a href="https://try.kotlinlang.org/">try.kotlinlang</a>. Access the URL <a href="https://try.kotlinlang.org/">https://try.kotlinlang.org</a> and click on “Convert from Java”. In this way you can convert your project graduallly and observe all the changes clearly.</p>

<p><img src="https://maikotrindade.com/public/img/javatokotlin.png" width="380" height="370" alt="From Java to Kotlin Android" /></p>

<h3 id="things-to-keep-in-mind">Things to keep in mind</h3>

<p>Interoperability – Java and Kotlin work perfectly together. So don’t be afraid to add Kotlin code step by step, it’s not necessary to migrate all code to another language.
Pitfalls –  Automatic conversions can also be dangerous to your project, there are some scenarios that you may face new bugs in your code, for example an unexpected nullability. Some code converted can be asserted as not null which in turn can lead to a NullPointerException.
Usage of <code class="language-plaintext highlighter-rouge">val</code> and <code class="language-plaintext highlighter-rouge">lateinit</code> – the misusage of these can cause problems to your actual project. <code class="language-plaintext highlighter-rouge">val</code> is like Java <code class="language-plaintext highlighter-rouge">final</code> variable and it’s known as immutable in kotlin and can be initialized only single time. A misusage of this field is setting a variable would be changed somehow, for example, a variable inside your model which will be used in a parcelable or as response of networki request. Make the property nullable if it makes better sense and improves null safety. <code class="language-plaintext highlighter-rouge">lateinit</code> might be good if used properly but it has its cons as well. Don’t make it a replacement for NullPointerException.</p>

<h3 id="google-codelab-refactoring-to-kotlin">Google Codelab “Refactoring to Kotlin”</h3>

<p>Google offers a Codelab specifically for refactoring <a href="https://codelabs.developers.google.com/codelabs/java-to-kotlin/#0">Java code to Kotlin</a>. Besides this course provides a very interesting channel to learn more about Koltin, its features and concepts, this is the list of what you will learn in the codelab:</p>

<ul>
  <li>Handling nullability</li>
  <li>Implementing singletons</li>
  <li>Data classes</li>
  <li>Handling strings</li>
  <li>Elvis operator</li>
  <li>Destructuring</li>
  <li>Properties and backing properties</li>
  <li>Default arguments and named parameters</li>
  <li>Working with collections</li>
  <li>Extension functions</li>
  <li>Top-level functions and parameters</li>
  <li>let, apply, with, and run keywords</li>
</ul>

<p>Check the codelab versions in <a href="https://codelabs.developers.google.com/codelabs/java-to-kotlin-zh/#0">Chinese</a> and <a href="https://codelabs.developers.google.com/codelabs/java-to-kotlin-pt-br/#0">Brazilian Portuguese</a>.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Dependency Injection with Dagger 2</title>
      <link>https://maikotrindade.com/2019/04/25/dependency-injection-with-dagger-2.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2019/04/25/dependency-injection-with-dagger-2.html</guid>
      <pubDate>Thu, 25 Apr 2019 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroductionDependency Injection (DI) is a design pattern that removes the dependency from the programming code so that it can be easy to manage and test the application. Dependency Injection makes...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>

<p>Dependency Injection (DI) is a design pattern that removes the dependency from the programming code so that it can be easy to manage and test the application. Dependency Injection makes our programming code loosely coupled. DI allows classes to define their dependencies without constructing them. At runtime, another class is responsible for providing these dependencies.</p>

<p>Problems of Dependency
There are mainly two problems of dependency lookup:</p>

<ul>
  <li>
    <p>The dependency lookup approach makes the code tightly coupled. If resource is changed, we need to perform a lot of modification in the code.</p>
  </li>
  <li>
    <p>Not easy for testing This approach creates a lot of problems while testing the application especially in black box testing.</p>
  </li>
</ul>

<h3 id="dagger-2">Dagger 2</h3>

<p>Dagger 2 automatically constructs objects by walking the dependency tree, and it provides compile-time guarantees on dependencies.
Dagger 2 is also recommended by <a href="https://developer.android.com/jetpack/docs/guide#fetch-data">Android team</a>.</p>

<p>Dagger 2 uses the following annotations:</p>

<p><code class="language-plaintext highlighter-rouge">@Module</code> and <code class="language-plaintext highlighter-rouge">@Provides</code>: define classes and methods which provide dependencies. <code class="language-plaintext highlighter-rouge">@Module</code> are responsible for providing objects which can be injected. Such classes can define methods annotated with <code class="language-plaintext highlighter-rouge">@Provides</code>. The returned objects from these methods are available for dependency injection.</p>

<p><code class="language-plaintext highlighter-rouge">@Inject</code>: requests the dependencies. In other words, this annotation will let Dagger knows what the dependencies it is needed to be used by the dependant. 
Can be used on a constructor, a field, or a method.</p>

<p><code class="language-plaintext highlighter-rouge">@Component</code>: enables selected modules and used for performing dependency injection.</p>

<h3 id="further-details">Further Details</h3>

<p><a href="https://www.youtube.com/watch?v=plK0zyRLIP8">The Future of Dependency Injection with Dagger 2</a> by Jake Wharton
<a href="https://www.youtube.com/watch?v=oK_XtfXPkqw">DAGGER 2 - A New Type of dependency injection</a></p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>How to start with the new token standard ERC777 with Solidity</title>
      <link>https://maikotrindade.com/2019/03/29/solidity-erc777-new-token-standard.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2019/03/29/solidity-erc777-new-token-standard.html</guid>
      <pubDate>Fri, 29 Mar 2019 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroductionERC20 is a standard which defines a common list of rules that an Ethereum token has to implement, giving developers the ability to program how new tokens will function within the Ethere...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>

<p><a href="https://github.com/ethereum/EIPs/issues/20">ERC20</a> is a standard which defines a common list of rules that an Ethereum token has to implement, giving developers the ability to program how new tokens will function within the Ethereum ecosystem. <a href="https://github.com/ethereum/EIPs/issues/20">ERC20</a> defines how the tokens are transferred between addresses and how data within each token is accessed.</p>

<p>The <a href="https://github.com/ethereum/EIPs/issues/777">ERC777</a> token standard specifies an improvement of <a href="https://github.com/ethereum/EIPs/issues/20">ERC20</a> while remaining backward compatible. It defines advanced features to interact with tokens. Namely, operators to send tokens on behalf of another address—contract or regular account—and send/receive hooks to offer token holders more control over their tokens.</p>

<h3 id="erc777-in-a-nutshell">ERC777 in a nutshell</h3>

<p>Transactions – Let’s talk about of the most interesting features that this new standard is bringing to the world. <a href="https://github.com/ethereum/EIPs/issues/777">ERC777</a> has a function called <code class="language-plaintext highlighter-rouge">send()</code> consists in having a transaction with an amount field and a data bit field. Thus the parameters can be freely selected again by the token user and the token operator in order to forward data to the recipient.</p>

<blockquote>

  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>function send(address to, uint256 amount, bytes calldata data) external;
    function operatorSend(
        address from,
        address to,
        uint256 amount,
        bytes calldata data,
        bytes calldata operatorData
    ) external;
</code></pre></div>  </div>

</blockquote>

<p>Burning Tokens – <a href="https://github.com/ethereum/EIPs/issues/777">ERC777</a> provides a feature called “Burning tokens”. It is the act of destroying existing tokens that explicitly defines two functions to burn tokens (<code class="language-plaintext highlighter-rouge">burn</code> and <code class="language-plaintext highlighter-rouge">operatorBurn</code>). These functions facilitate the integration of the burning process in wallets and dapps. However, the token contract may prevent some or all holders from burning tokens for any reason. The token contract may also define other functions to burn tokens.</p>

<p>Backward Compatibility – The standard does not use <code class="language-plaintext highlighter-rouge">transfer</code> and <code class="language-plaintext highlighter-rouge">transferFrom</code> and uses <code class="language-plaintext highlighter-rouge">send</code> and <code class="language-plaintext highlighter-rouge">operatorSend</code> to avoid confusion and mistakes when deciphering which token standard is being used. Besides, <a href="https://github.com/ethereum/EIPs/issues/777">ERC777</a> allows the implementation of ERC20 functions transfer, transferFrom, approve and allowance alongside to make a token fully compatible with <a href="https://github.com/ethereum/EIPs/issues/20">ERC20</a>.</p>

<h3 id="reference-implementation---getting-started">Reference Implementation - getting started</h3>

<p>I would suggest two references:</p>
<ol>
  <li><a href="https://github.com/0xjac/ERC777">0xjac</a></li>
  <li><a href="https://docs.openzeppelin.org/v2.3.0/api/token/erc777">OpenZeppelin</a></li>
</ol>

<h4 id="0xjac">0xjac</h4>

<p>This repository contains all reference implementation and all tests. The reference implementation is also available via npm. In order to use it, you can download and setup the npm in your machine, access the <a href="https://www.npmjs.com/get-npm">npm website</a> to see the instructions.</p>

<p>After the npm configuration, install the erc777 with:</p>

<p><code class="language-plaintext highlighter-rouge">npm install erc777</code></p>

<h4 id="openzeppelin">OpenZeppelin</h4>

<p>OpenZeppelin is an open framework of reusable and secure smart contracts in the Solidity. It provides implementations of standards like ERC20, ERC721 and now ERC777 too. The project started providing <a href="https://github.com/ethereum/EIPs/issues/777">ERC777</a> after implementing the <a href="https://github.com/OpenZeppelin/openzeppelin-solidity/issues/1159">issue-1159</a>.</p>

<p>In this contract <code class="language-plaintext highlighter-rouge">ERC777.sol</code>, we can see how the ERC777 implementation are being organized. The contract implements the interface <code class="language-plaintext highlighter-rouge">IERC777</code> and <code class="language-plaintext highlighter-rouge">IERC20</code>, it is possible to safely interact with ERC22 and ERC777 while all the events are emitted during the interactions.</p>

<p>In order to use the OpenZeppelin implementation in your project, you can download and setup the npm in your machine, access the <a href="https://www.npmjs.com/get-npm">npm website</a> to see the instructions.</p>

<p>After the npm configuration, install the openzeppelin with:</p>

<p><code class="language-plaintext highlighter-rouge">npm install openzeppelin-solidity</code></p>

<h3 id="further-details">Further details</h3>

<p>See <a href="https://www.youtube.com/watch?v=CVdZ09iqQj8">ERC777: a New Advanced Token Standard</a> by Jordi Baylina, ERC777’s author, along Jacques Dafflon and Thomas Shababi</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Introduction to Android WorkManager</title>
      <link>https://maikotrindade.com/2019/02/03/introduction-android-work-manager.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2019/02/03/introduction-android-work-manager.html</guid>
      <pubDate>Sun, 03 Feb 2019 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroductionEvery Android app has a main thread which is in charge of handling UI (including measuring and drawing views), coordinating user interactions, and receiving lifecycle events. If there i...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>

<p>Every Android app has a main thread which is in charge of handling UI (including measuring and drawing views), coordinating user interactions, and receiving lifecycle events. If there is too much work happening on this thread, the app appears to hang or slow down, leading to an undesirable user experience. Any long-running computations and operations such as decoding a bitmap, accessing the disk, or performing network requests should be done on a separate background thread.</p>

<p>Applications may also require some tasks to run even when the user is not actively using the app such as syncing periodically with a backend server or fetching new content within an app on a periodic basis. Applications may also require services to run immediately to completion even after the user has completed interacting with the app. Google created a guide called <a href="https://developer.android.com/guide/background/">Guide to background processing</a> which determines which solution best meets your needs for these use cases.</p>

<p><img src="https://maikotrindade.com/public/img/background_diagram.png" width="380" height="270" alt="Background Diagram on Android" /></p>

<p><em>Diagram from <a href="https://android-developers.googleblog.com/2018/10/modern-background-execution-in-android.html">Modern background execution in Android</a></em></p>

<h3 id="workmanager">WorkManager</h3>
<p><a href="https://maikotrindade.github.io/2022/02/15/improving-accessibility-jetpack-compose-app.html">Title</a>
<a href="https://developer.android.com/topic/libraries/architecture/workmanager">WorkManager</a> is part of <a href="https://developer.android.com/jetpack">Android Jetpack</a> and an Architecture Component for background work that needs a combination of opportunistic and guaranteed execution. Opportunistic execution means that WorkManager will do your background work as soon as it can. Guaranteed execution means that WorkManager will take care of the logic to start your work under a variety of situations, even if you navigate away from your app.</p>

<p>WorkManager is a simple, but incredibly flexible library that has many additional benefits. These include:</p>

<ol>
  <li>Support for both asynchronous one-off and periodic tasks</li>
  <li>Support for constraints such as network conditions, storage space, and charging status</li>
  <li>Chaining of complex work requests, including running work in parallel</li>
  <li>Output from one work request used as input for the next</li>
  <li>Handles API level compatibility back to API level 14(see note)</li>
  <li>Works with or without Google Play services</li>
  <li>Follows system health best practices</li>
  <li>LiveData support to easily display work request state in UI</li>
</ol>

<hr />

<h3 id="get-started">Get started</h3>

<p>Add the WorkManager dependency in Java or Kotlin to your Android project by openning the <code class="language-plaintext highlighter-rouge">build.gradle</code> file for your project and add the google() repository as shown below:</p>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>allprojects {
    repositories {
        google()
        jcenter()
    }
}
</code></pre></div>  </div>
</blockquote>

<p>Add the dependencies for the artifacts you need in the build.gradle file for your app or module. Currently you are able to add AndroidX dependencies or legacy Pre-AndroidX dependencies, so please choose the dependence what fit your project. Remember you can also add the <code class="language-plaintext highlighter-rouge">$work_version</code> into your <code class="language-plaintext highlighter-rouge">gradle.build</code> (project scope).</p>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dependencies {
	def work_version = "2.0.1"

 	// (Java only)
	implementation "androidx.work:work-runtime:$work_version"

	// Kotlin + coroutines
	implementation "androidx.work:work-runtime-ktx:$work_version"
    
	// optional - RxJava2 support
	implementation "androidx.work:work-rxjava2:$work_version"
	// optional - Test helpers
	androidTestImplementation "androidx.work:work-testing:$work_version"
}
</code></pre></div>  </div>
</blockquote>

<p>By default, WorkManager is initialized using a ContentProvider with a default Configuration. ContentProviders are created and run before the Application object, so this allows the WorkManager singleton to be setup before your code can run in most cases. This is suitable for most developers. However, you can provide a custom Configuration by using Configuration.Provider or initialize(android.content.Context, androidx.work.Configuration).</p>

<p>WorkManager BroadcastReceivers to monitor Constraints on devices before API 23. The BroadcastReceivers are disabled on API 23 and up. In particular, WorkManager listens to the following Intents:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>android.intent.action.ACTION_POWER_CONNECTED
android.intent.action.ACTION_POWER_DISCONNECTED
android.intent.action.BATTERY_OKAY
android.intent.action.BATTERY_LOW
android.intent.action.DEVICE_STORAGE_LOW
android.intent.action.DEVICE_STORAGE_OK
android.net.conn.CONNECTIVITY_CHANGE
</code></pre></div></div>

<p>In addition, WorkManager listens to system time changes and reboots to properly reschedule work in certain situations. For this, it listens to the following Intents:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>android.intent.action.BOOT_COMPLETED
android.intent.action.TIME_SET
android.intent.action.TIMEZONE_CHANGED
</code></pre></div></div>

<p>WorkManager uses the following permissions:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>android.permission.WAKE_LOCK to make //it can keep the device awake to complete work before API 23
android.permission.ACCESS_NETWORK_STATE //to listen to network changes before API 23 and monitor network Constraints
android.permission.RECEIVE_BOOT_COMPLETED //to listen to reboots and reschedule work properly.
</code></pre></div></div>

<p>Note that WorkManager may enable or disable some of its BroadcastReceivers at runtime as needed. This has the side-effect of the system sending <code class="language-plaintext highlighter-rouge">ACTION_PACKAGE_CHANGED</code> broadcasts to your app. Please be aware of this use case and architect your app appropriately.</p>

<h3 id="further-details">Further Details</h3>

<p>Watch the full session: <a href="https://www.youtube.com/watch?v=pe_yqM16hPQ">WorkManager — Android Jetpack (YouTube)</a></p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Lifecycle-aware components on Android</title>
      <link>https://maikotrindade.com/2019/01/19/lifecycle-aware-components-on-android.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2019/01/19/lifecycle-aware-components-on-android.html</guid>
      <pubDate>Sat, 19 Jan 2019 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>IntroductionLifecycle-aware components perform actions in response to a change in the lifecycle status of another component, such as activities and fragments. These components help you produce bett...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="introduction">Introduction</h3>

<p><a href="https://developer.android.com/topic/libraries/architecture/lifecycle">Lifecycle-aware</a> components perform actions in response to a change in the lifecycle status of another component, such as activities and fragments. These components help you produce better-organized, and often lighter-weight code, that is easier to maintain.</p>

<p>A common pattern is to implement the actions of the dependent components in the lifecycle methods of activities and fragments. However, this pattern leads to a poor organization of the code and to the proliferation of errors. By using lifecycle-aware components, you can move the code of dependent components out of the lifecycle methods and into the components themselves.</p>

<h3 id="components">Components</h3>

<p><strong>ViewModel</strong> - provides a way to create and retrieve objects that are bound to a specific lifecycle. A ViewModel typically stores the state of a view’s data and communicates with other components, such as data repositories or the domain layer which handles business logic. To read an introductory guide to this topic, see ViewModel.</p>

<p><strong>LifecycleOwner/LifecycleRegistryOwner</strong> - both LifecycleOwner and LifecycleRegistryOwner are interfaces that are implemented in the AppCompatActivity and Support Fragment classes. You can subscribe other components to owner objects which implement these interfaces, to observe changes to the lifecycle of the owner. To read an introductory guide to this topic, see Handling Lifecycles.</p>

<p><strong>LiveData</strong> - allows you to observe changes to data across multiple components of your app without creating explicit, rigid dependency paths between them. LiveData respects the complex lifecycles of your app components, including activities, fragments, services, or any LifecycleOwner defined in your app. LiveData manages observer subscriptions by pausing subscriptions to stopped LifecycleOwner objects, and cancelling subscriptions to LifecycleOwner objects that are finished. To read an introductory guide to this topic, see LiveData.</p>

<h4 id="lifecycle">Lifecycle</h4>

<p><a href="https://developer.android.com/reference/androidx/lifecycle/Lifecycle.html">Lifecycle</a> is a class that holds the information about the lifecycle state of a component (like an activity or a fragment) and allows other objects to observe this state. Lifecycle uses two main enumerations to track the lifecycle status for its associated component:</p>

<p><strong>Event</strong> – The lifecycle events that are dispatched from the framework and the Lifecycle class. These events map to the callback events in activities and fragments.
<strong>State</strong> – The current state of the component tracked by the Lifecycle object.</p>

<h4 id="lifecycleowner">LifecycleOwner</h4>

<p><a href="https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a> is a single method interface that denotes that the class has a Lifecycle. It has one method, getLifecycle(), which must be implemented by the class. If you’re trying to manage the lifecycle of a whole application process instead, see ProcessLifecycleOwner.</p>

<p>This interface abstracts the ownership of a Lifecycle from individual classes, such as Fragment and AppCompatActivity, and allows writing components that work with them. Any custom application class can implement the LifecycleOwner interface.</p>

<p>Components that implement LifecycleObserver work seamlessly with components that implement LifecycleOwner because an owner can provide a lifecycle, which an observer can register to watch.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Architecture Components – Binding Data</title>
      <link>https://maikotrindade.com/2018/12/15/architecture-componentes-binding-data.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/12/15/architecture-componentes-binding-data.html</guid>
      <pubDate>Sat, 15 Dec 2018 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>The Data Binding Library allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically. In this codelab you’ll learn how to se...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>The <a href="https://developer.android.com/topic/libraries/data-binding/">Data Binding Library</a> allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically. In this codelab you’ll learn how to set it all up, use layout expressions, work with observable objects and create custom Binding Adapters to reduce boilerplate to a minimum.</p>

<p><img src="https://maikotrindade.com/public/img/androiddatabinding.png" width="380" height="160" alt="Android Data Binding" /></p>

<h3 id="get-started">Get Started</h3>
<p>First thing we need to do is to enable the Data Binding library in yout project. So
modify your <code class="language-plaintext highlighter-rouge">build.gradle</code> (app module context) and add the following code:</p>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>android {
...
     dataBinding {
   	enabled true
	}
}
</code></pre></div>  </div>
</blockquote>

<p>Sync your project and now you are able to convert or create a layout to a Data Binding layout. You must wrap your layout with a <code class="language-plaintext highlighter-rouge">&lt;layout&gt;</code> tag and optionally use the tags <code class="language-plaintext highlighter-rouge">data</code>, <code class="language-plaintext highlighter-rouge">variables</code> and <code class="language-plaintext highlighter-rouge">expressions</code>. You can also automatically convert a regular layout to Data Binding using the Android Studio by right-clicking the parent layout tag and selecting  “Convert data binding layout”.</p>

<h4 id="example-of-usage-1">Example of usage 1</h4>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"&gt;
	&lt;data&gt;

  	&lt;variable
      	name="viewmodel"
      	type="com.android.databinding.viewmodels.MyExampleViewModel"/&gt;

		&lt;variable name="funds" type="Integer"/&gt;

	&lt;/data&gt;

	&lt;androidx.constraintlayout.widget.ConstraintLayout
       android:layout_width="match_parent"
       android:layout_height="match_parent"&gt;

.....

	&lt;/androidx.constraintlayout.widget.ConstraintLayout
&lt;/layout&gt;
</code></pre></div>  </div>
</blockquote>

<p>Layout variables are used to write layout <a href="https://developer.android.com/topic/libraries/data-binding/expressions#expression_language">expressions</a> which are placed in the value of element attributes and they use the <code class="language-plaintext highlighter-rouge">@{expression}</code> format. See the following example:</p>

<h4 id="example-of-usage-2">Example of usage 2</h4>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;ImageView
	android:id="@+id/imageView"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:visibility="@{funds &lt; 0 ? View.GONE : View.VISIBLE}"/&gt;
</code></pre></div>  </div>
</blockquote>

<h3 id="observing-data">Observing data</h3>

<p>Instead of explicitly updating the UI when values changes, you can use [observables] to automatically updates the UI. In this way, another <a href="https://maikotrindade.github.io/2017/02/21/android-architecture-components.html">Architecture</a> component of <a href="https://developer.android.com/jetpack">Android Jetpack</a> library is recommended: <a href="https://developer.android.com/topic/libraries/architecture/livedata">LiveData</a>.</p>

<p>Let’s discuss about only the <em>observables</em> and data binding works since this article is only explanning about Data Binding. When an <em>observable</em> value changes, the UI elements it’s bound to are updated automatically.</p>

<p>Use can freely interact with your data using <code class="language-plaintext highlighter-rouge">DataBindingUtil</code>. See the following example and notice DataBinding will auto-generate a class for you. In the Example, the class generated was <code class="language-plaintext highlighter-rouge">MainActivityBinding</code> because our original layout did not specify a name for the class so DataBinding simply used the name of the layout file and add word ‘Binding’ in the end:</p>

<p><code class="language-plaintext highlighter-rouge">main_activity.xml</code> -&gt; MainActivity + Binding -&gt;  <strong>MainActivityBinding</strong></p>

<h4 id="example-of-usage-3">Example of usage 3</h4>

<blockquote>
  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>override fun onCreate(savedInstanceState: Bundle?) {
  super.onCreate(savedInstanceState)

  val binding : MainActivityBinding =
  DataBindingUtil.setContentView(this, R.layout.main_activity)

  	binding.viewmodel = viewModel
}
</code></pre></div>  </div>
</blockquote>

<h4 id="more-details">More details</h4>

<p>I recommend you to watch this <a href="https://www.youtube.com/watch?v=qc_QNQzMSCE">amazing tutorial</a> presented by Dan Galpin: Level up with Data Binding and simplify your Android coding</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>What is special about ERC1155?</title>
      <link>https://maikotrindade.com/2018/11/20/what-is-special-about-ERC1155.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/11/20/what-is-special-about-ERC1155.html</guid>
      <pubDate>Tue, 20 Nov 2018 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>According to Blockchain experts, Non-Fungible Tokens can revolutionize the future of blockchain. Do you really understand this concept and how can it be used? Let’s start talking about the basics a...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>According to Blockchain experts, Non-Fungible Tokens can revolutionize the future of blockchain. Do you really understand this concept and how can it be used? Let’s start talking about the basics and discussing what makes NFTs special and with a promising future.</p>

<h3 id="fungible-tokens-and-non-fungible-tokens">Fungible Tokens and Non Fungible Tokens</h3>
<p>Fungibility is important in the world of blockchain and cryptocurrency. It is desired for any currency, traditional or digital, since most currencies aim to be an interchangeable asset. A token can be exchanged for any other token of the same value. For example, One US dollar currency can be changed for another US dollar currency without any difference to the user.</p>

<p>On the other hand, Non-Fungible Token can’t be exchanged for any other NFT, because it has a unique and non-interchangeable behavior. These characteristics make them different from each other and digitally scarce. It is possible to create an analogy of NFTs with opera show tickets. Although the tickets are for the same show and everyone will listen to the same songs, each ticket has an identifier, buyer’s name and seat number. They are not easily transferable because each ticket has its value in a unique way.</p>

<p>In the Ethereum network, there are popular patterns that have been specified by the community itself. Each standard is known as ERC which stands for Ethereum Request for Comments. It defines methods, technology, behaviors for a particular functionality in Ethereum and it is submitted either for peer review.</p>

<p><img src="https://maikotrindade.com/public/img/nonfungibletable.png" width="380" height="130" alt="ERC20 compared with ERC721" /></p>

<h3 id="erc-1155">ERC-1155</h3>
<p>ERC-1155 is a standard for contracts that manage any combination of fungible tokens and non-fungible tokens.</p>

<p>Let’s talk about how the management works in every mentioned pattern in this article. Each ERC-20 token is required to be deployed in separate contracts. In case of ERC-721, this requires a single contract for managing a group of non-fungible tokens. However ERC-1155 works differently, it can handle any fungible and non-Fungible tokens in a single contract. This allows control of multiple tokens with different types in the same deployed contract.</p>

<p>As a result, the pattern avoids tons of repetitive code circulating the several contracts in the Ethereum ecosystem and saving significant storage space and gas costs.</p>

<h3 id="what-is-special-about-erc1155">What is special about ERC1155?</h3>
<p>The new standard is a powerful tool that joins fungible tokens that have been widely accepted (list of <a href="https://ropsten.etherscan.io/tokens">ERC-20 tokens</a>) to the non-fungible tokens that are popularizing themselves (list of <a href="https://nonfungible.com/">NFT tokens</a>).</p>

<p>In addition, the interface ERC-1155 provides ways to make transactions more efficient. The interface defines the function “safeBatchTransferFrom” to group multiple tokens and enable atomic swaps. In other words, the interface allows multiple complex operations in a single transaction. This procedure is quite simple and does not involve complex implementation.</p>

<p>Backwards Compatibility is another feature of the standard. It is compatible with ERC-721 and ERC-20 which can be inherited without any issue.
ERC-1155 allows smart contracts to reference other contracts’ storage whenever it necessary. In this way, it avoids duplicating of code or misuse of storage by smart contracts. As a result, it improves the efficiency of the Ethereum ecosystem.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Solidity – Travis CI with Truffle</title>
      <link>https://maikotrindade.com/2018/07/26/solidity-travis-ci-with-truffle.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/07/26/solidity-travis-ci-with-truffle.html</guid>
      <pubDate>Thu, 26 Jul 2018 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Continuous IntegrationContinuous Integration aka CI is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="continuous-integration">Continuous Integration</h3>
<p><a href="https://www.thoughtworks.com/continuous-integration">Continuous Integration</a> aka <em>CI</em> is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early. By integrating regularly, you can detect errors quickly, and locate them more easily and not integrating continuously you will have longer periods between integrations. This makes it exponentially more difficult to find and fix problems. Such integration problems can easily knock a project off-schedule, or cause it to fail altogether.</p>

<p><img src="https://maikotrindade.com/public/img/ci.png" width="380" height="290" alt="Continuous Integration" /></p>

<h3 id="travis-ci">Travis CI</h3>
<p>Using <a href="https://travis-ci.com">Travis CI</a>, the users can easily sync <a href="https://github.com">Github</a> projects and test the code test the code in minutes. Travis CI can be configured to run the tests on a range of different machines, with different software installed (such as older versions of a programming language implementation, to test for compatibility), and supports building software in numerous languages, including C, C++, C#, Clojure, D, Erlang, F#, Go, Apache Groovy, Haskell, Java, JavaScript, Julia, Perl, PHP, Python, R, Ruby, Rust, Scala and Visual Basic. Several high-profile open source projects are using it to run builds and tests on every commit, such as Plone, Ruby on Rails, and Ruby.[8][9</p>

<h3 id="truffle-with-travis-ci">Truffle with Travis CI</h3>
<p>Firstly, as prerequisite you should follow the Travis CI docs in order to integrate your Github project with Travis.
Then add the following chunk of code into your <code class="language-plaintext highlighter-rouge">.travis.yml</code>:</p>

<p>View the full <code class="language-plaintext highlighter-rouge">.travis.yml</code> snippet on <a href="https://gist.github.com/maikotrindade/2d544de08215085abfbba59ce3378a2c">GitHub Gist</a>.</p>

<p>In this script, we are selecting nodeJs version 8.11.3 with latest version of Node package manager (npm). Ganache (old testRPC) and truffle are also installed. The trigger mechanisms starts with ganache initialization and the truffle command <code class="language-plaintext highlighter-rouge">truffle test</code>.  In other words, the code will be compiled and the tests will ran too.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Your data in everywhere using Cloud Firestore</title>
      <link>https://maikotrindade.com/2018/07/07/google-firestore.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/07/07/google-firestore.html</guid>
      <pubDate>Sat, 07 Jul 2018 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>As the official Firestore docs says, Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. While the Cloud Firestore interface h...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>As the <a href="https://cloud.google.com/firestore/docs/">official Firestore docs</a> says, Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. While the Cloud Firestore interface has many of the same features as traditional databases, as a NoSQL database it differs from them in the way it describes relationships between data objects.</p>

<p><img src="https://maikotrindade.com/public/img/firebase-cloud-firestore-maikotrindade.github.io.png" height="120" width="380" alt="Google Cloud Firestore" /></p>

<p>This <a href="https://firebase.google.com/docs/database/">Realtime Database</a> (RTDB) is highly integrated with Firebase platform, including Google’s Cloud Functions serverless platforms. Besides Firestore was designed for making it easier for developers to build offline apps with the help of a local database for web, iOS and Android and to easily sync data between different apps and users in real time.</p>

<h3 id="features">Features</h3>

<p><strong>Designed for scaling</strong> – Cloud Firestore delivers the best of the Google Cloud platform;</p>

<p><strong>Offline Support</strong>  –  Write, read, examine, and query data, even if the file is offline;</p>

<p><strong>Flexibility</strong>  – Store your data in documents, organized into collections architectured in a flexible hierarchical data structures;</p>

<p><strong>Expressive Queries</strong> – Use queries to retrieve documents and choose the documents in a collection corresponding to the query parameters;</p>

<p><strong>Real-time updates</strong> –  Data is synchronizated to update data on any connected party;</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Kotlin – tricks and tips</title>
      <link>https://maikotrindade.com/2018/06/20/kotlin-tips-tricks-cheat-sheet.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/06/20/kotlin-tips-tricks-cheat-sheet.html</guid>
      <pubDate>Wed, 20 Jun 2018 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Setup  buildscript {    // …    ext.kotlin_version = ‘&apos;  dependencies {      classpath &quot;org.jetbrains.kotlin&quot; +           &quot;kotlin-gradle-plugin:$kotlin_version&quot;    }    }       apply plugin: ‘kotli...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><strong>Setup</strong></p>

<blockquote>
  <p>buildscript {<br />
    // …<br />
    ext.kotlin_version = ‘<version to="" use="">'</version></p>

  <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dependencies {  
    classpath "org.jetbrains.kotlin" +   
        "kotlin-gradle-plugin:$kotlin_version"    
}    }   
</code></pre></div>  </div>

  <p>apply plugin: ‘kotlin’</p>

  <p>dependencies {<br />
    compile “org.jetbrains.kotlin:kotlin-stdlib-jre8”<br />
}</p>
</blockquote>

<p><strong>Utility Functions</strong><br />
Favor Kotlin top-level extension functions over the typical Java utility classes. And for easier consumption within Java code, use @file:JvmName to specify the name of the Java class which would get generated by the Kotlin compiler.</p>

<blockquote>
  <p>// Use this annotation so you can call it from Java code<br />
@file:JvmName(“StringUtil”)<br />
fun String.lengthIsEven(): Boolean = length % 2 == 0<br />
val lengthIsEven = “someString”.lengthIsEven()</p>
</blockquote>

<p><strong>Data classes</strong><br />
They are classes that have the specific purpose of holding data:</p>

<blockquote>
  <p>data class Dog(val name: String, val age: Int)</p>
</blockquote>

<p>The data class will have the following function out of the box:</p>

<blockquote>
  <p>toString of the form “Dog(name=Mark, age=12)” equals() and hashCode() copy()</p>
</blockquote>

<p>It will also become a subject for destructuring declarations:</p>

<blockquote>
  <p>val markTurtle = Dog(“Joe”, 50)<br />
val (name, age) = markTurtle<br />
println(name)</p>
</blockquote>

<p><strong>Inline functions</strong><br />
A lambda expression in Kotlin is translated to Java anonymous classes in Java 6 or 7, that is an overhead. Lambda calls are affecting the call stack which has a performance impact.</p>

<p>inline functions can be used to flat out calls instead of invoking another method call and adding that to the call stack. So it makes sense to use inline functions when we pass in the lambdas.</p>

<blockquote>
  <p>inline fun callBlock(block: () -&gt; Unit) {<br />
    println(“Before calling block”)<br />
    block()<br />
    println(“After calling block”)<br />
}</p>
</blockquote>

<p>When we call callBlock it gets translated to something like the following:</p>

<blockquote>
  <p>callBlock { println(“The block operation”) }<br />
String var1 = “Before calling block”;<br />
System.out.println(var1)<br />
String var2 = “The block operation”;<br />
System.out.println(var2);<br />
var1 = “After calling block”;<br />
System.out.println(var1);</p>
</blockquote>

<p>vs. the following if the function was not marked as inline</p>

<blockquote>
  <p>callBlock { println(“The block operation”) }
callBlock((Functinos0)null.INSTANCE);</p>
</blockquote>

<p>You have to be careful with inline functions though because it literary copies the method content where it is called and if the body of the functions is too large you really do not want to do this.</p>

<p>Knowing that, the following obviously will not make any sense because it has zero effect.</p>

<blockquote>
  <p>inline fun foo(noinline block: () -&gt; Unit) {// Single lambda marked as noinline
inline fun foo() { // No lambdas</p>
</blockquote>

<p><strong>Checking for null in conditions</strong><br />
First, you can explicitly check if b is null, and handle the two options separately:</p>

<blockquote>
  <p>val l = if (b != null) b.length else -1</p>
</blockquote>

<p>The compiler tracks the information about the check you performed, and allows the call to length inside the if. More complex conditions are supported as well:</p>

<blockquote>
  <p>if (b != null &amp;&amp; b.length &gt; 0)
  print(“String of length ${b.length}”)
else
  print(“Empty string”)</p>
</blockquote>

<p>Note that this only works where b is immutable (i.e. a local variable which is not modified between the check and the usage or a member val which has a backing field and is not overridable), because otherwise it might happen that b changes to null after the check.</p>

<p><strong>Safe Calls</strong><br />
Your second option is the safe call operator, written ?.:</p>

<blockquote>
  <p>b?.length</p>
</blockquote>

<p>This returns b.length if b is not null, and null otherwise. The type of this expression is Int?.</p>

<p>Safe calls are useful in chains. For example, if Bob, an Employee, may be assigned to a Department (or not), that in turn may have another Employee as a department head, then to obtain the name of Bob’s department head, if any), we write the following:</p>

<blockquote>
  <p>bob?.department?.head?.name</p>
</blockquote>

<p>Such a chain returns null if any of the properties in it is null.</p>

<p><strong>Elvis Operator</strong><br />
When we have a nullable reference r, we can say “if r is not null, use it, otherwise use some non-null value x”:</p>

<blockquote>
  <p>val l: Int = if (b != null) b.length else -1</p>
</blockquote>

<p>Along with the complete if-expression, this can be expressed with the Elvis operator, written ?::</p>

<blockquote>
  <p>val l = b?.length ?: -1</p>
</blockquote>

<p>If the expression to the left of ?: is not null, the elvis operator returns it, otherwise it returns the expression to the right. Note that the right-hand side expression is evaluated only if the left-hand side is null.</p>

<p>Note that, since throw and return are expressions in Kotlin, they can also be used on the right hand side of the elvis operator. This can be very handy, for example, for checking function arguments:</p>

<blockquote>
  <p>fun foo(node: Node): String? {<br />
  val parent = node.getParent() ?: return null<br />
  val name = node.getName() ?: throw IllegalArgumentException(“name expected”)<br />
}</p>
</blockquote>

<p><strong>The !! Operator</strong><br />
We can write b!!, and this will return a non-null value of b (e.g., a String in our example) or throw an NPE if b is null:</p>

<blockquote>
  <p>val l = b!!.length()</p>
</blockquote>

<p>Thus, if you want an NPE, you can have it, but you have to ask for it explicitly, and it does not appear out of the blue.</p>

<p><strong>Safe Casts</strong><br />
Regular casts may result into a ClassCastException if the object is not of the target type. Another option is to use safe casts that return null if the attempt was not successful:</p>

<blockquote>
  <p>val aInt: Int? = a as? Int</p>
</blockquote>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>How to handle Flutter connectivity</title>
      <link>https://maikotrindade.com/2018/03/04/how-to-handle-flutter-connectivity.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/03/04/how-to-handle-flutter-connectivity.html</guid>
      <pubDate>Sun, 04 Mar 2018 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>A profissional app handles offline/online connectivity in order to interact with the user according to his phone state. A Flutter could not be different and in this post I will you an amazing libra...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>A profissional app handles offline/online connectivity in order to interact with the user according to his phone state. 
A <a href="https://flutter.io/">Flutter</a> could not be different and in this post I will you an amazing library which will facilitate our development.
The <a href="https://github.com/jogboms/flutter_offline">flutter_offline</a> developed by <a href="https://github.com/jogboms">jogboms</a> is an utility library for handling offline/online connectivity.</p>

<h3 id="installation-and-usage">Installation and Usage</h3>

<p>The process is really straightforward. First of all, you need to add the library’s dependency in your project:</p>

<p><code class="language-plaintext highlighter-rouge">dependencies:
  flutter_offline: "^0.2.1"</code></p>

<p>Next step is import the package that you included in you project and start using the library as the following example shows:</p>

<p>View the full usage example on <a href="https://gist.github.com/maikotrindade/11bf4e8c34881f74db35f22ff724ebd2">GitHub Gist</a>.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Solidity – Call x Transactions and Solidity functions</title>
      <link>https://maikotrindade.com/2018/02/20/solidity-call-vs-transaction.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/02/20/solidity-call-vs-transaction.html</guid>
      <pubDate>Tue, 20 Feb 2018 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>In Ethereum, it is possible to interact with contracts via calls (aka message calls) or via transactions.The official documentation says:Transaction  A piece of data, signed by an External Actor. I...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>In <a href="https://www.ethereum.org/">Ethereum</a>, it is possible to interact with contracts via calls (<em>aka message calls</em>) or via transactions.
The <a href="https://ethereum.github.io/yellowpaper/paper.pdf">official documentation</a> says:</p>

<h3 id="transaction">Transaction</h3>
<blockquote>
  <p>A piece of data, signed by an External Actor. It represents either a Message or a new Autonomous Object. Transactions are recorded into each block of the blockchain.</p>
</blockquote>

<h3 id="message-call">Message Call</h3>
<blockquote>
  <p>The act of passing a message from one Account to another. If the destination account is associated with non-empty EVM Code, then the VM will be started with the state of said Object and the Message acted upon. If the message sender is an Autonomous Object, then the Call passes any data returned from the VM operation.</p>
</blockquote>

<p>In other words, a <strong>transaction</strong> is an asynchronous operation which is broadcasted to the network and processed by miners. A transaction consumes Ether and modify the blockchain. A <strong>message call</strong> is a read-only and not Ether consumer operation of a contract function. The results of a ‘call’ will not be published or broadcasted on the blockchain.</p>

<h2 id="modifiers-and-visibility">Modifiers and Visibility</h2>

<h3 id="solidity-modifiers">Solidity Modifiers</h3>
<p>Since <a href="https://github.com/ethereum/solidity/releases/tag/v0.4.17">Solidity 0.4.17</a>, it provides the following functions modifiers on its framework: <code class="language-plaintext highlighter-rouge">view</code> and <code class="language-plaintext highlighter-rouge">pure</code>.</p>

<p><strong>View</strong> – should be used in functions that did not change any state values of a contract;</p>

<p><strong>Pure</strong> – should be used if it does not even read any state information. Pure functions can be used for tasks like permission-control, calculations and typecasting.</p>

<h3 id="visibility">Visibility</h3>

<p><strong>public</strong> – are part of the contract interface and can be either called internally or via messages. For public state variables, an automatic getter function (see below) is generated;</p>

<p><strong>private</strong> – and state variables are only visible for the contract they are defined in and not in derived contracts;</p>

<p><strong>internal</strong> – and state variables can only be accessed internally (i.e. from within the current contract or contracts deriving from it), without using <code class="language-plaintext highlighter-rouge">this</code>;</p>

<p><strong>external</strong> – are part of the contract interface, which means they can be called from other contracts and via transactions. An external function <code class="language-plaintext highlighter-rouge">f</code> cannot be called internally (i.e. <code class="language-plaintext highlighter-rouge">f()</code> does not work, but <code class="language-plaintext highlighter-rouge">this.f()</code> works). External functions are sometimes more efficient when they receive large arrays of data;</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Solidity – Gas, gas price, fee and gas usage</title>
      <link>https://maikotrindade.com/2018/01/24/solidity-difference-gas-gas-price-fee.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/01/24/solidity-difference-gas-gas-price-fee.html</guid>
      <pubDate>Wed, 24 Jan 2018 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>gas – is the name for a special unit used in Ethereumgas price – a value set by the creator of the transaction; it’s a single gas unit’s price;fee – the result of  gas * gas priceTransactions costs...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><strong>gas</strong> – is the name for a special unit used in Ethereum</p>

<p><strong>gas price</strong> – a value set by the creator of the transaction; it’s a single gas unit’s price;</p>

<p><strong>fee</strong> – the result of  <strong>gas</strong> * <strong>gas price</strong></p>

<h3 id="transactions-costs-x-ethereum-system">Transactions costs x <a href="https://www.ethereum.org/">Ethereum</a> system</h3>

<ul>
  <li>
    <p>Have in mind if the gas price is too low, no one will process your transaction;</p>
  </li>
  <li>
    <p>The fees are paid in ether, though, which is different from gas;</p>
  </li>
  <li>
    <p>The transaction fails (still goes into the blockchain) in case of gas price is fine but the gas cost runs “over budget”. You don’t get the money back for the work that the miners did.</p>
  </li>
  <li>
    <p>Transaction fee = Amount of work that goes into something + storage space your code will take;</p>
  </li>
</ul>

<h3 id="optimize-gas-usage-of-your-smart-contract">Optimize gas usage of your smart contract</h3>

<p>Gas is necessary for the execution of smart contracts, but you shouldn’t specify too low or high price. Consider optimizing your smart contract to minimize the amount of gas required.</p>

<h4 id="what-should-i-take-into-account-for-optimized-contracts">What should I take into account for optimized contracts?</h4>

<p><strong>Global Variables usage – storage</strong>: Global variables are stored in a contract’s state on the blockchain, so you are going to be charged if you use global variables. Just use when it is necessary, this is a  practice in several languages, but it is especially crucial in ethereum development;</p>

<p><strong>Contract Size</strong>: The size of your contract will influence the transaction cost for all interactions with it. So how big is your contract, more expansive your contract will be to processed in the Ethereum’s network. If you are able to break the <a href="http://solidity.readthedocs.io">Solidity</a> contract up into smaller separate contracts, this will decrease user’s gas costs;</p>

<h4 id="further-details">Further Details</h4>
<p>Take a look in this <a href="https://consensys.github.io/smart-contract-best-practices/">documentation from ConsenSys</a> for Ethereum Smart Contract Security Best Practices and this <a href="https://medium.com/coinmonks/optimizing-your-solidity-contracts-gas-usage-9d65334db6c7">Medium post</a> about Optimizing gas usage.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Solidity – Block and Transaction Properties</title>
      <link>https://maikotrindade.com/2018/01/15/solidity-block-transaction-properties.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2018/01/15/solidity-block-transaction-properties.html</guid>
      <pubDate>Mon, 15 Jan 2018 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Solidity provides special variables and functions which always exist in the global namespace and are mainly used to provide information about the blockchain or are general-use utility functions. Th...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><a href="http://solidity.readthedocs.io">Solidity</a> provides special variables and functions which always exist in the global namespace and are mainly used to provide information about the blockchain or are general-use utility functions. The following is a list of properties related to the block and transactions:</p>

<p>•	 <strong>block.blockhash</strong> (uint blockNumber) returns (bytes32): Hash of the given block, works for only the 256 most recent blocks<br />
•	 <strong>block.coinbase</strong> (address): Current block miner’s address<br />
•	 <strong>block.difficult</strong> (uint): Current block difficulty<br />
•	 <strong>block.gaslimit</strong> (uint): Current block gas limit<br />
•	 <strong>block.number</strong> (uint): Current block number<br />
•	 <strong>block.timestamp</strong> (uint): Current block timestamp<br />
•	 <strong>msg.data</strong> (bytes): Complete call data<br />
•	 <strong>msg.gas</strong> (uint): Remaining gas<br />
•	 <strong>msg.sender</strong> (address): Sender of the message (current call)<br />
•	 <strong>msg.sig</strong> (bytes4): First 4 bytes of the call data (function identifier)<br />
•	 <strong>msg.value</strong> (uint): Number of wei sent with the message<br />
•	 <strong>now</strong> (uint): Current block timestamp (alias for block.timestamp)<br />
•	 <strong>tx.gasprice</strong> (uint): Gas price of the transaction<br />
•	 <strong>tx.origin</strong> (address): Sender of the transaction (full call chain)</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Solidity – Hashes and Typecasting</title>
      <link>https://maikotrindade.com/2017/12/11/solidity-hash-type-casting.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2017/12/11/solidity-hash-type-casting.html</guid>
      <pubDate>Mon, 11 Dec 2017 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>HashesIn Solidity, it is possible to use the keccak256 function to get a hash. Ethereum’s KECCAK-256 algorithm produces a 256-bit hexadecimal number.  keccak256(…) returns (bytes32):compute the Eth...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<h3 id="hashes">Hashes</h3>
<p>In <a href="http://solidity.readthedocs.io/en/v0.4.24/">Solidity</a>, it is possible to use the keccak256 function to get a hash. Ethereum’s KECCAK-256 algorithm produces a 256-bit hexadecimal number.</p>

<blockquote>
  <p>keccak256(…) returns (bytes32):
compute the Ethereum-SHA-3 (Keccak-256) hash of the (tightly packed) arguments</p>
</blockquote>

<p>Usage Examples</p>
<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">keccak256</span><span class="p">(</span><span class="mi">6382179</span><span class="p">)</span>
<span class="nx">keccak256</span><span class="p">(</span><span class="mi">97</span><span class="p">,</span> <span class="mi">98</span><span class="p">,</span> <span class="mi">99</span><span class="p">)</span>
</code></pre></div></div>

<h3 id="typecasting">Typecasting</h3>
<p><a href="http://solidity.readthedocs.io/en/v0.4.24/">Solidity</a> is a statically typed language, which means that the type of each variable (state and local) needs to be specified at compile-time. 
Solidity is able to perform operations between two variables that have the same type. Therefore you can convert one of the variables to the type of the others.</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">uint256</span> <span class="nx">z</span> <span class="o">=</span> <span class="nx">y</span> <span class="o">*</span> <span class="nx">uint256</span><span class="p">(</span><span class="nx">x</span><span class="p">);</span>
<span class="nx">uint8</span> <span class="nx">x</span> <span class="o">=</span> <span class="mi">8</span><span class="p">;</span>
<span class="nx">uint256</span> <span class="nx">y</span> <span class="o">=</span> <span class="mi">10</span> <span class="o">**</span> <span class="mi">18</span><span class="p">;</span>
</code></pre></div></div>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Hello Solidity, hello Ethereum</title>
      <link>https://maikotrindade.com/2017/11/07/solidity-basics.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2017/11/07/solidity-basics.html</guid>
      <pubDate>Tue, 07 Nov 2017 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>According to official Solidity docs is a contract-oriented, Solidity is a high-level language for implementing smart contracts. It was influenced by C++,Python and JavaScript and is designed to tar...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>According to <a href="https://media.readthedocs.org/pdf/solidity/develop/solidity.pdf">official Solidity docs</a> is a contract-oriented, Solidity is a high-level language for implementing smart contracts. It was influenced by C++,
Python and JavaScript and is designed to target the Ethereum Virtual Machine (EVM).</p>

<p>Alright, let’s talk about Solidity’ syntax and its features. Basically I’m mention the following subjects: Contracts, Types of variables, Math operations, Functions, Arrays, Structs and Events.</p>

<h4 id="lets-start">Let’s start</h4>

<p>A contract is the fundamental building block of Ethereum applications — everything goes inside the contracts. This is very similar to Java, commonly all the code is encapsuled in ‘Class’.</p>

<p>First important thing you need to learn is how Solidity handles variables. Solidity is a statically typed language, which means that the type of each variable. Once you start coding variables and functions inside you Contract file, you need to understand Solidity has two types of variables: state and local. 
State variables are permanently stored in contract storage - into the Ethereum blockchain, it may cost some ‘gas’ in case you try to modify them.
Local variable you can modify them freely but remember you will loose their value right after the context/scope change - they are not stored.</p>

<p><strong>Booleans</strong>
<code class="language-plaintext highlighter-rouge">bool</code>: The possible values are constants true and false.</p>

<p><strong>Integers</strong>
<code class="language-plaintext highlighter-rouge">int</code> / <code class="language-plaintext highlighter-rouge">uint</code>: Signed and unsigned integers of various sizes. Keywords uint8 to uint256 in steps of 8 (unsigned of 8 up to 256 bits) and int8 to int256. uint and int are aliases for uint256 and int256, respectively.</p>

<p><strong>Address</strong>
<code class="language-plaintext highlighter-rouge">address</code>: Holds a 20 byte value (size of an Ethereum address). Address types also have members and serve as a base for all contracts.</p>

<p><strong>Members of Addresses</strong>
<code class="language-plaintext highlighter-rouge">balance</code> and <code class="language-plaintext highlighter-rouge">transfer</code>: It is possible to query the balance of an address using the property balance and to send Ether (in units of wei) to an address using the transfer function.</p>

<p><strong>Fixed-size byte arrays</strong>
<code class="language-plaintext highlighter-rouge">bytes1</code>, <code class="language-plaintext highlighter-rouge">bytes2</code>, <code class="language-plaintext highlighter-rouge">bytes3</code>, …, <code class="language-plaintext highlighter-rouge">bytes32</code>. byte is an alias for <code class="language-plaintext highlighter-rouge">bytes1</code>.</p>

<p><strong>Dynamically-sized byte array</strong>
bytes: Dynamically-sized byte array.
string: Dynamically-sized UTF-8-encoded string.</p>

<p><strong>String Literals</strong>
They are written with either double or single-quotes (“foo” or ‘bar’). They do not imply trailing zeroes as in C; “foo” represents three bytes not four. As with integer literals, their type can vary, but they are implicitly convertible to bytes1, …, bytes32, if they fit, to bytes and to string.</p>

<h4 id="math-operations">Math Operations</h4>

<p>Solidity offers the following math operations (it is almost the same as in most programming languages):</p>

<p>Addition: x + y
Subtraction: x - y,
Multiplication: x * y
Division: x / y
Modulus / remainder: x % y 
Support an exponential operator (i.e. “x to the power of y”, x^y):</p>

<h4 id="structs">Structs</h4>
<p>Sometimes you need a more complex data type. For this, Solidity provides structs:</p>

<p>`struct Person {
  uint age;
  string name;
}
Structs allow you to create more complicated data types that have multiple properties.</p>

<h4 id="events">Events</h4>
<p>Events are a way for your contract to communicate that something happened on the blockchain to your app front-end, which can be ‘listening’ for certain events and take action when they happen.</p>

<p><a href="https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-events">Events</a> are inheritable members of contracts. When they are called, they cause the arguments to be stored in the transaction’s log - a special data structure in the blockchain. These logs are associated with the address of the contract and will be incorporated into the blockchain and stay there as long as a block is accessible (forever as of Frontier and Homestead, but this might change with Serenity). Log and event data is not accessible from within contracts (not even from the contract that created them).</p>

<h4 id="further-details">Further details</h4>

<p>I’d recommend this article <a href="https://consensys.github.io/smart-contract-best-practices/recommendations/">Ethereum Smart Contract Best Practices</a> for beginners.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Architecture Components – let&apos;s make Android great again</title>
      <link>https://maikotrindade.com/2017/02/21/android-architecture-components.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2017/02/21/android-architecture-components.html</guid>
      <pubDate>Tue, 21 Feb 2017 00:00:00 -0800</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Google I/O 2017 brought a new package of outstanding news. In my point of view, one of the most relevant news were Architecture components, a new bunch of libraries that help developers design apps...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><img src="https://maikotrindade.com/public/img/android_great_again.jpg" height="215" width="340" alt="Android great again" />
Google I/O 2017 brought a new package of outstanding news. In my point of view, one of the most relevant news were <a href="https://developer.android.com/topic/libraries/architecture/index.html">Architecture components</a>, a new bunch of libraries that help developers design apps with testability, maintainability and clean code.</p>

<h3 id="room">Room</h3>
<p>This is my favorite library of Architecture Components, surely. Room is an object mapping library that let the code clean and collaborate with SQL queries. Furthermore, the library provides SQL queries validation compilation time, annotations and <a href="http://reactivex.io/documentation/observable.html">observables</a> for database changes. I knew this today would come, a day that Google will release a library for persistence such Apple offer for iOS (<a href="https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/">Core Data</a>). Hereafter I have no doubt Room will be a reference for the persistence layer although there are tons of similar libraries such as <a href="http://ormlite.com/">ORMLite</a>, <a href="http://www.activeandroid.com/">Active Android</a> or <a href="http://greenrobot.org/greendao/">GreenDAO</a>.</p>

<h3 id="viewmodel">ViewModel</h3>
<ul>
  <li>Provide data for fragment/activity;</li>
  <li>Independent of View: configuration changes don’t affect ViewModel;</li>
  <li>Similar to an usual presenter however the retention/loading is built-in;</li>
  <li>Retention happens through FragmentManager and HolderFragment;</li>
</ul>

<h3 id="live-data">Live Data</h3>
<p>it is responsible for listen and propagate data changes: an observable data holder It allows broadcasting of data changes all over the architecture layers taking into account all system issues eg. memory leaks.</p>

<h3 id="lifecycle-owner---lifecycle">Lifecycle Owner - Lifecycle</h3>
<p>It allows the creation of lifecycle-aware components which are able to adjust itself automatically according to the current lifecycle. This feature is possible because Lifecycle owner associates a class to the lifecycle via an abstract class called getLifecycle().</p>

<h4 id="further-details">Further Details</h4>
<p>I recommend this <a href="https://github.com/googlesamples/android-architecture-components">project</a> which Google team implemented samples of Architecture Componentes and this <a href="https://www.youtube.com/watch?v=FrteWKKVyzI&amp;list=PLOU2XLYxmsIKC8eODk_RNCWv3fBcLvMMy&amp;index=13">video</a> from Google I/O.</p>
]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Introduction to Reactive Programming with RxJava</title>
      <link>https://maikotrindade.com/2016/11/05/rxjava.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2016/11/05/rxjava.html</guid>
      <pubDate>Sat, 05 Nov 2016 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>RxJava is a Java VM implementation of ReactiveX, a library for composing asynchronous and event-based programs by using observable sequences. It is used for reactive programming which I like to ref...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><a href="https://github.com/ReactiveX/RxJava">RxJava</a> is a Java VM implementation of ReactiveX, a library for composing asynchronous and event-based programs by using observable sequences. It is used for reactive programming which I like to refer as “programming with asynchronous data streams” or “programming waiting for something happens to trigger your code” or “programming to react undetermined events”</p>

<p>I’m gonna be straightfoward because this topic it is a well known case that you only learn by doing. Basically, this is how it works: A Subscriber subscribes to Observable, then Observable calls Subscriber.onNext() for any number of items, if something goes wrong here is Subsciber.onError() and if all finishes fine, here is Subscriber.onCompleted().</p>

<h4 id="the-foundations">The foundations</h4>

<p>Subscribers
	-&gt; It listens to the events/items;</p>

<p>Observables 
	-&gt; It emits events/items - This class provides methods for subscribing to the Observable as well as delegate methods to the various Observers. It is necessary to trigger/listen/activate/start the observables otherwise they don’t do anything;</p>

<p>Operators
	-&gt; Functions responsible for manipulate observables. It can applyed along other operators and it has seveval goals: creation, combination, transformation, filtering, etc;</p>

<p>Schedulers
	-&gt; It manages the work with thread pools via Executors (java.util.concurrent);</p>

<h4 id="transforming-streams-with-operators">Transforming Streams with operators</h4>

<p>As it was said before, operators can manipulate observables. There are plenty of them and it is really important to know how/when use them. Here is the most popular RxJava operators:</p>

<table>
  <thead>
    <tr>
      <th>Category</th>
      <th>Operator</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Combination</td>
      <td>merge(), zip(), concat(), …</td>
    </tr>
    <tr>
      <td>Filtering</td>
      <td>cache(), retry(), replay(), …</td>
    </tr>
    <tr>
      <td>Transforming</td>
      <td>map(), flatMap(), concatMap(), …</td>
    </tr>
    <tr>
      <td>Creating</td>
      <td>just(), from(), defer(), …</td>
    </tr>
  </tbody>
</table>

<h4 id="further-details">Further details</h4>

<p>I totally recommend this <a href="https://youtu.be/htIXKI5gOQU?t=1s">talk</a> by <a href="http://jakewharton.com/">Jake Wharton</a>, an outstanding developer and a reference in opensource projects. Another option is watch this <a href="https://www.youtube.com/watch?v=k3D0cWyNno4">video</a> but don’t forget to practice, try to implement what it is suggested in the video.</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Some useful GIT commands</title>
      <link>https://maikotrindade.com/2016/09/03/major-git-commands.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2016/09/03/major-git-commands.html</guid>
      <pubDate>Sat, 03 Sep 2016 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>Git is a version control system that is used for software development and other version control tasks developed by Linus Torvalds in 2005. As a distributed revision control system it is aimed at sp...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p><a href="https://git-scm.com/">Git</a> is a version control system that is used for software development and other version control tasks developed by Linus Torvalds in 2005. As a distributed revision control system it is aimed at speed, data integrity, support for distributed and non-linear workflows.</p>

<h4 id="git-config">git config</h4>
<p>Sets configuration values for your user name, email, gpg key, preferred diff algorithm, file formats and more.</p>

<h4 id="git-branch--a">git branch -a</h4>
<p>Lists existing branches, including remote branches.</p>

<h4 id="git-branch--d-branch-name">git branch -d [branch-name]</h4>
<p>Deletes the specified branch</p>

<h4 id="git-push-origin-delete-branch-name">git push origin –delete [branch-name]</h4>
<p>Deletes the specified branch from remote</p>

<h4 id="git-stash">git stash</h4>
<p>Temporarily stores all modified tracked files</p>

<h4 id="git-stash-list">git stash list</h4>
<p>Lists all stashed changesets</p>

<h4 id="git-stash-pop">git stash pop</h4>
<p>Restores the most recently stashed files</p>

<h4 id="git-stash-drop">git stash drop</h4>
<p>Discards the most recently stashed changeset</p>

<h4 id="git-reset-commit">git reset [commit]</h4>
<p>Undoes all commits afer [commit], preserving changes locally</p>

<h4 id="git-reset-hard-commit">git reset –hard [commit]</h4>
<p>Discards all history and changes back to the specified commit</p>

<h4 id="git-show">git show</h4>
<p>Shows information about a git object.</p>

<h4 id="git-grep">git grep</h4>
<p>Lets you search through your trees of content for words and phrases. Example: git grep “www.google.com” – *.js</p>

]]></content:encoded>
      
      
    </item>
    
    <item>
      <title>Model View Presenter (MVP) on Android</title>
      <link>https://maikotrindade.com/2016/06/12/model-view-presenter-mvp-on-android.html</link>
      <guid isPermaLink="true">https://maikotrindade.com/2016/06/12/model-view-presenter-mvp-on-android.html</guid>
      <pubDate>Sun, 12 Jun 2016 00:00:00 -0700</pubDate>
      <dc:creator>Maiko Trindade</dc:creator>
      
      <description>The MVP pattern allows separate the presentation layer from the logic, so that everything about how the interface works is separated from how we represent it on screen. Ideally the MVP pattern woul...</description>
      
      
      
      
      
      <content:encoded><![CDATA[<p>The MVP pattern allows separate the presentation layer from the logic, so that everything about how the interface works is separated from how we represent it on screen. Ideally the MVP pattern would achieve that same logic might have completely different and interchangeable views. First thing to clarify is that MVP is not an architectural pattern, it’s only responsible for the presentation layer . In any case it is always better to use it for your architecture that not using it at all.</p>

<p><strong>Check this simplified <a href="https://github.com/maikotrindade/android-mvp">MVP example for Android</a></strong></p>

<p><strong>Mode</strong>l: This is the well known model, present in many of the most common patterns and use cases. It represents the world we are working with, every real world element that our app should know how to represent. Both the View and the Presenter are aware of this model and they know how to use its properties and methods (the view doesn’t really need to know the model and originally shouldn’t but it’s a tradeoff that avoids the need to have setter methods for every field that we want to update).</p>

<p><strong>View</strong>: As stated before, views are our Fragment and Activity classes that we are using, they are able to alter the UI as we need and they need to receive structured data from a source in order to populate themselves. This layer shouldn’t know anything else about the obtention of the data, we made it as simple as we could.</p>

<p><strong>Presenter</strong>: This layer, introduced here, is implemented with native java code meaning it doesn’t need to know whether it’s used in an Android application or a web service. How does this work with our structure previously described? Easy, what we are going to add to each view is a simple interface which defines the actions that any view using a specific presenter would need to do in order to populate itself with the data it provides. The presenter is responsible to act as the middle man between view and model. It retrieves data from the model and returns it formatted to the view. But unlike the typical MVC, it also decides what happens when you interact with the view.</p>

<h3 id="references">References</h3>

<ul>
  <li>https://medium.com/mobiwise-blog/android-basic-project-architecture-for-mvp-72f4b33252d0#.gebnmc1rq</li>
  <li>http://antonioleiva.com/mvp-android</li>
  <li>http://hannesdorfmann.com/mosby/mvp/</li>
</ul>
]]></content:encoded>
      
      
    </item>
    
  </channel>
</rss>
