<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ashutosh jha on Medium]]></title>
        <description><![CDATA[Stories by Ashutosh jha on Medium]]></description>
        <link>https://medium.com/@ashujha-1996?source=rss-19260eb64035------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g2aUUwc8W5ye8eBIIedMhA.png</url>
            <title>Stories by Ashutosh jha on Medium</title>
            <link>https://medium.com/@ashujha-1996?source=rss-19260eb64035------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 13:40:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashujha-1996/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SDD: Skip the code, show me the talkings]]></title>
            <link>https://ashujha-1996.medium.com/sdd-leave-the-code-show-me-the-talkings-bc5cc5f719c7?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc5cc5f719c7</guid>
            <category><![CDATA[ai-sdl]]></category>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[ai-development]]></category>
            <category><![CDATA[specs]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Thu, 12 Nov 2026 03:55:10 GMT</pubDate>
            <atom:updated>2026-11-12T03:55:52.024Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fIrxCaPa41KWUjIq" /><figcaption>Photo by <a href="https://unsplash.com/@wesleyphotography?utm_source=medium&amp;utm_medium=referral">Wesley Tingey</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>AI writes most of our code now, but the research, trade-offs and problem solving behind it vanish into private chat windows. Spec-Driven Development (SDD) turns that thinking into reviewed files that live next to the code, so your repo doubles as a code wiki. Leave the code; show me the talkings.</p><p>The shift underneath is simple: we are moving towards maintaining specs rather than code. The agent can regenerate code on demand, but it cannot regenerate our intent, so the spec is the part worth owning, reviewing and controlling.</p><p><strong>Plugin used in this article:</strong> <a href="https://github.com/gotalab/cc-sdd">cc-sdd</a>, an open-source SDD plugin for AI coding agents.</p><h3>1. Why do we need SDD?</h3><p>Because an AI can build a feature in minutes, while the thinking that shaped it stays in one person’s prompt history. Three things go wrong without a spec:</p><ul><li><strong>Lost context.</strong> The why behind a decision (rejected options, constraints, edge cases) disappears when the chat closes. The next engineer, or the next agent, re-derives it or guesses.</li><li><strong>Agent guesswork.</strong> Agents work best with just enough context. Too little and they fill gaps with assumptions; too much and they drift off track.</li><li><strong>Review at the wrong end.</strong> Reading 2,000 generated lines tells you what was built, not whether it was the right thing. Agreeing on intent first is far cheaper.</li></ul><p>SDD puts a structured spec between the idea and the implementation. The spec records intent, boundaries and decisions, and it is what we maintain and control.</p><p><strong>The biggest win is sharing.</strong> The research you did, the options you weighed and the problems you solved are no longer stuck in your chat. They sit in the repo as files your peers can read, comment on and build upon in a PR, so one person’s findings become the whole team’s starting point. Over time those files stop being personal notes and become an asset for the organisation.</p><h3>2. How to set up SDD, and keep it alive</h3><p>The setup is tool agnostic. Any tool works if the repo has three things:</p><ol><li><strong>A specs folder</strong>, one sub-folder per feature, holding requirements.md, design.md and tasks.md.</li><li><strong>Steering docs</strong>: project-level memory (product context, tech stack, structure) that every spec inherits.</li><li><strong>Phase prompts with human gates</strong>: reusable skills or commands that draft each document, and a person who approves it before the next phase starts.</li></ol><p>The quickest way to get all three is <a href="https://github.com/gotalab/cc-sdd">cc-sdd</a>, an open-source (MIT) SDD harness inspired by Kiro. It installs 17 Agent Skills in one command:</p><pre>cd your-project<br>npx cc-sdd@latest                  # Claude Code (default)<br>npx cc-sdd@latest --codex-skills   # or Codex, Cursor, Copilot, Gemini CLI, OpenCode...</pre><p>On an existing codebase, run /kiro-steering first to bootstrap the steering docs from what is already there. Why steering matters, and how to tune rules and templates, is covered next.</p><p><strong>Why steering matters.</strong> Steering docs are the memory every spec starts from. Without them, each agent session re-learns your product, stack and conventions, or guesses, and two specs can quietly contradict each other. With them, every requirement, design and task is generated with the same context, so you write it once instead of repeating it in every prompt.</p><p><strong>Rules and templates.</strong> Both live in the settings folder and are yours to edit. Templates set the structure of each document (a PRD-style requirements.md, extra API or database sections in design.md). Rules set the principles and judgment criteria the AI follows when it generates and reviews them. Tune them once and every spec follows your team&#39;s format.</p><p><strong>Maintaining it</strong></p><ul><li>Raise the spec files as the first PR, so reviewers read intent before code.</li><li>Change the spec in the same PR that changes the behaviour. A stale spec is worse than none.</li><li>Re-sync steering docs when the stack or conventions change.</li><li>Use it for bugs too, not only new features.</li></ul><h3>3. Using SDD in your daily workflow</h3><p>Every feature moves through the same five steps, and a person approves each document before the next one is generated. Typical spec generation takes under ten minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGS_xofBAcBltOuyv6z6SQ.png" /></figure><p>Each arrow is a checkpoint: nothing moves forward until the document before it is approved.</p><ol><li><strong>Init.</strong> /kiro-discovery &lt;idea&gt; routes the work (extend an existing spec, implement directly, or start a new spec) and writes a brief.md. /kiro-spec-init &lt;feature&gt; then creates the spec folder.</li><li><strong>Requirements.</strong> /kiro-spec-requirements &lt;feature&gt; writes requirements.md: EARS-format requirements with acceptance criteria.</li><li><strong>Design.</strong> /kiro-spec-design &lt;feature&gt; writes design.md: architecture, Mermaid diagrams and a File Structure Plan.</li><li><strong>Tasks.</strong> /kiro-spec-tasks &lt;feature&gt; writes tasks.md: ordered tasks with boundaries and dependencies.</li><li><strong>Impl.</strong> /kiro-impl &lt;feature&gt; implements the tasks test-first, with independent review of each one.</li></ol><p><strong>Validate and review, not just generate.</strong> Generation is only half the loop. Alongside each phase, use the validation and review skills:</p><ul><li>/kiro-validate-design runs an interactive quality review of the design before any code is written. Challenge it until it is right, then move on.</li><li>/kiro-validate-gap compares requirements with the existing codebase, so you see what already exists and what is missing.</li><li>/kiro-review checks each finished task against the approved spec, its boundaries and the verification evidence.</li><li>/kiro-validate-impl runs after all tasks are done and checks cross-task consistency, the full test suite and overall spec coverage.</li></ul><h3>4. How SDD controls code generation</h3><p>SDD gives you checkpoints before and after the agent writes anything:</p><ul><li><strong>Gates before code.</strong> Requirements and design are approved by a person. A wrong assumption costs one edit in a markdown file, not a rewrite of generated code.</li><li><strong>Boundaries.</strong> The design’s File Structure Plan drives the tasks, and each task carries _Boundary:_ and _Depends:_ notes. Reviews flag boundary violations, not just style issues, so the agent stays inside its lane.</li><li><strong>Grounded context.</strong> Steering docs and EARS-style requirements give the agent just enough context. You can write requirements in fuzzy language and let the agent structure them.</li><li><strong>Small, reviewed steps.</strong> With native subagents, each task gets a fresh implementer working test-first (RED, then GREEN), an independent reviewer, and an auto-debug pass when blocked.</li><li><strong>Checks after code.</strong> /kiro-validate-gap compares requirements with the existing codebase, and /kiro-validate-impl checks cross-task consistency and spec coverage.</li></ul><h3>5. What it ultimately becomes: a code wiki</h3><p>Every feature leaves behind requirements.md, design.md and tasks.md, with Mermaid diagrams, in git. After a few months that folder answers the questions a normal wiki never keeps up with:</p><ul><li><strong>Why was it built this way?</strong> Requirements hold the intent, designs hold the trade-offs, and the notes in tasks.md hold what the implementation taught us.</li><li><strong>Always current.</strong> Specs are versioned with the code and reviewed in the same PRs, so they drift less than a separate wiki.</li><li><strong>Faster onboarding.</strong> A new engineer, or a new agent session, reads the steering docs and the feature’s spec before touching code.</li><li><strong>Better next change.</strong> Extending a feature starts from its existing spec, so every agent run begins with the team’s accumulated context.</li></ul><p><strong>It is not only for engineers.</strong> The specs are plain markdown, so other stakeholders can use the same wiki:</p><ul><li><strong>Product managers</strong> can read the requirements to see exactly what shipped, and your next PRD starts from the existing requirements and design instead of from memory. It is grounded in what the product really does today, so new asks build on real behaviour and overlaps are caught early.</li><li><strong>QA</strong> can turn acceptance criteria straight into test cases.</li><li><strong>Designers and support</strong> can check the intended behaviour and edge cases without reading code.</li><li><strong>Leads and new joiners</strong> can understand a feature and its trade-offs in minutes.</li></ul><p>The wiki is only as good as its upkeep: keep specs concise and update them with the code. Do that, and the talkings outlive the chat window.</p><p>Happy Prompting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc5cc5f719c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Giving an AI Agent 8x faster Memory: What We Learned Building One]]></title>
            <link>https://blog.devgenius.io/giving-an-ai-agent-8x-faster-memory-what-we-learned-building-one-777703c2c377?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/777703c2c377</guid>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[ai-memory]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[fde]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 10:20:42 GMT</pubDate>
            <atom:updated>2026-11-16T12:55:55.442Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_mZjyagbgi1flaJ6KvgdA.png" /></figure><p><em>Lessons from building the memory layer for an on-call and triage agent. Written for engineers who are about to build the same thing.</em></p><h3>1. Why an agent needs memory at all</h3><p>A large language model is stateless. Every run starts from a blank context window. For a chatbot that is tolerable. For an agent that does real work every day, it causes four problems.</p><p>1. It repeats work it has already done. Take an on-call agent that triages a flight-booking failure. On Monday it spends 40 tool calls working out that a supplier timeout is the cause. On Tuesday it sees the same symptom and starts from zero. Nothing was learned.</p><p>2. It repeats mistakes, and no one can correct it for good. A human reviewer says, “for payment failures, check the gateway status first, not the app logs.” Without memory that feedback lasts one conversation. Someone has to re-type it into a prompt forever.</p><p>3. It cannot build on its own history. Questions like “has this happened before?”, “what did we conclude last time?” and “is this a new failure or a regression?” can only be answered if past runs are stored somewhere the agent can query.</p><p>4. Context windows are not a substitute. Stuffing everything into the prompt gets expensive and slow, and quality drops as the window fills. The right facts have to be <em>retrieved</em> when they are needed. That is a memory system.</p><p>The pitch in one line: memory turns an agent from a function into a colleague who accumulates experience.</p><h3>2. The types of memory</h3><p>The vocabulary comes from cognitive science, and it maps well onto agents. Most confusion in design discussions comes from mixing these up, so it helps to name them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obZuwlrQMZ-uW4adIlmP8A.png" /></figure><p>Three more forms sit alongside these. They aren’t separate cognitive categories, but you will meet them:</p><ul><li>Short-term / session memory. The conversation history carried across turns. It is working memory with a bit of persistence, usually just a message list.</li><li>User / entity memory. Per-user or per-customer preferences and facts, such as “this user prefers concise answers.” It is semantic memory keyed by an entity.</li><li>Parametric memory. What the model weights already know. You can’t edit it cheaply, so treat it as read-only background.</li></ul><p>In our on-call triage agent we deliberately focused on two: episodic and procedural. <em>Episodic</em> is “what happened,” stored as reports. <em>Procedural</em> is “how to do it,” stored as playbooks and triage rules. Those two gave us most of the value. Semantic and user memory can come later.</p><h3>3. When to use which</h3><p>The most useful question is: what is the agent going to do with this information?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUUobTKPgJtEV3rgNI8mbw.png" /></figure><p>Practical rules of thumb:</p><ul><li>Start with the cheapest thing that works. A well-written playbook pasted into the system prompt beats a vector database, until you have more playbooks than fit in the prompt.</li><li>Episodic memory is high-volume, low-trust. The agent writes it, nobody reviews each entry, and it will contain noise. Retrieve it as <em>evidence</em>, not as <em>instruction</em>.</li><li>Procedural memory is low-volume, high-trust. It changes behaviour, so it should be curated. If an agent can freely rewrite its own rules, one bad run can poison every later run. We let agents write reports freely. Rule changes go through a more deliberate path.</li><li>Keep the types physically separate. Different folders, different labels, different filters. We store reports and domain rules in separate subtrees, and search can filter by type (report, playbook, triage-rules). Mixing them made retrieval noisy.</li></ul><h3>4. Our architecture, and why it looks like this</h3><p>Earlier choice was to use confluence as a memory. But the read and search time was huge enough to motivate us and go for optimisation. The design goals were: durable and human-readable, fast enough for in-loop recall, and cheap to operate. With this we have achieved 8x faster search and 5x faster read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*hxtubDzUtQFAeYsqmg6GGQ.png" /></figure><ul><li>Confluence is the source of truth. People already read and edit it. Humans can correct, delete, or annotate memory in a UI they already know. This was the most valuable decision we made: memory that only a program can inspect is memory nobody trusts.</li><li>S3 is a read-through cache. Confluence reads were too slow for an agent loop. Reads go to S3 first and fall back to Confluence on a miss.</li><li>Qdrant is the search index. Hybrid search (dense embeddings plus BM25 keyword, fused with reciprocal rank fusion) over chunked page bodies.</li><li>A background sync job copies Confluence into S3 and Qdrant every 5 minutes.</li></ul><p>The write path only touches Confluence. Everything else is derived, so any of it can be rebuilt from Confluence.</p><h4>4.1 Why Qdrant and not S3 Vectors</h4><p>S3 Vectors looked attractive: we already run on S3, there is nothing to host, and it is cheap. We still chose self-hosted Qdrant, for one reason: hybrid search.</p><ul><li>S3 Vectors has no native BM25 or sparse-vector support. It does dense similarity only. We showed in 5.1 that dense-only search misses exact tokens such as error codes, booking IDs and supplier names, and those are what triage queries contain.</li><li>Adding keyword search would mean a second system. We’d need something like OpenSearch alongside S3 Vectors, plus code to merge the two ranked lists. That erases the “one less thing to run” advantage that made S3 Vectors appealing.</li><li>Qdrant does it in one query. It holds a dense vector and a sparse BM25 vector per chunk, and fuses them with reciprocal rank fusion server-side. It also supports payload filters (domain, type), which we use on every search.</li><li>The operational cost was acceptable. Qdrant runs self-hosted on ECS/Fargate in the same AWS account, so there’s no new vendor. Dense embeddings come from Bedrock, and the BM25 side runs locally with fastembed, so it needs no extra API or credentials.</li><li>The scale fits. We’re at roughly 5k to 100k pages at moderate QPS, comfortably within a single Qdrant node.</li></ul><p>When S3 Vectors would be the right call: you only need semantic similarity, your queries are natural language rather than identifiers, you want zero infrastructure, or you’re at a very large scale where storage cost dominates. Choose based on whether your queries contain exact tokens. If they do, you need hybrid search.</p><p>One design consequence: because the index is derived data, this decision is cheap to revisit. If S3 Vectors gains sparse support, we can rebuild the index from Confluence without touching the source of truth.</p><h4>4.2 How the S3 cache let us keep Confluence for humans</h4><p>The tension: we wanted memory that humans can read, edit and delete (Confluence), but an agent loop needs fast, predictable recall, and Confluence is neither fast nor built for machine-scale reads.</p><p>The S3 cache resolves this without giving up either goal:</p><ul><li>Humans and agents use different surfaces of the same data. People work in Confluence: formatted reports, page hierarchy, comments, edit history. Agents read JSON objects from S3. Neither has to compromise for the other.</li><li>Reads become O(1) and fast. A search hit carries the S3 path, so reading a page is a single GET. An ID-only read costs two (a pointer, then the object). Confluence is only hit on a cache miss.</li><li>Confluence is shielded from agent traffic. Agents can re-read memory many times per run. Without the cache, that load would hit Confluence’s rate limits and latency. With it, Confluence sees roughly one read per page per change, made by the sync job.</li><li>Human edits still flow through. A person fixes a report in Confluence, and the next 5-minute sync tick copies it into S3 and re-embeds it. Deletions propagate too, via the manifest (5.8). The human-readable copy stays authoritative.</li><li>Writes stay simple. Agents write only to Confluence. There is no dual-write to S3 and Qdrant to keep consistent, so there’s no partial-failure case to handle. S3 and Qdrant are rebuildable views.</li><li>Cache misses are a safety net, not a failure. A brand-new page isn’t in S3 yet, so the read falls through to live Confluence and is fresh. Any S3 problem also degrades to a slower read instead of an outage.</li><li>S3 layout adds structure the wiki tree doesn’t. Objects are grouped by type, domain and date (reports/&lt;domain&gt;/YYYY/MM/DD/&lt;page_id&gt;.json), and keyed by page ID, so renames never break them.</li></ul><p>The price is the 5-minute staleness window on updates (5.6). For agent memory, where notes are written once and recalled later, we judged that a good trade. fresh=True covers the cases where it isn&#39;t.</p><p>The pattern in general: keep a human-friendly system of record, and put a machine-friendly, disposable read layer in front of it. You get trust from the first and speed from the second.</p><h3>5. The learnings</h3><h4>5.1 Use hybrid search, not just vectors</h4><p>Pure semantic search is bad at exact tokens: error codes, booking IDs, supplier names, ticket keys. Those are exactly what triage queries contain. Pairing dense embeddings with BM25 and fusing the results fixed most of the “why didn’t it find the obvious one?” cases. It also let us pick Qdrant over a vector-only store, because it supports dense, sparse and fusion natively.</p><h4>5.2 Let the server decide where things go</h4><p>Our first instinct was to let the agent choose a path or parent page for each write. That failed in the obvious way: agents invent slightly different folder names, and the tree turns into a mess.</p><p>The fix was to make the server own placement. The agent passes domain, type and a title. The agent can&#39;t get the layout wrong because it never sees it.</p><p>Rule: give agents intent-level tools (“save this report for the domain”), not storage-level tools (“create a page under parent 4821”).</p><h4>5.3 Deduplicate on write</h4><p>Agents retry. Agents get triggered twice by the same alert. Without a guard you get five copies of the same report, and retrieval then returns five near-identical hits that crowd out everything else.</p><p>We added an optional dedup_key (for example id-&lt;channel&gt;-&lt;ts&gt;-&lt;issue_type&gt;), stored as a label. If a page with that label exists, the write updates it in place instead of creating a new one. It turns &quot;create&quot; into an idempotent upsert.</p><h4>5.4 Prevent lost updates on read-modify-write</h4><p>Two agents, or an agent and a human, editing the same page will silently overwrite each other. We pass expected_version on update, taken from a fresh read. If the page changed since, the update is rejected and the agent re-reads and merges. It&#39;s the same optimistic locking you&#39;d use on any database row, and agents need it as much as people do.</p><h4>5.5 Give agents a way to bypass the cache</h4><p>A cache makes stale reads possible, and an agent about to edit a page must not work from a stale copy. read(fresh=True) skips the cache and reads live from the source. Rule: reads for answering can be cached; reads that are the basis of a write must be fresh.</p><h4>5.6 Be explicit about your consistency model, and write it down</h4><p>We chose eventual consistency on purpose, and the asymmetry is worth noticing:</p><ul><li>A new page is a guaranteed cache <em>miss</em>, so it falls through to live Confluence and is always fresh.</li><li>An update to an already-cached page is a cache <em>hit</em>, so it serves the old copy for up to 5 minutes.</li></ul><p>Nobody will remember this in three months when someone asks “why didn’t my edit show up?” We wrote the exact sequence into the design doc, with the fix (a synchronous push on update) noted but not built. Documenting a known tradeoff costs an hour. Rediscovering it costs a day of debugging.</p><h4>5.7 Don’t trust the search index of the system you depend on</h4><p>This one surprised us. Confluence’s CQL search is index-backed and lags new pages by minutes. Our “find or create the container page” logic used CQL, so it couldn’t see a container created a few seconds earlier and created a duplicate.</p><p>The fix was to use the non-index-backed endpoints (/content?spaceKey=&amp;title=, /content?type=page) for anything that needs read-your-writes behaviour, and to keep CQL only where a lag is harmless. Any time you build dedup or find-or-create on top of a search API, check whether the search is eventually consistent.</p><h4>5.8 Detect deletions explicitly</h4><p>“What changed in the last 10 minutes?” never tells you what was <em>deleted</em>, because a deleted page simply stops appearing. If a human removes a bad memory, it must vanish from the cache and the index too, or the agent keeps recalling it forever.</p><p>We keep a manifest of {page_id: version, path} and diff it against the full list of live pages each tick. Anything in the manifest but not in the live set gets removed from S3 and Qdrant. It&#39;s a small feature, but without it the &quot;humans can curate memory&quot; promise is false.</p><h4>5.9 Use overlapping windows and idempotent steps</h4><p>Our sync looks back 10 minutes but runs every 5. A window equal to the interval leaves no margin, so one late or failed tick loses changes. Overlap costs a little repeated work, which is fine because every step is idempotent: Qdrant point IDs are a deterministic hash of page_id:chunk_index, so re-syncing overwrites instead of duplicating. Design sync so that running it twice is always safe. Then retries, overlaps and crashes stop mattering.</p><h4>5.10 Name files by ID, not by title</h4><p>Titles change and pages get moved. We key S3 objects by page ID, and record the path in the search index payload and in an _ids/&lt;page_id&gt; pointer, so a rename never orphans anything. Reads stay O(1): a search hit carries its path, so a read is a single GET.</p><h4>5.11 Keep the tool surface small and forgiving</h4><p>The agent-facing API is five operations: search, read, find, write, update. Tools return an error <em>string</em> rather than raising, so the agent can read the failure and adapt. find(domain, type, title) exists because &quot;give me the exact page called X&quot; is a different job from &quot;find things about X,&quot; and semantic search is the wrong tool for the first one.</p><h4>5.12 Make failures loud</h4><p>A memory system that silently stops syncing looks fine, because reads still work, until someone notices the agent is recalling week-old information. We post an alert whenever a sync tick has errors, and only then, so the alert stays meaningful. Silent staleness is the worst failure mode of a memory system.</p><h3>6. Pitfalls we’d warn you about</h3><ol><li>Storing everything. More memory is not better memory. Noisy episodic stores make retrieval worse. Write structured, purposeful records, not transcripts.</li><li>No forgetting. Memory needs deletion and correction paths. Ours are “humans edit Confluence” and the deletion sweep.</li><li>Treating retrieved memory as instructions. A retrieved report is evidence written by a previous agent run. It can be wrong. Rules that should change behaviour belong in a curated procedural store.</li><li>Letting agents choose storage locations. See 5.2.</li><li>Hiding the store from humans. If people can’t read and fix it, they won’t trust it, and they’ll be right.</li><li>Building a vector database before you need one. If you have twenty playbooks, put them in the prompt.</li></ol><h3>7. Takeaways</h3><ol><li>Agents need memory because context windows are temporary, and experience isn’t.</li><li>Separate episodic (“what happened”) from procedural (“how to do it”). They have different volume, trust and retrieval needs.</li><li>Keep a human-readable system of record and treat caches and indexes as derived, rebuildable views.</li><li>Combine keyword and semantic search.</li><li>Give agents intent-level tools, and make the server own placement, dedup and versioning.</li><li>Design for eventual consistency out loud: document the stale windows, and offer a fresh-read escape hatch.</li><li>Make every sync step idempotent, and make failures loud.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=777703c2c377" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/giving-an-ai-agent-8x-faster-memory-what-we-learned-building-one-777703c2c377">Giving an AI Agent 8x faster Memory: What We Learned Building One</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Case of the Mysterious 0x8BADF00D: How a Simple Getter Created an Infinite Loop]]></title>
            <link>https://ashujha-1996.medium.com/the-case-of-the-mysterious-0x8badf00d-how-a-simple-getter-created-an-infinite-loop-a4bda99297ec?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4bda99297ec</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Fri, 28 Nov 2025 13:10:38 GMT</pubDate>
            <atom:updated>2025-11-28T13:10:38.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qUDj_6bypSzog-UR" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The Mystery Begins</h3><p>It was late Thursday when crash reports started appearing in our monitoring dashboard. Our Flutter-based mobile application was experiencing sudden terminations, all sharing the same cryptic error code: 0x8BADF00D. For those unfamiliar with iOS&#39;s dark humour, this hexadecimal spells &quot;ate bad food&quot; – Apple&#39;s way of indicating an app became unresponsive and had to be force-terminated.</p><p>The crash logs revealed a pattern: the app was failing to shut down gracefully when iOS requested termination, triggering the watchdog timer after 5 seconds. But what was causing this hang?</p><h3>Following the Trail</h3><p>The stack trace showed the main thread stuck in a synchronization wait (__psynch_cvwait), frozen while the app attempted to terminate in the background. This pointed to something blocking the main thread during the shutdown sequence.</p><p>Our investigation led to the search results page, which used GetX reactive state management. The initial suspects were navigation calls with animations:</p><pre>// Navigation with 300ms animation<br>Get.to(() =&gt; ResultPage(), <br>    transition: Transition.downToUp,<br>    duration: Duration(milliseconds: 300));</pre><p>These animations during app termination could block the main thread. However, this was just the surface of a deeper issue.</p><h3>How GetX and Obx Created the Perfect Storm</h3><p>GetX’s Obx widget is designed to automatically rebuild whenever observed reactive values change. This convenience, however, became our downfall:</p><pre>Obx(() {<br>  final list = controller.processedList;<br>  return ListView.builder(<br>    itemCount: list.length,<br>    itemBuilder: (context, index) =&gt; ItemWidget(list[index]),<br>  );<br>})</pre><p>The Obx widget was watching processedList, but here&#39;s where things went catastrophically wrong.</p><h3>The Real Culprit</h3><p>The core issue was a getter that violated GetX’s fundamental principles:</p><pre>List&lt;Item&gt; get processedList {<br>  if (someCondition) {<br>    // Find priority item<br>    final priorityIndex = sourceList.value.indexWhere(<br>        (item) =&gt; item.isPriority == true);<br>    <br>    if (priorityIndex &gt;= 0) {<br>      // CRITICAL ERROR: Mutating reactive data inside a getter!<br>      final priorityItem = sourceList.value[priorityIndex];<br>      sourceList.value.removeAt(priorityIndex);<br>      sourceList.value.insert(0, priorityItem);<br>    }<br>    return sourceList.value;<br>  }<br>  return [];<br>}</pre><p>This created a vicious cycle specific to GetX’s reactivity system:</p><ol><li>Obx accessed processedList to build the UI</li><li>The getter modified sourceList.value (a reactive RxList)</li><li>Modifying sourceList.value notified all Obx listeners</li><li>Obx detected the change and triggered a rebuild</li><li>The rebuild accessed processedList again</li><li>Infinite loop achieved</li></ol><h3>Why GetX Made It Worse During Termination</h3><p>GetX’s reactivity doesn’t automatically pause during app lifecycle changes. When iOS requested termination:</p><ul><li>Background processes might trigger one final update</li><li>Obx widgets continued responding to changes</li><li>The infinite loop prevented graceful shutdown</li><li>iOS’s watchdog timer killed the app after 5 seconds</li></ul><h3>The Resolution</h3><p>The fix required understanding GetX’s reactivity rules:</p><pre>// CORRECT: Pure getter without side effects<br>List&lt;Item&gt; get processedList {<br>  if (someCondition) {<br>    final list = List&lt;Item&gt;.from(sourceList.value);<br>    <br>    final priorityItem = list.firstWhereOrNull(<br>        (item) =&gt; item.isPriority == true);<br>    <br>    if (priorityItem != null) {<br>      // Return NEW list without modifying source<br>      return [<br>        priorityItem,<br>        ...list.where((item) =&gt; item != priorityItem),<br>      ];<br>    }<br>    return list;<br>  }<br>  return [];<br>}</pre><h3>GetX Best Practices to Prevent This</h3><h4>1. Never Mutate Observable State in Getters</h4><pre>// BAD<br>RxList&lt;Item&gt; items = &lt;Item&gt;[].obs;<br>List&lt;Item&gt; get sortedItems {<br>  items.sort(); // Modifies observable!<br>  return items;<br>}</pre><pre>// GOOD<br>List&lt;Item&gt; get sortedItems {<br>  return List&lt;Item&gt;.from(items)..sort(); // Creates new list<br>}</pre><h4>2. Use Computed Observables for Derived State</h4><pre>class Controller extends GetxController {<br>  final sourceList = &lt;Item&gt;[].obs;<br>  <br>  // Create a separate observable for processed data<br>  late final processedList = Rx&lt;List&lt;Item&gt;&gt;([]);<br>  <br>  @override<br>  void onInit() {<br>    super.onInit();<br>    // Update processed list when source changes<br>    ever(sourceList, (_) =&gt; _updateProcessedList());<br>  }<br>  <br>  void _updateProcessedList() {<br>    final sorted = List&lt;Item&gt;.from(sourceList)<br>      ..sort((a, b) =&gt; a.priority.compareTo(b.priority));<br>    processedList.value = sorted;<br>  }<br>}</pre><h4>3. Implement Lifecycle Awareness</h4><pre>class SafeObx extends StatefulWidget {<br>  final Widget Function() builder;<br>  <br>  @override<br>  _SafeObxState createState() =&gt; _SafeObxState();<br>}<br><br>class _SafeObxState extends State&lt;SafeObx&gt; with WidgetsBindingObserver {<br>  bool _shouldRebuild = true;<br>  <br>  @override<br>  void initState() {<br>    super.initState();<br>    WidgetsBinding.instance.addObserver(this);<br>  }<br>  <br>  @override<br>  void didChangeAppLifecycleState(AppLifecycleState state) {<br>    _shouldRebuild = state == AppLifecycleState.resumed;<br>  }<br>  <br>  @override<br>  Widget build(BuildContext context) {<br>    if (!_shouldRebuild) return SizedBox.shrink();<br>    return Obx(widget.builder);<br>  }<br>}</pre><h4>4. Properly Dispose Controllers</h4><pre>class SearchController extends GetxController {<br>  Timer? _debounceTimer;<br>  <br>  @override<br>  void onClose() {<br>    _debounceTimer?.cancel();<br>    // Clear observables to prevent rebuilds during disposal<br>    searchResults.clear();<br>    super.onClose();<br>  }<br>}</pre><h4>5. Use GetBuilder for Non-Reactive Updates</h4><pre>// When you don&#39;t need automatic rebuilds<br>GetBuilder&lt;Controller&gt;(<br>  id: &#39;list_view&#39;,<br>  builder: (controller) {<br>    return ListView.builder(<br>      itemCount: controller.processedList.length,<br>      itemBuilder: (context, index) =&gt; ItemWidget(),<br>    );<br>  },<br>)</pre><pre>// Manually trigger updates when needed<br>controller.update([&#39;list_view&#39;]);</pre><h4>6. Implement Debouncing for Frequent Updates</h4><pre>class Controller extends GetxController {<br>  final _searchQuery = &#39;&#39;.obs;<br>  Timer? _debounce;<br>  <br>  void updateSearch(String query) {<br>    _debounce?.cancel();<br>    _debounce = Timer(Duration(milliseconds: 300), () {<br>      _searchQuery.value = query;<br>    });<br>  }<br>}</pre><h3>Key Lessons for GetX Developers</h3><ol><li><strong>Understand GetX’s Reactivity Chain</strong>: Every .obs variable creates listeners. Modifying them triggers rebuilds.</li><li><strong>Getters Must Be Pure</strong>: They should calculate and return values without side effects.</li><li><strong>Lifecycle Matters</strong>: GetX doesn’t automatically handle app lifecycle. Implement safeguards.</li><li><strong>Choose the Right Tool</strong>:</li></ol><ul><li>Use Obx for frequently changing data</li><li>Use GetBuilder for controlled updates</li><li>Use GetX&lt;Controller&gt; when you need both</li><li><strong>Test Edge Cases</strong>: Always test app termination, backgrounding, and rapid state changes.</li></ul><h3>Prevention Checklist</h3><ul><li>Audit all getters for side effects</li><li>Implement lifecycle observers in stateful widgets using Obx</li><li>Add dispose/onClose methods to all controllers</li><li>Use computed observables for derived state</li><li>Test app termination scenarios</li><li>Monitor for 0x8BADF00D crashes</li><li>Consider using GetBuilder for complex lists</li></ul><h3>The Aftermath</h3><p>After implementing these fixes and best practices, the crashes disappeared. The app could terminate gracefully, and the reactive UI continued to work as intended. The incident taught us that GetX’s power requires discipline — its automatic reactivity is a double-edged sword that demands careful handling.</p><p>The 0x8BADF00D crash wasn’t just about a misbehaving getter; it was about understanding how reactive frameworks operate under stress. By following these best practices, developers can harness GetX’s convenience without falling into its traps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4bda99297ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Github Actions : Automate everything]]></title>
            <link>https://blog.devgenius.io/github-actions-automate-everything-ef7be205919f?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef7be205919f</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[flutter-web]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 08:42:19 GMT</pubDate>
            <atom:updated>2024-02-28T04:55:54.834Z</atom:updated>
            <content:encoded><![CDATA[<h3>Github Actions : CI/CD for flutter</h3><blockquote>As a software engineer, our core task is to minimize repetitive &amp; manual processes, which could easily save time &amp; cost. Today we will try to automate after development steps i.e. <strong>Deployment &amp; Distribution processes</strong>.</blockquote><p>This process is commonly known as CI/CD (Continuous integration &amp; Continuous Delivery/Deployment).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2rB5xkVd9MbYwL0e6l8Yw.png" /><figcaption>Representation of how this cycle works</figcaption></figure><p>CI/CD process consist of pulling the code from version control, creating an environment, creating the build/image, deploy and distribute it to the user or quality assurance team. There are multiple tools available in market such as :</p><ol><li>Jenkins</li><li>CodeMagic</li><li>Travis CI</li><li>Codeship and many others.</li></ol><blockquote>The actual pain among all of them is to setup &amp; authenticate between each platform. For example, connect git with jenkins, then connect jenkins with firebase and then firebase with distribute it.</blockquote><p>Github has picked it and solved it using <strong>Github Action. </strong>Now you can automate the CI/CD process without setting up any other tool. Github will handle everything.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FKz6ofgw1gNlug%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FKz6ofgw1gNlug%2Fgiphy.gif%3Fcid%3Decf05e47vdo37pf7f8ldc2rkuaewq69thpjod6pe53wqc5qi%26ep%3Dv1_gifs_search%26rid%3Dgiphy.gif%26ct%3Dg&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExZTA2anJjNTBnam14amhlYWlwY2x2cTY3b3h6a3NtYnd2cGp1ZzY2ZSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FKz6ofgw1gNlug%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="289" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd1b9552f7eebbe9633b771ee12ff630/href">https://medium.com/media/dd1b9552f7eebbe9633b771ee12ff630/href</a></iframe><h3>What can we do with Github Actions?</h3><ol><li>We can automate web app deployment process.</li><li>We can build .apk or .aab for android and send it to play store directly.</li><li>We can build .ipa for iOS.</li><li>We can test our code whenever we merge a new change.</li></ol><p>and many other processes…</p><h3><strong>How Github Actions Work?</strong></h3><p>By using Github workflow, we can write the instructions step by step. Let’s understand with an example, how to deploy a web app using github action.</p><p>Step 1 : Create folders and files</p><p>Create a workflow inside .github folder in your root directory. And create main.yaml file. File name could be anything with .yaml extension. The file structure will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*dsGj-BEKtjvqqzWciaAm1A.png" /><figcaption>Flutter project file structure</figcaption></figure><p>Step 2 : Setup hosting service.</p><p>We are using firebase. To setup firebase, we can use npm and using CLI, we can login into firebase and enable hosting with github actions. After selecting the option, it will automatically generate <em>firebase-hosting-merge.yaml</em> file. The file will look something like this.</p><pre># This file was auto-generated by the Firebase CLI<br># https://github.com/firebase/firebase-tools<br><br>name: Deploy to Firebase Hosting on merge<br>&#39;on&#39;:<br>  push:<br>    branches:<br>      - master<br>jobs:<br>  build_and_deploy:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v4<br>      - uses: FirebaseExtended/action-hosting-deploy@v0<br>        with:<br>          repoToken: &#39;${{ secrets.GITHUB_TOKEN }}&#39;<br>          firebaseServiceAccount: &#39;${{ secrets.FIREBASE_SERVICE_ACCOUNT_[ACCOUNT_NAME] }}&#39;<br>          channelId: live<br>          projectId: [account_name]</pre><p>The code snippet states that, whenever you push the code on master branch, this action will trigger with a job. The job will run on ubuntu and use services such as <em>actions</em> and <em>Firebase hosting </em>with all the credentials mentioned.</p><p>Step 3 : Replace the variables</p><p>Change service account name as per your firebase account and you are ready for your first deployment.</p><p>Similarly we are change our workflow for any other framework. Here is one more example for flutter web app hosting:</p><pre>name: Build and Release<br>&#39;on&#39;:<br>  push:<br>    branches:<br>      - main<br>jobs:<br>  hosting:<br>    name: Deploy Web App<br>    runs-on: ubuntu-latest<br>    steps:<br>      # Checkout Repository<br>      - uses: actions/checkout@v4<br><br>      # Install Flutter command<br>      - uses: subosito/flutter-action@v2<br>        with:<br>          flutter-version: &#39;3.16.0&#39;<br>          channel: &#39;stable&#39;<br><br>      # Build Website<br>      - name: Build Website<br>        run: |<br>          flutter --version<br>          flutter config --enable-web<br>          flutter pub get<br>          flutter build web --release<br>        working-directory: ./<br><br>      # Deploy Firebase Hosting<br>      - name: Deploy Firebase Hosting<br>        uses: w9jds/firebase-action@master<br>        with:<br>          args: deploy --only hosting:firebase-service-account-name<br>        env:<br>          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}<br>          PROJECT_PATH: ./</pre><p>Check this video for more details</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FP0x0LmiknJc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DP0x0LmiknJc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FP0x0LmiknJc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/af1f8159b8e27fa3bd32b7e33999cae2/href">https://medium.com/media/af1f8159b8e27fa3bd32b7e33999cae2/href</a></iframe><blockquote>Pro tip : Always protect your branch from outside code merge or push to avoid unnecessary action triggers.</blockquote><p>That’s all for today. Thanks for staying until the end. Suggestions are welcome.</p><p>Let’s connect now on <a href="https://twitter.com/iamAshujha">Twitter</a>, <a href="https://www.instagram.com/ashutosh.j_/">Instagram</a> or <a href="https://www.linkedin.com/in/ashujhaji/">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef7be205919f" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/github-actions-automate-everything-ef7be205919f">Github Actions : Automate everything</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Server Driven UI — How it helps us?]]></title>
            <link>https://blog.devgenius.io/server-driven-ui-how-it-helps-us-e17addada4fc?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/e17addada4fc</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[server-driven-ui]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[ui-framework]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Tue, 25 Apr 2023 17:55:31 GMT</pubDate>
            <atom:updated>2023-04-25T19:39:50.223Z</atom:updated>
            <content:encoded><![CDATA[<h3>Server Driven UI — How it helps us?</h3><p>Exploring server driven UI using flutter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K0h2NghvKADfTQCh" /><figcaption>Photo by <a href="https://unsplash.com/es/@alexbemore?utm_source=medium&amp;utm_medium=referral">Alexander Shatov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Before starting this article, I have a couple of questions for you.</p><ol><li>What do you think how the apps like Swiggy, Zomato, Blinkit etc. changes their UI (Specially the dashboard) instantly on special occasion i.e. Diwali, Sale or any other festive season?</li><li>How does the app changes their layout, style, element positioning etc. according to the user behavior?</li></ol><blockquote>Yes, there are number of ways to solve these problems. And the solution depends on the complexity of features as well. And here is the <em>Server Driven UI</em> comes to save us.</blockquote><h3>What is Server driven UI or SDUI?</h3><p>In a layman term, if you can control your UI from server end (may be using some config or some other way), that is called SDUI.</p><blockquote>But the question is, for some frameworks such as Flutter which compiles the code and convert it to the binary, how can we render our UI from Backend server?</blockquote><p>Let’s talk about something practical:</p><h4>This is something which we will try to create using Server Driven UI with Flutter.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cb-jXy6u524RH4To" /><figcaption>Photo by <a href="https://unsplash.com/@hi_muhammad_salim?utm_source=medium&amp;utm_medium=referral">Muhammad Salim</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Let’s first break the UI into multiple components. These are the widgets which we can easily see on the screen :</p><ol><li>Scaffold</li><li>Image (You can go with some animation using <a href="https://pub.dev/packages/lottie">Lottie</a>)</li><li>Text or RichText</li><li>Floating action button</li></ol><p>We know that the UI in flutter is nothing but a tree of widgets, which resembles with the JSON tree structure. So here we will try to first convert the above UI using JSON.</p><pre>{<br>          &quot;type&quot;: &quot;scaffold&quot;,<br>          &quot;attributes&quot;: {&quot;color&quot;: &quot;0x9ff000000&quot;},<br>          &quot;body&quot;: {<br>            &quot;type&quot; : &quot;column&quot;,<br>            &quot;children&quot;:[<br>              {<br>                &quot;type&quot;:&quot;image&quot;,<br>                &quot;attributes&quot;:{<br>                  &quot;url&quot;: &quot;your_image_or_animation_url&quot;<br>                }<br>              },<br>              {<br>                &quot;type&quot;:&quot;align&quot;,<br>                &quot;attributes&quot; :{<br>                  &quot;alignment&quot; : &quot;bottomLeft&quot;<br>                },<br>                &quot;child&quot; :{<br>                  &quot;type&quot;: &quot;text_widget&quot;,<br>                  &quot;attributes&quot;: {<br>                    &quot;hint&quot;:<br>                    &quot;Text here&quot;,<br>                    &quot;text_style&quot;: {<br>                      &quot;font&quot;: &quot;ebGaramond&quot;,<br>                      &quot;font_size&quot;: 16,<br>                      &quot;color&quot;: &quot;0xFFFFFFFF&quot;<br>                    },<br>                    &quot;padding&quot; :{<br>                      &quot;bottom&quot; : 40.0<br>                    }<br>                  }<br>                }<br>              }<br>             <br>            ]<br>          },<br>          &quot;floatingActionButton&quot; : {<br>            &quot;type&quot;: &quot;floating_action_button&quot;,<br>             &quot;attributes&quot; : {<br>                &quot;icon&quot; : &quot;icon_url_here&quot;<br>              }<br>          }<br>        }</pre><p>This JSON can be served from server which we are going to draw on our screen. For that, first we will have to convert this JSON into flutter widget using mapper or extension functions.</p><p>This is the helper function which converts the JSON into widgets by checking the type we have provided.</p><pre>Widget? getWidgetFromJson(Map&lt;String, dynamic&gt; json, BuildContext context) {<br>  final widgetType = json[&#39;type&#39;];<br>  if (widgetType == null) return null;<br>  switch (widgetType) {<br>    case kAlign:<br>      {<br>        return Align.getAlignWidget(json, context);<br>      }<br>    case kImageWidget:<br>      {<br>        return Image.getImageWidget(json, context);<br>      }<br>    case kColumn:<br>      {<br>        return Column.getColumnWidget(json, context);<br>      }<br>    case kTextWidget:<br>      {<br>        return _getTextWidget(json, context);<br>      }<br>  }<br>  return Container();<br>}</pre><p>For each type of widget which we gonna use, we can create an extension and pass the JSON into it. For example, let’s write a function for text widget :</p><pre>TextWidget _getTextWidget(Map&lt;String, dynamic&gt; json, BuildContext context) {<br>  final attributes = json[&#39;attributes&#39;];<br>  if (attributes == null) return TextWidget();<br>  String hint = &#39;&#39;;<br>  hint = attributes[&#39;hint&#39;].toString();<br><br>  TextStyle? textStyle;<br>  TextAlign textAlign = TextAlign.center;<br><br>  final style = attributes[&#39;text_style&#39;];<br>  if (style != null) {<br>    final font = style[&#39;font&#39;];<br>    final fontSize = style[&#39;font_size&#39;];<br>    Color color = Colors.black;<br>    try {<br>      color = Color(int.parse(style[&#39;color&#39;]));<br>    } catch (e) {}<br>    textStyle = getTextStyle(font: font, fontSize: fontSize, color: color);<br><br>    final align = style[&#39;text_align&#39;];<br>    switch (align) {<br>      case &#39;left&#39;:<br>        {<br>          textAlign = TextAlign.left;<br>          break;<br>        }<br>      case &#39;right&#39;:<br>        {<br>          textAlign = TextAlign.right;<br>          break;<br>        }<br>      case &#39;justify&#39;:<br>        {<br>          textAlign = TextAlign.justify;<br>          break;<br>        }<br>      case &#39;start&#39;:<br>        {<br>          textAlign = TextAlign.start;<br>          break;<br>        }<br>      case &#39;end&#39;:<br>        {<br>          textAlign = TextAlign.end;<br>          break;<br>        }<br>    }<br>  }</pre><p>P.S. : I have written simple method for conversion. But extension function is recommended.</p><p>Taadaa, now you got your widget with the same attributes you have mentioned in your JSON. You can draw it on your screen.</p><p>If you are here, you have learnt to create your own server driven UI framework. Soon we are going to make our framework public. Till then, keep building.</p><p>Here is an app which is written on Server Driven UI : <br>Pixher : <a href="https://play.google.com/store/apps/details?id=com.pixher.android">Get it on Play store</a></p><h3>Ashutosh jha 🇮🇳 on Twitter: &quot;Get creative post and story ideas from our collection.Download Pixher App https://t.co/96Sf6dEZPk pic.twitter.com/267kaPXzxm / Twitter&quot;</h3><p>Get creative post and story ideas from our collection.Download Pixher App https://t.co/96Sf6dEZPk pic.twitter.com/267kaPXzxm</p><p>That’s all for today. Thanks for staying until the end. Suggestions are welcome.</p><p>Let’s connect now on <a href="https://twitter.com/iamAshujha">Twitter</a>, <a href="https://www.instagram.com/ashutosh.j_/">Instagram</a> or <a href="https://www.linkedin.com/in/ashujhaji/">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e17addada4fc" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/server-driven-ui-how-it-helps-us-e17addada4fc">Server Driven UI — How it helps us?</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Obfuscation in Flutter (Android)]]></title>
            <link>https://medium.com/design-bootcamp/code-obfuscation-in-flutter-android-cb9fb7f546ba?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb9fb7f546ba</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Thu, 15 Dec 2022 07:15:32 GMT</pubDate>
            <atom:updated>2022-12-15T08:21:56.667Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eu9PyO58uyVoS_WU" /><figcaption>Photo by <a href="https://unsplash.com/@flyd2069?utm_source=medium&amp;utm_medium=referral">FLY:D</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The story begins when we were about to publish our flutter app to the production. But before that, the app went to the VAPT (<strong>Vulnerability Assessment and Penetration Testing</strong>) process.</p><h3><strong>What is code obfuscation?</strong></h3><p>Code obfuscation is the process of making a program’s code difficult to understand, usually with the aim of making it harder to reverse engineer or modify. This can be done through various techniques, such as making variable and function names unreadable, or by adding extra layers of indirection or complexity to the code. Obfuscation is often used to protect intellectual property or to prevent malicious tampering with a program. (Thanks to <a href="https://openai.com/">ChatGPT</a> 😉).</p><h3><strong>Why is code obfuscation?</strong></h3><p>If you are developing an app where security of user’s data is on top of everything, you can’t compromise it. Though fool proof security is a myth. But we can maximise it to some extent by using these methods:</p><ol><li><a href="https://developer.android.com/studio/build/shrink-code">Shrink your code (or tree shaking)</a> : It detects and safely removes unused classes, fields, methods, and attributes from your app.</li></ol><p>2. Minify your code : It is the process to simplify characters from the code without changing or touching the function of the code.</p><p>3. Enable proguard : Use proguard rules to define which files you want not to change during the process of minification and shrinking.</p><h3>Let’s jump to the How part</h3><h4>Obfuscation using flutter command</h4><pre>export version=1.0.0<br>flutter build apk --release --shrink --obfuscate --split-debug-info=misc/mapping/${version}</pre><p>It will create an apk in release mode which will be shrinked and obfuscated. But what if you are using native codes? How can we protect that as well?</p><pre>buildTypes {<br>        release {<br>            signingConfig signingConfigs.release<br>            minifyEnabled true<br>            useProguard true<br>            shrinkResources true<br>            proguardFiles getDefaultProguardFile(&#39;proguard-android.txt&#39;), &#39;proguard-rules.pro&#39;<br>        }<br>    }</pre><p>Paste this line to your app level build.gradle file in android folder</p><p>Explanation :</p><ol><li>It will use your release mode signing configs. You will have to create .jks file and a key.properties where you can mention your signing credentials.</li><li>Keep proguard-rules.pro inside the app folder, so you can define your rules inside it. <a href="https://developer.android.com/reference/androidx/annotation/Keep">Read here</a> how to define proguard rules.</li><li>To protect flutter files during obfusaction, using these lines inside your proguard-rules file:</li></ol><pre>#Flutter Wrapper<br>-keep class io.flutter.app.** { *; }<br>-keep class io.flutter.plugin.**  { *; }<br>-keep class io.flutter.util.**  { *; }<br>-keep class io.flutter.view.**  { *; }<br>-keep class io.flutter.**  { *; }<br>-keep class io.flutter.plugins.**  { *; }</pre><p>4. To protect xml renderer files, use these rules:</p><pre>-keep class org.xmlpull.v1.** { *;}<br> -dontwarn org.xmlpull.v1.**</pre><p>5. You can mention the proguard rules for all your plugins you are using to obfuscate them as well.</p><blockquote>Now your app is ready with obfuscation. All the resources have been shrink, all de-referenced codes and comments are removed and the classes are rename to some random classes.</blockquote><h3>Now it’s time for a pro tip</h3><p>If you have reached till here, then here’s a gift for you. Is your app keep on crashing after enbaling proguard?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Ffeistysarcastichornbill&amp;display_name=Gfycat&amp;url=https%3A%2F%2Fgfycat.com%2Ffeistysarcastichornbill-stressed-fear-overwatch&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FFeistySarcasticHornbill-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="1280" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d17791abf0929d1421095c8fc04210d/href">https://medium.com/media/5d17791abf0929d1421095c8fc04210d/href</a></iframe><p>Try this hack to debug it:</p><p>Replace release to debug and run app in debug mode.</p><pre>buildTypes {<br>        debug {<br>            signingConfig signingConfigs.release<br>            minifyEnabled true<br>            useProguard true<br>            shrinkResources true<br>            proguardFiles getDefaultProguardFile(&#39;proguard-android.txt&#39;), &#39;proguard-rules.pro&#39;<br>        }<br>    }</pre><p>You will get the logs. If anything is crashing due to proguard, just mention the keep or don’t warn rule for that plugin.</p><p>That’s all for today. Thanks for staying until the end. Suggestions are welcome.</p><p>Let’s connect now on <a href="https://twitter.com/iamAshujha">Twitter</a>, <a href="https://www.instagram.com/ashutosh.j_/">Instagram</a> or <a href="https://www.linkedin.com/in/ashujhaji/">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb9fb7f546ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/code-obfuscation-in-flutter-android-cb9fb7f546ba">Code Obfuscation in Flutter (Android)</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web socket in Flutter]]></title>
            <link>https://blog.devgenius.io/web-socket-in-flutter-615d21ddf1c5?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/615d21ddf1c5</guid>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[realtime]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[chat]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Mon, 19 Sep 2022 12:46:48 GMT</pubDate>
            <atom:updated>2022-09-19T16:47:07.157Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q9psv0hEbv-cG6Jb" /><figcaption>Photo by <a href="https://unsplash.com/@neilsoniphotography?utm_source=medium&amp;utm_medium=referral">Neil Soni</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>For two way communication such as real-time messaging, GPS tracking, video calling etc. we often use web socket. Let’s deep dive into how it works and what is the implementation and best practices for this.</p><p>P.S. : You will get lot of Pro tips during the read.</p><blockquote>Web socket works on Pub/Sub model</blockquote><h3>What is Pub/Sub Model?</h3><p>Pub/Sub messaging means Publish/Subscribe messaging model. We have to subscribe for the data and socket will start giving the update. In a very simple words, subscribe to get the data stream and unsubscribe to stop getting data.</p><p>After connecting the websocket, we have to keep it connected by two-way communication. If any of the way stop sending data, connection will be lost and you have to connect it again. Let’s start our implementation for Flutter. For this we will be using the below given plugin:</p><h3>1. Add it in your pubspec.yaml</h3><pre>web_socket_channel: ^2.1.0</pre><p>Add this line in the dependencies of <em>pubspec.yaml</em> and run <em>flutter pub get</em>.</p><p>Import it in your file</p><pre>import &#39;package:web_socket_channel/io.dart&#39;;</pre><blockquote>Pro tip 1 : Make your helper class a <a href="https://flutterbyexample.com/lesson/singletons">singleton class</a> and keep all the important methods here.</blockquote><h3>2. Connect to socket</h3><pre>IOWebSocketChannel _client;</pre><pre>WebSocket.<em>connect</em>(_endPoint).then((ws) {<br>  _client = IOWebSocketChannel(ws);<br>  if (_client != null) {<br>    _client.sink.add(&quot;Socket added&quot;);<br>  }<br>}).onError((error, stackTrace) {<br>  <br>});</pre><p>Here we are establishing connection with the socket. Endpoint will be your url starts with <em>ws or wss. </em>After connection we will get a socket client. Keep it as IOWebSocketChannel. IOWebSocketChannel.sink.add will be used to send the data.</p><h3>3. Subscribe for a topic</h3><pre>_client.sink.add(subscriptionText);</pre><p>Here, subscription text will be the message you want to send to the backend to start the subscription.</p><h3>4. Start listening to message</h3><pre>_client.stream.listen((message){<br>    //parse your message here<br> },<br> onDone: () {<br>   <br> },<br>);</pre><p>IOWebSocketChannel.stream will start sending the data which can be listen by above method. You can parse your message and use it within your app.</p><p>onDone : It will call on the disconnection of socket.</p><blockquote>Pro tip 2 : Always send and receive data in bytes or use ProtoBuf</blockquote><h3>4. Unsubscribe to the topic</h3><pre>_client.sink.add(unSubscriptionText);</pre><p>Send the un-subscription message as mentioned at backend. It will stop the data stream.</p><h3>5. Disconnect the socket</h3><pre>_client?.sink?.close(status.goingAway);</pre><p>IOWebSocketChannel.sink.close will close the connection. Here status.goingAway is the status defined in library. You can also use your custom text.</p><h3>Best practices</h3><ol><li>Avoid sending subscription message multiple times.</li><li>Send heartbeat on every 10 seconds. Heartbeat is a text which keeps the connection alive. It is the text mentioned at backend server.</li><li>On every internet connect/disconnect you should connect your socket and subscribe all the topics again.</li><li>Keep a buffer Queue to save the subscriptions if you lose the internet connection in between. You can send this subscription on re-connection of internet.</li><li>Maintain one map to retrieve previously subscribed data.</li><li>If you get error or disconnect due to internet, keep retrying for at least 3 times (or you can keep on trying).</li><li>Don’t forget to unsubscribe to the topic if it’s not needed.</li><li>Connect socket on app resume and disconnect on app pause.</li></ol><blockquote>Pro tip 3 : Try to make as less subscriptions as possible at one time.</blockquote><p>Here is the working code. You can modify it as per your use case.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b876c5df46e535cfe1881f41213fc76/href">https://medium.com/media/3b876c5df46e535cfe1881f41213fc76/href</a></iframe><p>That’s all for today. Thanks for staying until the end. Suggestions are welcome. Happy coding.</p><p>Let’s connect now on <a href="https://twitter.com/iamAshujha">Twitter</a>, <a href="https://www.instagram.com/ashutosh.j_/">Instagram</a> or <a href="https://www.linkedin.com/in/ashujhaji/">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=615d21ddf1c5" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/web-socket-in-flutter-615d21ddf1c5">Web socket in Flutter</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Responsive Vs Adaptive Apps | Flutter]]></title>
            <link>https://medium.com/design-bootcamp/responsive-vs-adaptive-apps-flutter-1ce45be2f466?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ce45be2f466</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Sun, 18 Sep 2022 09:33:15 GMT</pubDate>
            <atom:updated>2022-09-20T05:35:17.764Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LoT_n0lrG5groooE6opGCg.jpeg" /><figcaption>Source : Internet</figcaption></figure><p>Are you building cross-platform apps which can run on Android, iOS, macOS, Linux or any other machine you want it to run? Irrespective of programming language you are choosing, you must be aware of how your app will look like when you will switch to the different devices.</p><p>There is a very minute difference between a responsive app and an adaptive app.</p><h3>Responsive app</h3><p>As per flutter official doc, a <em>responsive</em> app has had its layout tuned for the available screen size. When you are writing code you are making sure that if you will change the device your app will look similar on every devices. The size of widgets will get change as per device width and height. The button size will get changed while changing the device and many different aspects.</p><p>Here are some of the widgets we can use to make our app responsive:</p><ul><li><a href="https://api.flutter.dev/flutter/widgets/AspectRatio-class.html">AspectRatio</a></li><li><a href="https://api.flutter.dev/flutter/widgets/CustomSingleChildLayout-class.html">CustomSingleChildLayout</a></li><li><a href="https://api.flutter.dev/flutter/widgets/CustomMultiChildLayout-class.html">CustomMultiChildLayout</a></li><li><a href="https://api.flutter.dev/flutter/widgets/FittedBox-class.html">FittedBox</a></li><li><a href="https://api.flutter.dev/flutter/widgets/FractionallySizedBox-class.html">FractionallySizedBox</a></li><li><a href="https://api.flutter.dev/flutter/widgets/LayoutBuilder-class.html">LayoutBuilder</a></li><li><a href="https://api.flutter.dev/flutter/widgets/MediaQuery-class.html">MediaQuery</a></li><li><a href="https://api.flutter.dev/flutter/widgets/MediaQueryData-class.html">MediaQueryData</a></li><li><a href="https://api.flutter.dev/flutter/widgets/OrientationBuilder-class.html">OrientationBuilder</a></li></ul><blockquote>But what about user experience (UX)? Do you think the same UI will work for mobile and web and desktop? The answer is <strong>Big No</strong>.</blockquote><p>Major differences between mobile and web/desktop apps.</p><ol><li>In mobile, you are having gesture controls, such as click, long press, drags etc. On the other hand, in web you are having hover, cursor click, left click, right click etc.</li><li>While using the app in both of the cases, user has very different psychology.</li><li>The screen size of course. In mobile, you have very compact view as well as resources. You cannot show heavy or large images. You cannot show big texts. But in web, you have lot of space to give lot of information. <strong>But don’t make it clutter</strong>.</li><li>The <a href="https://fonts.google.com/">font</a> you are using should be apt for the end customer. e.g. You cannot go with fancy fonts for health apps. Or you cannot go with newspaper kind of text with social apps like Instagram 😅.</li></ol><blockquote>Pro tip 1: Whenever writing code, step back and think about the end user and their psychology.</blockquote><p>What your users may expect when they click on this button? Is the message/tooltip given is properly convincing your message or not? Are the <a href="https://fonts.google.com/icons">icons</a> you are using, clearly interpreting the use of it or not? Is the position of widget proper and accessible or not? For this we can consider Adaptive apps.</p><h3>Adaptive apps</h3><p><a href="https://docs.flutter.dev/development/ui/layout/adaptive-responsive#:~:text=Flutter%20allows%20you%20to%20create,you%20get%20a%20BoxConstraints%20object.">As per official doc</a>, <em>Adapting</em> an app to run on different device types, such as mobile and desktop, requires dealing with mouse and keyboard input, as well as touch input. It also means there are different expectations about the app’s visual density, how component selection works (cascading menus vs bottom sheets, for example), using platform-specific features (such as top-level windows), and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*UOXaz8oQQb0oSE9xMDhW1A.png" /><figcaption>Source : Internet</figcaption></figure><p>Few tips to take care of while writing adaptive apps :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*7-m9ACsFQV0yyNx5abklwA.png" /><figcaption>Designed by : Canva</figcaption></figure><ol><li>Use <a href="https://api.flutter.dev/flutter/material/BottomNavigationBar-class.html">Bottom Navigation Bar</a> in <em>Mobile</em> and use <a href="https://api.flutter.dev/flutter/material/NavigationRail-class.html">Navigation Rail</a> in <em>Web</em>.</li><li>To make various sections of your dashboard, you can go with <a href="https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html">SingleChildScrollView</a> or <a href="https://api.flutter.dev/flutter/widgets/ListView-class.html">ListView</a> for Web and <a href="https://api.flutter.dev/flutter/material/TabBar-class.html">TabBar</a> with <a href="https://www.youtube.com/watch?v=POtoEH-5l40&amp;ab_channel=Flutter">TabBarView</a> for Mobile.</li><li>Use Clicks to show description in mobile. Use hover effect to show description in web.</li><li>Use tooltip to show description of icon in mobile and Text with icon in web.</li><li>Use more graphics and less text in mobile. You can go with text with graphics in web.</li></ol><blockquote>Pro tip 2 : Always use <a href="https://docs.flutter.dev/assets/images/docs/tools/devtools/dart-devtools.gif">devtools</a> to monitor app performance, network calls, child re-rendering and many more.</blockquote><p>That’s all for today. Thanks for staying until the end. Suggestions are welcome.</p><p>Let’s connect now on <a href="https://twitter.com/iamAshujha">Twitter</a>, <a href="https://www.instagram.com/ashutosh.j_/">Instagram</a> or <a href="https://www.linkedin.com/in/ashujhaji/">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ce45be2f466" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/responsive-vs-adaptive-apps-flutter-1ce45be2f466">Responsive Vs Adaptive Apps | Flutter</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blogs-On board!]]></title>
            <link>https://blog.devgenius.io/blogs-on-board-daa45b5a5c4f?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/daa45b5a5c4f</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[blog]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Sat, 13 Mar 2021 15:28:39 GMT</pubDate>
            <atom:updated>2021-12-21T08:59:53.448Z</atom:updated>
            <content:encoded><![CDATA[<p><em>As a blog creator, have you ever wonder how to deliver your content across the platform? Yes, you heard it right. You can use your content on native platform such as Mobile devices, Web Apps, Desktop devices or anywhere you want with the native view (</em><strong><em>not going to render web view anymore</em></strong><em>).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dnDNuwwads6qNHPr" /><figcaption>Photo by <a href="https://unsplash.com/@anete_lusina?utm_source=medium&amp;utm_medium=referral">Anete Lūsiņa</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Let’s dig out into the solution now.</p><h3><strong>CMS (Content management system)</strong></h3><p>The tool which allows you to curate, create, manage and deliver your content in the easiest possible way in known as CMS. For our solution we are going to use <strong>Wordpress </strong>as a CMS.</p><p>Wordpress provides the platform to create beautiful websites and blog sites with cool and enhanced features, which bloggers find it easy to use. To know more about how to create blog posts on wordpress, refer this video.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQU8GFqvXRxE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQU8GFqvXRxE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQU8GFqvXRxE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ea27866c2ee6128d71973ec3d32267b/href">https://medium.com/media/7ea27866c2ee6128d71973ec3d32267b/href</a></iframe><p>For better understanding of how we can manage our content, let’s assume the CMS as a book. A book will have different chapters. A chapter will have different topics. And a topic will have your content.</p><p>Book -&gt; CMS</p><p>Chapter -&gt;Categories</p><p>Topic -&gt; Post</p><p>Now we are going to follow the above hierarchy. I am assuming that you have blogs (Posts) ready with you on your wordpress admin portal. If not, check the left panel -&gt; Posts -&gt; Add New. Create you blogs here and save it. You can embed images, videos and other content within the body of your blog.</p><p>Second step is to create the chapters. Check left panel -&gt; Posts -&gt; Categories-&gt; Add New Category. Name the category and add some description. If you want to add thumbnail of your category, you can add image link in description itself and use it. The same we followed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aW9MeXsuVAJrpo2Q3E2Wtg.png" /></figure><p>Third step is to map the blogs with chapters. The map it, go to your blog-&gt; see top right options -&gt; Click on settings icon. Inside the Post tab, you can see an option of <strong><em>Categories. </em></strong>Here you can assign the blog in one or many of the chapters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wea7XKmhGuYRqYiwnP3xIQ.png" /></figure><h3><strong>Your blog to JSON</strong></h3><p>Now the next part is to convert your blog’s content to JSON, which can easily embed into any native platform. Below is the format of URL which will give us blog post data in JSON packet. This is the open API for public use. You can use GET request to get all your posts available on your blog site. You can also fetch data category wise, if you have categorized your blogs. Let’s say you want to fetch blogs having healthcare as a category. You can pass the id of the category available on your wordpress console.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f44af314ddee3ac9c04a1e31ed4c257/href">https://medium.com/media/1f44af314ddee3ac9c04a1e31ed4c257/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f379c1d2b344485ca82c4fe63ce814a/href">https://medium.com/media/2f379c1d2b344485ca82c4fe63ce814a/href</a></iframe><p>Now you can use this JSON to render it in your mobile application or any application you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tNyG2El5pRbTIqOR0hstw.png" /></figure><p>You are all caught up. Thanks for reading. Feel free to comment.</p><p>Join me on <a href="https://twitter.com/iamAshujha">twitter</a>, <a href="https://github.com/ashujhaji">Github</a>, <a href="https://www.linkedin.com/in/ashujhaji/">LinkedIn</a> 👐</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=daa45b5a5c4f" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/blogs-on-board-daa45b5a5c4f">Blogs-On board!</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTML rendering in chrome custom tab (Android)]]></title>
            <link>https://blog.devgenius.io/html-rendering-in-chrome-custom-tab-android-54ff91fd08a4?source=rss-19260eb64035------2</link>
            <guid isPermaLink="false">https://medium.com/p/54ff91fd08a4</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[dev]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Ashutosh jha]]></dc:creator>
            <pubDate>Sat, 15 Aug 2020 13:20:27 GMT</pubDate>
            <atom:updated>2020-08-16T09:34:07.605Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-5Dz41Yk1zyffunx8EZoOA.jpeg" /></figure><blockquote>This is a workaround to open custom html page inside chrome custom tab or any other web view library.</blockquote><h4>Introduction</h4><p>Chrome custom tab in android is a library which gives leverage to open any url inside the native app. It gives the feel of web page similar to the app theme. Also it helps us to render a web page 4 times faster than the native webview as it uses the caching mechanism of chrome browser. This was all about opening url. But how about rendering the html inside the chrome custom tab?</p><h4>Objective</h4><p>We will render our local custom html script inside the chrome custom tab.</p><h4>Let’s start</h4><blockquote>Step 1: SDK integration of chrome custom tab.</blockquote><pre>implementation &#39;androidx.browser:browser:1.2.0&#39;</pre><p>To know more about library and sdk integration, <a href="https://developer.chrome.com/multidevice/android/customtabs"><em>click here</em></a><em>.</em></p><blockquote>Step 2: Create a custom html page.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d78787525bae5536c42f4651eede1388/href">https://medium.com/media/d78787525bae5536c42f4651eede1388/href</a></iframe><p><em>We are using this html for demonstration purpose only. We can create any html as per our requirement. And put this file in asset folder in android.</em></p><blockquote>Step 3: Let’s have some actual code now.</blockquote><p>As chrome custom tab only supports url but not raw html to render. So we need to convert our html file to some sort of url. By the below written method, we will get a url of a file stored in external cache directory.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0d05a1f8d1879a109671af1b5b45225/href">https://medium.com/media/d0d05a1f8d1879a109671af1b5b45225/href</a></iframe><blockquote>Step 4: Open URL inside the chrome custom .</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c5764fb6ec7016471749272175c40f1/href">https://medium.com/media/4c5764fb6ec7016471749272175c40f1/href</a></iframe><p><strong><em>Congratulations! We have done it.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54ff91fd08a4" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/html-rendering-in-chrome-custom-tab-android-54ff91fd08a4">HTML rendering in chrome custom tab (Android)</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>