<?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 Vasileios Chroniadis on Medium]]></title>
        <description><![CDATA[Stories by Vasileios Chroniadis on Medium]]></description>
        <link>https://medium.com/@chron.vas?source=rss-5e3a2cb057a3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KfDG8sARkyDHGBzMPbf5EQ.jpeg</url>
            <title>Stories by Vasileios Chroniadis on Medium</title>
            <link>https://medium.com/@chron.vas?source=rss-5e3a2cb057a3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:58:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chron.vas/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[From Android-Dependent to Platform-Agnostic: The 3 Modern Android Library Categories]]></title>
            <link>https://medium.com/@chron.vas/from-android-dependent-to-platform-agnostic-the-3-modern-android-library-categories-77eb80afbbe3?source=rss-5e3a2cb057a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/77eb80afbbe3</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Vasileios Chroniadis]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 23:04:46 GMT</pubDate>
            <atom:updated>2026-07-16T23:04:46.984Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mE4v5RkMa7Mi7xVtLQHCdg.png" /></figure><p>Over the past decade of building Android libraries, I’ve realized they differ not just by what they do, but by <strong>how tightly they’re coupled to the Android OS</strong>.</p><p>When designing or choosing a library today, understanding this level of coupling is crucial. Historically, libraries fell into two buckets. Thanks to <strong>Kotlin Multiplatform (</strong><a href="https://kotlinlang.org/multiplatform/"><strong>KMP</strong></a><strong>)</strong>, we now have a clear third category.</p><p>Through my own experience, I’ve found it helpful to group these libraries into three main categories, ranked from ‘deeply Android’ to ‘completely platform-agnostic.</p><h3>1. Android Dependent</h3><p>These libraries are deeply dependent on the Android OS. They rely on native lifecycles, hardware APIs, Context, system services, or other Android-only functionality.</p><p>Historically, this category was dominated by UI libraries (because of XML layouts and View system knowledge) and service-style libraries. Therefore, your UI library had to be an “Android library” with Android imports and framework knowledge.</p><p>Since UI can now be multiplatform, with libraries like <strong>Compose Multiplatform (</strong><a href="https://kotlinlang.org/compose-multiplatform/"><strong>CMP</strong></a><strong>)</strong> empowered by <a href="https://kotlinlang.org/multiplatform/">KMP</a>, the UI category of libraries no longer automatically means an Android-only library.</p><h3>2. Android Context-Independent (Accidental KMP Candidates)</h3><p>These libraries are written for the Android/JVM ecosystem but don’t actually need Context, lifecycles, or Android system APIs. They typically handle business logic, calculations, data parsing, or architectural patterns.</p><p>Because they contain no Android imports, <strong>they are “accidental” candidates for Kotlin Multiplatform</strong>. They’re already free of Android framework dependencies — they’re just still locked into the JVM by Java-specific classes (e.g. java.util.UUID, java.net.URL, java.time.*, etc.).</p><p>Swap those for pure Kotlin equivalents (or kotlinx.* libraries), and you can often turn them into proper multiplatform libraries with minimal effort.</p><h3>3. Platform-Agnostic (Kotlin Multiplatform)</h3><p>These libraries are intentionally designed from the ground up (or properly migrated) to run anywhere. Using Kotlin Multiplatform, they compile to Android (JVM), iOS (native), desktop, web, and more.</p><p>They rely on pure Kotlin and the kotlinx.* ecosystem instead of platform-specific code.</p><h3>Functional Areas: Where Common Libraries Fit</h3><p><strong>Android Dependent</strong></p><ul><li>Camera, permissions, background tasks, location services, and anything that directly touches hardware or system services.</li></ul><p><strong>Context-Independent (Accidental KMP)</strong></p><ul><li>Dependency injection (e.g. Koin), threading &amp; coroutines, most business logic, validators, parsers, and utility classes.</li></ul><p><strong>Platform-Agnostic (KMP)</strong></p><ul><li>Networking (Ktor), databases (SQLDelight), serialization (kotlinx.serialization), logging, state management, and date/time handling.</li><li>UI components, animations, and image loading (thanks to Compose Multiplatform).</li></ul><p><strong>Hybrid (Shared API + Platform Implementation)</strong></p><ul><li>Navigation, maps, audio/video playback, localization, and UI testing.<br>These usually expose a clean KMP interface while using platform-native engines underneath (ExoPlayer on Android, AVPlayer on iOS, etc.).</li></ul><h3>Key Takeaway for Library Authors &amp; Integrators</h3><p>If you’re writing an Android library in 2026, ask yourself one simple question:</p><blockquote><strong>Does this code actually need an Android or Java specific import?</strong></blockquote><p>If the answer is no, design it as a Context-Independent library from the start. You’ll future-proof your work, make it much easier to adopt Kotlin Multiplatform later, and increase its value to the wider developer community.</p><p>The multiplatform era is here. The best time to start thinking platform-agnostic was yesterday. The second best time is today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77eb80afbbe3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of Neutral Friction: Why the ‘Grill Me’ Skill is a Game-Changer for AI Coding]]></title>
            <link>https://medium.com/@chron.vas/the-power-of-neutral-friction-why-the-grill-me-skill-is-a-game-changer-for-ai-coding-f7ab471190e2?source=rss-5e3a2cb057a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7ab471190e2</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[ai-skills]]></category>
            <category><![CDATA[ai-coding]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Vasileios Chroniadis]]></dc:creator>
            <pubDate>Mon, 15 Jun 2026 21:23:08 GMT</pubDate>
            <atom:updated>2026-06-15T21:23:08.823Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*top9T4xVa4IzG3GSZLxxuQ.jpeg" /></figure><p>In the rapidly evolving landscape of AI-assisted software engineering, we routinely fall into the <strong>“specs-to-code” c</strong>ycle: a frustrating endless cycle of prompt engineering, trying to perfect instructions rather than engaging with the messy, architectural reality of our thoughts and of our projects.</p><p>The reality is that the specs-to-code approach currently doesn’t work very effectively. LLM’s lack the contextual knowledge, but until the technology evolves, we must find more deliberate ways to work with LLMs.</p><p>Matt Pocock highlighted in a recent workshop that this circle can be done more successfully, by using the <strong>“Grill Me” skill</strong>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-QFHIoCo-Ko%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-QFHIoCo-Ko&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-QFHIoCo-Ko%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/afbc79e2cec198623d5af3d4b04e3c25/href">https://medium.com/media/afbc79e2cec198623d5af3d4b04e3c25/href</a></iframe><p>With this skill you can move from a cycle of fixing broken implementation, to a cycle of refining and clarifying intent, but <strong>its most surprising impact might actually be on team dynamics!</strong></p><h3>The De-Personification of Design</h3><p>When we seek feedback from human colleagues, architectural reviews can carry heavy social baggage. As I explored in an earlier article: <a href="https://medium.com/@chron.vas/asking-questions-and-negative-perception-9ef44ee6223a">Asking questions and negative perception</a>, human inquiry is a natural but rarely a neutral act. In the milliseconds after a direct question is asked, our subconscious “System A” associative memory fires up. We immediately start evaluating hidden context:</p><ul><li><em>Is the timing inconvenient?</em></li><li><em>Are there ulterior motives or past mistakes colourising this interaction?</em></li><li><em>Is the directness of this question breaking a certain cultural or hierarchical boundary?</em></li></ul><p>Because of these variables, the danger of human questions being perceived as negative is remarkably high. Not to mention engaging in an enquiry with the purpose of getting a straightforward answer requires a massive amount of deliberate empathy, trust-building, and psychological safety.</p><p>By outsourcing the critique to an AI, you can alleviate that possibility completely!</p><blockquote><em>The AI becomes a neutral mirror: an ego-free sounding board that objectively reflects technical gaps and architectural blind spots without motive, malice, or the systemic anxieties of human-to-human questioning.</em></blockquote><h3>Why This Workflow Alters the Engineering Lifecycle</h3><p>When you shift the AI from just a code output machine to a rigorous interviewer, your development process transforms in three distinct ways:</p><ul><li><strong>Psychologically Safe Exploration:</strong> Because humans don’t attach personal motives to machines, it becomes more safe for the human to not know something, to be wrong, to be confused, or to have the opportunity to pivot radically the conversation. You bypass the “negative perception” loop entirely, unlocking more honest, high-velocity design iterations.</li><li><strong>Forced Conceptual Clarity:</strong> The AI doesn’t just generate a plan; it forces you to align on a bulletproof design concept. By questioning aspects such as data structures, state management, scale assumptions etc., it <strong>exposes edge cases</strong> you would have otherwise discovered painfully during production.</li><li><strong>The Leverage of Strategic Ambiguity:</strong> You retain total control over the depth of the feedback loop. You can still give loose “non-answers” to see where the AI probes next, or intentionally steer it towards specificities of your architecture. You still remain the undisputed system architect, and the AI is simply sharpening your tools.</li></ul><h3>Moving Beyond “Vibe Coding”</h3><p>Treating AI as a code generator only leads to a superficial, vibe-based approach to software development -<strong>“Vibe Coding”.</strong> It feels fast right up until the moment the architecture collapses under its own weight.</p><p>The “Grill Me” skill introduces a mature, highly intentional <strong>human-in-the-loop</strong> engineering process. It keeps your hands firmly on the wheel as the architect while offloading the cognitive overhead of mapping out every single “what-if” scenario.</p><p>Ultimately, this workflow isn’t just about speed, it is about <strong>clarity</strong>. By actively embracing the healthy friction of an AI grilling session, you ensure that the codebase you eventually build is robust, testable, and deeply understood.</p><h3>The TLDR:</h3><p>Human design reviews necessitates human to human questions, which risks falling into “negative perception” traps. With AI asking the questions, this eliminates the risk of negatively perceiving another human, saving human-to-human collaboration for higher-level &amp; high-trust strategic alignment.</p><p>Embrace the friction; enjoy the results.</p><ul><li><a href="https://github.com/mattpocock/skills/blob/main/skills/productivity/grill-me/SKILL.md">skills/skills/productivity/grill-me/SKILL.md at main · mattpocock/skills</a></li><li><a href="https://medium.com/@chron.vas/asking-questions-and-negative-perception-9ef44ee6223a">Asking questions and negative perception</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7ab471190e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Be careful what you wish for]]></title>
            <link>https://medium.com/@chron.vas/be-careful-what-you-wish-for-19b3504a8102?source=rss-5e3a2cb057a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/19b3504a8102</guid>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-safety]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[developer-experience]]></category>
            <dc:creator><![CDATA[Vasileios Chroniadis]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 22:43:28 GMT</pubDate>
            <atom:updated>2026-04-22T22:43:28.696Z</atom:updated>
            <content:encoded><![CDATA[<p>A tiny story about AI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZIKlGMyaVixRpKqt4K_lg.png" /></figure><p>Articles praising AI capabilities are everywhere. Limitations? Not so much. That’s what makes small, revealing mishaps like this one fun and worth sharing.</p><p>I recently asked an AI coding agent to help me with a small project. The requirement was simple: read a file that sat just outside the project folder, and make some code out of that.</p><p>Because of how the chosen build system works, that file could not be used since it was located just outside of the project folder.</p><p>But the AI kept trying to move it inside the project folder.</p><blockquote>I’ve never asked for that.</blockquote><p>Then I had to explicitly tell AI to stop doing that. It then created links to the file and tried to use that.</p><blockquote>I’ve never asked for that either.</blockquote><p>Then again I tried to explicitly tell AI to stop doing that. It then copied the file into the project.</p><blockquote>I’ve never asked for that either.</blockquote><p>All of the times the AI found a “creative” workaround. The behavior was interesting and eye-opening.</p><p>This whole ordeal made me think, how many times an AI worked around like this and in what scenarios? How many times was that critical to things like safety?</p><p>How many times did the human just accepted the link, and then pushed the code without that file which resulted e.g. in a CI fail, or worse? One’s imagination can run wild with other scenarios like that. But what should it do? Stopping earlier, explaining the error succinctly, could be nice, but it would only fit that scenario, therefore making a persciption is really hard.</p><p>What should the humans do? Well that bit is obvious, pay attention to what your AI agent does. And maybe, every once in a while, be a little careful what you wish for.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19b3504a8102" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A simple software principle]]></title>
            <link>https://medium.com/@chron.vas/a-simple-software-principle-d842bcfc47de?source=rss-5e3a2cb057a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d842bcfc47de</guid>
            <category><![CDATA[api-design]]></category>
            <category><![CDATA[software-principles]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Vasileios Chroniadis]]></dc:creator>
            <pubDate>Mon, 13 Nov 2023 17:47:21 GMT</pubDate>
            <atom:updated>2023-11-13T17:47:21.547Z</atom:updated>
            <content:encoded><![CDATA[<p>Prefer language tools, if they exist, rather than relying on assumptions.</p><figure><img alt="Grayscale photograph of metal tools" src="https://cdn-images-1.medium.com/max/1024/1*O8J85-YcJx2u8GC9lcRINw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@carlosirineu?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Carlos Irineu da Costa</a> on <a href="https://unsplash.com/photos/grayscale-photography-of-metal-tools-eMc0lpn1P60?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>Assume you are working on a project that consumes a third-party SDK that provides you with a simple list of fruits. Your application’s task is to take these fruits and make juice with them. You name the juice that you make with the name of the 1st fruit you get from this list.</p><p>Your application looks like this:</p><pre>import fruitery.SDK<br>import fruitery.SDK.Fruit<br><br>fun main(args: Array&lt;String&gt;) {<br>    val sdk = SDK()<br>    val fruits = sdk.getFruits()<br>    val juice = makeJuice(fruits)<br>}<br><br>private fun makeJuice(fruits: List&lt;Fruit&gt;) =<br>    Juice(<br>        name = fruits.first().name,<br>        content = squash(fruits)<br>    )<br>}<br><br>private data class Juice(val name: String, val content: String)<br><br>private fun squash(fruits: List&lt;Fruit&gt;) = /* squash the fruits */</pre><p>Do you see a problem with that? If not, look closer. More specifically “fruits.first()”. <strong>Kotlin docs state clearly that it can throw, but there is no compilation error. </strong>It is therefore up to you to decide if you build your app to defend against this possibility or not. Some other languages don’t tell you that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*MNlC_nRQcwGjuYwGYyRkJQ.png" /></figure><p>Some will make the <strong><em>assumption</em></strong> that it will never return a list of empty fruits. Some of the most common arguments defending this approach are:</p><ul><li><em>The whole point of using the SDK to begin with is to get some fruits, not an empty list.</em> You are, of course, correct. <strong>BUT:</strong> SDKs can fail, internal errors might occur, and one of them could result in the list returning being empty.</li><li><em>I have used this SDK a million times before, and it never returned an empty list.</em> You are again correct; no one can take away your experience, BUT: You don’t control the SDK. You probably don’t work for the SDK team either. The SDK team might also have a valid reason to return no fruit.</li><li><em>It compiles, so it must be fine</em>, BUT: You are forgetting that Kotlin is just a language. Remember the Java null pointer exception back in the Java days? It compiled fine too. Even if Kotlin is a million times better than Java, it is still not “perfect”, and just because Kotlin is able to take care of NPE (and many other issues) doesn’t mean that it takes care of everything and can make all the decisions for you.</li><li><em>I have seen the SDK’s source code, and I can attest that this cannot happen</em>, BUT: How are you sure that this is not going to change in the next SDK version? What is your team’s process on updating SDK versions? What are you going to do in your app if this changes?</li><li><em>My other colleague also supports the idea that it’s fine</em>, BUT: Will you both take the same responsibility if that crashes? Think about that for a second. Also, again, what does the language documentation tell you?</li><li><em>The majority of the team believes that’s fine.</em> This is probably the most valid argument against that, and it can self-portray as “common sense”, BUT: You should probably start checking how sense is your common, especially when your collective common sense contradicts something like the official documentation. This may also be derived from team culture (e.g., the fear of suggesting something new) and could be prevalent among less diverse teams (including technical or industry experience diversity, etc.) or other team culture factors in various degrees. But if the majority is truly happy, that is probably the most central point of a healthy codebase.</li><li><em>There is no use case designed or specified for receiving empty fruit lists; therefore, we do not have a defined UI for this use case</em>, BUT: Probably, this is not the first time something like that has come up. What do you normally do within your team in this case? Maybe do that here too?</li></ul><h3>It’s not just lists</h3><p>The same list/fruit example can be with e.g. casting:</p><pre>open class Animal<br><br>class Dog : Animal()<br><br>class Cat : Animal() {<br>    fun meow() { /*..*/ }<br>}<br><br><br>fun someFunction(animal: Animal) {<br>    (animal as Cat).meow() // ClassCastException crash<br>}</pre><p>In this case, there is not even directly linked documentation that you can look up for this ClassCastException. Keep in mind that Kotlin, or any language for that matter, is not perfect and can’t make decisions for you.</p><h3>It’s not just Kotlin</h3><p>In Android, we are lucky that we have such a nice, strongly typed language. Similar problems might occur in other languages too, no matter if they are strongly typed or not, which could beg a different solution or a different principle than what I am proposing here.</p><h3>Where does it end?</h3><p>There is no point in checking everything every time. It can lead to Analysis Paralysis, and it can slow down code progression without adding much meaningful impact, especially to external eyes.</p><p>But you have to be aware of these things. Think about employing the help of automated tools, and maybe have a way to connect those instances with real runtime problems. Ideally, talk with the SDK developers to clarify that (maybe suggest adding documentation) or let them know of a crash you observed around that.</p><h3>Architectural positioning</h3><p>Let’s say that now the developer and the team are convinced to follow this principle, but where (in which architectural layer) should the check (filtering out bad fruit lists in the first example) take place?</p><p>..and, of course the answer is:</p><blockquote>It depends</blockquote><p>If you follow clean architecture, you might consider adding such checks in the data layer. But isn’t this filtering a domain matter? You might be considering the danger of spreading out your “domain” logic to other architectural layers.</p><p>It is important to take a glance at what this affects. Maybe have a look at pre-existing examples in the codebase you are working on; maybe have a look at adjacent teams and find out what they are doing. Ask your colleagues what they would be most fine with, and ideally agree and have clarity on how much you follow principles that affect that. How other languages deal with those problems can also be an inspiration.</p><h3>The principle</h3><p>If you made it this far, thanks for reading my thoughts. The principle I propose is simple:</p><blockquote>Prefer language tools, if they exist, rather than relying on assumptions.</blockquote><p>In the first Kotlin example, instead of calling list.first(), prefer calling list.firstOrNull(), which is using the Kotlin language tools to protect your app from unexpected crashes.</p><p>Some languages do not have those protections. Maybe ask around or make your own, but be pragmatic with extra care towards external APIs so your API can be robust without relying on assumptions for any of the API consumers.</p><h4>Another principle on the back of that is:</h4><blockquote>Consider adding protections closer to the source.</blockquote><p>Meaning, if this protection makes sense to be added, consider adding it at the layer closer to the source of what needs to be protected against instead of delegating to a layer above.</p><p>This could make your unit testing simpler and more robust, with fewer tests and simpler test cases for those other layers above, without losing any of the coverage. Notice the word “consider” here.</p><p>Thanks to Jodi Winters and Rob Duxbury for proof reading it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d842bcfc47de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Asking questions and negative perception]]></title>
            <link>https://medium.com/@chron.vas/asking-questions-and-negative-perception-9ef44ee6223a?source=rss-5e3a2cb057a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ef44ee6223a</guid>
            <category><![CDATA[asking-questions]]></category>
            <category><![CDATA[openness]]></category>
            <category><![CDATA[empathy]]></category>
            <category><![CDATA[perception]]></category>
            <dc:creator><![CDATA[Vasileios Chroniadis]]></dc:creator>
            <pubDate>Thu, 03 Mar 2022 20:01:39 GMT</pubDate>
            <atom:updated>2022-03-03T20:01:39.290Z</atom:updated>
            <content:encoded><![CDATA[<p>What happens often, is when people ask direct questions, the danger of being perceived as negative is high.</p><p>So how does one maintain a positive perception, while still being able to ask and receive questions?</p><p>Quick answer: Context and perception.</p><h3>Why would asking questions could be perceived as negative?</h3><h4>Timing inconvenience.</h4><p>Imagine you are an expert in satellites, and you are speaking in a conference about a technology that satellites use. Then an attendee raises a hand and asks for a satellite definition.</p><p>It is possible that this attendee is unaware of the definition, and it is also possible that the attendee does know that and has other intentions by asking that question.</p><p>Would that be therefore a bad time to ask such a question? Are there ulterior motives? At this point the person receiving the question is forced to infer to context to figure that.</p><p>The speaker is building context to understand the periphery of the question, and the attendee as well. And this happens in milliseconds. “System A” Associative memory* is used a lot in this step.</p><h4>The way the question is asked.</h4><p>A major difference that I have observed, is that directness is not appreciated equally everywhere. Culture and personal experiences might be a big factor on this one of both the person posing the question, as well as the person receiving the question. People have built their associative memory based on their experience, therefore when asking a direct question on a culture that direct questions are common, one could assume that the possibility of the question being perceived as negative is lower than if the same question would be asked in a culture that direct questions are not that common.</p><h4>Prior personal relations.</h4><p>Does the person receiving the question know the person asking the question? What could their prior interaction be, what would the result? Again, associative memory plays an important role.</p><p>So, what if those 2 know each other?</p><h4>Mistakes in the past</h4><p>If they know each other, either could have done many, or few mistakes in the past. They could both have had mostly positive interactions. I believe that there is very little knowledge of what could the other perceive as a mistake or a negative experience in the past, and even if there were very few of them, people tend to remember them more than the positive ones. The negative event remembrance is more likely to overwhelm the positive one in almost all cases.</p><h4>Stress</h4><p>People tend to have more stress when talking to a crowd. Also, people sitting up asking a question in front of many others can have similar stress levels too.</p><h3>So, what does one do? These are my suggestions.</h3><p>I would suggest approaching the situation in “good faith” on the intentions of the person asking the question and answering the question, maybe you haven’t understood the full context of the person asking the question. And how could you, or anyone? Acknowledge non expertise on the complexity to understand other people. You can barely understand yourself. The science of Psychology wouldn’t need exist if there was full understanding of each other.</p><h4>Focus on proof, not evidence.</h4><p>This one is self-explanatory, but many people don’t know the difference, the lines between these 2 might even be skewed. Isn’t life itself a constant effort to distinguish those lines?</p><h4>Acknowledge and be constantly aware of all of the above.</h4><h4>Empathy</h4><p>Imagine being in the shoes of the other person. Don’t overdo it though, remember that you do not know fully the other person. Overdoing it can be destructive too.</p><h4>Trust?</h4><p>A security expert would say trust no one (zero trust principle). Is this appropriate for conducting living, exploring, and evolving?</p><h4>Be open, but cautious.</h4><p>To me, it looks like there are more reasons and paths that lead to negative perception. How does one build context towards another, to strengthen the chances of a positive perception? Partly how is knowing each other. That requires trust. Trust needs to be built towards one another, to be able to gather more context to improve at assuming intentions next time.</p><p>A case where someone asks trust but gives none back, always results in that person getting very small amounts of it in the end.</p><blockquote>Constantly check your own facts and be open to change. The way you would do it is also important.</blockquote><ul><li>Questions for you, what important things did I miss? Which ones of the above are facts? How do you perceive them? What are your facts? Whatever the answer is, whatever your facts are, try to remember them.</li></ul><p><strong>* “System A” Associative memory</strong> <a href="https://www.youtube.com/watch?v=CjVQJdIrDJ0">https://www.youtube.com/watch?v=CjVQJdIrDJ0</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ef44ee6223a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling multiple Realm databases]]></title>
            <link>https://medium.com/@chron.vas/handling-multiple-realm-databases-f50f1100cae1?source=rss-5e3a2cb057a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f50f1100cae1</guid>
            <category><![CDATA[realm-android]]></category>
            <category><![CDATA[realm-migration]]></category>
            <category><![CDATA[realm-modules]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[realm]]></category>
            <dc:creator><![CDATA[Vasileios Chroniadis]]></dc:creator>
            <pubDate>Mon, 02 Apr 2018 09:51:00 GMT</pubDate>
            <atom:updated>2018-04-09T15:00:39.536Z</atom:updated>
            <content:encoded><![CDATA[<h4>And how to avoid unnecessary migrations</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kLrLgDZjAt0P_xNrM1qtg.jpeg" /></figure><p>In this story we are going to touch upon creating RealmModules for each schema, why is it important, and what could go wrong if we decide not to.</p><p>Let’s begin with an imaginary scenario, in which you have an application that contains 2 different Realm configurations for 2 different database files, each containing various RealmObject classes representing the data, which are unrelated across the databases.</p><p>In the 1st database, your data is quite “boring”, meaning that the field names, properties and relations for the RealmObjects this database would contain, would probably never change, so a migration would not be needed. Let’s call the first database notChanging database, give it a file name “notchanging.realm”, a Realm configuration “notChangingConfiguration”, and a NotChanging RealmObject representing the data this db will have. Safe to not include a migration to the configuration builder.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/78edf4b0862542b1991617110eb2b0cd/href">https://medium.com/media/78edf4b0862542b1991617110eb2b0cd/href</a></iframe><p>In the 2nd database, your data might change in the future, meaning that you would probably include a migration in the future for it, so defining a version from the get go is recommended. Let’s call the second database “probablyChanging” database.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/328f780b0dc35fff8ef89085239133bf/href">https://medium.com/media/328f780b0dc35fff8ef89085239133bf/href</a></iframe><p>Time passes, both databases have been populated with useful data <em>which you don’t want to lose</em>, and you now have to migrate the data from the probablyChanging database into the new format. To keep it simple, let’s say that the new format that needs migrating is just <strong>renaming probablyChangingField2 to probablyChangingField2Updated </strong>for the ProbablyChanging Realm Object.</p><p>Simple stuff. So the migration for the probably changing database would look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fa6e1aa4438bedf121824c32055a88e/href">https://medium.com/media/8fa6e1aa4438bedf121824c32055a88e/href</a></iframe><p>You would think, that the only thing you need, is to add a migration for the <strong>probablyChangingConfiguration and just increment the version. Let’s see how this approach plays out, and explain why it’s not enough.</strong></p><p>After updating the schema version to 2 you are ready to hit the play button and …</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3oKIPwoeGErMmaI43S%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fculture--run-3oKIPwoeGErMmaI43S&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3oKIPwoeGErMmaI43S%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="327" frameborder="0" scrolling="no"><a href="https://medium.com/media/8433801c00157db24c45df6a1642435b/href">https://medium.com/media/8433801c00157db24c45df6a1642435b/href</a></iframe><p><strong>Oh noooo!! </strong>Realm.<em>getInstance</em>(notChangingConfiguration) fails! 💥</p><blockquote>What went wrong? Why the notChangingConfiguration crashes?</blockquote><p>Let’s take a look both databases just before the migration. Using <a href="https://github.com/realm/realm-browser-osx">RealmBrowser </a>for Mac (or <a href="https://github.com/uPhyca/stetho-realm">Stetho-Realm</a> if you’re brave enough).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/238/1*EufDAVVsV-JQMWAYUJ36Tw.png" /></figure><blockquote>Something does not look right</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FhqWSl79s72MQ8%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fnoes-hqWSl79s72MQ8&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FhqWSl79s72MQ8%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="319" frameborder="0" scrolling="no"><a href="https://medium.com/media/0bee8a13e93b1609af54d95d6f82db85/href">https://medium.com/media/0bee8a13e93b1609af54d95d6f82db85/href</a></iframe><p>Why does <strong>notchangingdb </strong>contain “<strong>tables”</strong> that suppose to exist only on<strong> probablychangingdb</strong>? 🤔</p><p>Let’s take a look at the <a href="https://realm.io/docs/java/latest#schemas">documentation</a> for Schemas and Modules.</p><blockquote>“ The default schema for a Realm is simply all the Realm model classes in a project…”</blockquote><p>So every class that extends RealmObject will be, by default, included in every database as a table! That’s why we see ProbablyChanging and NotChanging Realm objects (class_NotChangingObject and class_ProbablyChanging tables) included in both databases!</p><p>Let’s replay the scenario, only this time we are going to <strong>declare modules for each database configuration.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63b7baeb563eab90827e953f3ccfd204/href">https://medium.com/media/63b7baeb563eab90827e953f3ccfd204/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*fy6RL6bpHGmh3OIqN4IjpQ.png" /></figure><p>Much better! Now we see that each .realm database contains only the tables for the objects that it’s supposed to contain! This derives from the RealmModule definition resulting in a much improved schema structure than before.</p><p>Replaying the previous migration, just for the <strong>probablychangingdb </strong>works like a breeze!</p><p>If you have an app in production with no modules defined and multiple database configurations, you need to untangle them with these steps before applying migrations to any of them.</p><ol><li>First you have to declare the modules for each database and <strong>at the same step </strong>add a migration for removing the unnecessary generated tables.</li><li>Then you can proceed applying the migration to each table (RealmObject) separately.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FVguA9WaSffqP6%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FVguA9WaSffqP6%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FVguA9WaSffqP6%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="348" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1c72cd4fc4b3ac7ef3dd15d8d0d563d/href">https://medium.com/media/e1c72cd4fc4b3ac7ef3dd15d8d0d563d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*rzpBgoQO1bPxMXRHTgYx_g.png" /></figure><blockquote>Divide and conquer</blockquote><p>Now you can manage your Realm “data containers” like a pro, and avoid unnecessary migrations by defining RealmModules for each db.</p><p>👏 if you liked the story, I hope it helped.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f50f1100cae1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Realm for Android and initial seed data: Pre-populating from Json and extracting the database]]></title>
            <link>https://medium.com/hackernoon/realm-for-android-pre-populating-from-json-and-extracting-the-database-8709a2f8db18?source=rss-5e3a2cb057a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8709a2f8db18</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[realm]]></category>
            <dc:creator><![CDATA[Vasileios Chroniadis]]></dc:creator>
            <pubDate>Mon, 01 Aug 2016 20:25:41 GMT</pubDate>
            <atom:updated>2019-05-22T11:10:04.160Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve came across the “hustle” of creating an app that will use Realm, having the database previously populated with data and just include the created <a href="https://hackernoon.com/tagged/database">database</a> file in the published app, omitting the Json (or any other file) that is being used to populate it.</p><p>Doing so for a “to be published” app saves time (parsing the file and populating a db) and space (omitting the file which used to create the database).</p><h4>The main idea:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*KQvB05sc2bdd4rY95P9gBQ.png" /></figure><p>I’m going to show the simplest possible way to achieve this, but this can be much improved (a separate <a href="https://hackernoon.com/tagged/gradle">Gradle</a> task maybe?) and even be a part of the main project, not having to maintain 2 code bases and 2 different projects for one app.</p><h4>For the hasty</h4><blockquote>The project is on <a href="https://github.com/chronvas/RealmTesting">Github</a>, but check the “Keep in mind” section first</blockquote><h3>Begin!</h3><p>I am using Android Studio (3.1) and Realm Java version 5.0.0.<br>The build.gradle of the project looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f6a1a79309853f9267a0ac14f407029e/href">https://medium.com/media/f6a1a79309853f9267a0ac14f407029e/href</a></iframe><p>And the build.gradle of the app module looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/714bf3d78e66680554ece7fe0fc389fc/href">https://medium.com/media/714bf3d78e66680554ece7fe0fc389fc/href</a></iframe><p>It’s time to add a class that extends android.app.Application, so our whole application starts from this class and Realm gets initialized and configured on OnCreate. It’s handy to set a name for your .realm file containing the database. More configurations can be <a href="https://realm.io/docs/java/latest/api/io/realm/RealmConfiguration.Builder.html">passed</a> in this way. Just remember to point out this class in the Android Manifest.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3728a2561a57a73ffa342b2a3a5e92ba/href">https://medium.com/media/3728a2561a57a73ffa342b2a3a5e92ba/href</a></iframe><p>Now we need the Json file. A simple one for brevity reasons named “people.json” :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c6ee7b73f53beb4d99c25c5322e7a03/href">https://medium.com/media/8c6ee7b73f53beb4d99c25c5322e7a03/href</a></iframe><p>The .json file has to be placed into raw resources in order to be accessible. Create the raw resource folder if it does not exist</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*24q8D80jhFg_SpzIfbvmMg.png" /></figure><p>The representing Java class for parsing the Json:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d52b60c3c1585dedeba6e9811fbaec3/href">https://medium.com/media/4d52b60c3c1585dedeba6e9811fbaec3/href</a></iframe><h4>Ok! It’s time for parsing</h4><p>Normally, we would use a helper class extending AsyncTask. But thanks to the Realm.executeTransaction we can just this built in method instead.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac9d5ea4906849520feb71298f810879/href">https://medium.com/media/ac9d5ea4906849520feb71298f810879/href</a></iframe><p>And a simple button to call .importFromJson()</p><p>Keep in mind that calling importFromJson does not delete the database or the data in it, it just adds the results from the Json parsing.</p><p>On Android monitor we can view the time it took to complete, and possibly saved from a published app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*N5duMdW0sdu6p1KKF5Y0Ew.png" /></figure><h3>Now, where is my .realm database file?</h3><p>Once you run the application to a device, in Android Studio, open “Device File Explorer”, navigate under the “ Data / Data / &lt;Package Name&gt; / files ” directory you can find the .realm file and pull it to your computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*crA6Ps_YtOKMMs2AaUPSjA.png" /></figure><h4>Did it work?</h4><p>You can add another button for simplicity to return the number of Persons found in the database. The code of the two simple buttons could look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e67e8c6f01dd0dde129a2130457aed80/href">https://medium.com/media/e67e8c6f01dd0dde129a2130457aed80/href</a></iframe><p>Now just take the .realm file and place it under raw resources again to be used as the database.</p><h3>On the “to be published” app</h3><p>Just put the .realm file in the raw resource directory and copy it to the appropriate place (FilesDir) using copyBundledRealmFile method on App.java .</p><p>I added an <strong><em>shouldOverwriteDatabaseOnAppStartup </em></strong>flag if you want to overwrite the database every time the app starts with a fresh one, or just keep the one that copyBundledRealmFile created the first time the app ran:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8531b6af2507e0b12cd1288011e42893/href">https://medium.com/media/8531b6af2507e0b12cd1288011e42893/href</a></iframe><h3>Keep in mind!</h3><ul><li>With the <strong><em>shouldOverwriteDatabaseOnAppStartup </em></strong>flag set to true, <strong>every time your application starts</strong>, it copies or overwrites the .realm database from raw directory to the /files directory, so keep in mind that whatever change you make it is going to be lost upon App.java call. In order to demonstrate the “problem” I have added 2 more buttons to change and query the name of the first person. <strong>In order to avoid this</strong>, set the flag to false, which makes a file existence check before writing the .realm file.</li><li>The .realm file still has 2 instances. In the raw resource directory and in the /files directory. So saving space is not done in fully.</li><li>Don’t forget to use the correct data model when you read the database, or a realm migration if needed.</li></ul><blockquote>I hope you found this article useful. The project can be found here <a href="https://github.com/chronvas/RealmTesting">https://github.com/chronvas/RealmTesting</a></blockquote><blockquote>Special thanks to Kenneth Geisshirt for reading this and suggesting realm.executeTransaction over AsyncTask</blockquote><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><a href="https://goo.gl/Ahtev1"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></a></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8709a2f8db18" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/realm-for-android-pre-populating-from-json-and-extracting-the-database-8709a2f8db18">Realm for Android and initial seed data: Pre-populating from Json and extracting the database</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>