<?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 Ray Chong on Medium]]></title>
        <description><![CDATA[Stories by Ray Chong on Medium]]></description>
        <link>https://medium.com/@ray-chong?source=rss-728c38967520------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*31GC3wXD41HtcaHjqy924A.jpeg</url>
            <title>Stories by Ray Chong on Medium</title>
            <link>https://medium.com/@ray-chong?source=rss-728c38967520------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:39:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ray-chong/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 Chaos to Clarity: My Approach to Engineering Strategy]]></title>
            <link>https://ray-chong.medium.com/from-chaos-to-clarity-my-approach-to-engineering-strategy-1412e4570412?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/1412e4570412</guid>
            <category><![CDATA[engineering-mangement]]></category>
            <category><![CDATA[strategy]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[engineering-culture]]></category>
            <category><![CDATA[strategic-thinking]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Sun, 08 Dec 2024 14:45:39 GMT</pubDate>
            <atom:updated>2024-12-14T11:42:44.551Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q9YCECISAnQFeA1X88E3mw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@skyinferno?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Osama Madlom</a> on <a href="https://unsplash.com/photos/a-black-and-white-photo-of-a-chess-board-cShsbxi72CM?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>After a few years working as engineering manager, I’ve come to realize that strategy isn’t some abstract, once-a-year exercise. It’s something you need in place to guide your decisions day-to-day, helping you and your team stay focused on what really matters. Without it, you risk getting stuck in the chaos of endless tasks and shifting priorities. That’s why I’m sharing a few approaches I’ve developed to craft an engineering strategy that works — something practical, clear, and easy to follow. Whether you’re leading a small team or a large organization, these ideas have helped me move the needle, and I hope they help you too.</p><p>Engineering strategy doesn’t need to feel complicated. At its core, it’s about making smart decisions that help your team and company succeed — without overthinking it. Working as an Engineering Manager in a fintech company, the stakes are high. People trust us with their money, so systems need to be reliable, secure, and fast. Here’s how I approach it in a way that works for both the team and the business.</p><p>The first thing I do is figure out what’s going on. <strong>I spend time diagnosing the state of our team, tech, and processes.</strong> This means diving deep into the systems to identify where we’re struggling. Technical debt is usually an obvious one. Maybe parts of our payment engine are slow or fragile because of quick fixes over the years, or our codebase has grown so complex that no one’s quite sure how everything fits together anymore. These are the red flags I can’t ignore.</p><p>But diagnosing the situation isn’t just about the code. I also take a hard look at how the team is working. Are pull requests taking too long to merge? Are people constantly frustrated by deployment failures, or potentially is there a lot of steps required to deploy the workload? Or is the team spending too much time waiting on decisions because communication isn’t clear? All of this matters just as much as the technical side.</p><p>At the same time, I align with the business. In fintech, business goals are clear: scale up, stay reliable, and gain customer trust. If leadership says we need to double our transaction capacity in a year, I need to ask — can our infrastructure handle it? And if not, what do we need to do about it? Understanding where the company wants to go gives me a clear north star to work toward. Once I know where we stand, I set clear guidelines that the team can follow. I try to avoid creating long, formal documents because no one has time for that. Instead, I boil it down to simple, memorable priorities. For example:</p><p><strong>• Reliability comes first.</strong></p><p><strong>• Automate anything that’s repetitive.</strong></p><p><strong>• Build small, ship fast, and get feedback early.</strong></p><p>These principles guide every decision we make. If we’re deciding between refactoring some old code or building a flashy new feature, the team already knows: reliability comes first. If the deployment pipeline is slowing us down, we stop and fix it because we automate pain points wherever possible. By keeping things simple, the team can focus on what matters most without second-guessing.</p><p>Next comes the action. Policies are great, but nothing changes unless we follow through. I make sure the team focuses on work that makes a real impact. If manual testing or deployments are slowing us down, we invest time in setting up CI/CD pipelines to automate them. If people are feeling stuck or bogged down, we fix what hurts the most. That might mean improving documentation, cleaning up flaky tests, or breaking down big projects into smaller, shippable pieces. To keep up momentum, I push for smaller, frequent releases rather than massive projects that take months to deliver. Shipping small means we can learn faster, fix things quickly, and build confidence with every release. In fintech, where people depend on our systems to work, this kind of steady progress is key. Of course, no strategy is perfect from the start. I keep track of progress by defining a few key metrics. Things like deployment frequency, lead time, and recovery time after an incident tell me whether we’re moving in the right direction. Every quarter, I gather the team to review what’s working and what isn’t. Sometimes we’ll realize we need to refocus — maybe we spent too much time on new features and not enough on technical debt. That’s fine. Strategy is a living thing, not a fixed plan. We adjust and keep going.</p><p>At the end of the day, engineering strategy is about making the right choices at the right time. For my team, this means fixing what’s broken, building what’s valuable, and empowering people to do their best work. It’s not about perfection. It’s about progress — one step, one release, and one win at a time.</p><blockquote>And when things get tough, I remind myself: <strong>strategy isn’t about the end goal; it’s about moving forward every day</strong>. As long as we keep that in focus, we’re on the right track.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1412e4570412" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crafting High-Quality HTTP API Endpoints: A Guide to Excellence]]></title>
            <link>https://ray-chong.medium.com/crafting-high-quality-http-api-endpoints-a-guide-to-excellence-bf4c43086503?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf4c43086503</guid>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Mon, 12 Feb 2024 15:14:00 GMT</pubDate>
            <atom:updated>2024-02-12T15:14:00.041Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ayrWfGo1ize2Z1_focsew.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@clarktibbs?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Clark Tibbs</a> on <a href="https://unsplash.com/photos/do-something-great-neon-sign-oqStl2L5oxI?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>In the ever-evolving landscape of web development, the design of HTTP API endpoints plays a critical role in the seamless interaction between systems. A well-crafted API not only facilitates better communication between services but also enhances the developer experience, making it easier to integrate and work with. Here’s how you can create or spot a good design for HTTP API endpoints:</p><h4>1. Clear Naming Conventions</h4><p>The cornerstone of any good API design is clear naming. A thoughtful naming convention makes endpoints intuitive and predictable, reducing the learning curve for developers. Consistency in naming conventions across your API ensures that once a developer learns how to interact with one part of your API, they can easily interact with others. This consistency fosters a more streamlined development process and less room for errors. If you have no clue where to start, you may refer to this <a href="https://medium.com/@pabashani.herath/clean-code-naming-conventions-4cac223de3c6">source</a> or consider <a href="https://www.amazon.com/Naming-Things-Hardest-Software-Engineering/dp/B0BTLYZWRL">buying a book</a>.</p><h4>2. API Versioning and Backward Compatibility</h4><p>API versioning is essential for maintaining backward compatibility while allowing for evolution and growth. Introducing versions within your API paths or headers ensures that existing integrations remain intact when changes or improvements are made. This approach respects the time and investment made by developers in learning and integrating with your API.</p><h4>3. Implementing Pagination</h4><p>Large datasets can overwhelm systems, but pagination offers a solution. Whether you choose page + offset or cursor-based pagination, limiting the amount of data returned in a single request ensures that your API remains efficient and responsive. Pagination not only optimizes performance but also enhances the usability of your API.</p><h4>4. Security Best Practices</h4><p>Security should never be relegated to a secondary concern in API design, beginning foremost with authentication. Employing the correct request headers for authentication is critical, ensuring every request to your API is properly authorized. Such a measure is paramount in shielding sensitive data and operations from unauthorized intrusion. Furthermore, the implementation of TLS encryption or SSL pinning, where feasible, is essential for the safeguarding of data during transit. Moreover, the meticulous handling of secret credentials, adhering to established best practices, and the deployment of stringent access control measures are imperative for maintaining a secure API framework. To guard against DDoS attacks and ensure your API can manage a high volume of requests without succumbing to abuse, it’s crucial to strategize for rate limiting. This approach not only prevents your API from being overwhelmed but also promotes equitable usage among all users.</p><h4>5. Simplifying Cross-Resource References</h4><p>Simplifying the way references are made between various resources significantly enhances the clarity and user-friendliness of your API. By designing clear and logical resource identifiers and ensuring links between resources are intuitive, you can facilitate easier navigation through complex relationships. For instance, using consistent, readable IDs for resources and employing direct links in API responses (e.g., providing a direct URL to a related resource in the response of a query) allows users to efficiently access and understand the connections within your API.</p><h4>6. Standardized API Response Format</h4><p>A standardized response format, including errors, makes your API predictable and easier to integrate. Proper error codes and messages guide developers in troubleshooting and handling exceptions gracefully.</p><h4>7. Comprehensive Documentation</h4><p>Finally, none of the above matters if your API is not well-documented. Providing detailed documentation, complete with an error dictionary, makes your API accessible and user-friendly. Tools like Swagger UI or Postman can simplify the documentation process and offer interactive explorations of your API. Github Rest API docs is one of the great examples that demonstrate the above elements together with cURL.</p><p>In conclusion, the art of crafting excellent HTTP API endpoints is not just about adhering to technical specifications; it’s about creating an experience that is secure, efficient, and intuitive for both developers and end-users. By embracing clear naming conventions, thoughtful API versioning, efficient pagination, and robust security practices, among other strategies, you can lay the foundation for an API that stands the test of time. Remember, the goal is to not only meet the immediate needs of your users but to anticipate the evolving landscape of technology and design your API to be as future-proof as possible. With these guidelines in mind, you’re well on your way to developing an API that is not just functional, but truly exceptional.</p><p>References:</p><ul><li><a href="https://blog.hubspot.com/website/api-rate-limit#:~:text=API%20rate%20limiting%20is%20a,what%20actions%20can%20be%20taken.">API Rate Limiting — Everything You Need to Know</a></li><li><a href="https://medium.com/@pabashani.herath/clean-code-naming-conventions-4cac223de3c6">Clean Code Naming Conventions</a></li><li><a href="https://learn.microsoft.com/en-us/azure/architecture/best-practices/api-design">Microsoft RESTful web API Design</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf4c43086503" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android: Tackling Application Not Responding(ANRs)]]></title>
            <link>https://medium.com/codex/android-tackling-application-not-responding-anrs-3c91360cd023?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c91360cd023</guid>
            <category><![CDATA[mobile-app-performance]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[anr]]></category>
            <category><![CDATA[mobile-analytics]]></category>
            <category><![CDATA[android-performance]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Tue, 13 Dec 2022 15:53:11 GMT</pubDate>
            <atom:updated>2022-12-28T12:14:25.776Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EcVahNG1a7VpBDzq" /><figcaption>Photo by <a href="https://unsplash.com/@dawson2406?utm_source=medium&amp;utm_medium=referral">Stephen Dawson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>ANR, which stands for “Application Not Responding,” is a type of error that occurs when an Android app is unresponsive for a prolonged period of time. This can happen if the app is performing a long-running operation on the main thread, such as a complex computation or network operation, and is unable to respond to user input or other events in a timely manner.</p><p>A crash differs from an ANR in that a crash is a code exception, whereas an ANR is an ongoing state of nonresponsiveness. As a result, when a crash occurs, the app itself terminates. When an ANR occurs, the user is unable to do anything in the app and is forced to quit it, or the Android system displays an error message to the user, and the app may be killed if the problem is not resolved.</p><p>ANRs are a common source of frustration for Android users, resulting in negative app reviews and ratings. Furthermore, poor performance in these areas directly impacts your ranking and discoverability. This puts your app’s position in search results at risk and its eligibility to be featured.</p><p>The ANR threshold for an app is exhibiting at least one ANR in at least <strong>0.47%</strong> of its daily sessions. It’s critical to stay below these thresholds if you want to maximize your title’s visibility on Google Play. Furthermore, if your title exceeds the device bad behavior threshold on any core vital for a given phone model, Google Play may reduce its visibility for users on that phone model. Read more on <a href="https://android-developers.googleblog.com/2022/10/raising-bar-on-technical-quality-on-google-play.html">Raising the bar on technical quality on Google Play</a>.</p><h3>Prevention</h3><p>According to the information, they observed and detected quite a few of the use cases that mostly contribute to ANRs. Developers should always stay away from these red-flag practices in order to avoid ANR errors.</p><ul><li><strong>Performing long-running operations on the main thread</strong>: If your app is performing a long-running operation, such as a complex computation or network operation, on the main thread, it may become unresponsive and trigger an ANR error.</li><li><strong>Poorly designed user interface</strong>: If your app has a poorly designed user interface, it may be more likely to trigger ANR errors. For example, if your app has a lot of buttons or other controls that are densely packed together, it may be difficult for users to interact with your app, and they may accidentally trigger ANR errors.</li><li><strong>Input dispatching timed out:</strong> If your app has not responded to an input event (such as key press or screen touch) within 5 seconds.</li><li><strong>Executing service:</strong> If a service declared by your app cannot finish executing Service.onCreate() and Service.onStartCommand()/Service.onBind() within a few seconds.</li><li><strong>Service.startForeground() not called:</strong> If your app uses Context.startForegroundService() to start a new service in the foreground, but the service then does not call startForeground() within 5 seconds.</li><li><strong>Broadcast of intent:</strong> If a <a href="https://developer.android.com/reference/android/content/BroadcastReceiver">BroadcastReceiver</a> hasn&#39;t finished executing within a set amount of time. If the app has any activity in the foreground, this timeout is 5 seconds.</li></ul><h3>Detection</h3><p>Finding ANRs is the largest obstacle to solving them. Because they are unable to take into account all the factors that their users encounter, developers won’t be able to catch all ANRs in testing. Additionally, ANRs are not only software faults, making it impossible to eradicate them from the system totally. The reality is that developers must constantly balance improving app speed with conserving system resources. Furthermore, because there are so many different devices with varying specifications and performance, it is challenging for developers to recreate them for every possible use case. Hardware limitations on older devices may cause slowness with large and ineffective UI updates. Hence, there is a need to employ tools or libraries to assist developers in figuring out ANRs. Below are the tools available for FREE that might help reduce ANRs events.</p><p><strong>Firebase Crashlytics</strong><br>Crashlytics now start collecting ANRs events from Android 11+ devices. Developer may filter the event type to ANRs if they wish to drill down the ANRs event collected by Firebase Crashlytic kits. Attaching a sample log of the ANR event from the dashboard. This might help developers to look for the root cause.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FI6zdiR4o6HvGsOtA4FLtg.png" /><figcaption>Preview of Firebase Crashlytic for ANR</figcaption></figure><p><strong>Google Play Console<br></strong>Compared to Firebase, Google Play Console are more emphasized on the affected devices. Even there’s a stack trace rows are provided for developers insight, I do find the firebase one is much more useful when it comes to debugging. The options is now sit under the <strong>Quality</strong> section, <strong>Android Vitals</strong> &gt; <strong>Crashes and ANRs </strong>from<strong> Google Play Console Dashboard.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*frvdtDGbpBaMUMADho3SWw.png" /><figcaption>Preview of Google Play Console</figcaption></figure><p><strong>ANR Watchdog<br></strong>This is an incredible library from <a href="https://github.com/SalomonBrys">SalomonBrys</a>. Do check <a href="https://github.com/SalomonBrys/ANR-WatchDog">this repository</a> from Github on the implementation details and how it works. Basically, this library schedule a simple thread/ runnable to be run on the UI thread as soon as possible, and it comes with a timeout interval of 5 seconds(because this is the ANR timeout interval). If the runnable has been run within that 5 seconds, it will repeatedly schedule a new runnable, else it will raise an error with all running threads stack traces. Developers may integrate this with Firebase Crashlytics or other preferred analytics SDK to set up the reporting channel.</p><p>Hopefully, the above explanation provides more insights into understanding ANRs events and tackling them to improve your app usability as well as boost Play Store ranking and visibility. Attaching the reference below:</p><ul><li><a href="https://developer.android.com/topic/performance/vitals/anr">ANRs | App quality | Android Developers</a></li><li><a href="https://support.google.com/googleplay/android-developer/answer/9844486">Monitor your app&#39;s technical quality with Android vitals</a></li><li><a href="https://firebase.google.com/docs/crashlytics/debug-anr-errors">Debug your Android app based on ANR tags in the Crashlytics dashboard | Firebase Crashlytics</a></li><li><a href="https://github.com/SalomonBrys/ANR-WatchDog">GitHub - SalomonBrys/ANR-WatchDog: A simple watchdog that detects Android ANR (Application Not Responding) error and throws a meaningful exception</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c91360cd023" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/android-tackling-application-not-responding-anrs-3c91360cd023">Android: Tackling Application Not Responding(ANRs)</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Security: How to Protect Your Device and Keep Your Data Safe]]></title>
            <link>https://medium.com/codex/android-security-how-to-protect-your-device-and-keep-your-data-safe-4704aed458f9?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/4704aed458f9</guid>
            <category><![CDATA[mobile-fraud]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[mobile-security]]></category>
            <category><![CDATA[fraud-prevention]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Sat, 10 Dec 2022 15:35:42 GMT</pubDate>
            <atom:updated>2022-12-14T14:41:20.352Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ugt6G8tsqhE4h6Hg" /><figcaption>Photo by <a href="https://unsplash.com/@danny144?utm_source=medium&amp;utm_medium=referral">Dan Nelson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a popular mobile operating system, Android is a frequent target for cybercriminals seeking access to sensitive information. From malware and viruses to phishing scams and insecure apps, there are numerous threats to the security of your Android device. To protect your device and keep your data safe, there are several steps you can take.</p><p>First and foremost, always keep your Android software up to date. This will ensure that you have the latest security patches and fixes, which can help protect your device from newly discovered vulnerabilities. To check for updates, go to the Settings app and tap on “System,” then “Advanced” and “System Update.”</p><p>Next, be careful when downloading apps from unknown sources. The Google Play Store is the safest place to download apps, as it has a rigorous review process in place to weed out insecure or malicious apps. However, you may sometimes come across an app that is only available outside of the Play Store. In these cases, make sure to do your research and only download apps from reputable sources. Be sure you only grant permission needed by the functionality.</p><p>In the Android operating system, there are several permissions that are considered sensitive and require special care and attention. These permissions include the following:</p><ul><li>Access to the device’s camera and microphone</li><li>Access to the device’s location</li><li>Access to the device’s contacts and call logs</li><li>Access to the device’s storage</li><li>Access to the device’s SMS and MMS messages</li></ul><p>Apps that request these permissions should be carefully reviewed, as they may be able to access sensitive information or perform actions that could potentially harm the user. When installing an app, it’s important to carefully review the permissions that it is requesting and only grant access to those that are necessary for the app to function properly.</p><p>In addition to these permissions, it’s also important to be aware of any app that requests permission to “draw over other apps” or “display on top of other apps.” These permissions can allow the app to display information on top of other apps, which could be used to trick the user into revealing sensitive information or performing actions that they would not otherwise do.</p><p>Overall, it’s important to be aware of the sensitive permissions that apps may request, and to carefully review and manage these permissions to help protect your device and your personal information.</p><p>In terms of proactive measures, it’s important to use strong and unique passwords for all of your accounts, and to enable two-factor authentication whenever possible. This will help to prevent unauthorized access to your accounts, even if your device is lost or stolen. In addition, consider using a password manager to help generate and securely store complex passwords for all of your accounts.</p><p>If you suspect that you may be the victim of mobile fraud, there are several steps you can take to react and protect yourself. First, contact your bank or credit card company to report the fraud and to request that they freeze your accounts. Next, change your password and enable two-factor authentication on all of your accounts.</p><p>You can take steps to prevent future fraud by regularly monitoring your accounts for suspicious activity and by staying up to date on the latest mobile security threats. Also, consider installing a security app on your device. These apps can help protect your device from malware and viruses, and may also include features such as theft protection and remote wiping.</p><p>In conclusion, taking these steps can help protect your Android device and keep your data safe. Always keep your software up to date, be careful when downloading apps, use a strong password, enable two-factor authentication, and consider installing a security app. By following these tips, you can help ensure that your device and your personal information remain secure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4704aed458f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/android-security-how-to-protect-your-device-and-keep-your-data-safe-4704aed458f9">Android Security: How to Protect Your Device and Keep Your Data Safe</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android: Compressing video with FFmpeg]]></title>
            <link>https://ray-chong.medium.com/android-compressing-video-with-ffmpeg-c5c613d65680?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5c613d65680</guid>
            <category><![CDATA[video-compression]]></category>
            <category><![CDATA[android-video-compression]]></category>
            <category><![CDATA[ffmpeg]]></category>
            <category><![CDATA[ffmpeg-mobile-apps]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Tue, 04 Jan 2022 16:43:32 GMT</pubDate>
            <atom:updated>2022-01-04T16:47:35.263Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z31ZpQslJvzvbCTRe2XYXA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jakobowens1?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jakob Owens</a> on <a href="https://unsplash.com/s/photos/video?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>FFmpeg is a free and open-source software project that includes a library and tools for dealing with video, audio, and other multimedia files and streams. The command-line FFmpeg utility, which is used to process video and audio data, is at its heart. Format transcoding, basic editing (trimming and concatenation), video scaling, video post-production effects, and standards compliance are all common uses (SMPTE, ITU).</p><p>FFmpeg is a sophisticated tool that can handle practically anything with multimedia files you can think of. We’re only interested in using it to compress video files in this tutorial, so I won’t go through all of its features. To avoid reinventing the wheel, I will demonstrate the use of <a href="https://github.com/WritingMinds/ffmpeg-android-java"><strong>FFmpeg-Android-Java</strong></a> in this article. According to a few sample use cases I found on the internet, FFmpeg can compress a 30 seconds video with an 80MB file size down to 4MB in 90 seconds. That’s 95% smaller in size!</p><h3>Compress Techniques</h3><p>Before we dive into the tutorial steps, let&#39;s understand how FFmpeg works in general. There are a few techniques that influence the quality of a video when it is compressed to a lower size.</p><ol><li><strong>Bitrate</strong></li></ol><p>The most straightforward technique is to alter the bitrate, with <strong>-b</strong> flag, which may or may not result in a difference in quality. The ability of humans to see and hear isn’t as simple and straightforward as we’d like to believe. Changing bitrates can sometimes make a significant impact on subjective quality. In other situations, it may only affect the file size. It’s sometimes difficult to predict what will happen without putting something to the test. For example, the below query will copy the audio (<strong>-c:a copy</strong>) from <strong>input.mp4</strong> and convert the video to a VP9 codec (<strong>-c:v vp9</strong>) with a bit rate of 1M/s (<strong>-b:v</strong>), all bundled up in a Matroska container (<strong>output.mp4</strong>).</p><blockquote><strong>ffmpeg -i input.mp4 -c:a copy -c:v vp9 -b:v 1M output.mp4</strong></blockquote><p>2. <strong>Frame rate</strong></p><p>Another technique to improve video quality is to use the <strong>-r</strong> option to change the frame rate. The command below creates a new Matroska with the audio stream copied over and the video stream’s frame rate forced to 30 frames per second, instead of using the frame rate from the input (<strong>-r 30</strong>).</p><blockquote><strong>ffmpeg -i input.mp4 -c:a copy -c:v vp9 -r 30 output.mp4</strong></blockquote><p>3. <strong>Dimension</strong></p><p>You can also use FFmpeg to change the dimensions of your video. The most straightforward method is to set a preset video size:</p><blockquote><strong>ffmpeg -i input.mp4 -c:a copy -s hd720 output.mp4</strong></blockquote><p>Frame rate and bitrate adjustments are two simple yet efficient methods for changing media quality. If the quality of an existing source is already poor, increasing these values will not enhance it.</p><p>Changing these settings is the most efficient way to compress a high-quality stream into a smaller file. The compression process can be highly subjective at times, and it may not always perform as planned. Making some modifications and seeing if it looks or sounds better is the best technique.</p><p><strong>Implementation</strong></p><p><a href="https://github.com/WritingMinds/ffmpeg-android-java">GitHub - WritingMinds/ffmpeg-android-java: Android java library for FFmpeg binary compiled using https://github.com/writingminds/ffmpeg-android</a></p><p>This tutorial is based on the Github library attached above. To start with the implementation, you’ll need to amend your app .gradle file to include the library source either in <a href="https://oss.sonatype.org/content/repositories/releases/com/writingminds/FFmpegAndroid/0.3.2/FFmpegAndroid-0.3.2.aar">AAR</a> format or via a grade import statement.</p><pre>repositories {<br>    flatDir {<br>        dirs &#39;libs&#39;<br>    }<br>}<br><br>dependencies {<br>    implementation(name:&#39;FFmpegAndroid&#39;, ext:&#39;aar&#39;)</pre><pre>    // or</pre><pre>implementation &#39;com.writingminds:FFmpegAndroid:0.3.2&#39;   <br>}</pre><p>The minimum support version for this library starts at Android 4.1+ and it currently supports these architectures listed below,</p><ul><li>armv7</li><li>armv7-neon</li><li>armv8</li><li>x86</li><li>x86_64</li></ul><p>Before we can use this library, we must first load the binary for initialization. The device may also be subject to the FFmpegNotSupported exception in rare circumstances. It’s usually a good idea to send a message to users via Toast / Dialog so that they are aware of the situation. If it’s in the plans, you can also send the user to a different method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/148197da14cfcfa31f14d3d22f5d3de0/href">https://medium.com/media/148197da14cfcfa31f14d3d22f5d3de0/href</a></iframe><p>Once the library is successfully inits, you may start compressing the source video selected by the user. Usage as below;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8dcbf6a25135ddb1fe5db22f2ae9958b/href">https://medium.com/media/8dcbf6a25135ddb1fe5db22f2ae9958b/href</a></iframe><blockquote><strong>execFFmpegBinary</strong>(new String[]{“-y”, “-i”, “source-path”, “-s”, “480x320”, “-r”, “25”, “-vcodec”, “mpeg4”, “-b:v”, “300k”, “-b:a”, “48000”, “-ac”, “2”, “-ar”, “22050”, “output-path”})</blockquote><p>The above query also can be translated to this manner if a cmd statement is preferred.</p><blockquote>ffmpeg -y -i /source-path/input.mp4 -s 480x320 -r 25 -vcodec mpeg4 -b:v 300k -b:a 48000 -ac 2 -ar 22050 /source/output.mp4</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*5e4kRYbQlzLe3v3tkJdrpw.png" /><figcaption>command cheatsheet</figcaption></figure><p>You can begin experimenting with the command based on the situation. Please check this <a href="https://linux.die.net/man/1/ffmpeg">website</a> for further options on the command for advanced video/audio processing. Have a great time exploring and having fun!</p><p>Reference:</p><ul><li><a href="https://github.com/WritingMinds/ffmpeg-android-java">GitHub - WritingMinds/ffmpeg-android-java: Android java library for FFmpeg binary compiled using https://github.com/writingminds/ffmpeg-android</a></li><li><a href="https://www.ffmpeg.org/ffmpeg.html">ffmpeg Documentation</a></li><li><a href="https://linux.die.net/man/1/ffmpeg">ffmpeg(1) - Linux man page</a></li><li><a href="https://www.labnol.org/internet/useful-ffmpeg-commands/28490/">Useful FFmpeg Commands for Working with Audio and Video Files</a></li><li><a href="https://trac.ffmpeg.org/wiki/Encode/H.264">Encode/H.264 - FFmpeg</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5c613d65680" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Fraud Detection with HMS Safety Detect Kit]]></title>
            <link>https://ray-chong.medium.com/android-fraud-detection-with-hms-safety-detect-kit-18bf5e204dcb?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/18bf5e204dcb</guid>
            <category><![CDATA[fraud-detection]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hms]]></category>
            <category><![CDATA[mobile-fraud]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Sun, 02 Jan 2022 14:25:20 GMT</pubDate>
            <atom:updated>2022-01-02T14:25:20.172Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UBtOJfIDzPhHBRt6y23nVw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@matthewhenry?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Matthew Henry</a> on <a href="https://unsplash.com/s/photos/security?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>As mobile devices and mobile applications become more mainstream, mobile fraud threats are on the rise. While COVID-19 is mostly responsible for the current increase in mobile banking, the trend is expected to continue. Mobile fraud is a chance for fraudsters as well. Mobile banking Trojans have increased by 173% in the first quarter of 2020, according to industry experts, and mobile phishing attacks have increased by 37% year over year. To fight this, mobile fraud detection employs a variety of technologies, including mobile app shielding and risk analytics, to aid in the prevention of account takeover and other sorts of fraud. Behind the scenes, many technologies are employed to detect fraudulent behaviour and provide fraud protection to customers without interfering with their user experience.</p><p>In this tutorial, I’ll show you how to use the <a href="https://developer.huawei.com/consumer/en/doc/development/Security-Guides/introduction-0000001050156325"><strong>Safety Detect</strong></a> library from Huawei Mobility Services. The <a href="https://developer.huawei.com/consumer/en/doc/development/Security-Guides/userdetect-0000001050154382"><strong>User Detect API</strong></a> is one of the sub-service parks under Safety Detect, and its purpose is to assist in the identification of fake users using a real-time risk analysis engine.</p><h4>How does it work?</h4><p>The API gathers relevant data within the authorized scope and uploads it to a real-time risk analysis engine to determine whether the current user is a fake. A verification number is issued to the user for secondary verification if the user is suspicious or unsafe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*s5lCiLFcHplU6TedDJisag.png" /></figure><h4>Why should we use this kit?</h4><p>Batch registration, credential stuffing attacks, activity bonus hunting, and content crawling are all examples of fraudulent user behavior that this API may assist your app to prevent. And, in most cases, this type of activity/behavior has a direct influence on operation cost or consumes system resources.</p><p>To start implementing this API, first, you must register your application under the HMS dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sxnVBkhD-PFHunkhIH856g.png" /></figure><p>Once the API is enabled and the application is created, you may obtain your configuration file <strong>‘agconnect-service.json’</strong> file and <strong>APP ID</strong> under the project information page. Please copy the json file to your project root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-MjS4R4tMAn9enmK4IbCJQ.png" /></figure><p>You can begin using this API in your app once you’ve obtained the necessary information and key. To begin, add the dependency to your project &amp; app’s.gradle file. Please refer to this <a href="https://developer.huawei.com/consumer/en/doc/development/Security-Guides/version-change-history-0000001050156329"><strong>document</strong></a> for further information on versioning.</p><p>Your project .gradle file should include Huawei under the repository and dependencies list.</p><pre>buildscript <strong>{<br>    </strong>ext.kotlin_version = &#39;1.3.72&#39;<br>    repositories <strong>{<br>        maven { url &#39;https://developer.huawei.com/repo/&#39; }<br>        </strong>google()<br>        jcenter()<br><br>    <strong>}<br>    </strong>dependencies <strong>{<br>        </strong>classpath &#39;com.android.tools.build:gradle:3.6.3&#39;<br>       <strong> classpath &#39;com.huawei.agconnect:agcp:1.2.1.301&#39;</strong><br>        classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;<br>     <br>    <strong>}<br>}<br><br></strong>allprojects <strong>{<br>    </strong>repositories <strong>{<br>        maven { url &#39;https://developer.huawei.com/repo/&#39; }<br>        </strong>google()<br>        jcenter()<br><br>    <strong>}<br>}<br></strong></pre><p>And, once the repositories are synced with the system, you may start adding the library dependency under app .gradle file.</p><pre>apply plugin: &#39;com.android.application&#39;<br><strong>apply plugin: &#39;com.huawei.agconnect&#39;</strong><br>apply plugin: &#39;kotlin-android&#39;<br>apply plugin: &#39;kotlin-android-extensions&#39;<br><strong><br></strong>android <strong>{<br><br>    ...<br>}<br><br></strong>dependencies <strong>{<br>    </strong>implementation fileTree(dir: &#39;libs&#39;, include: [&#39;*.jar&#39;])<br>     ...</pre><pre>    <strong>implementation &#39;com.huawei.hms:safetydetect:6.1.0.302&#39;</strong><br><br><strong>}</strong></pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70d7305d90775c1fe07aaa08f7f9fe04/href">https://medium.com/media/70d7305d90775c1fe07aaa08f7f9fe04/href</a></iframe><p>After the app successfully init the library, you may start to verify the user by calling the below method. In case the verify method doesn&#39;t work as expected, you may browse <a href="https://developer.huawei.com/consumer/en/doc/development/Security-References/safetydetectstatuscodesapi-0000001050259854"><strong>this document</strong></a><strong> </strong>to dig further into the root cause.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a020c51a7cbb1b4d700db4c82a9d6ccb/href">https://medium.com/media/a020c51a7cbb1b4d700db4c82a9d6ccb/href</a></iframe><p>If you’re interested to dive more, here is the Github repo for HMS Safety Detect.</p><p><a href="https://github.com/HMS-Core/hms-safetydetect-demo-kotlin/tree/master/SafetyDetect-UserDetect-Kotlin-Demo">hms-safetydetect-demo-kotlin/SafetyDetect-UserDetect-Kotlin-Demo at master · HMS-Core/hms-safetydetect-demo-kotlin</a></p><p>Reference:<br><a href="https://developer.huawei.com/consumer/en/doc/development/Security-Guides/introduction-0000001050156325">https://developer.huawei.com/consumer/en/doc/development/Security-Guides/introduction-0000001050156325</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18bf5e204dcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effective Conflicts Management Techniques]]></title>
            <link>https://ray-chong.medium.com/effective-conflicts-management-techniques-309eb8d53f2f?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/309eb8d53f2f</guid>
            <category><![CDATA[workplace]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[conflict-resolution]]></category>
            <category><![CDATA[effective-communication]]></category>
            <category><![CDATA[conflict-management]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Fri, 10 Dec 2021 07:28:41 GMT</pubDate>
            <atom:updated>2021-12-11T03:51:00.037Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2J1lTm7Bv7hUHTVJkQw4yQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@cherrydeck?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Cherrydeck</a> on <a href="https://unsplash.com/s/photos/discussion?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Conflict Management was the topic of a recent course I took. Which is a procedure for resolving disagreements or disputes, minimizing bad consequences, and prioritizing positive outcomes.</p><blockquote>This important managerial talent entails a variety of methods based on the situation, as well as negotiating and creative thinking. An organization’s ability to minimise interpersonal issues, improve client happiness, and deliver better commercial outcomes can all be improved by correctly managing conflict.</blockquote><p>For the sake of sharing, I’m writing down some major insights from one of the course’s topics.</p><h4><strong>1. Clarity &gt; Motivation</strong></h4><p>We should always break down the goals into smaller pieces with details, and make sure those items are actionable, in order to have better clarity on the goals. For a better outcome, the definition of done, and success should always be conveyed to stakeholders.</p><h4>2. Comfort Matters</h4><p>We must always remember that people come from different backgrounds and cultures. Some people prefer getting to the heart of the subject and resolving problems within specific parameters, while others strive to avoid it at all costs. As a result, one of the most important factors is communication. Before voicing a complaint or providing input, always acquire permission from the stakeholder and make sure they are comfortable and open to the discussion. For a more productive and seamless approach, try holding this session in a quiet location. It would be preferable if we attempted to address the issue somewhere other than the place where they are now situated, as most emotions are tied with that place. It’s possible that a pantry or coffee shop might be a better option.</p><h4>3. Connection Before Correction</h4><p>It is preferable to establish the connection before delving into the points or correcting others. Pay attention to their side of the story while acknowledging their emotions and sentiments. When it’s necessary, give them praise and appreciation, rather than commanding them with authority, which has been shown to be ineffective.</p><h4>4. Choice to make</h4><p>Recognize that there are likely a variety of options that would satisfy both your and the other person’s needs. Draw on your shared goals and interests, as well as the things you both agree on. Make some plans and prioritize them to achieve the best possible result for both of you. Make it obvious that the decision and outcome of the end product belong to both you and the other parties.</p><h4>5. Concise Messaging</h4><p>When sending a message, we should always keep the intended audience in mind, making sure to use language and phrases that the recipient will understand. Texts and e-mails, for example, should avoid acronyms that the recipient may not recognize. We should strive for brevity and concision without losing clarity and thoroughness to respect others’ time. Getting the most out of e-mail presents a unique set of obstacles. Messages are frequently poorly constructed, lack particular subject lines, are slow to get to the point, or are just too long to be read in their entirety.</p><p>In electronic communication, striking the correct tone or avoiding the wrong one can be difficult. Because written communication lacks nonverbal cues such as tone of voice or body language, it is more likely to be misconstrued and potentially cause offense. As a result, it’s possible that significant communications should be reviewed by someone who can analyze the tone and content and provide feedback.</p><p><strong>Conclusion<br></strong>Whether you like it or not, you will encounter a variety of conflicts throughout your career. It is critical that you understand who you are and how you interact with others. The more self-aware you become, the better your chances of resolving issues, improving relationships, and becoming more effective and valuable to your team and organization.</p><p>And, if you believe your conflict-management skills are lacking, you can begin to improve your game by better understanding the impact of conflict. Read articles, take a course, talk to people who deal with conflict well, implement a conflict resolution process in your life — whatever it takes to improve your conflict acumen, you will notice a dramatic, positive improvement in how you deal with conflict.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=309eb8d53f2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android 12: Splash Screen API]]></title>
            <link>https://ray-chong.medium.com/android-12-splash-screen-api-d57b89553d55?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/d57b89553d55</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-12]]></category>
            <category><![CDATA[splash-screen]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[jetpack]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Fri, 16 Jul 2021 16:12:03 GMT</pubDate>
            <atom:updated>2021-07-16T16:12:03.778Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_HtZsdGX0yBeEnKFjpyog.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@solenfeyissa?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Solen Feyissa</a> on <a href="https://unsplash.com/s/photos/mobile-app-google?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>With the recent launch of Android 12 a.k.a API 31, Google introduced a new platform API that aims to boost the user experience with <a href="https://developer.android.com/about/versions/12/features/splash-screen#kotlin">Splash Screen API</a>. Unlike the legacy way of doing things, the new Splash Screen API did come with a few handful configurations which allow developers to customize their ideal screen on top of this feature.</p><p>Before we get our hands dirty on Splash Screen API, first we need to understand what&#39;s a <strong>warm start</strong> and <strong>cold start</strong>. You may read in detailed <a href="https://developer.android.com/topic/performance/vitals/launch-time">here</a>.</p><blockquote><strong>Warm Start</strong><br>A warm start encompasses some subset of the operations that take place during a cold start; at the same time, it represents more overhead than a hot start. There are many potential states that could be considered warm starts. For instance:</blockquote><blockquote>The user backs out of your app, but then re-launches it. The process may have continued to run, but the app must recreate the activity from scratch via a call to <a href="https://developer.android.com/reference/android/app/Activity#onCreate(android.os.Bundle)">onCreate()</a>.</blockquote><blockquote>The system evicts your app from memory, and then the user re-launches it. The process and the activity need to be restarted, but the task can benefit somewhat from the saved instance state bundle passed into <a href="https://developer.android.com/reference/android/app/Activity#onCreate(android.os.Bundle)">onCreate()</a>.</blockquote><blockquote><strong>Cold Start</strong><br>A cold start refers to an app’s starting from scratch: the system’s process has not, until this start, created the app’s process. Cold starts happen in cases such as your app’s being launched for the first time since the device booted, or since the system killed the app. This type of start presents the greatest challenge in terms of minimizing startup time, because the system and app have more work to do than in the other launch states.</blockquote><p>Based on the documentation, Splash Screen will only show to user when the app is launched from cold start condition. <strong>It will never show for a warm start.</strong></p><h3><strong>Implementation</strong></h3><p>The new Splash Screen API will only work with API 31, developer will need to adjust the <strong>compileSdkVersion </strong>to 31 as shown below.</p><pre>android <strong>{<br>    </strong>compileSdkVersion 31<br>    buildToolsVersion &quot;31.0.0&quot;<br>     ....<br>}</pre><p>Once sync with the configuration, the next step is to create a theme for the splash screen. Since this API is only available on Android 12, we will also need to cater to devices lower than API 31 by creating a different set of themes under different folders. For non-compatible devices, we can create the splash screen with the following configuration. The code snippet below shows a layer list contains the splash logo and footer text.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f038a44262ace904142f9a2d84364d6/href">https://medium.com/media/4f038a44262ace904142f9a2d84364d6/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a67003420fe3a1c1b674abf966a2ea14/href">https://medium.com/media/a67003420fe3a1c1b674abf966a2ea14/href</a></iframe><p>And for API 31 theme, the configuration is slightly richer. Based on the <a href="https://developer.android.com/about/versions/12/features/splash-screen#kotlin">official documentation</a>, the Splash Screen comes with the following configuration.</p><pre>Use <a href="https://developer.android.com/reference/android/R.attr#windowSplashScreenBackground">windowSplashScreenBackground</a> to fill the background with a specific single color:<br><strong>&lt;item name=&quot;android:windowSplashScreenBackground&quot;&gt;@color/...&lt;/item&gt;</strong></pre><pre>Use <a href="https://developer.android.com/reference/android/R.attr#windowSplashScreenAnimatedIcon">windowSplashScreenAnimatedIcon</a> to replace an icon in the center of the starting window.<br><strong>&lt;item name=&quot;android:windowSplashScreenAnimatedIcon&quot;&gt;@drawable/...&lt;/item&gt;</strong></pre><pre>Use windowSplashScreenIconBackground to set a background behind the splash screen icon.<br><strong>&lt;item name=”android:windowSplashScreenIconBackground”&gt;@color/...&lt;/item&gt;</strong></pre><pre>use <a href="https://developer.android.com/reference/android/R.attr#windowSplashScreenBrandingImage">windowSplashScreenBrandingImage</a> to set an image to be shown at the bottom of the splash screen.<br><strong>&lt;item name=”android:windowSplashScreenBrandingImage”&gt;@drawable/...&lt;/item&gt;</strong></pre><p>For the playground project I used to implement Splash screen, I decided to give animated icon a try with this following configuration. Despite the fact that implementing a branding image is against the recommended design guideline, but for the purpose to demo the usage, the option will be present in the config below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/109a516a0a2c187416c27faecd46a1cc/href">https://medium.com/media/109a516a0a2c187416c27faecd46a1cc/href</a></iframe><h3>One Last Step…</h3><p>Under project manifest, assign the theme to Splash Activity. And don&#39;t forget to set the <strong>exported</strong> tag to false. In case you are not clear what’s this flag does, please read the details over <a href="https://developer.android.com/guide/topics/manifest/receiver-element.html?hl=en">this official documentation</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9c3a62e3b1bc40216523a6d35e9c419/href">https://medium.com/media/a9c3a62e3b1bc40216523a6d35e9c419/href</a></iframe><p>Afterwards, the Splash Screen should look something like this.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F575874500%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F575874500&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1190930891_960&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="970" height="2048" frameborder="0" scrolling="no"><a href="https://medium.com/media/336febcecff6106c1858add2c27f61c3/href">https://medium.com/media/336febcecff6106c1858add2c27f61c3/href</a></iframe><h3>Additional Configuration</h3><p>Aside from the general implementation steps, developer is given the flexible to configure a animation or to exit straight once the processing work has been done from view model. The options are available in the code snippet below,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a177d1305796d718dd7d4802a9b27d6f/href">https://medium.com/media/a177d1305796d718dd7d4802a9b27d6f/href</a></iframe><p>I’ve hosted the sample project in my GitHub, feel free to check it out! Happy coding.</p><p><a href="https://github.com/raychong/android-splash-demo">raychong/android-splash-demo</a></p><p><strong>Reference:</strong><br><a href="https://developer.android.com/about/versions/12/features/splash-screen#kotlin">https://developer.android.com/about/versions/12/features/splash-screen#kotlin</a></p><p><a href="https://developer.android.com/topic/performance/vitals/launch-time">https://developer.android.com/topic/performance/vitals/launch-time</a></p><p><a href="https://9to5google.com/2021/07/13/android-12-animated-splash-screen/">https://9to5google.com/2021/07/13/android-12-animated-splash-screen/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d57b89553d55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Emulator Detection]]></title>
            <link>https://ray-chong.medium.com/android-emulator-detection-4d0f994aab5e?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d0f994aab5e</guid>
            <category><![CDATA[emulator]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Thu, 22 Apr 2021 14:12:22 GMT</pubDate>
            <atom:updated>2022-01-14T14:30:16.871Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y6CmkVPnHFeivrqtZkH1wg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@rmrdnl?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Daniel Romero</a> on <a href="https://unsplash.com/s/photos/android?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Over the past few years, the Fintech industry is sprouting up all over the world and helping the rise of new markets. Consumers are getting used to experiencing a seamless digital experience when handling their funds. As the mobile application getting mature and providing more functionality to users, they become more attractive to attackers/hackers.</p><p>Usually, attackers will start to understand their target application by using an emulator for the operating system where the application will be run and analyzed. Regardless of the type of attacks they wish to execute, the first step is usually to use an emulator. Therefore in this article, I’m going to show some of the methods to identify whether the app is executed and running on an emulator.</p><p>First, we need to gather types of the emulator in the market and analyze their properties. This is the list of often used android emulators in the market:</p><ul><li>Android Studio Emulator</li><li>Bluestacks</li><li>Genymotion</li><li>Nox</li><li>Droid4x</li><li>Andy</li><li>MEmu player</li></ul><p>So, to start with the detection, the easiest way is to check on the build values under BuildConfig. All these values can be accessed programmatically and most of the time they contain proof of the presence of an emulator.</p><ul><li>Build.MANUFACTURER</li><li>Build.MODEL</li><li>Build.HARDWARE</li><li>Build.FINGERPRINT</li><li>Build.BOARD</li><li>Build.PRODUCT</li></ul><pre>private fun checkBuildConfig(): Boolean {<br>    var isEmulator = (Build.<em>MANUFACTURER</em>.<em>contains</em>(&quot;Genymotion&quot;) <br>            || Build.<em>MODEL</em>.<em>contains</em>(&quot;google_sdk&quot;)<br>            || Build.<em>MODEL</em>.<em>toLowerCase</em>().<em>contains</em>(&quot;droid4x&quot;)<br>            || Build.<em>MODEL</em>.<em>contains</em>(&quot;Emulator&quot;)<br>            || Build.<em>MODEL</em>.<em>contains</em>(&quot;Android SDK built for x86&quot;)<br>            || Build.<em>HARDWARE </em>== &quot;goldfish&quot;<br>            || Build.<em>HARDWARE </em>== &quot;vbox86&quot;<br>            || Build.<em>HARDWARE</em>.<em>toLowerCase</em>().<em>contains</em>(&quot;nox&quot;)<br>            || Build.<em>FINGERPRINT</em>.<em>startsWith</em>(&quot;generic&quot;)<br>            || Build.<em>PRODUCT </em>== &quot;sdk&quot;<br>            || Build.<em>PRODUCT </em>== &quot;google_sdk&quot;<br>            || Build.<em>PRODUCT </em>== &quot;sdk_x86&quot;<br>            || Build.<em>PRODUCT </em>== &quot;vbox86p&quot;<br>            || Build.<em>PRODUCT</em>.<em>toLowerCase</em>().<em>contains</em>(&quot;nox&quot;)<br>            || Build.<em>BOARD</em>.<em>toLowerCase</em>().<em>contains</em>(&quot;nox&quot;)<br>            || (Build.<em>BRAND</em>.<em>startsWith</em>(&quot;generic&quot;) &amp;&amp;    Build.<em>DEVICE</em>.<em>startsWith</em>(&quot;generic&quot;)))</pre><pre>    return isEmulator<br>}</pre><p><strong>Go Advanced:</strong><br> If all these checkings still not sufficient for you, probably need to go a little bit deeper to check the files/folder usually used by the emulator.</p><pre>private val GENY_FILES = <em>arrayOf</em>(<br>        &quot;/dev/socket/genyd&quot;,<br>        &quot;/dev/socket/baseband_genyd&quot;<br>)</pre><pre>private val PIPES = <em>arrayOf</em>(<br>        &quot;/dev/socket/qemud&quot;,<br>        &quot;/dev/qemu_pipe&quot;<br>)<br>private val X86_FILES = <em>arrayOf</em>(<br>        &quot;ueventd.android_x86.rc&quot;,<br>        &quot;x86.prop&quot;,<br>        &quot;ueventd.ttVM_x86.rc&quot;,<br>        &quot;init.ttVM_x86.rc&quot;,<br>        &quot;fstab.ttVM_x86&quot;,<br>        &quot;fstab.vbox86&quot;,<br>        &quot;init.vbox86.rc&quot;,<br>        &quot;ueventd.vbox86.rc&quot;<br>)<br>private val ANDY_FILES = <em>arrayOf</em>(<br>        &quot;fstab.andy&quot;,<br>        &quot;ueventd.andy.rc&quot;<br>)<br>private val NOX_FILES = <em>arrayOf</em>(<br>        &quot;fstab.nox&quot;,<br>        &quot;init.nox.rc&quot;,<br>        &quot;ueventd.nox.rc&quot;<br>)</pre><pre>fun checkFiles(targets: Array&lt;String&gt;): Boolean {<br>    for (pipe in targets) {<br>        val file = File(pipe)<br>        if (file.exists()) {<br>            return true<br>        }<br>    }<br>    return false<br>}</pre><pre>fun checkEmulatorFiles():Boolean {<br>    return (checkFiles(GENY_FILES)<br>            || checkFiles(ANDY_FILES)<br>            || checkFiles(NOX_FILES)<br>            || checkFiles(X86_FILES)<br>            || checkFiles(PIPES))<br>}</pre><p><strong>Bottom line:<br></strong>The usage of fintech mobile applications is growing rapidly over the world. Step into the ground of security is eventually a must for developers to secure their application in order to get rid of fraud cases. There are many more mechanisms to detect emulators available on the internet, do give them a try and figure out the best solution for your use cases.</p><p><strong>Reference</strong>:</p><p><a href="https://stackoverflow.com/a/21505193/1107579">https://stackoverflow.com/a/21505193/1107579</a></p><p><a href="http://koreascience.or.kr/article/JAKO201533678768383.pdf">http://koreascience.or.kr/article/JAKO201533678768383.pdf</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d0f994aab5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android: Publish to Firebase Distribution via Gradle command]]></title>
            <link>https://ray-chong.medium.com/android-publish-to-firebase-distribution-via-gradle-command-6ce43c36cf21?source=rss-728c38967520------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ce43c36cf21</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[firebase-app-distribution]]></category>
            <dc:creator><![CDATA[Ray Chong]]></dc:creator>
            <pubDate>Sun, 10 Jan 2021 16:34:43 GMT</pubDate>
            <atom:updated>2021-01-10T16:39:47.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8bwLdxBe4IF5ruvZlq3jQ.jpeg" /></figure><p>In this article, I’ll be showing you how to set up and distribute your Android app to Firebase Distribution via Gradle task.</p><p>Let’s Start!</p><p><strong>Step 1: Create a firebase project.</strong><br>Navigate to Firebase console, create your android project if you haven&#39;t done so. Navigate to project settings, create an app which matches the package name stated in your .gradle file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DiIOYhm_AE6CKge5PUKHUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*NgeyDPu9CuYHVslm64NyrQ.png" /></figure><p>Once your app is created, navigate to <strong>App Distribution</strong> tab via the side menu. Click on <strong>Get Started</strong> to activate firebase distribution.</p><p><strong>Step 2: Create a service account</strong></p><blockquote>Service accounts are useful for setting up App Distribution in a CI environment. Authenticating with a <a href="https://cloud.google.com/iam/docs/creating-managing-service-accounts">service account</a> allows you to use client libraries (e.g., the Firebase CLI, Gradle, and fastlane) to distribute your builds. When you use a service account to authenticate, Firebase uses <a href="https://cloud.google.com/docs/authentication/production">Application Default Credentials (ADC)</a> to locate your app’s credentials, which you can provide by either setting the GOOGLE_APPLICATION_CREDENTIALS environment variable or by pointing to the path of your service account key in your app&#39;s code.</blockquote><p>So, to begin with, the account creation, first you will need to visit <a href="https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts"><strong>Google Cloud Console</strong></a>. Select your application in the top action bar, then proceed to create a service account from the panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7iNzvtvHs_TMc89a-uBRIQ.png" /></figure><p>Fill in the account details under the first step and then assign the role for this service account as <strong>Firebase App Distribution Admin</strong>. Click on done afterward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*zsREybj_USSiyjSVkEMgkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*AAK9YPL86QIIB88LTRYZTw.png" /></figure><p>Once the service account is created, click on the three dots from the row and proceed to create a private key in .json file format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*a0o_dVxsM0tUsf4wHzHs8A.png" /></figure><p>The console will then automatically download the .json file for you. Make a copy of this file and put it in your android project in the root directory. We’ll be using this file to setup Gradle task in a while.</p><p><em>Note: If your project is hosted in a public repository, please make sure you have put enough effort to secure your credential. This is because the private key is authorized for full admin access to your Firebase project. Read more on how to prevent commit credentials into git repo </em><a href="https://medium.com/better-programming/how-you-can-prevent-committing-secrets-and-credentials-into-git-repositories-adffc25c2ea2"><em>here</em></a><em>.</em></p><p><strong>Step 3: Configure Gradle task</strong></p><p>To begin with this, you can start adding firebase dependency in your project level .gradle file.</p><pre>dependencies <strong>{</strong></pre><pre>    ........<br>    classpath &#39;com.google.firebase:firebase-appdistribution-gradle:2.0.1&#39;<br><br><strong>}</strong></pre><p>Once the dependency is added, apply the firebase distribution plugin at your android level .gradle file. Also, don&#39;t forget to include firebase SDK in your app. You may go for Firebase Android BoM option. Read more about Firebase Android BoM <a href="https://firebase.google.com/docs/android/learn-more#bom"><strong>here</strong></a>.</p><pre>.....<br>apply plugin: &#39;com.google.gms.google-services&#39;<br>apply plugin: &#39;com.google.firebase.appdistribution&#39;</pre><pre>dependencies {<br>  // Import the BoM for the Firebase platform<strong><br>  implementation platform(&#39;com.google.firebase:firebase-bom:26.2.0&#39;)</strong></pre><pre>// When using the BoM, you don&#39;t specify versions in Firebase library dependencies<br>  // Declare the dependency for the Firebase SDK for Google     Analytics<br> <strong>implementation &#39;com.google.firebase:firebase-analytics-ktx&#39;<br></strong>}</pre><p>Once the plugin and SDK are sync to the project, you may proceed to configure firebase distribution under <strong>buildTypes</strong> or <strong>productFlavors</strong> section in your app level .gradle file. You might need to refer to the <a href="https://firebase.google.com/docs/app-distribution/android/distribute-gradle#3_configure_your_distribution_properties">parameters list</a> for the available options.</p><p>For example, if you wish to separate the distribution configuration for your develop and production environment. You may use the following code. For this use case, I’ll be using <strong>productFlavors </strong>to demonstrate the usage.</p><pre>productFlavors <strong>{<br>      </strong>dev <strong>{<br>    </strong>dimension &quot;version&quot;<br>    versionNameSuffix &quot;-dev&quot;<br>    applicationId &#39;com.pentagon_labs.ruum.dev&#39;<br>    testInstrumentationRunner  &#39;androidx.test.runner.AndroidJUnitRunner&#39;<br><br>    firebaseAppDistribution <strong>{<br>        </strong>serviceCredentialsFile = &quot;./ruum-app-firebase-admin.json&quot;<br>        releaseNotes = &quot;Initial release&quot;<br>        testers=&quot;ali@example.com, bri@example.com, cal@example.com&quot;<br>    <strong>}<br>}<br><br></strong>prod <strong>{<br>    </strong>dimension &quot;version&quot;<br>    applicationId &#39;com.pentagon_labs.ruum&#39;<br>    testInstrumentationRunner &#39;androidx.test.runner.AndroidJUnitRunner&#39;<br><br>    firebaseAppDistribution <strong>{<br>        </strong>serviceCredentialsFile = &quot;./ruum-app-firebase-admin.json&quot;<br>        releaseNotesFile = &quot;./firebase-dist-prod-release-notes.txt&quot;<br>        testersFile = &quot;./firebase-dist-prod-testers.txt&quot;<br>    <strong>}<br>}<br>    }</strong></pre><p>Properties:</p><ul><li><strong>serviceCredentialsFile: </strong>This is the file generated earlier from Google Cloud Console after service account creation. For this case, the path is located at my project root. You may change it to <strong>/android</strong> directory.</li><li><strong>releaseNotesFile</strong>: This file is used to state your changelog, instructions or message you wish to deliver to your testers.</li><li><strong>releaseNote</strong>: If you think putting the instruction or message in a file is redundant, you may proceed to this option.</li><li><strong>testersFile</strong>: This file is used to state your testers. You can specify the testers as a comma-separated list of email addresses.</li><li><strong>testers: </strong>Specify testers straight away and separate each of them with a comma.</li><li><strong>groups</strong>: Release to a group of testers via group aliases.</li><li><strong>groupsFile</strong>: Same as above, but the content are hosted in a separated file.</li><li><strong>apkPath: </strong>Absolute or relative path to the APK file you want to upload. If unspecified, Gradle determines the file’s location using the APK output directory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GLsP4xiozlJMnYZ6JHwLXA.png" /><figcaption>You may find the group alias here.</figcaption></figure><p><strong>Step 4: Distribute your app to testers</strong></p><p>Finally, to package your test app and invite testers, build the targets assembleBUILD-VARIANT and appDistributionUploadBUILD-VARIANT with your project&#39;s Gradle wrapper, where BUILD-VARIANT is the optional product flavor and build type you configured in the previous step. For more information about product flavors, see <a href="https://developer.android.com/studio/build/build-variants"><strong>Configure build variants</strong></a><strong>.</strong></p><p>For example, to distribute your app using the prod build variant, run the following command:</p><pre>./gradlew assembleProdRelease appDistributionUploadProdRelease</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*sJJ-2gPfe1ogDk7cz6BFgg.png" /></figure><p>Once you distribute your build, it becomes available in the App Distribution dashboard of the Firebase console for 150 days (five months). When the build is 30 days from expiring, an expiration notice appears in both the console and your tester’s list of builds on their test device.</p><p>Testers who haven’t been invited to test the app receive email invitations to get started, and existing testers receive email notifications that a new build is ready to test. You can monitor the status of each tester-whether they accepted the invitation and whether they downloaded the app-in the Firebase console.</p><p>Last, I’ll attach some reference links below. Please feel free to ask me if you encounter any issues. Have fun!</p><ul><li><a href="https://firebase.google.com/docs/android/setup#kotlin+ktx">https://firebase.google.com/docs/android/setup#kotlin+ktx</a></li><li><a href="https://buddy.works/actions/firebase">https://buddy.works/actions/firebase</a></li><li><a href="https://itnext.io/firebase-app-distribution-vs-testflight-16ade1f6d349">https://itnext.io/firebase-app-distribution-vs-testflight-16ade1f6d349</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ce43c36cf21" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>