<?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 Adhityavarman on Medium]]></title>
        <description><![CDATA[Stories by Adhityavarman on Medium]]></description>
        <link>https://medium.com/@adhityavarman?source=rss-12b249367763------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eFP51VOPOoD3yrd7XLdhiQ.png</url>
            <title>Stories by Adhityavarman on Medium</title>
            <link>https://medium.com/@adhityavarman?source=rss-12b249367763------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:30:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adhityavarman/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[A Fully Customizable Date Time Picker Widget for Mendix Native Applications]]></title>
            <link>https://adhityavarman.medium.com/a-fully-customizable-date-time-picker-widget-for-mendix-native-applications-08ccbbf13af5?source=rss-12b249367763------2</link>
            <guid isPermaLink="false">https://medium.com/p/08ccbbf13af5</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Adhityavarman]]></dc:creator>
            <pubDate>Sun, 17 May 2026 18:45:34 GMT</pubDate>
            <atom:updated>2026-05-17T18:45:34.725Z</atom:updated>
            <content:encoded><![CDATA[<p>Date and time selection is a common requirement in native apps, but default pickers often limit UI flexibility and customization.</p><p>This <strong>fully customizable Date Time Picker widget</strong> for Mendix Native applications is designed to provide a cleaner experience with flexible styling, configurable behavior, and modern UI options.</p><p>In this blog, we’ll explore:</p><ul><li>Widget overview &amp; features</li><li>UI customization options</li><li>Styling possibilities</li><li>Example configurations</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMmmZS_Rk5i1PC6uqw4Vag.png" /></figure><h3>Customizing the Widget UI</h3><p>The widget exposes multiple style classes, allowing different sections to be customized independently. Small changes can significantly alter the appearance while keeping functionality unchanged.</p><h3>Input Field Styling</h3><p>Customize the input appearance before opening the picker.</p><p>Structure:</p><pre>&lt;label /&gt;<br>&lt;manMark /&gt;<br><br>&lt;container&gt;<br>    &lt;inputDateText /&gt;<br>    &lt;inputPlaceholder /&gt;<br>    &lt;iconContainer /&gt;<br>&lt;/container&gt;<br><br>&lt;validationMessage /&gt;</pre><p>Example:</p><pre>export const inputStyles = {<br>    label:{<br>        fontSize:16,<br>        fontWeight:&quot;600&quot;,<br>        color:&quot;#111827&quot;<br>    },<br><br>    manMark:{<br>        color:&quot;#EF4444&quot;<br>    },<br>    container: {<br>        backgroundColor: &quot;#F8FAFC&quot;,<br>        borderRadius: 14,<br>        borderWidth: 1,<br>        borderColor: &quot;#E5E7EB&quot;,<br>        paddingHorizontal: 14,<br>        paddingVertical: 12<br>    },<br><br>    inputDateText: {<br>        color: &quot;#111827&quot;,<br>        fontSize: 14<br>    },<br><br>    inputPlaceholder: {<br>        color: &quot;#9CA3AF&quot;<br>    },<br>    validationMessage:{<br>        color:&quot;#DC2626&quot;,<br>        fontSize:12<br>    }<br>};  </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*SVLpo-EAWazb5hyT4uZUqw.png" /></figure><h3>Modal Container Styling</h3><p>The modal controls the overall popup appearance.</p><p>Structure:</p><pre>&lt;modalContainer&gt;<br>    &lt;card&gt;</pre><p>Example:</p><pre>export const modalStyles = {<br>    card: {<br>        backgroundColor: &quot;#FFFFFF&quot;,<br>        borderRadius: 24,<br>        padding: 18<br>    },<br>    modalContainer: {<br>        backgroundColor: &quot;rgba(0,0,0,0.2)&quot;<br>    }<br>};</pre><h3>Calendar Styling</h3><p>Customize selected dates and calendar appearance.</p><p>Structure:</p><pre>&lt;yearHeader /&gt;<br>&lt;rangeHeader /&gt;<br>&lt;timeHeader /&gt;<br>&lt;dateTimeHeader /&gt;<br><br>&lt;monthTitle /&gt;<br>&lt;weekDay /&gt;<br>&lt;selectedDay /&gt;<br>&lt;pickedDayText /&gt;<br>&lt;dayText /&gt;</pre><p>Example:</p><pre>export const calendarStyles = {<br>    yearHeader:{<br>        paddingVertical:12<br>    },<br><br>    timeHeader:{<br>        backgroundColor:&quot;#F8FAFC&quot;<br>    },<br>    monthTitle:{<br>        fontSize:18,<br>        fontWeight:&quot;700&quot;<br>    },<br><br>    weekDay:{<br>        color:&quot;#9CA3AF&quot;<br>    },<br><br>    selectedDay:{<br>        backgroundColor:&quot;#2563EB&quot;<br>    },<br><br>    pickedDayText:{<br>        color:&quot;#FFF&quot;<br>    }<br>};</pre><h3>Range Picker Styling</h3><p>Range selection introduces additional UI states.</p><p>Structure:</p><pre>&lt;day /&gt;<br>&lt;startDay /&gt;<br>&lt;middleDay /&gt;<br>&lt;endDay /&gt;</pre><p>Example:</p><pre>export const rangeStyles = {<br>    startDay: {<br>        backgroundColor: &quot;#2563EB&quot;,<br>        borderRadius: 50<br>    },<br>    middleDay: {<br>        backgroundColor: &quot;#DBEAFE&quot;<br>    },<br>    endDay: {<br>        backgroundColor: &quot;#2563EB&quot;,<br>        borderRadius: 50<br>    }<br>};</pre><h3>Year Picker Customization</h3><p>The widget includes a scrollable year selector.</p><p>Structure:</p><pre>&lt;yearScrollContainer&gt;<br>    &lt;yearTextItem /&gt;<br>    &lt;yearSelectedText /&gt;<br>    &lt;centerHighlight /&gt;<br>&lt;/yearScrollContainer&gt;</pre><p>Example:</p><pre>export const yearStyles = {<br>    yearSelectedText: {<br>        color: &quot;#2563EB&quot;,<br>        fontWeight: &quot;700&quot;<br>    },<br><br>    centerHighlight: {<br>        backgroundColor: &quot;#EFF6FF&quot;<br>    }<br>};</pre><h3>Time Picker Styling</h3><p>The clock interface can also be customized.</p><p>Structure:</p><pre>&lt;inputRow&gt;<br><br>&lt;input /&gt;<br>&lt;activeInput /&gt;<br><br>&lt;meridiem /&gt;<br>&lt;activeMeridiem /&gt;<br><br>&lt;clock&gt;<br>&lt;num /&gt;<br>&lt;activeNum /&gt;<br><br>&lt;needle /&gt;<br>&lt;knob /&gt;<br>&lt;centerDot /&gt;</pre><p>Example:</p><pre>export const timeStyles = {<br>    input:{<br>        color:&quot;#6B7280&quot;<br>    },<br><br>    activeInput:{<br>        color:&quot;#2563EB&quot;,<br>        fontWeight:&quot;700&quot;<br>    },<br><br>    activeMeridiem:{<br>        color:&quot;#2563EB&quot;<br>    },<br>    clock: {<br>        backgroundColor: &quot;#F8FAFC&quot;<br>    },<br><br>    activeNum: {<br>        color: &quot;#2563EB&quot;<br>    },<br><br>    needle: {<br>        backgroundColor: &quot;#2563EB&quot;<br>    }<br>};</pre><h3>Action Button Styling</h3><p>Footer actions support customization as well.</p><p>Structure:</p><pre>&lt;footer&gt;<br><br>&lt;cancelBtn /&gt;<br>&lt;cancelText /&gt;<br><br>&lt;doneBtn /&gt;<br>&lt;doneText /&gt;</pre><p>Example:</p><pre>export const footerStyles = {<br>    doneBtn: {<br>        backgroundColor: &quot;#2563EB&quot;,<br>        borderRadius: 12<br>    },<br><br>    doneText: {<br>        color: &quot;#FFFFFF&quot;<br>    },<br><br>    cancelBtn: {<br>        backgroundColor: &quot;#F3F4F6&quot;<br>    },<br>    doneText:{<br>        fontWeight:&quot;600&quot;,<br>        color:&quot;#FFF&quot;<br>    },<br><br>    cancelText:{<br>        color:&quot;#6B7280&quot;<br>    }<br>};</pre><h3>Final Thoughts</h3><p>The widget is designed to support customization across multiple layers — from input fields and calendars to range selection and clock interactions.</p><p>The goal is simple: <strong>make the picker feel like part of your application instead of a standalone component.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08ccbbf13af5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Custom Styling in Mendix Native Custom Widgets]]></title>
            <link>https://adhityavarman.medium.com/mastering-custom-styling-in-mendix-native-custom-widgets-bb12b650df84?source=rss-12b249367763------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb12b650df84</guid>
            <category><![CDATA[mendix]]></category>
            <category><![CDATA[low-code-development]]></category>
            <category><![CDATA[ui-ux-design]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Adhityavarman]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 16:42:21 GMT</pubDate>
            <atom:updated>2026-04-13T18:16:33.219Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kpdysnCscCo7LRSa56hfcA.png" /></figure><p>Hi Everyone, Let me ask you something… Have you ever tried to customize UI in a Mendix Native widget and felt like:</p><blockquote><em>“Why is this so hard compared to web?”</em></blockquote><p>In web development, things are simple. You inspect → add a class → tweak CSS → done. But in Mendix Native…</p><p>↬ There is no CSS.<br>↬ No DOM.<br>↬ No quick fixes.</p><p>I have been there too.</p><p>↬ Trying to change a small UI element…<br>↬ Spending hours figuring out where to apply styles…<br>↬ And sometimes ending up thinking:</p><blockquote><em>“Is this even possible in Mendix Native?”</em></blockquote><p>But here’s the truth,<br>▸ It’s absolutely possible.<br>▸ You just need to understand <strong>how styling actually works in Native widgets</strong>.</p><p>After getting started, let’s quickly walk through what you’ll gain from this blog.</p><p>In this blog, I’ll show you:</p><ul><li>A clear understanding of <strong>Mendix Widget Development</strong></li><li>A quick jump into <strong>Native Widget fundamentals</strong></li><li>How to <strong>apply custom styling in Native widgets</strong></li><li>How to <strong>export and expose styling for developers</strong></li><li>A practical <strong>working example with sample code</strong></li><li>Quick Implementation Tip on <strong>Mendix</strong></li></ul><p>No unnecessary theory, No confusion.</p><p>Just a <strong>straightforward, developer-friendly guide</strong> to help you take control of UI in Mendix Native widgets.</p><h3>1. Mendix Widget Development</h3><p>Before jumping into Native styling, it’s important to have a basic understanding of how Mendix widget development works.</p><p>If you’re new or need a quick refresher, I highly recommend going through the official documentation:</p><ul><li>Mendix Widget Development Guide — <a href="https://docs.mendix.com/howto/extensibility/build-native-widget/">Click Here</a></li><li>Mendix Widget Property Types — <a href="https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/">Click Here</a></li></ul><p>These will give you a solid foundation on how widgets are structured, how properties are defined, and how everything connects behind the scenes.</p><p>Don’t worry — you don’t need to master everything. Just get a basic idea, and we’ll build on top of that step by step.</p><h3>2. A Quick Jump into Native Widget Fundamentals</h3><p>Mendix Native widgets are built using <strong>React Native</strong>, not regular React. <br>At first, this might sound like a small difference… but it changes how UI works completely.</p><p><strong>React (Web):</strong></p><ul><li>Uses HTML elements like div, span, p</li><li>Styling is done using CSS</li><li>Works with the DOM (browser-based)</li></ul><p><strong>React Native:</strong></p><ul><li>Uses components like View, Text, TouchableOpacity</li><li>Styling is done using JavaScript (StyleSheet)</li><li>No DOM — everything is rendered natively on mobile</li></ul><p>In today’s AI-driven world, we often rely on vibe coding to move faster — but having a clear understanding is still essential when it comes to reviewing and refining the code.</p><h3>3. How to Apply Custom Styling in Native Widgets</h3><p>Let me quickly show how styling works in React Native, <a href="https://reactnative.dev/docs/style"><strong><em>learn more</em></strong></a></p><p>Here styling is defined and used within the component itself. Styles are defined directly using JavaScript:</p><pre>const styles = StyleSheet.create({<br>    container: {<br>        padding: 16,<br>        backgroundColor: &quot;#fff&quot;<br>    }<br>});</pre><p>And then apply it directly:</p><pre>&lt;View style={styles.container} /&gt;</pre><h3>4. How to Export and Expose Styling for Developers</h3><p>Now let’s take it one step further. In real-world widgets, we don’t just apply styles, we <strong>export and expose them</strong> so other developers can use and control them.</p><h4>Understanding ViewStyle and TextStyle</h4><p><strong>ViewStyle</strong> → Used for container-level styling (layout, padding, border, etc.)<br><strong>TextStyle</strong> → Used for text-level styling (font size, color, spacing, etc.)</p><p>This helps you keep styling <strong>structured and type-safe</strong>.</p><h4>Example: Defining and Exporting Styles</h4><pre>import { StyleSheet, ViewStyle, TextStyle } from &quot;react-native&quot;;<br><br>export interface CustomStyle {<br>    label: TextStyle;<br>    container: ViewStyle;<br>}<br><br>export const styles: CustomStyle = StyleSheet.create({<br>    label: {<br>        marginBottom: 4,<br>        fontSize: 12,<br>        color: &quot;black&quot;<br>    },<br>    container: {<br>        padding: 12,<br>        borderWidth: 1,<br>        borderColor: &quot;#DCD9D9&quot;,<br>        borderRadius: 10<br>    }<br>});</pre><h3>5. A Practical Working Example with Sample Code</h3><p>Let’s wrap this up with a simple <strong>Accordion Widget</strong> — clean, minimal, and practical.</p><h4>src/Accordion.jsx</h4><pre>import React, { useState } from &quot;react&quot;;<br>import { View, Text, TouchableOpacity } from &quot;react-native&quot;;<br>import { defaultStyle , AccordionStyle } from &quot;./style&quot;;<br>import { AccordionProps } from &quot;../typings/AccordionProps&quot;;<br>import { mergeNativeStyles } from &quot;@mendix/pluggable-widgets-tools&quot;; // Most Important thing<br><br>export function Accordion ({ title, content, style }: AccordionProps&lt;AccordionStyle&gt;): ReactElement {<br>    const styles = mergeNativeStyles(defaultStyle, style); //Merging mendix style and default style<br>    const [open, setOpen] = useState(false);<br>    return (<br>        &lt;View style={styles.container}&gt;<br>            &lt;TouchableOpacity onPress={() =&gt; setOpen(!open)}&gt;<br>                &lt;Text style={styles.title}&gt;{title}&lt;/Text&gt;<br>            &lt;/TouchableOpacity&gt;<br>            {open &amp;&amp; (<br>                &lt;View style={styles.content}&gt;<br>                    {content}<br>                &lt;/View&gt;<br>            )}<br>        &lt;/View&gt;<br>    );<br>};</pre><h4>src/style.ts</h4><pre>import { StyleSheet, ViewStyle, TextStyle } from &quot;react-native&quot;;<br><br>export interface AccordionStyle {<br>    [key: string]: ViewStyle | TextStyle;<br>    container: ViewStyle;<br>    title: TextStyle;<br>    content: ViewStyle;<br>    text: TextStyle;<br>}<br>export const defaultStyle : AccordionStyle = StyleSheet.create({<br>    container: {<br>        borderWidth: 1,<br>        borderColor: &quot;#DCD9D9&quot;,<br>        borderRadius: 8,<br>        marginBottom: 10<br>    },<br>    title: {<br>        padding: 12,<br>        fontSize: 14,<br>        fontWeight: &quot;600&quot;,<br>        backgroundColor: &quot;#F5F5F5&quot;<br>    },<br>    content: {<br>        padding: 12<br>    },<br>    text: {<br>        fontSize: 13,<br>        color: &quot;#333&quot;<br>    }<br>});</pre><p>The idea is simple: Define → Structure → Export → Reuse. <br>That’s how you build <strong>scalable and customizable Native widgets</strong>.</p><h4>What This Shows</h4><ul><li>Simple state-based interaction</li><li>Clean separation of <strong>logic</strong> and <strong>styling</strong></li><li>Use of mergeNativeStyles to combine default and external styles</li><li>A reusable pattern for real-world widgets</li></ul><p>This is the exact pattern you can scale into a full <strong>Mendix Native custom widget</strong>.</p><h3>6. Quick Implementation Tip (Use it in Mendix)</h3><p>One simple trick to speed up your UI changes 👇</p><ul><li>Apply a class to your widget from Mendix</li><li>Define the styling for that class inside your Mendix app</li><li>Run the app and adjust styles directly</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*zxqMNTID9jR6KMjCEl4uEg.png" /><figcaption>Apply class name for the Accordion Widget</figcaption></figure><p>After that you can adjust the style from your own customStyle.js or do it in <strong>theme\native\main.js</strong>.</p><pre>export const addressAccord = {<br>    container: {<br>        borderWidth: 1,<br>        borderColor: &quot;#e5e5e5&quot;,<br>        borderRadius: 8,<br>        marginBottom: 10<br>    },<br>    title: {<br>        padding: 16,<br>        fontSize: 18,<br>    },<br>    content: {<br>        padding: 12<br>    },<br>    text: {<br>        color: &quot;#000&quot;<br>    }<br>}</pre><p>👉 This way, you can tweak UI without rebuilding the widget every time.</p><p>Small change… but saves a lot of time during development</p><h3>Conclusion</h3><p>At last, you might have got an idea of how to build fully<strong> scalable Native widgets, </strong>that anyone can use, customize, and extend.</p><p>As I said earlier, in today’s world we have powerful AI tools for vibe coding.<br>Use this blog as a reference and Ask your AI agent to handle styling while building widgets</p><p>But remember… Your understanding is what turns it into clean, scalable, production-ready code</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb12b650df84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customize Your Mendix Native App Splash Screen]]></title>
            <link>https://adhityavarman.medium.com/customize-your-mendix-native-app-splash-screen-3c7607e9b196?source=rss-12b249367763------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c7607e9b196</guid>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[mendix]]></category>
            <dc:creator><![CDATA[Adhityavarman]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 10:23:25 GMT</pubDate>
            <atom:updated>2026-03-03T10:23:25.194Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAd2w5RWhZBhSOxmZJW6fw.gif" /></figure><p>In this blog, I will guide you through the process of creating a <strong>custom splash screen</strong> for your <strong>Mendix Native application</strong>. By default, Mendix provides a basic splash screen, but customizing it allows for better branding and an improved user experience.</p><h3>Preparing Your Mendix Native App</h3><p>Before implementing a custom splash screen, you need to<strong> </strong>build your native app and <strong>bundle the Mendix code</strong> using the <a href="https://docs.mendix.com/refguide/mobile/distributing-mobile-apps/building-native-apps/native-build-locally/"><strong>Mendix Native Mobile Builder.</strong></a><strong> </strong>Once the package is generated, you can proceed with customization.</p><h3>Understanding the Android Studio Project Structure</h3><p>After generating the package, open the project in <strong>Android Studio</strong>, where all the necessary files for building the mobile app will be available.</p><p>Key Files and Their Functions:<br>𝗔𝗻𝗱𝗿𝗼𝗶𝗱𝗠𝗮𝗻𝗶𝗳𝗲𝘀𝘁.𝘅𝗺𝗹 – Defines app permissions, activities, and configurations.<br>𝗠𝗮𝗶𝗻𝗔𝗽𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻.𝗷𝗮𝘃𝗮 – The entry point for initializing the React Native app.<br>𝗠𝗮𝗶𝗻𝗔𝗰𝘁𝗶𝘃𝗶𝘁𝘆.𝗷𝗮𝘃𝗮 – The main activity that launches the app.<br>𝗚𝗿𝗮𝗱𝗹𝗲 𝗙𝗶𝗹𝗲𝘀 – Manage dependencies and build configurations.</p><p>Important Folders in <strong>res</strong> (Resources) Directory:<br>𝗱𝗿𝗮𝘄𝗮𝗯𝗹𝗲 – Contains images like the app icon.<br>𝗹𝗮𝘆𝗼𝘂𝘁 – Stores XML files defining UI elements.<br>𝗺𝗶𝗽𝗺𝗮𝗽 – Different resolutions of the app icon.<br>𝗿𝗮𝘄 – Used for storing raw resources like audio, JSON files, and runtime URL.<br>𝘃𝗮𝗹𝘂𝗲𝘀 — Holds colors, strings, and styles.</p><p>Now that we understand the project structure, let’s move on to understanding the splash screen implementation.</p><h3>Understanding the Default Splash Screen</h3><p>Before making modifications, it’s important to understand how the <strong>default splash screen</strong> works in a <strong>Mendix Native app</strong>.</p><p>By default, the splash screen is managed in:</p><ul><li>𝗠𝗮𝗶𝗻𝗔𝗽𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻.𝗷𝗮𝘃𝗮 – Uses <strong>MendixSplashScreenPresenter </strong>and <strong>react-native-splash-screen</strong> to control splash screen behavior.</li><li>𝗠𝗮𝗶𝗻𝗔𝗰𝘁𝗶𝘃𝗶𝘁𝘆.𝗷𝗮𝘃𝗮 – Initializes the splash screen inside the onCreate() method.</li></ul><p>Next, we will proceed with <strong>customizing the splash screen</strong> to reflect your branding. Instead of removing the existing implementation, we will ensure it references our <strong>custom splash screen</strong>.</p><h3>Customizing the Splash Screen</h3><p>Now that we understand how the default splash screen works, let’s proceed with customizing it to align with your brand identity.</p><h4><strong>Step 1: Create a Custom Splash Screen Layout</strong></h4><p>Navigate to res/layout/ and create a new XML layout <strong>customlayout.xml</strong> . This file defines the visual design of the splash screen and references a custom icon in the drawable folder.</p><p>Ensure you add your own icon to the drawable folder:<br>📂 <strong>res/drawable/custom_icon.png</strong></p><p>Now, add the following code to <strong>customlayout.xml</strong>:</p><pre>&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    android:background=&quot;@color/white&quot;&gt;<br><br>    &lt;ImageView<br>        android:id=&quot;@+id/app_icon&quot;<br>        android:layout_width=&quot;55dp&quot;<br>        android:layout_height=&quot;55dp&quot;<br>        android:scaleType=&quot;fitCenter&quot;<br>        android:adjustViewBounds=&quot;true&quot;<br>        android:layout_centerInParent=&quot;true&quot;<br>        android:src=&quot;@drawable/custom_icon&quot; /&gt;<br>&lt;/RelativeLayout&gt;</pre><h4><strong>Step 2: Implement Splash Screen Logic in Java</strong></h4><p>Now, create a <strong>CustomSplash.java</strong> file inside your Java package. This file will handle splash screen logic, including animations.</p><p>Below is the <strong>CustomSplash.java</strong> file, which you can use to implement a custom splash screen with animation in your Mendix Native app. I have added comments to explain each section of the code.</p><pre>package com.mendix.nativetemplate;<br><br>import android.app.Activity;<br>import android.app.Dialog;<br>import android.os.Build;<br>import android.os.Handler;<br>import android.view.animation.AccelerateDecelerateInterpolator;<br>import android.view.animation.ScaleAnimation;<br>import android.widget.ImageView;<br><br>public class CustomSplash {<br>    private static Dialog mSplashDialog; // Dialog instance to display the splash screen<br><br>    /**<br>     * Show the custom splash screen.<br>     * This method creates and displays a full-screen dialog containing the splash screen layout.<br>     *<br>     * @param activity The current activity where the splash screen will be shown.<br>     */<br>    public static void show(final Activity activity) {<br>        if (activity == null || activity.isFinishing()) return; // Prevents crashes if activity is null or closing<br><br>        activity.runOnUiThread(() -&gt; {<br>            // Create a full-screen dialog with no title<br>            mSplashDialog = new Dialog(activity, android.R.style.Theme_NoTitleBar_Fullscreen);<br>            mSplashDialog.setContentView(R.layout.customlayout); // Set the splash screen layout<br>            mSplashDialog.setCancelable(false); // Prevent users from dismissing the splash screen manually<br>            mSplashDialog.show(); // Display the splash screen<br><br>            // Get reference to the app icon and start animation<br>            ImageView appIcon = mSplashDialog.findViewById(R.id.app_icon);<br>            startIconAnimation(appIcon, activity);<br>        });<br>    }<br><br>    /**<br>     * Animates the splash screen icon with a scaling effect.<br>     * <br>     * @param appIcon  The ImageView to animate (app logo).<br>     * @param activity The activity where the animation is applied.<br>     */<br>    private static void startIconAnimation(ImageView appIcon, Activity activity) {<br>        ScaleAnimation scaleAnim = new ScaleAnimation(<br>                0f, 1f, // Start and end scale for X-axis<br>                0f, 1f, // Start and end scale for Y-axis<br>                ScaleAnimation.RELATIVE_TO_SELF, 0.5f, // Pivot at center horizontally<br>                ScaleAnimation.RELATIVE_TO_SELF, 0.5f  // Pivot at center vertically<br>        );<br>        scaleAnim.setDuration(1000); // Animation duration in milliseconds<br>        scaleAnim.setFillAfter(true); // Ensures the animation effect remains after completion<br>        scaleAnim.setInterpolator(new AccelerateDecelerateInterpolator()); // Smooth transition effect<br><br>        appIcon.startAnimation(scaleAnim); // Start the animation on the app icon<br><br>        // Automatically hide the splash screen after 1.5 seconds<br>        new Handler().postDelayed(() -&gt; hide(activity), 1500);<br>    }<br><br>    /**<br>     * Hide the splash screen.<br>     * Ensures that the splash screen is dismissed safely, avoiding memory leaks.<br>     *<br>     * @param activity The activity from which the splash screen should be dismissed.<br>     */<br>    public static void hide(Activity activity) {<br>        if (activity == null || activity.isFinishing() || <br>            (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.JELLY_BEAN_MR1 &amp;&amp; activity.isDestroyed())) {<br>            return; // Prevent errors if activity is not valid<br>        }<br><br>        activity.runOnUiThread(() -&gt; {<br>            if (mSplashDialog != null &amp;&amp; mSplashDialog.isShowing()) {<br>                mSplashDialog.dismiss(); // Close the splash screen dialog<br>                mSplashDialog = null; // Clean up resources to avoid memory leaks<br>            }<br>        });<br>    }<br>}</pre><h4><strong>Step 3: Update </strong><strong>MainActivity.java to Use the Custom Splash Screen</strong></h4><p>Your final step is to replace the default SplashScreen.show(this) with CustomSplash.show(this) inside MainActivity.java.</p><p>Here’s how your <strong>onCreate()</strong> method should look:</p><pre>protected void onCreate(@Nullable Bundle savedInstanceState) {<br>  CustomSplash.show(this);<br>  this.getLifecycle().addObserver(new MendixActivityObserver(this));<br>  boolean hasDeveloperSupport = ((MainApplication) getApplication()).getUseDeveloperSupport();<br>  mendixApp = new MendixApp(AppUrl.getUrlFromResource(this), MxConfiguration.WarningsFilter.none, hasDeveloperSupport, false);<br>  super.onCreate(savedInstanceState);<br>}</pre><h3>Conclusion</h3><p>By following these steps, you have successfully <strong>customized the splash screen</strong> for your <strong>Mendix Native application</strong>. This enhances branding and improves user experience with a smooth animated splash screen.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c7607e9b196" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing SAML SSO Login in a Mendix Native Application]]></title>
            <link>https://adhityavarman.medium.com/implementing-saml-sso-login-in-a-mendix-native-application-e3e71eee7307?source=rss-12b249367763------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3e71eee7307</guid>
            <dc:creator><![CDATA[Adhityavarman]]></dc:creator>
            <pubDate>Mon, 23 Dec 2024 06:39:31 GMT</pubDate>
            <atom:updated>2024-12-23T10:17:05.575Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hq0pqgJ5RsGPEG4uSakJCQ.png" /></figure><p>Implementing SAML SSO in Mendix Native apps can often be complex. However, by leveraging the same web SSO configuration, you can efficiently achieve mobile SSO without the need for separate setups.</p><p>In this blog, I will share my approach to help other developers easily integrate SAML SSO into their Mendix Native apps.</p><h3><strong>Create an Application in Azure</strong></h3><p><strong>Step 1: </strong>After login to <a href="https://portal.azure.com/">Azure Portal</a>, navigate to <strong>Enterprise Applications</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*_UmUyVeJW_OGdZKhen1emg.png" /></figure><p><strong>Step 2: </strong>Select <strong>Create New Application</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*PckpHBk2zE2RKUvgqwEjuA.png" /></figure><p>Select <strong>Create Your Own Application, </strong>fill the app name and click on create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hd4-4OJ6_ls4YMEXbZpzug.png" /></figure><p><strong>Step 3: </strong>After creating the application, click on <strong>Setup Single-Sign-On</strong> and choose <strong>SAML.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ugYdkgEXMQb28huA7vdkg.png" /></figure><p>Edit the basic SAML configuration, Add the <strong>Identifier URL</strong> and <strong>Reply URL</strong> for your app. For example</p><ul><li><strong>Identifier URL:</strong> https://&lt;yourappname&gt;-sandbox.mxapps.io/</li><li><strong>Reply URL:</strong> https://&lt;yourappname&gt;-sandbox.mxapps.io/sso/</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjU6Jl-GQH_Pb784VxI85w.png" /></figure><p><strong>Step 4: </strong>After configuring the Identifier and Reply URL, scroll down to the <strong>SAML Certificates</strong> section and copy the <strong>App Federation Metadata URL</strong>.</p><p><strong>Step 5: </strong>Ensure that users are created in the <strong>Users and Groups</strong> section.</p><h3><strong>Mendix SAML Module Setup and Configuration</strong></h3><p>Download SAML module from the Mendix Marketplace, Then call the <strong>Startup Microflow</strong> from the SAML module (SAML.Startup) in the app’s <strong>After Startup</strong> setting and add a navigation item to access the <strong>SAMLConfigOverview</strong> page and the <strong>MX Module Reflection</strong> page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*Rq95LcBu3adXrbCrtHZ_Rg.png" /></figure><p>Run the application to configure the Service Provider (SP) and Identity Provider (IDP) setup. Follow the steps below for further configuration.</p><p><strong>Step 1 : </strong>Go to the <strong>SP Configuration</strong> tab and complete the following fields: Name, Organization URL , Display Name ,Developer Support details Click <strong>Save</strong> to apply the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*74LqBkhuzSNNhsE_ESM0Gg.png" /></figure><p><strong>Step 2 :</strong> Navigate to the <strong>IDP Configuration</strong> tab and add new IDp Configuration.</p><p><strong>Step 3 : </strong>Now in Identity Provider, fill the Alais Name and Paste the <strong>Metadata URL</strong> copied from the Azure portal earlier. Click next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*bdhN9Mv8toNsqq5-H2fbPA.png" /></figure><p><strong>Step 4 : </strong>Check the Allow IDP Initiated Authentication option on the next page and click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*vF_GCj9rQ7kXXcTXmW-e4w.png" /></figure><p><strong>Step 5 : </strong>Map the incoming details from the IDP to your system, then select the object and member name to store the details on the next page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*M-weUU1yDBEl5-hKuIoSkQ.png" /></figure><p><strong>Step 6 : </strong>In User provisioning section, enable <strong>Allow the module to create users </strong>and select a default role for new users, To allow the creation of new users.</p><p><strong>Step 7 : </strong>In <strong>Just in time provisioning, a</strong>dd claims for FullName and Email by filling <strong>Name </strong>with specified URL from Azure’s attribute claims, setting Name Format to String, and filling the Friendly Name field.<br>Map these to the respective Mendix attributes, skip the next two pages, and finish the setup.</p><p><strong>Step 8 :</strong> Finally, toggle the configured IDP to <strong>Yes</strong> to make it active.</p><h3>Implementing SSO on Mobile</h3><p>To implement SAML SSO in a Mendix Native mobile app, we can use a <strong>Web View</strong> widget to load the SSO login page and handle authentication. Here’s how you can set it up:</p><p><strong>Step 1: </strong>Create a native page for Single Sign-On (SSO) login. On this page, include a temporary data view to securely capture and store the login details from the integrated web view widget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*qfdeNxSSQkyCWBLT2bvUSw.png" /><figcaption>SSOLogin_Page</figcaption></figure><p>This approach ensures the SSO login page is displayed within the mobile app, enabling users to securely authenticate and login to the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*KOnSLN40R5HctS6Hsy8k4g.png" /><figcaption>Nanoflow — DS_SSOLogin</figcaption></figure><p><strong>Step 2: </strong>In the Callback tab, configure the followings</p><ul><li><strong>Message Attribute</strong>: Choose the attribute where the username from the web view will be stored. This ensures that the authentication data is properly captured and passed to the nanoflow for further processing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*FOnK4jstx4RQ1J4NxiLP6g.png" /><figcaption>Web View Widget — Callback</figcaption></figure><ul><li><strong>On Message</strong>: Set this action to call a nanoflow. The nanoflow should handle custom login activity by processing the username and password retrieved from the message attribute.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jOWegMhPu9YlT-IHmxrDGA.png" /><figcaption>Nanoflow — OCH_Login</figcaption></figure><p>After the user successfully login through SSO, the username will be retrieved from the landing page in the web application. The landing page should include the logic to send the username back to the mobile app.</p><p><strong>Step 3:</strong> In the web app, go to the landing page after successful SSO login. When using SAML SSO, the accounts are automatically created by the SAML module, so set a <strong>Before Commit Event Handler</strong> on the <strong>Account</strong> entity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DtohDZvQ-wO3UFDwFoOBGA.png" /><figcaption>Microflow — BCM_UpdatePasword</figcaption></figure><p>In this handler, update the password to a default value like ‘Mendix@123’ (or use your own password) for a the selected user role in the IDp configuration. This ensures all new accounts have a predefined password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*zLrEc39fv3cC-AIkX1s9Mw.png" /></figure><p>Use an data view to send a login details back to the mobile app by creating a DS_OnLoad nanoflow that includes a JavaScript function to send the login details back to the mobile app using bellow code.</p><pre>export async function SendResponse_JS(input) {<br> // BEGIN USER CODE<br>    try{<br>        if (window.ReactNativeWebView &amp;&amp; typeof window.ReactNativeWebView.postMessage === &quot;function&quot;) {<br>            window.ReactNativeWebView.postMessage(input);<br>            return true;<br>        } else {<br>            return false<br>        }<br>    } catch (e) {<br>        console.error(&quot;Error in BackToMobile JavaScript action:&quot;, e);<br>        return false<br>    }<br> // END USER CODE<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*H_4EECUAzQ-m4gmQtVoxXw.png" /><figcaption>Nanoflow — DS_OnLoad</figcaption></figure><p>Since this JavaScript is designed to work exclusively within the web view, the message will only be passed if it is rendered within the web view environment.</p><p>For more details on how to implement and customize the <strong>WebView</strong> widget in Mendix, check out my <a href="https://medium.com/@adhityavarman218/mendix-native-web-view-f94b983fb648">detailed guide on the WebView widget here</a>.</p><p>When the mobile app initiates the SSO process, the WebView renders the login page. After a successful login, the web landing page sends a message back to the app, triggering custom login logic using the data stored in the selected attribute.</p><h3>Summary</h3><p>By following these steps, you can implement a SAML SSO experience in your Mendix Native apps using a WebView. This approach leverages the same SSO configuration as the web application, simplifying the process and eliminating the need for separate setups for mobile.</p><p><a href="https://medium.com/u/ba482148ea26">Mendix</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3e71eee7307" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use web view widget in Mendix]]></title>
            <link>https://adhityavarman.medium.com/mendix-native-web-view-f94b983fb648?source=rss-12b249367763------2</link>
            <guid isPermaLink="false">https://medium.com/p/f94b983fb648</guid>
            <dc:creator><![CDATA[Adhityavarman]]></dc:creator>
            <pubDate>Sun, 22 Dec 2024 08:58:30 GMT</pubDate>
            <atom:updated>2024-12-22T17:13:22.667Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vuTppEgmfnVXvO_MS9pfqg.png" /></figure><p>The Mendix Native <strong>Web View</strong> widget allows you to embed web pages or HTML content within your native mobile app. It seamlessly integrates web features with the native experience and interactions. This widget is perfect for adding external services or custom features without losing the native app feel.</p><p>In this blog, I will share my experience using the Mendix Native Web View widget, its key features, and how it helped me integrate web content seamlessly into native apps.</p><h3>Data source Tab</h3><p>In the Data Source tab, the widget provides two input fields: one for rendering a URL and another for rendering HTML content. Both inputs use Mendix expressions, allowing developers to test the widget with both static and dynamic inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*ES2DKFJYj1mF2UywTr4BVA.png" /></figure><p>This flexibility helps in testing and adjusting the widget’s behavior with different content sources.</p><h3><strong>Events Tab</strong></h3><p>In the Event tab, the widget offers two Mendix custom actions to control the web view’s behavior. These actions allow developers to handle events such as loading a URL or interacting with the embedded content, providing more control and flexibility over the web view’s functionality.</p><p><strong>On load:</strong> it will be called when the WebView successfully loads the content (either from a URL or HTML).<br><strong>On error:</strong> it will be called when the WebView fails to load the content (due to errors like network issues or invalid URLs).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*m7mkWqH37kWMHRgY8lK6WQ.png" /></figure><h3>Callback Tab</h3><p>In the Callback section, the widget provides two key features:</p><ol><li><strong>On message — </strong>This function is called whenever a message is sent from the WebView content (HTML/JavaScript) to the React Native app using <br>window.ReactNativeWebView.postMessage([string]), allows only string.</li><li><strong>Message attribute</strong> — This stores the incoming message from the web, allowing you to use the data in your app’s logic.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*6jCn2CiZgAhvwWUn5E0lew.png" /></figure><p>These features enable seamless communication between the web and native app, allowing for dynamic interactions.</p><h3><strong>Advanced Tab</strong></h3><p>In the Advanced tab, the widget provides <strong>User agent </strong>and <strong>Open links externally</strong></p><ol><li><strong>User agent: </strong>This can be used to simulate different browsers or devices, ensuring content is served appropriately for the platform.</li><li><strong>Open links externally : </strong>Controls whether links inside the WebView open inside the WebView or in the system’s external browser.<br>If <strong>true</strong>, external links are opened in the default browser. If <strong>fasle</strong>, links open within the WebView itself</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*q1ffne3SOuKUn7pDo9ye_g.png" /></figure><h3>Summary</h3><p>In this blog, we’ve explored the key features of the Mendix Native Web View widget. From the <strong>Data Source Tab</strong>, where you can dynamically test URLs and HTML content, to the <strong>Event Tab</strong> offering custom actions for better control of the web view’s behavior. The <strong>Callback Section</strong> further enhances this by enabling seamless communication between the web and native app through the On Message function and attributes that store incoming data.</p><p><a href="https://medium.com/u/ba482148ea26">Mendix</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f94b983fb648" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Deep Linking in Mendix Native Application]]></title>
            <link>https://adhityavarman.medium.com/mendix-native-deep-link-a0e13be4b288?source=rss-12b249367763------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0e13be4b288</guid>
            <dc:creator><![CDATA[Adhityavarman]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 09:18:58 GMT</pubDate>
            <atom:updated>2024-12-22T15:40:35.883Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jc6zyWZ4TlRbvCj7wTgf1w.png" /></figure><p>In this blog, I’m going to show you how to implement and effectively use <strong>Mendix Native Deep Link</strong> in your Native applications. Deep linking is an essential feature that allows users to navigate directly to specific screens or features in your app.</p><p>In this guide, I will walk you through setting up the Mendix Native Deep Link and handling various use cases, including navigation with and without parameters and implementing deep linking in authenticated apps.</p><h3><strong>About Deep link:</strong></h3><p>A deeplink in the context of a native app refers to a URL scheme that allows one app to directly open another app or navigate to a specific screen within the same app. It is a powerful way to create a seamless user experience by linking deep into the app’s specific functionality or pages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHwbfHNGOcPWB2McaZkDkg.png" /></figure><h3><strong>Setting Up Deep Linking in a Mendix Native App</strong></h3><p>To implement <strong>Mendix Native Deep Link</strong>, the first step is to set up a blank native app in Mendix and enable the deep linking capability. Here’s how you can do it step by step:</p><ol><li><strong>Prepare Your App for Building: </strong>After completing the initial setup and requirements, go to <strong>App → Build Native Mobile App</strong> in the Mendix studio pro.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*sKIIMu63Yd3WrH_VD4c31Q.png" /></figure><p><strong>2. Set Necessary App Details : </strong>Fill in the required details for your app, such as the app name, bundle identifier, and versioning information.</p><p><strong>3. Enable Deep Link Capability: </strong>Navigate to the <strong>App Capabilities</strong> tab. Enable <strong>Deep Link</strong> and In the text box provided under the deep link option, set the <strong>App Scheme Name</strong> (e.g., myapp). This is the unique identifier for your app’s deep link structure.</p><p><strong>4. Save and Build the Template : </strong>After configuring the deep link capability and other necessary settings, save the changes. Proceed to build the app template with proper configuration to ensure everything is ready for testing and deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXVp_JHJwa9B7qIx7BBJ4A.png" /></figure><h3><strong>Configuring Deep Link in Android Studio</strong></h3><p>After setting up deep linking in Mendix and enabling it in the <strong>App Capabilities</strong> tab, the next step is to configure your app in <strong>Android Studio</strong>. This will allow your app to handle deep links and receive parameters from the calling app.</p><p>1. In Android Studio, go to the AndroidManifest.xml file, which is located in the <strong><em>app/src/main/</em></strong> directory of your project.</p><p>2. Look for the<strong> &lt;intent-filter&gt;</strong> element inside the <strong>&lt;activity&gt;</strong> tag that is responsible for handling deep links.</p><p>3. Update the <strong>&lt;data&gt;</strong> element to enable your app to accept custom parameters. Modify the line to <strong><em>&lt;data android:scheme=”myapp” android:host=”login” /&gt;</em></strong></p><p>4. Here, the <strong>android:scheme</strong> is your app’s scheme name and <strong>android:host</strong> can be used to define a custom parameter(Login). This allows your app to receive the custom parameter, for instance,<br><strong>with parameter:<em> myapp://login?user=parmetervalue</em></strong><br><strong>without parameter:</strong> <strong><em>myapp://</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uymzrjTL-bvyxLJf0DETOw.png" /></figure><p>After making these changes, sync the module to apply the updates to your app. Now, build your APK in Android Studio by going to <strong>Build &gt; Build APK</strong> or <strong>Build &gt; Generate Signed APK</strong>. This will generate the APK file with the deep link configuration.</p><h3><strong>How to Test Deep Linking in Mendix</strong></h3><p>Testing deep linking is a critical step to ensure your app behaves as expected when launched through a deep link URL.</p><p>To test your deep link functionality, we need a <strong>helper app</strong> that can send the deep link URL and launch the signed app. This helper app will have a button or action that triggers a nanoflow to open the target app via Java Script with deep link URL.</p><p>To handle parameters passed via the deep link when the signed app is opened, you need to implement JavaScript in your <strong>Signed app</strong> to read these parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*IRDrMs8iz_jfC24-d61CZg.png" /></figure><p>In your Signed app, create a JavaScript action that runs when the app starts(App event on load), Will share the sample code at the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*vlauTQA4vuo1Oyi6f2pUXA.png" /></figure><h3>Best Practices for Deep Linking in Mendix Native Apps</h3><p>When implementing deep linking in Mendix, it’s crucial to follow best practices to ensure the security and integrity of your app, especially when dealing with sensitive data such as login credentials or personal information. Here’s a simple yet important practice to follow:</p><p><strong>Secure Sensitive Data: </strong>If you are passing sensitive data, such as login credentials or personal information, via deep links, it is essential to <strong>encrypt</strong> this data before sending it and <strong>decrypt</strong> it once received by the app. This prevents data leakage and ensures that sensitive information remains secure during transit.</p><p><strong>Encryption and Decryption : </strong>Use strong encryption algorithms (e.g., AES) to encrypt sensitive data before embedding it into the deep link URL. Once the app receives the deep link with the encrypted data, decrypt it on the server side to process it securely.</p><h3>Summary</h3><p>When using deep links in your Mendix native app, always ensure that sensitive information is <strong>encrypted</strong> and <strong>decrypted</strong> properly to prevent potential data leakage. Implementing this practice will help you secure user data and maintain the integrity of your app’s security.</p><h3><strong>Sample JavaScript Code for Open App and Read Parameters</strong></h3><p><strong>1. JavaScript to Open Deep Link URL:<br></strong>This JavaScript code is used in your helper app (or another app) to trigger a deep link and open the target app.</p><pre>import { Linking, Alert } from &#39;react-native&#39;;<br>export async function OpenApp_JS(deepLink, playStoreURL) {<br> try {<br>  const supported = await Linking.canOpenURL(deepLink);<br>  if (supported) {<br>   await Linking.openURL(deepLink);<br>  } <br>  else {<br>   const canOpenPlayStore = await Linking.canOpenURL(playStoreURL);<br>   if (canOpenPlayStore) {<br>    await Linking.openURL(playStoreURL);<br>   } <br>   else {<br>    Alert.alert(&#39;App not available&#39;,&#39;The app is not installed and the Play Store cannot be opened.&#39;);<br>   }<br>  }<br> } catch (error) {<br>  console.error(&#39;Error opening the app:&#39;, error);<br>  Alert.alert(&#39;Error&#39;, &#39;An error occurred while trying to open the app or Play Store.&#39;);<br> }<br>}<br>}</pre><p><strong>2. JavaScript to Read Deep Link Parameters in App:<br></strong>This JavaScript should be used in your Native app’s On-Load event to read parameters from the deep link when the app starts.</p><pre>import { Linking } from &#39;react-native&#39;;<br>export async function getDeepLinkToken() {<br>  try {<br>    const url = await Linking.getInitialURL();<br>    if (!url) {<br>      console.log(&quot;No URL found&quot;);<br>      return &quot;No URL found&quot;;<br>    }<br>    console.log(&quot;Received URL:&quot;, url);<br>    const queryParams = {};<br>    const [path, query] = url.split(&quot;?&quot;);<br>    if (query) {<br>      query.split(&quot;&amp;&quot;).forEach((param) =&gt; {<br>        const [key, value] = param.split(&quot;=&quot;);<br>        queryParams[key] = decodeURIComponent(value);<br>      });<br>    }<br>    return queryParams.username;<br>  }catch (error) {<br>     console.error(&quot;Error processing deep link:&quot;, error);<br>     throw new Error(&quot;Error processing deep link&quot;);<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0e13be4b288" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>