<?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 Mark Saif on Medium]]></title>
        <description><![CDATA[Stories by Mark Saif on Medium]]></description>
        <link>https://medium.com/@markseif?source=rss-782fa918372b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LDu4at6IvFZI9uxg_apM3g.jpeg</url>
            <title>Stories by Mark Saif on Medium</title>
            <link>https://medium.com/@markseif?source=rss-782fa918372b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 27 Jun 2026 07:01:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@markseif/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[What the hell is Android Bench?]]></title>
            <link>https://markseif.medium.com/what-the-hell-is-android-bench-57aa3beab938?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/57aa3beab938</guid>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Sat, 07 Mar 2026 02:01:29 GMT</pubDate>
            <atom:updated>2026-03-07T02:01:29.099Z</atom:updated>
            <content:encoded><![CDATA[<p>You might have seen that <a href="http://www.google.com"><strong>Google</strong></a> recently launched something called <a href="https://developer.android.com/bench/"><strong>Android Bench</strong></a>. At first, I thought it was just another tool for testing the quality of Android apps. But it turns out it’s something completely different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2v5N7V6F7wvO7ywLca6wJQ.png" /><figcaption>Android Bench</figcaption></figure><p>Google wants developers to build Android apps faster while making sure quality isn’t sacrificed for speed. In the current <strong>AI era</strong>, where thousands of AI models claim to be the best for coding, it’s actually difficult to know which ones truly perform well for Android development.</p><p>That’s where <a href="https://developer.android.com/bench/"><strong>Android Bench</strong></a> comes in.</p><p>Android Bench is a <strong>benchmarking framework</strong> that evaluates an AI model’s ability to:</p><ul><li>Understand mobile codebases</li><li>Generate accurate patches</li><li>Solve Android-specific engineering problems</li></ul><p>The benchmark includes challenges that replicate real problems developers face during everyday development. It consists of <strong>100 tasks selected from a pool of 38,989 pull requests</strong>, which makes the evaluation much closer to real-world scenarios.</p><p>This is actually a smart approach for both companies and developers. It helps them decide <strong>which AI model is worth investing in</strong>, ensuring a higher return on investment (ROI).</p><p><a href="https://www.linkedin.com/in/wbars/"><strong><em>Kirill Smelov</em></strong></a>, Head of AI Integrations at <a href="http://www.jetbrains.com"><strong>JetBrains</strong></a>, also commented on this:</p><blockquote><em>“Measuring AI’s impact on Android is a massive challenge, so it’s great to see a framework that’s this sound and realistic. While we’re active in benchmarking ourselves, Android Bench is a unique and welcome addition. This methodology is exactly the kind of rigorous evaluation Android developers need right now.”</em></blockquote><blockquote><strong>Kirill Smelov</strong></blockquote><h3>First Android Bench Results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugRi-iyWbrOORkwO4W_K4w.png" /><figcaption>First Android Bench Results</figcaption></figure><p>The first results clearly show which models currently perform best. According to the benchmark:</p><ol><li><strong>Gemini 3.1 Pro Preview</strong> ranks first</li><li><strong>Claude</strong> comes second</li><li><strong>GPT‑5.2</strong> follows in third place</li></ol><p>These benchmarks could become very useful for developers trying to decide <strong>which AI model to use in their workflow</strong>.</p><p>Personally, I believe <strong>Android Bench will play an important role in helping teams choose the right AI tools for Android development.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57aa3beab938" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do you know that you can change language only for your app?]]></title>
            <link>https://markseif.medium.com/do-you-know-that-you-can-change-language-only-for-your-app-7bad5d814408?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bad5d814408</guid>
            <category><![CDATA[androi̇d]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Sat, 03 May 2025 10:10:45 GMT</pubDate>
            <atom:updated>2025-05-03T10:10:45.815Z</atom:updated>
            <content:encoded><![CDATA[<p>Since Android 13, Google has provided a new way to handle the locale for your app. Most of the time, the user can change his mobile language, and by default, it changes your app language. But now you can set a list of languages that your app supports, and the user can choose between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*IncCwUJeeFyPngKDe2_Itg.png" /></figure><p>Let&#39;s start to enable automatic per-app language support</p><p>1-Make sure that the generateLocaleConfig is true as it is false by default</p><p>by adding this in your build.gradle.kts.</p><pre>android {<br>      androidResources {<br>        generateLocaleConfig = true<br>      }<br>    }</pre><p>2-Create new file and name it resources.properties and add it inside your res package</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zf-jDhUExWmW8XRf_iSyLw.png" /></figure><p>2-here we will declare our app supported language Create a file called res/xml/locales_config.xml</p><p>and add your supported languages inside it</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;locale-config xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;<br>   &lt;locale android:name=&quot;en-US&quot;/&gt;<br>   &lt;locale android:name=&quot;en-GB&quot;/&gt;<br>   &lt;locale android:name=&quot;fr&quot;/&gt;<br>   &lt;locale android:name=&quot;ja&quot;/&gt;<br>   &lt;locale android:name=&quot;zh-Hans-MO&quot;/&gt;<br>   &lt;locale android:name=&quot;zh-Hant-MO&quot;/&gt;<br>&lt;/locale-config&gt;</pre><p>then inside your manifest file make sure that you have pointed to this file.</p><pre>&lt;manifest&gt;<br>    ...<br>    &lt;application<br>        ...<br>        android:localeConfig=&quot;@xml/locales_config&quot;&gt;<br>    &lt;/application&gt;<br>&lt;/manifest&gt;</pre><p>Congrats now the user will find the language you supports inside your application settings.</p><p>Next Article it will be about how to create lanugae picker with latest updates.</p><p>You can follow me on <a href="https://x.com/markseiftech?ref=selfso">X </a>also <a href="https://github.com/markoeltiger?ref=selfso">Github </a>and <a href="https://www.linkedin.com/in/mark-sief-b1383b179/?ref=selfso">Linkedin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bad5d814408" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns in Android Development: A Developer’s Guide]]></title>
            <link>https://markseif.medium.com/design-patterns-in-android-development-a-developers-guide-112c35018331?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/112c35018331</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Fri, 14 Mar 2025 04:12:59 GMT</pubDate>
            <atom:updated>2025-03-14T04:12:59.321Z</atom:updated>
            <content:encoded><![CDATA[<h3>andDesign Patterns in Android Development: A Developer’s Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h_LLZ6EPiyZmXEIPadQ_pw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h_LLZ6EPiyZmXEIPadQ_pw.png" /></figure><p>If you’ve been working with Android development for a while, you’ve probably heard the term <strong>design patterns</strong> being thrown around. They might sound like something complex, but in reality, they’re just tried-and-tested solutions to common coding problems. Think of them as blueprints for writing cleaner, more maintainable, and scalable code.</p><p>In this article, we’ll break down some of the most useful design patterns in Android development, why they matter, and how you can apply them in real-world projects.</p><h3>1. Singleton Pattern — The One and Only</h3><p>Imagine you have a database instance, a network client, or a shared preferences manager in your app. You don’t want multiple instances of these floating around, eating up memory and causing inconsistencies. That’s where the <strong>Singleton Pattern</strong> comes in.</p><h3>How It Works:</h3><p>It ensures that only <strong>one instance</strong> of a class exists and provides a global access point to it.</p><h3>Implementation:</h3><pre>object DatabaseHelper {<br>    fun getConnection(): String {<br>        return &quot;Database Connected&quot;<br>    }<br>}</pre><p>Here, DatabaseHelper is a singleton, meaning the same instance will be used throughout the app. Simple, yet powerful!</p><h3>2. Factory Pattern — Smart Object Creation</h3><p>Sometimes, creating objects the usual way (new keyword or constructor) isn’t flexible enough. The <strong>Factory Pattern</strong> lets you create objects without specifying the exact class type beforehand.</p><h3>Example:</h3><p>Let’s say you need different types of buttons in your app.</p><pre>sealed class Button {<br>    class PrimaryButton : Button()<br>    class SecondaryButton : Button()<br>}</pre><pre>object ButtonFactory {<br>    fun createButton(type: String): Button {<br>        return when (type) {<br>            &quot;primary&quot; -&gt; Button.PrimaryButton()<br>            &quot;secondary&quot; -&gt; Button.SecondaryButton()<br>            else -&gt; throw IllegalArgumentException(&quot;Unknown button type&quot;)<br>        }<br>    }<br>}</pre><p>Now, you can create buttons dynamically without worrying about their exact type!</p><h3>3. Observer Pattern — Keeping Things in Sync</h3><p>Ever used LiveData or Flow in Jetpack Compose? If so, congratulations — you’ve already used the <strong>Observer Pattern</strong>!</p><h3>Why It’s Useful:</h3><p>It helps in situations where one object (the <strong>observable</strong>) needs to notify multiple objects (the <strong>observers</strong>) when something changes. This is great for UI updates, data binding, and event-driven programming.</p><h3>Example:</h3><pre>val liveData = MutableLiveData&lt;String&gt;()</pre><pre>liveData.observe(viewLifecycleOwner) { updatedText -&gt;<br>    textView.text = updatedText<br>}</pre><p>Whenever liveData changes, the observer (in this case, the UI) gets notified and updates accordingly.</p><h3>4. Dependency Injection (DI) — Keeping It Loose</h3><p>Manually creating dependencies in every class can lead to tight coupling. DI solves this by <strong>injecting dependencies</strong> rather than creating them manually.</p><h3>Example with Hilt (Google’s DI Framework):</h3><pre>@InstallIn(SingletonComponent::class)<br>@Module<br>class AppModule {<br>    @Provides<br>    fun provideRetrofit(): Retrofit {<br>        return Retrofit.Builder()<br>            .baseUrl(&quot;https://api.example.com&quot;)<br>            .build()<br>    }<br>}</pre><p>Now, anytime you need a Retrofit instance, you just ask Hilt to inject it—no need to instantiate it manually!</p><h3>Wrapping Up</h3><p>Design patterns in Android aren’t just fancy concepts; they solve real-world problems and make your code <strong>cleaner, scalable, and maintainable</strong>. By mastering these patterns, you’ll write better code, debug faster, and build more efficient apps.</p><p>So next time you’re coding, take a moment to ask: <strong>Can I apply a design pattern here?</strong> Chances are, the answer is <strong>yes</strong>!</p><p>Happy coding! 🚀</p><p>You can follow me on <a href="https://x.com/markseiftech">X</a> , <a href="https://www.linkedin.com/in/mark-sief-b1383b179/">LinkedIn</a> and <a href="http://github.com/markoeltiger">Github </a>for more like Articles !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=112c35018331" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Detekt?  Enhancing Code Quality in Kotlin Development]]></title>
            <link>https://markseif.medium.com/why-detekt-enhancing-code-quality-in-kotlin-development-97c4618ad314?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/97c4618ad314</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Sat, 08 Mar 2025 01:15:09 GMT</pubDate>
            <atom:updated>2025-03-08T01:23:20.673Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Detekt is a static code analysis tool for Kotlin" src="https://cdn-images-1.medium.com/max/1024/1*jR3Z3DXkq2teoNdyCVU50g.png" /></figure><h3>Introduction 📝</h3><p>As a <strong>contributor to </strong><a href="https://github.com/detekt/detekt"><strong>Detekt</strong></a>, I have firsthand experience with how this tool helps improve Kotlin code quality. In modern software development, maintaining high code quality is essential for building scalable and maintainable applications. <strong>Static code analysis</strong> tools help developers detect issues early in the development process, reducing technical debt and improving overall efficiency. For <strong>Kotlin developers</strong>, <strong>Detekt</strong> is a powerful tool designed specifically to analyze and enforce best practices in Kotlin codebases.</p><h3>What is Detekt? 🔍</h3><p><strong>Detekt</strong> is a <strong>static code analysis tool for Kotlin</strong> that helps developers identify <strong>code smells</strong>, enforce <strong>coding standards</strong>, and automate <strong>code reviews</strong>. It provides comprehensive reports highlighting potential issues such as <strong>complex functions, long parameter lists, unused imports, and redundant code</strong>. Compared to other tools like <strong>Android Lint</strong> and <strong>SonarQube</strong>, <strong>Detekt</strong> is specifically optimized for <strong>Kotlin</strong> and offers extensive customization options.</p><h3>Why Use Detekt? ✅</h3><p>Using <strong>Detekt for Kotlin static analysis</strong> brings several advantages:</p><ul><li><strong>🛑 Detect Code Smells</strong> — Identifies problematic areas like long methods, high cyclomatic complexity, and unused code.</li><li><strong>📏 Ensures Coding Standards</strong> — Helps maintain consistency across a codebase by enforcing <strong>Kotlin best practices</strong>.</li><li><strong>🤖 Automates Code Reviews</strong> — Acts as an <strong>automated code reviewer</strong>, flagging issues before code is merged.</li><li><strong>🔄 Integrates with CI/CD Pipelines</strong> — Works seamlessly with tools like <strong>GitHub Actions, Jenkins, and GitLab CI/CD</strong> to maintain code quality across deployments.</li><li><strong>⚙️ Customizable Rule Set</strong> — Developers can <strong>customize Detekt rules</strong> to fit their project’s needs, enabling flexibility in enforcing standards.</li></ul><h3>How to Set Up Detekt in a Kotlin Project 🛠️</h3><p>Adding <strong>Detekt to a Kotlin project</strong> is straightforward. Follow these steps:</p><ol><li><strong>📌 Add Detekt to Gradle</strong></li></ol><pre>plugins {id(&quot;io.gitlab.arturbosch.detekt&quot;) version &quot;1.23.0&quot; }</pre><p><strong>2. 🚀 Run Detekt Analysis</strong> Execute the following command to analyze your project:</p><pre>./gradlew detekt</pre><p><strong>3. 📊 Review the Generated Report</strong> Detekt generates an <strong>HTML or XML report</strong> detailing the issues found in the code.</p><h3>Customizing Detekt Rules 🎯</h3><p>Detekt allows <strong>customizing rules</strong> to match project-specific requirements:</p><ol><li><strong>🛠️ Generate a Default Configuration File</strong></li></ol><pre>./gradlew detektGenerateConfig</pre><p><strong>2. ⚙️ Modify </strong><strong>detekt.yml to Adjust Rules</strong></p><ul><li><strong>❌ Disable unwanted rules</strong></li><li><strong>📏 Adjust thresholds</strong> for complexity metrics</li><li><strong>🔍 Enable additional checks</strong> for stricter validation</li></ul><p>Example:</p><pre>complex-methods:<br>  active: true<br>  threshold: 15</pre><h3>Conclusion 🎉</h3><p>Stay tuned for <strong>Part Two</strong>, where I will provide a hands-on example of using Detekt in a Kotlin project! <strong>Detekt for Kotlin</strong> is an essential tool for developers aiming to improve <strong>code quality</strong>, enforce <strong>best practices</strong>, and automate <strong>static analysis</strong>. By integrating <strong>Detekt</strong> into your <strong>Kotlin development workflow</strong>, you can <strong>reduce technical debt, enhance maintainability, and ensure high standards</strong> in your Kotlin projects. Start using <strong>Detekt today</strong> to make your <strong>Kotlin code cleaner and more efficient</strong>! 🚀</p><p>Follow on <a href="https://github.com/markoeltiger">github </a>and <a href="https://www.linkedin.com/in/mark-sief-b1383b179/">LinkedIn </a>for more !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97c4618ad314" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[روم — Room Database]]></title>
            <link>https://markseif.medium.com/%D8%B1%D9%88%D9%85-room-database-df07b49d470f?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/df07b49d470f</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Thu, 30 Jan 2025 07:58:58 GMT</pubDate>
            <atom:updated>2025-01-30T07:58:58.883Z</atom:updated>
            <content:encoded><![CDATA[<h3>روم — Room Database</h3><h3>واحدة من المكتبات المهمة جداً ليك كمبرمج نيتف هي روم — Room Database</h3><p>وهي المسؤلة عن storage عندك في الابب</p><h3>أمتي تستخدمها</h3><p>لما تكون محتاج تحفظ داتا كتيرة وكبيرة عندك في الابليكشن علي عكس ال Sharedprefrences</p><p>تستخدمها فقط لما تعوز تحفظ معلومات او بيانات اساسية ورئيسية</p><p>او تحديداً (“تفضيلات المستخدم”) سواء هو بيحب اللايت مود ولا الدارك مود طب هو بيحب انهي لغة اكتر الحاجات دي بنستخدم معاها شيرد بريفرنسز ولكن لو هحفظ مثلاً list&lt;items&gt;يبقا انا كدا هستخدم روم</p><p>روم تعتبر الحد الفاصل بينك وبين sqllite database وبتسهل عليك الموضوع جداً</p><h3>عشان تطبقها او تستخدمها لازم يكون عندك 3 مكونات رئيسية</h3><p>1-Entity : ودي بتبقا المودل كلاس الي بنعملوه زي الداتا الي جايلنا زي مثلاً</p><p>وبنعلن عنه بأنوتشن فوق الكلاس بيكتب كدا <a href="https://web.facebook.com/entitymag/?__tn__=kK*F">Entity</a>@ بيبقا مكان table database</p><p>2-DAO ودا بيبقا انترفيس فيه الميثودز الي بيتم استخدامها زي مثلاًة انك تضيف اوبجيكت او تمسح او تختار عناصر معينة من ال entity بتاعتك</p><p>3-Database class ودا الكلاس الي بيأكسس ال entities عن طريق ال DAO</p><p>الرسمة الي تحت بتشرح الروم شغالة ازاي ولو ركزت شوية هتلاقي ان تطبيق الروم شبه تطبيق الريتروفيت</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1H8PYK__IZ7bElWFAim3sQ.jpeg" /></figure><p>يتبع لو عجب الناس</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df07b49d470f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is “exported=true” in Android Manifest ?]]></title>
            <link>https://markseif.medium.com/what-is-exported-true-in-android-manifest-6280113a47ce?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6280113a47ce</guid>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 09:13:25 GMT</pubDate>
            <atom:updated>2024-10-03T06:17:17.734Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is “exported=true” in Android Manifest ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqXdIgXuAK0mVhyyfeBOAQ.png" /><figcaption>Android Security</figcaption></figure><p>For me, it is the most dangerous line of code on any project codebase,</p><p>I will tell you why you are literally by setting exported = true you are giving a backdoor to any hacker to reverse engineer your app it actually can access any activity with this flag = true so let`s get started and learn what it mean.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*PZLPS-m1_iGNudZPyfhewA.gif" /><figcaption>Lets get started</figcaption></figure><p>You of course know that Android has main 4 components :</p><ul><li>Activities</li><li>Services</li><li><strong>Broadcast receivers</strong></li><li>Content providers</li></ul><p>This time we will focus on Broadcast receivers in nutshell it is if any other app or the system want to talk to your project you need to use broadcast receivers and to enable receiving these events you should set the exported flag with true .</p><p>So when any hacker decompile your apk he will sea the Manifest then he can know which activity is used for this component.</p><p>Then He can open any activity directly with out the need to process the normal flow of the app so let`s check some code.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;&gt;<br><br>    &lt;uses-feature<br>        android:name=&quot;android.hardware.camera&quot;<br>        android:required=&quot;false&quot; /&gt;<br><br>    &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.POST_NOTIFICATIONS&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.CAMERA&quot; /&gt;<br><br>    &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;<br><br>    &lt;application<br>        android:name=&quot;.core.BankingApp&quot;<br>        android:allowBackup=&quot;true&quot;<br>        android:dataExtractionRules=&quot;@xml/data_extraction_rules&quot;<br>        android:fullBackupContent=&quot;@xml/backup_rules&quot;<br>        android:icon=&quot;@mipmap/ic_launcher&quot;<br>        android:label=&quot;@string/app_name&quot;<br>        android:supportsRtl=&quot;true&quot;<br>        android:theme=&quot;@style/Theme.App.Starting&quot;<br>        tools:targetApi=&quot;31&quot;&gt;<br>        &lt;!-- With singleTop avoid reopening from notification --&gt;<br>        &lt;activity<br>            android:name=&quot;.PinActivity&quot;<br>            android:exported=&quot;false&quot;<br>            android:launchMode=&quot;singleTop&quot;&gt;<br>            &lt;intent-filter&gt;<br>                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;<br>                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;<br>            &lt;/intent-filter&gt;<br>        &lt;/activity&gt;<br>      &lt;activity<br>            android:name=&quot;.LoginActivity&quot;<br>            android:exported=&quot;false&quot;<br>            android:launchMode=&quot;singleTop&quot;&gt;<br>           <br>        &lt;/activity&gt;<br>        &lt;activity<br>            android:name=&quot;.TransferActivity&quot;<br>            android:exported=&quot;true&quot;<br>            android:launchMode=&quot;singleTop&quot;&gt;<br>       <br>        &lt;/activity&gt;<br>        <br>        &lt;!--  Allow Koin to init WorkManager itself--&gt;<br>        &lt;provider<br>            android:name=&quot;androidx.startup.InitializationProvider&quot;<br>            android:authorities=&quot;${applicationId}.androidx-startup&quot;<br>            android:exported=&quot;false&quot;<br>            tools:node=&quot;merge&quot;&gt;<br>            &lt;meta-data<br>                android:name=&quot;androidx.work.WorkManagerInitializer&quot;<br>                android:value=&quot;androidx.startup&quot;<br>                tools:node=&quot;remove&quot; /&gt;<br>        &lt;/provider&gt;<br>    &lt;/application&gt;<br><br>&lt;/manifest&gt;</pre><p>This Manifest file is for a banking project that has 3 activities first two are log in, Pin Activities (Authorization security related) and they are fine exported = false, the third one is money transfer activity which is exported = true for some reason</p><p>In the normal flow, the user will log in Enter the pin then do his money transfer securely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*fVmCanPdidBQM-r7-bcnGA.png" /><figcaption>Normal flow</figcaption></figure><p>But the hacker can directly open the transfer activity and miss out on it passing values and wrong data and that`s not what we want.</p><p>Anyone can do that by passing this command</p><p><strong>am start -n com.android.banking/.</strong>TransferActivity</p><p>It will open the transfer activity directly</p><h3>How to protect yourself from this vulnerability?</h3><p>Per documentation :-</p><h3>Use calls and callbacks</h3><p>In the case you used broadcast receivers for internal app purposes (ie. event completion notification), you can restructure your code to pass a callback that would fire after event completion instead.</p><ul><li>Just set “<em>android:exported=false</em>” unless you really want your activity to be exported just make sure to limit which apps can access it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqXdIgXuAK0mVhyyfeBOAQ.png" /></figure><p>Thanks for reaching here for more articles like that please follow me</p><p><a href="https://www.linkedin.com/in/mark-sief-b1383b179/">Linkedin </a>, <a href="https://github.com/markoeltiger">Github </a>and <a href="https://medium.com/@markoeltiger8">Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6280113a47ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Deploy Any Project From GitHub to Cpanel (FTP) - Laravel PHP Project]]></title>
            <link>https://blog.devops.dev/how-to-deploy-any-project-from-github-to-cpanel-ftp-laravel-php-project-f29bac33f134?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f29bac33f134</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Sat, 16 Mar 2024 04:23:08 GMT</pubDate>
            <atom:updated>2024-03-19T08:56:16.299Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello People,</p><p>In this article, I will share with you my way to auto-deploy my client&#39;s websites from GitHub to Cpanel.</p><p>One of the most important practices in the software world is called “CI-CD”</p><p>which stands for <strong>continuous integration and continuous delivery</strong>/deployment, it speeds up delivery time also development time .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0AIVjXhy-9J8FLGn6P-ATw.png" /><figcaption>Deploy Any Project From GitHub to Cpanel</figcaption></figure><p>let&#39;s go to the important part ,</p><h3>We will upload PHP (Laravel) website directly to the server through ftp account.</h3><p>First : We need to create FTP account on our Cpanel , Open the cpanel then go to FTP accounts then add username , choose the domain and add the password (and make sure there is no special characters and I will tell you why later😂)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*pIBKp9D7VjoiH8DBUk9Pvg.png" /><figcaption>FTP Accounts</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QUi8afwSMcx6giqJTDdrg.png" /><figcaption>FTP Host , Port</figcaption></figure><p>Second : Go to your github repo and then go to Actions sections and choose set up a workflow yourself .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*IQIyL8YN60n9E7RNidQ-EQ.jpeg" /><figcaption>Set up your own workflow</figcaption></figure><p>Now we will start writing our own workflow on a YML file which a language to write <strong>human-readable data serialization language</strong> that is often used for writing configuration files.</p><p>we will write this <a href="https://gist.github.com/markoeltiger/6af73eb5469c8249780612d837fac0b1">insturctions</a> you will find it on this gist on github</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b24bf6b91034a9d15aeba5a10ae1524d/href">https://medium.com/media/b24bf6b91034a9d15aeba5a10ae1524d/href</a></iframe><p>these instructions contains three main parts</p><p>First Part : which is about when to do the deployment (Every Push) ,</p><p>and what branch to get the code from and we choosed (master)</p><p>Second part : to checkout the repo to git the latest updates.</p><p>Third part : to sync the code via ftp account .</p><p>now commit then wait until the workflow finishes loading .</p><p>Congratsssss 💃 🚀 with every push your server will be updated with the latest code base.</p><p>I hope you liked the article and it helped you .</p><p>you can follow me on <a href="https://github.com/markoeltiger">github </a>, <a href="https://www.linkedin.com/in/mark-sief-b1383b179/">linked in</a> , twitter and <a href="http://marksaif.online/">visit my website</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f29bac33f134" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/how-to-deploy-any-project-from-github-to-cpanel-ftp-laravel-php-project-f29bac33f134">How To Deploy Any Project From GitHub to Cpanel (FTP) - Laravel PHP Project</a> was originally published in <a href="https://blog.devops.dev">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Localization in jetpack compose ]]></title>
            <link>https://markseif.medium.com/localization-in-jetpack-compose-39c44c315fd8?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/39c44c315fd8</guid>
            <category><![CDATA[compose-ui]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Thu, 05 Oct 2023 19:52:31 GMT</pubDate>
            <atom:updated>2023-10-05T19:52:31.024Z</atom:updated>
            <content:encoded><![CDATA[<p>Localization of course is an essential part of every modern android project and it is mostly an easy task todo on the regular projects (without compose).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-KImRPcn1b0h89BabjAiEA.png" /><figcaption>Localization on compose</figcaption></figure><p>But now while developing the projects using compose we faced muliple issues with localization that we will discuss on this blog :</p><p>1-Change Layout Diraction with RTL language (Make it dynamic to switch between RTL , LTR)</p><p>2-Using Arabic and other languages strings in compose</p><p>for the first part which is changing layout diraction with RTL languages</p><p>we will need to use CompositionLocalProvider which provides Local to the compose elements of the tree that we will use to provide the current diraction for the compose elements</p><p>first we need to check the current APP language if it RTL or not and if it supports like “arabic” we will asign the rtl layout diraction to it like the sample below</p><pre>var local = if (LanguageSetting.getLanguage(this).toString()==&quot;ar&quot;) LayoutDirection.Rtl else LayoutDirection.Ltr</pre><p>note : the default is of course LTR</p><p>now we will pass the layout diraction we give it to “local” before to the</p><p>CompositionLocalProvider.</p><pre>CompositionLocalProvider(LocalLayoutDirection provides local) {<br>    Row {<br>      Text(&quot;Test Text&quot;, modifier = Modifier.padding(end = 8.dp))<br>    }<br>  }</pre><p>Congrats now your project support RTL languages like (arabic , urdo and herbew) and alot more</p><p>Now the second point which is using arabic and other languages</p><p>you need to make sure that you change Configuration when the user chooses to chage the languages</p><p>i use this setCurrentLanguage function to change the language and it works fine with jetpack compsoe</p><pre>private fun setCurrentLanguage(){<br>    val config = resources.configuration<br>    val locale = java.util.Locale(LanguageSetting.getLanguage(this).toString())<br>    java.util.Locale.setDefault(locale)<br>    if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.JELLY_BEAN_MR1)<br>        config.setLocale(locale)<br>    else<br>        config.locale = locale<br><br>    if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.N)<br>        createConfigurationContext(config)<br>    resources.updateConfiguration(config, resources.displayMetrics)<br>}</pre><p>of course jetpack compose is a great ui tooling but like at the first of any new technology there is Odds we face it but we work on it together .</p><p>i hope i have helped you to solve localization issue with compose .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39c44c315fd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Compose VS XML]]></title>
            <link>https://markseif.medium.com/android-compose-vs-xml-1473cd549c5e?source=rss-782fa918372b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1473cd549c5e</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[compose]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Mark Saif]]></dc:creator>
            <pubDate>Tue, 22 Nov 2022 14:35:46 GMT</pubDate>
            <atom:updated>2022-11-22T14:40:53.727Z</atom:updated>
            <content:encoded><![CDATA[<p>Now Days Compose became more important to build native android UI , and google pushes it forward to replace XML and in this part we will talk about it .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GXz3Is7ZR8i0lZL54WmLPg.png" /></figure><h3>Compose Features</h3><p>First question comes to any android developer is why to use Compose ? and why to start learning it?</p><p>as in <a href="https://developer.android.com/jetpack/compose/why-adopt">google`s documentation</a> they say 4 reasonable reasons and they are meanly about reducing efforts , development time and less code .</p><p>also it`s more <strong>easier</strong> than XML and <strong>familiar</strong> to the reader of the code</p><p>I will tell you the most important reason and it is that compose will be the trend in android . and most of companys will ask developers to learn it as it gives them more power and gives the business less time to market .</p><h3>How to use Compose?</h3><p>Compose is Intuitive because it uses declarative API all you need is just to describe the layout you want to draw over your UI , Compose consists of</p><p>small, stateless components that are not tied to a specific activity or fragment. which makes reusing it very easy.</p><h3>Learn Compose or XML ?</h3><p>I think you must learn both because the are a lot of old projects out there which built in xml , also there will be a lot of projects in Jetpack compose.</p><p>So you shouldn’t lose any of them . and you can start learning them in <a href="https://developer.android.com/courses/android-basics-compose/course">google android developers courses</a></p><h3>Conclusion</h3><p>Jetpack Compose is gaining reputation between android developers also google advises to use it , and also you should now the basics of xml because if you are asked to edit some old legacy xml code base.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1473cd549c5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>