# Segun Famisa

Personal blog for Segun Famisa.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Designing Android's missing WorkManager test rule

DevFeed: [Designing Android's missing WorkManager test rule](<https://devfeed.tech/articles/designing-android-s-missing-workmanager-test-rule-25830.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/androids-missing-work-manager-test-rule>)

Author: Segun Famisa

Published: 2026-08-30T06:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Library](<https://devfeed.tech/topics/library.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [guide](<https://devfeed.tech/tags/guide.md>), [integration-testing](<https://devfeed.tech/tags/integration-testing.md>), [library](<https://devfeed.tech/tags/library.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

The article presents a WorkManager test rule intended to reduce repeated setup, cleanup, state retrieval, and API calls when testing Android work. It discusses the androidx.work:work-testing library, integration-style testing with TestDriver, and a proposed WorkManagerTestRule.

### Source excerpt

TL;DR - create a work manager rule to make your tests easier to write. It's not hard to do, and it pays off. I have been working quite a bit with WorkManager stuff these days, and while attempting to write tests for them, I realised there were things I was doing repeatedly. Work Manager provides a helpful testing library - androidx.work:work-testing and they have a very nice guide on how to write tests for work manager - both integration tests, and testing worker implementation details1, and despite this, I found myself writing a couple of things over and over again. This post is somewhere between bringing awareness to testing APIs available for WorkManager, and showcasing a test rule that I think can help lower the barrier to testing. Before Say I have a SyncDispatcher class that does sync, and sometimes, I want to keep existing work, and other times, I want to replace the existing work. class SyncDispatcher(val workManager: WorkManager) { fun sync(params: SyncParams) { val existingWorkPolicy = if (params.syncAll) { ExistingWorkPolicy.REPLACE } else { ExistingWorkPolicy.APPEND_OR_REPLACE } val workRequest = OneTimeWorkRequestBuilder<SyncWorker>() .setConstraints(Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build()) .build() workManager.beginUniqueWork("sync-work", existingWorkPolicy, workRequest) .enqueue() } } If I wanted to test this behaviour in an "integration-testing" style, I could use the TestDriver API2 of work manager to instrument the constraints that my work depends on, be it initial delay, network condition, period delay (for perioidic work), stopping the work with a reason, and so on. // SyncDispatcherTest.kt @Before { val config = Configuration.Builder().setExecutor(SynchronousExecutor()).build() WorkManagerTestInitHelper.initializeTestWorkManager(testContext, config) } @Test fun `sync all drops all prior sync requests`() = runTest() { // given that we have previous sync work enqueued dispatch.sync(syncPartialParams) // when we

## Why AI-Generated Text Cannot Be Reliably Identified by Stylistic "Tells"

DevFeed: [Why AI-Generated Text Cannot Be Reliably Identified by Stylistic "Tells"](<https://devfeed.tech/articles/no-you-can-t-tell-it-was-written-by-ai-25839.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/no-you-cant-tell-it-was-written-by-ai>)

Author: Segun Famisa

Published: 2026-02-05T06:00:00Z

Content type: opinion

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [personal](<https://devfeed.tech/tags/personal.md>)

### AI overview

This essay argues that stylistic "tells" are not reliable evidence that a document was written by AI. It explains that many styles associated with AI existed in human writing before AI and may also reflect the human content, annotation, and labor involved in training AI systems.

### Source excerpt

Preface Yes. This is another AI post. It's kinda hard to ignore. I have seen people casually claim that a post, text, or an article was AI-written, and they're usually wrong. Of course, not always. I am not speaking to the cases where you know the author and their style, or you have seen the content somewhere else, or the content is straight up gibberish or nonsensical. I am speaking about the cases where people assert that certain "tells" people have that make them know that a document or email was written by AI. In this essay, I will argue that, your favourite "tells" that a document was produced by AI, at best, is wrong, and depending on your position, in life, at worst, is dangerous and harmful. This essay is 100% written by me. I did not use AI for anything. Not even for grammar or spelling check, formatting or tone adjustments. You will see some ideas and claims that I make that other people have also made. These arguments are definitely not unique to me, so I am not claiming to be the first to be making them. I will intentionally use some of the "tells" I have seen people claim leads them to conclude it's AI, and I will try to reference the related literary and rhetorical device, if any. Ready? Yeah, let's delve into it. AI Did Not Just Invent Styles. Humans Used It First 1 The first argument is, any pattern you think you have noticed from AI usage was first used by humans. This is an undebatable fact. These AIs did not just materialise. They were trained on original human content. AI Has Elements of the Stylistic Choices of the People Who Trained It 2 My second argument is that the styles we see with AI, reflect the stylistic choices of the people who did training and annotation. The development of AI had many phases. Many of those phases involved grunt work of people--humans 3, manually inputing data, annotating it, and scoring the AI outputs. So who trained it? A lot of the early training, data annotations and other manual processes, happened with cheap lab

## Exploring Custom Text Rendering with Jetpack Compose

DevFeed: [Exploring Custom Text Rendering with Jetpack Compose](<https://devfeed.tech/articles/exploring-custom-text-rendering-with-jetpack-compose-25835.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/exploring-custom-text-rendering-in-compose>)

Author: Segun Famisa

Published: 2026-01-11T06:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Canvas](<https://devfeed.tech/topics/canvas.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [canvas](<https://devfeed.tech/tags/canvas.md>), [compose](<https://devfeed.tech/tags/compose.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>)

### AI overview

This tutorial explores custom text rendering in Jetpack Compose using the TextMeasurer, TextLayoutResult, and Canvas APIs. It explains how to measure text, inspect line and character-level layout information, and use those results when drawing text with custom effects.

### Source excerpt

TL;DR: exploring TextMeasurer, TextLayoutResult and Canvas for custom text rendering with Jetpack compose My coworker showed me this article from devtechie on how to implement custom text rendering in SwiftUI. I was a bit envious of how easy it looked and I thought..."hmm, I think we should actually be able to do this in compose quite easily too". So, I decided to explore the lower level text APIs available on Compose and challenged myself to recreate the renderings with Compose. Before I talk through my take on some of the custom text renderings I want to recreate, I want to get straight to the main APIs that we can use to achieve the effects. Jetpack Compose Lower-Level Text APIs TextMeasurer The TextMeasurer API allows us to - you guessed it - measure the text before we draw it. It takes into account the style, text, constraints, and other things that could influence the size of the text. TextMeasurer has a measure function that returns a TextLayoutResult. The typical way one would create a text measurer is: val textStyle = MaterialTheme.typography.headlineLarge val text = "My special text" val textMeasurer = rememberTextMeasurer() val textLayoutResult = remember(text, textStyle, constraints) { textMeasurer.measure( text = text, style = textStyle, //constraints = constraints <--- if you need constraints ) } TextLayoutResult The TextLayoutResult is where the fun is. It contains information about the text being laid out. With TextLayoutResult, you can do a lot of cool things. You can get the number of lines required to draw the text via TextLayoutResult.lineCount. It also allows us to get the size of the text via TextLayoutResult.size. I really like this API because it's so powerful - it even gives us character by character information. You can get the bounding box Rect of a particular index in the text, and this is powerful for influencing the text rendering on a character-by-character basis. I strongly recommend going through the TextResultLayout docs to see what y

## Live Templates in Android Studio

DevFeed: [Live Templates in Android Studio](<https://devfeed.tech/articles/live-templates-in-android-studio-25829.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/android-studio-live-templates>)

Author: Segun Famisa

Published: 2025-07-17T06:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [ide](<https://devfeed.tech/topics/ide.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [code](<https://devfeed.tech/tags/code.md>), [ide](<https://devfeed.tech/tags/ide.md>), [intellij](<https://devfeed.tech/tags/intellij.md>), [jetbrains](<https://devfeed.tech/tags/jetbrains.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [shortcuts](<https://devfeed.tech/tags/shortcuts.md>), [tests](<https://devfeed.tech/tags/tests.md>), [workflow](<https://devfeed.tech/tags/workflow.md>)

### AI overview

This tutorial explains IntelliJ-based IDE live templates, with a focus on creating a custom Android Studio template for Kotlin test functions that use backticks. It describes the template settings, applicable context, abbreviation, description, and template variables.

### Source excerpt

If you are already familiar with live templates, feel free to skip to the live template for kotlin tests If you use IntelliJ-based IDEs like Android Studio, WebStorm, etc., chances are that you have seen some kinds of "shortcuts" (pictured below) show up when you press some key combinations. These are called live templates. For example, if you type sout in a Java/Kotlin file, you see a pop-up like the one above. When you press tab, it autocompletes into System.out.println (in Java) or println in Kotlin. Live templates allow you to generate common code constructs by typing keywords that trigger the template. This feature is not new, and I definitely remember seeing it in the Netbeans IDE when I developed J2ME applications. If, like me, you write a lot of Android code in Android Studio, you may also know that if you type comp in a Kotlin file and press the tab key, a composable function is generated. I have personally found these templates extremely useful for developing faster, and I use them all the time. I even have a few of my own templates, and one of them is the main reason I am writing this article. -- Live Template for Kotlin tests One of the things I do almost every day when I write code is write tests. If you use Kotlin, you might know that backticks are allowed in test function names. I like to optimise my workflow, and I realised this was an opportunity to save myself a few keystrokes for every test I write. I ended up writing a live template to automatically create a test function with backticks (does anyone else find the backtick key awkwardly placed on the keyboard?). To set this up, I follow the instructions on JetBrains' website. You can do the same: CMD + , to open settings Navigate to Editor > Live Templates Select Kotlin group (the templates are usually grouped, but you can also create your own group if you so please) Click on the little + button or CMD + N , and select 1 or Live Template Now we can begin to set the details for the live template. Th

## Selectively running Android UI tests

DevFeed: [Selectively running Android UI tests](<https://devfeed.tech/articles/selectively-running-android-ui-tests-25843.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/selectively-run-android-ui-tests>)

Author: Segun Famisa

Published: 2024-12-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Instrumentation](<https://devfeed.tech/topics/instrumentation.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [adb](<https://devfeed.tech/tags/adb.md>), [android](<https://devfeed.tech/tags/android.md>), [ci](<https://devfeed.tech/tags/ci.md>), [flag](<https://devfeed.tech/tags/flag.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [instrumentation](<https://devfeed.tech/tags/instrumentation.md>), [junit](<https://devfeed.tech/tags/junit.md>), [property](<https://devfeed.tech/tags/property.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [test-lab](<https://devfeed.tech/tags/test-lab.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

This tutorial explains how to selectively run additional checks in Android UI tests. It uses a custom annotation and AndroidJUnitRunner filters to target specific tests, then passes arguments through adb or Gradle so the checks can be enabled only under chosen conditions, such as CI runs.

### Source excerpt

Intro This is really a note for my future self. Recently, I had a situation where I wanted to perform some extra checks after a test has been run. These additional checks are done after each test is run via a Junit rule SpecialRule which is applied to a test suite. For the purpose of illustration, let's say our SpecialRule looks like this: class SpecialRule : TestRule { override fun apply(statement: Statement, desc: Description): Statement { return object : Statement() { override fun evaluate() { try { // Run the test. statement.evaluate() } finally { // Perform extra checks after the test. Log.d("SpecialRule", "performing extra checks") } } } } } However, we were concerned about the run duration of the tests being extended significantly by the extra checks, so we wanted a bit more control. That led to some constraints. We wanted to: be able to selectively perform those checks on specific tests perform those checks only under certain conditions. Constraint #1 - Selectively perform additional checks on specific tests The immediate approach that came to mind was to use a custom annotation - @SpecialTest, and then somehow find a way to target the tests that are annotated with this. Luckily, the AndroidJunitRunner provides various filters to target specific annotations. For example, to run all the tests annotated with @SpecialTest , we will use something like: adb shell am instrument -w -e annotation com.mypackage.SpecialTest com.android.foo/androidx.test.runner.AndroidJUnitRunner If you use Flank to run your tests on Firebase Test Lab, then you can use: --test-targets: "annotation com.mypackage.SpecialTest" Now that we can selectively target the tests, we need to extend our test rule to only perform these checks if the test is annotated with @SpecialTest annotation. Our SpecialRule then becomes something like: class SpecialRule : TestRule { override fun apply(statement: Statement, desc: Description): Statement { return object : Statement() { override fun evaluate() { t

## Analyzing your Gradle dependencies

DevFeed: [Analyzing your Gradle dependencies](<https://devfeed.tech/articles/analyzing-your-gradle-dependencies-25824.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/analyze-gradle-dependencies>)

Author: Segun Famisa

Published: 2024-03-14T20:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [Android](<https://devfeed.tech/topics/android.md>), [debug](<https://devfeed.tech/topics/debug.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [debug](<https://devfeed.tech/tags/debug.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [guide](<https://devfeed.tech/tags/guide.md>)

### AI overview

A practical guide to analyzing Gradle dependencies in Android projects. It explains how dependency configurations determine classpaths, describes the ResolvableConfigurationsTask available in Gradle 7.5 and later, and recommends examining compile classpaths to identify unexpected dependencies in build type and product flavor combinations.

### Source excerpt

Featured in Android Weekly #614 and Kotlin Weekly #398 As Android developers, now and then, we may have to investigate or analyze the Gradle dependencies we are using. Whether we are trying to find out which versions of libraries we are using, or we are trying to find out where one - perhaps unusual dependency is coming from, we may end up needing this knowledge. A short story. Recently, leak canary - which we use to detect memory leaks - was found to be deactivated in our project. Upon investigating, I found that it was deactivated because a test dependency was accidentally added to the classpath of our debug builds. So, I had to investigate to find out what test dependency is there, and how it got there. In this post, I will share some tips that can help you analyze our Gradle dependencies and debug them too. Analyzing the configurations First, to analyze the dependencies, one needs to know which kinds of dependencies one is looking for. We can do this by trying to understand how exactly the dependencies are declared - and that determines how they end up in the classpath. In other words, we need to know the configurations. Configurations are a way for you to tell Gradle how exactly to package these dependencies to achieve the final output. Some dependencies might be used only in compile time, while some are needed both in compile time and runtime. Some might even have special behaviors, or relations to plugins like kapt and ksp, or only available in certain source sets - like tests. As described in Google's guide to declaring dependencies, some of the officially supported configurations include api, implementation, compileOnly, runtimeOnly among others. In version 7.5 and above, Gradle provides a ResolvableConfigurationsTask task that reports all the configurations that can be resolved within your project. The task is run as indicated below. ./gradlew :app:resolvableConfigurations app here can be replaced with whichever Gradle module you are interested in seeing.

## Analyze Stack Traces in Android Studio

DevFeed: [Analyze Stack Traces in Android Studio](<https://devfeed.tech/articles/analyze-stack-traces-in-android-studio-25825.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/analyze-stack-trace-in-android-studio>)

Author: Segun Famisa

Published: 2020-06-22T09:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Development](<https://devfeed.tech/topics/development.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [debug](<https://devfeed.tech/tags/debug.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [proguard](<https://devfeed.tech/tags/proguard.md>), [r8](<https://devfeed.tech/tags/r8.md>)

### AI overview

A tutorial on using Android Studio's built-in stack trace analysis tool to format imported crash reports and make their entries clickable and navigable. It also discusses obfuscated stack traces from release builds using ProGuard or R8/D8.

### Source excerpt

Introduction As programmers, we spend a significant part of our time debugging errors. Stack traces are very useful in doing so, and careful analysis of the stack traces help us to locate and fix the problem. In this post, I'll show a quick way we can use Android Studio to make it easier to debug errors using the built-in "stack trace analysis" tool. Context As Android developers, once an app is released into the wild (i.e deployed on a device outside our development environment), we have to rely on crash reporting tools like Firebase Crash reporting, Instabug, Appsee, etc, to collect these reports and aggregate them for us. The experience of working with stack traces varies from whether we are in development or in production. In development, we often get the stack traces right there in the logcat of Android Studio where each line in the stack trace is a clickable link that takes us straight to corresponding line of code. On the other hand, when we collect crash reports and stack traces in the wild, we collect them as text - sometimes formatted, sometimes not. This adds the additional overhead of having to format the stack trace in order to be human-readable and then manually search for the corresponding lines of code in the IDE. Using the "Anaylze Stack Trace" tool Luckily for us, Android Studio solves a part of this problem and makes it easier for us when we are analyzing stack traces that are generated in the wild. When you receive a stack trace, you can import them into Android Studio and introduce all the nice formatting, hyperlink and navigating functionality that we get as if it's a crash from the logcat. The Android Developer docs page pretty much explains how to use this tool, but I'll summarize the steps here: In the Android Studio menu bar, navigate to "Analyze > Analyze Stack Trace or Thread Dump" Paste the stack trace in the window Click "Normalize" to format the stack trace - in case it is not already formatted. Click on "OK" to complete this. On click

## Debugging Android app launch by setting debug app

DevFeed: [Debugging Android app launch by setting debug app](<https://devfeed.tech/articles/debugging-android-app-launch-by-setting-debug-app-25826.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/android-debugging-set-debug-app>)

Author: Segun Famisa

Published: 2020-04-26T09:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [adb](<https://devfeed.tech/tags/adb.md>), [android](<https://devfeed.tech/tags/android.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [commands](<https://devfeed.tech/tags/commands.md>), [debugger](<https://devfeed.tech/tags/debugger.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial explains how to configure an Android application as the debug app so it waits for a debugger before launching. It covers using Android developer options and the set-debug-app adb command, including how to clear the setting and create command-line aliases.

### Source excerpt

Recently, I had to debug a deeplink problem that happens only on fresh app start-up. I was particularly interested in seeing what was happening at different parts of the app when the app starts up. Naturally, I put Log.d() statements allover the app, but it wasted a lot of my time. Every time I added a new log statement, I had to rebuild the app. In this short mini-blog, I'm going to share something I learned from a colleague - how to set a debug app and what it means. How can I set a debug app? A "debug app" is the app that you want to debug. When you set a debug app, the app is not launched until a debugger is attached. On launching the app, you see a dialog with "Waiting for Debugger" as its title. An example of the dialog is as shown in the screenshot below. By the time you see this dialog, you can (set break up points and) attach your debugger, then the app launch will resume. There are two ways you can set your debug app - via the developer options in your device settings or via an adb command. Setting debug app from developer options You can set the debug app and configure other options via the UI in developer options. To set it up: Navigate to Settings -> System -> Developer options and then scroll to the Debugging section. Click on "Select debug app". Select the application you want to debug from the list. Check the "Wait for debugger" option - this is what activates the behaviour we want where the debugged application waits for the debugger to attach before launching. The screenshots below show the step 2-4: And with that, you have set your app as the debug app. To clear the debug app, you can deselect your app by selecting the "Nothing" option when you get to step 3 above. Setting debug app from adb It is also possible to set the debug app from adb. I personally find this option quicker and more convenient than the other approach, but that's just me. The feature is available via the set-debug-app adb command. Typical usage is: adb shell am set-debug-app -

## Using sample data resources in Android Studio

DevFeed: [Using sample data resources in Android Studio](<https://devfeed.tech/articles/using-sample-data-resources-in-android-studio-25842.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/sample-data-with-android-studio>)

Author: Segun Famisa

Published: 2018-10-01T09:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Android](<https://devfeed.tech/topics/android.md>), [XML](<https://devfeed.tech/topics/xml.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [code](<https://devfeed.tech/tags/code.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [xml](<https://devfeed.tech/tags/xml.md>)

### AI overview

A tutorial on using sample data resources in Android Studio 3.2 to populate layout previews. It explains design-time tools attributes in XML and covers framework-provided and custom sample data.

### Source excerpt

Recently, Android Studio 3.2 became stable. The new release brings loads of goodies (explained in the release post here). One of the nice features that caught my attention was the support for Sample data. Using sample data in Android Studio isn't particularly a new feature. I first saw it in this year's Google I/O Android app that was open sourced. It has probably being around even longer. However, with the new Android Studio 3.2 it's even easier to use sample data in your projects. I took the feature for a spin and decided to share my findings. In this quick post, I'll be sharing how you can take advantage of sample data resources in your project. "Sample data" as you might guess, helps us to provide sample data to populate our fields when working with layouts in Android studio. It makes design previews with real data really neat and easy - we don't have to have hardcoded tool attribute values in our XML files. The tools: namespace and attributes You can use the tools namespace in most (if not all) places you can use the Android namespace within your layouts. In addition, you can also use the tools attributes for some error handling like tools:targetApi, and tools:ignore . If these view attributes (for example, textColor) are supported by the preview, you will be able to see your views with the attributes specified in the preview section of your layout editor. The code below shows the text colour as red in the layout preview. <TextView ... android:text="Hello World!" tools:textColor="#FF0000" /> The system only shows these values in the layout editor while designing, but ignores all view attributes that carry the tools namespace, which makes it really handy. It is also why they are also known as design time attributes. If you want to see more about tools/design time attributes, check out this post - https://segunfamisa.com/posts/android-studio-design-time-attributes Sample data One can typically use sample data in two ways. Either by using the sample data provided

## Notification Channels in Android Oreo

DevFeed: [Notification Channels in Android Oreo](<https://devfeed.tech/articles/notification-channels-in-android-oreo-25840.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/notification-channels-android-o>)

Author: Segun Famisa

Published: 2018-02-06T20:20:02Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [SDKs](<https://devfeed.tech/topics/sdks.md>), [API](<https://devfeed.tech/topics/api.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [app](<https://devfeed.tech/tags/app.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [sdk](<https://devfeed.tech/tags/sdk.md>)

### AI overview

This tutorial explains Android Oreo notification channels, including their categories, user-controlled settings, runtime creation, unique IDs and names, importance levels, and channel groups. It states that apps targeting API 26 need to implement notification channels to continue sending notifications.

### Source excerpt

In (not-so) recent news, Google is going to enforce that all apps target SDK 26 (Android Oreo) by late 2018, in order to ensure security and improved performance in apps. You can read more about the announcement here. Now, it's pretty easy to target API 26, but there's no gurantee that your app will function as it used to by just changing the targetSdkVersion value in your build.gradle file. This post looks specifically at one of the new things introduced in Android Oreo, and how targeting API 26 will affect your app, and notifications - notification channels (or categories). TL;DR Your app will stop sending notifications to the users if you target API 26 and you don't implement notification channels. What are Notification Channels? In Android O, notification channels are somewhat like groups or categories of notifications - say you're building a social networking app, the channels can be "activity" - likes, or comments on your posts, "messages", etc. In fact, in the settings of your app, the user sees channels as "categories" as seen in the screenshot below. With the introduction of notification channels, users can get a fine control of what they want to be notified about. They can specifically turn off notifications for a certain channel, specify the importance as well as the preferred sound for a particular category of notifications and determine whether or not to override DND (Do not disturb) Implementing Notification Channels Creating notification channels These notification channels are created at runtime, so they can be dynamically changed to fit the requirements of your the user. For example, if a user subscribes to group chat for example, you can create a channel matching that particular group, and when they leave the group, you can remove the notification channel. So how then does one add channels to notifications? At the simplest level, one needs to create a channel with a unique name and ID and a level of importance. The uniqueness of the name and ID onl

## Custom Fonts on Android with Android Support Library

DevFeed: [Custom Fonts on Android with Android Support Library](<https://devfeed.tech/articles/custom-fonts-on-android-with-android-support-library-25834.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/custom-fonts-with-android-support-library>)

Author: Segun Famisa

Published: 2017-09-04T12:00:00Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [fonts](<https://devfeed.tech/tags/fonts.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [library](<https://devfeed.tech/tags/library.md>)

### AI overview

This tutorial explains how to use Android Support Library 26 to declare custom fonts in XML and programmatically on devices running API 14 and later. It contrasts this approach with custom views and the Calligraphy library.

### Source excerpt

Android Oreo was officially unveiled a couple of weeks ago, and it introduces a lot of new and exciting features. If you haven't already, you should check the developers website for the list of what's new in Android O. One of the really interesting features for developers is the new way to apply fonts right there in your XML files. That's great right? Yup. Except that it works out of the box for only API 26 (Android O). In this post, we will look at how to backport this awesome feature to older versions - down to API 14 using the Support Library 26. Custom Fonts on Android - Old Ways. Previously on Android, there were limited ways to use custom fonts on Android. The following techniques are the ones I consider the most popular ways of implementing custom fonts in Android: 1. Custom Views One would typically need a custom view that extends the equivalent view where trying to apply a font to. In the custom view, one would create a Typeface and then call setTypeface (or a similar method, that, sets the typeface). One would also need to have the font file placed in the assets folder. The code in the custom view typically looks like: Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "fonts/" + fontName; setTypeface(tf); 2. Calligraphy Library Thanks to some awesome developers, there is another approach to having custom fonts in your apps - and the library is called Calligraphy - https://github.com/chrisjenx/Calligraphy. The usage is fairly straightforward, and the pitfalls are clearly identified. But as with every library, it comes with the penalty of adding extra dependencies thereby increasing method count. Custom Fonts with Support Library - The New Way. Thanks to the good folk at Google and their work on Android Support Library 26 it is now possible to declare fonts in XML - something called font families, and also programmatically without the need of an extra library besides the support library (which you most likely already use in your app anyway). H

## Implementing Bottom Navigation View in your app

DevFeed: [Implementing Bottom Navigation View in your app](<https://devfeed.tech/articles/implementing-bottom-navigation-view-in-your-app-25831.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/bottom-navigation-view-android>)

Author: Segun Famisa

Published: 2016-10-24T08:42:45Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>), [Material Design](<https://devfeed.tech/topics/material-design.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [bottomnavigationview](<https://devfeed.tech/tags/bottomnavigationview.md>), [code](<https://devfeed.tech/tags/code.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [material-design](<https://devfeed.tech/tags/material-design.md>)

### AI overview

A tutorial showing how to implement Android's BottomNavigationView using version 25 of the Android Design Support Library. It covers adding the dependency, configuring the view and menu items, and handling item-selection events.

### Source excerpt

Sometimes in March 2016, Luke Wroblewski announced that the Bottom navigation bars were now a part of the material design guidelines. Until then, bottom nav bars were seen as an anti-pattern and were heavily kicked against. There have been several nice libraries to implement this bottom nav bar design, some of which include: https://github.com/roughike/BottomBar and https://github.com/aurelhubert/ahbottomnavigation. Just last week, Google (through Nick Butcher) announced the release of the v25 of the Android Design Support Library which includes the new BottomNavigationView. In this short post, I'll be showing how to use it in your Android app. If you are in a hurry, feel free to jump straight to look at the sample code here: https://github.com/segunfamisa/bottom-navigation-demo Setup To get started with this, you need the latest version (version 25) of Android SDK & tools (including SDK tools, build-tools, platform-tools, support repository). How to use it. 1. Add the design support library First step is to add the design support library to your app-level build.gradle file. Example is as shown below: dependencies { ... compile 'com.android.support:design:25.0.0' } 2. Add the BottomNavigationView to your layout Next step, is to add the actual bottom nav view to the layout. Typically, you will add something like: <android.support.design.widget.BottomNavigationView android:id="@+id/navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="start" design:menu="@menu/bottom_nav_items" /> The BottomNavigationView uses design:menu is a custom attribute that points to the menu resource containing items to be shown on the BottomNavigationView. There are other custom attributes for the view, including: design:itemBackground to set the background of the menu resource design:itemIconTint to set the tint which is applied to the item icons. design:itemTextColor to set the menu item text colour. 3. Define the nav items in the menu

## Improved notifications with Direct reply in Android N

DevFeed: [Improved notifications with Direct reply in Android N](<https://devfeed.tech/articles/improved-notifications-with-direct-reply-in-android-n-25841.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/notifications-direct-reply-android-nougat>)

Author: Segun Famisa

Published: 2016-09-25T08:42:45Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [notifications](<https://devfeed.tech/tags/notifications.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial explains Android N direct reply notifications, which let users respond inline from a notification. It describes how RemoteInput, notification actions, and PendingIntent work together and outlines the implementation steps for adding direct reply to an app.

### Source excerpt

Introduction Notifications is one feature that improves at almost every Android update. From single tap notifications, to actionable notifications, Android N also introduces some new features to Notifications in Android. Android N introduces direct reply, notification bundling and other cool features. If you have Android N installed on your device, you may have noticed the new way the notifications appear. You may also have noticed that you can reply messages in-line right from your notification. I noticed this behaviour has already been implemented on quite a number of apps including Twitter, Slack, WhatsApp. This is made possible by Direct reply. Direct reply aims to reduce the number of steps between receiving a notification and acting on it. The image below is direct reply in action on Slack for Android app. In this post, we will walk through the steps in implementing direct reply in your apps. I will cover the new notification styles and bundling notifications in another post. How it works? Direct reply makes use of a combination of notification, action and Remote Input. Once a Remote input is added to a notification, Android knows that it should request for input from the user. This happens the same way to request for voice input on Android wear 2.0. How to implement? Implementation happens in 3 major steps: 1. Add direct reply action First thing to do, is to add a direct reply action to your notification. To do this, you need to first: a. Build your label using a remote input. The remote input holds information such as the label to show for the action, and the key that will be used to retrieve the user input later on. String replyLabel = getString(R.string.notif_action_reply); RemoteInput remoteInput = new RemoteInput.Builder(KEY_REPLY) .setLabel(replyLabel) .build(); b. Build your notification action Next step is to build the notification action. This uses the NotificationCompat.Action for backwards compatibility. You will then connect the action with the re

## Android studio layout preview with tools designtime attributes

DevFeed: [Android studio layout preview with tools designtime attributes](<https://devfeed.tech/articles/android-studio-layout-preview-with-tools-designtime-attributes-25828.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/android-studio-design-time-attributes>)

Author: Segun Famisa

Published: 2016-09-08T21:42:45Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Android](<https://devfeed.tech/topics/android.md>), [XML](<https://devfeed.tech/topics/xml.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [recyclerview](<https://devfeed.tech/tags/recyclerview.md>), [ui](<https://devfeed.tech/tags/ui.md>), [xml](<https://devfeed.tech/tags/xml.md>)

### AI overview

A short Android Studio tutorial explaining how to use tools design-time attributes in Android XML layouts to preview sample content without affecting app runtime. It covers declaring the tools namespace, replacing Android attributes for previews, and previewing list content.

### Source excerpt

This is a short tip for Android Studio users. Many people know this, but I thought to still share for those that don't know. As developers, when we're building a UI layout in Android, it's common desire to want to preview what we're designing right? We usually want to add that sample data, like android:text="Test Test" to see how exactly it will look in our layout. Many times, we forget to remove such sample data. It's even more stressful when you're building a list. You have to run the app to see what your list looks like. Well, designtime attributes are here to help. Designtime attributes? What are they? Designtime attributes are attributes that are used only in rendering the Android studio layout preview, they have no impact at runtime. Designtime attributes aren't new in Android studio. They've been around since Android Studio 0.2.11. Designtime attributes are specified by the use of the tools namespace in Android XML layouts. Using designtime attributes a. Declare tools namespace. To use the designtime attributes, you need to first declare the tools namespace within the root tag of your layout. Your layout will look something like: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" ... > ... </LinearLayout> All tools attributes get stripped out at compile time by AAPT, and that's how they have no effect at runtime. b. Replace android namespace with tools Now that you have declared the namespace, you can replace almost any android xml attribute with tools, for the designtime. For example, let's say we wanted to test our text wrapping and see how our textview would look with a very long text, we would do something like: <TextView android:layout_width="match_parent" android:layout_height="wrap_content" ... tools:text="Test test, let's add some really really really long text" /> Note the tools:text attribute we used instead of the usual android:text Interesting uses with listviews and recycler vie

## Manage Android dependencies versions using gradle extra properties.

DevFeed: [Manage Android dependencies versions using gradle extra properties.](<https://devfeed.tech/articles/manage-android-dependencies-versions-using-gradle-extra-properties-25827.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/android-gradle-extra-properties>)

Author: Segun Famisa

Published: 2016-07-29T09:05:30Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [android-development](<https://devfeed.tech/topics/android-development.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Development](<https://devfeed.tech/topics/development.md>), [modules](<https://devfeed.tech/topics/modules.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [modules](<https://devfeed.tech/tags/modules.md>), [properties](<https://devfeed.tech/tags/properties.md>)

### AI overview

A tutorial on managing Android dependency versions with Gradle extra properties. It shows how to externalize repeated hardcoded version values and move shared configuration to the root project for reuse across multiple modules.

### Source excerpt

This is yet another tip you can use in improving your Android development experience and speed. We all love dependencies right? Yes we do! A typical Android studio project (you can stop reading now if you still use Eclipse 😑 seriously) has a project level build.gradle file and as many module-level build.gradle as there are modules. Dependencies are usually managed at the app-module level, and your app-module build.gradle file can quickly get messy from dependencies. It gets even worse, when you have other modules you reference in your app-module, each with its own dependencies. In this post, I'll show a quick way of making things look neat, and easy to maintain. Externalize hardcoded values. Let's say our project's app-module build.gradle looks like this: apply plugin: 'com.android.application' android { ... } ... dependencies { // support libraries compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:percent:23.4.0' compile 'com.android.support:cardview-v7:23.4.0' compile 'com.android.support:gridlayout-v7:23.4.0' //play services compile 'com.google.android.gms:play-services-location:9.2.1' compile 'com.google.android.gms:play-services-gcm:9.2.1' // other dependencies ... } You can see that we've repeated quite a number of versions, including the android support libraries. What we want to do is to externalize hardcoded values in our build.gradle file by leveraging gradle's extra properties. We can extract these hardcoded into an ext block. Our build.gradle file will now look like this: apply plugin: 'com.android.application' android { ... } ... ext { supportLibraryVersion = '23.4.0' playServicesVersion = '9.2.1' } dependencies { // support libraries compile "com.android.support:appcompat-v7:$supportLibraryVersion" compile "com.android.support:design:$supportLibraryVersion" compile "com.android.support:percent:$supportLibraryVersion" compile "com.android.support:cardview-v7:$supportLibraryVersion"

## Remote config with Firebase

DevFeed: [Remote config with Firebase](<https://devfeed.tech/articles/remote-config-with-firebase-25837.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/firebase-remote-config>)

Author: Segun Famisa

Published: 2016-06-13T06:05:30Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Firebase](<https://devfeed.tech/topics/firebase.md>), [A/B Testing](<https://devfeed.tech/topics/a-b-testing.md>)

Tags: [a-b-testing](<https://devfeed.tech/tags/a-b-testing.md>), [android](<https://devfeed.tech/tags/android.md>), [app](<https://devfeed.tech/tags/app.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [remote-config](<https://devfeed.tech/tags/remote-config.md>)

### AI overview

A tutorial on using Firebase Remote Config to change app behavior and content without deploying a new app version. It explains benefits such as audience-specific customization, gradual feature rollouts, impact monitoring, and A/B testing, then begins setup instructions.

### Source excerpt

I've probably said this countless times, that Firebase is one of the most exciting announcements for me at this year's I/O and I'm yet to fully explore it. Recently, I tried out the crash reporting and it was smooth. Check out this post to catch up on that. Another really interesting part of Firebase is Remote config. Remote config allows you update your app without necessarily deploying a new version of your app. The biggest challenge as app developers is getting your users to update their apps. Firebase remote config seems to solve the problem of configuring and updating your app without having to redeploy an update of your app. I first observed this behaviour on Twitter's Android app. The app changes right there even when you're on it without you updating. My twitter app just changed without updating 😳 -- SF (@segunfamisa) February 13, 2016 In this post, I would show how you can use Firebase's remote config feature to achieve this behaviour. Why should I use remote config? The major benefit of remote config is delivering the right experience to your users, the right users as fast as possible. Adapting to user feedback is very important to the success of your app. Testing out new features is equally important. There is where remote config comes in handy. You can change the look and feel of your app remotely with remote config, allowing you to run experiments all geared towards providing a premium experience for your app. For example, you want to determine how well a green button attracts users to click, compared to how a black button does. Remote config is your go to. You want to run a campaign for Christmas, so you want your app to have that Green, White and Red feel, you should not have to redeploy a new app solely for that purpose, and even if you do, what's the guarantee that half of your users will update their app? Remote config has to be your buddy. Remote config is superb for A/B testing. TL;DR, remote config allows you: Modify your app without a new produc

## Chrome Custom Tabs in Android

DevFeed: [Chrome Custom Tabs in Android](<https://devfeed.tech/articles/chrome-custom-tabs-in-android-25832.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/chrome-custom-tabs>)

Author: Segun Famisa

Published: 2016-06-04T08:05:30Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Chrome](<https://devfeed.tech/topics/chrome.md>), [Android](<https://devfeed.tech/topics/android.md>), [WebView](<https://devfeed.tech/topics/webview.md>), [Google](<https://devfeed.tech/topics/google.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [browser](<https://devfeed.tech/tags/browser.md>), [chrome](<https://devfeed.tech/tags/chrome.md>), [code](<https://devfeed.tech/tags/code.md>), [developers](<https://devfeed.tech/tags/developers.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [technical](<https://devfeed.tech/tags/technical.md>), [webview](<https://devfeed.tech/tags/webview.md>)

### AI overview

A tutorial explaining why and how to use Chrome Custom Tabs in Android applications. It compares opening links externally and using WebView, then describes Custom Tabs as a way to display Chrome content within an app with customizable controls and transitions.

### Source excerpt

Introduction I have been seeing a behaviour in some apps for a while, and I've always wanted to know how it was done. I noticed some apps that allow to view urls within the app, used something that is "Powered by Chrome". I first noticed this on the Twitter for Android app, then on Medium, then Feedly. I was interested in knowing how these worked, but I didn't know what to search for. Finally, a few weeks ago, I stumbled on "Chrome Custom Tabs". Alas, that was what I was looking for. In this post, I'm going to explain why, when and how to use "Chrome Custom Tabs" in your Android applications. Why use Chrome Custom tabs? When building apps, developers are usually faced with difficult tradeoffs to make when we have to show web content in our Android apps. Very common and easy solution is to open links externally. If you do this, then these lines of code will look familiar: Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(browserIntent); This typically results in a heavy-weight transition between the app and web. Launching a browser from your app to view web content results in a huge context switch which isn't customizable, and hence could lead to a terrible experience. An improvement on this experience will be to use a WebView which is essentially an Android view that displays web pages. However, this options requires technical work to implement and delivers a browsing experience that the users aren't used to. To solve this problem, the Google Chrome team introduced a new feature last September, called custom tabs. This allows to load a chrome tab within your app, and also allows you customize the look and feel of Chrome thereby making the transition between your app and the web content fast & seamless for your users. This is Chrome Custom tab in action on Twitter for Android app: Chrome Custom tab allows you customize the experience of Chrome. It allows you customize: Toolbar color Enter and exit animations Add custom actions to th

## Intro to the new ConstraintLayout in Android

DevFeed: [Intro to the new ConstraintLayout in Android](<https://devfeed.tech/articles/intro-to-the-new-constraintlayout-in-android-25833.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/constraint-layout-in-android>)

Author: Segun Famisa

Published: 2016-05-30T11:05:30Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Android](<https://devfeed.tech/topics/android.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [constraintlayout](<https://devfeed.tech/tags/constraintlayout.md>), [guide](<https://devfeed.tech/tags/guide.md>), [layout](<https://devfeed.tech/tags/layout.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial introduces Android's ConstraintLayout and the associated layout editor in Android Studio 2.2 Preview. It explains how constraints position views relative to other views, layout edges, or guidelines, and describes resize, side, and baseline handles. It also outlines setup requirements and initial ways to create a ConstraintLayout.

### Source excerpt

Last week, also during the Google I/O conference, Google introduced a new set of tools for Android developers. Among them is a new Layout editor and a new layout called the ConstraintLayout. The ConstraintLayout was said to be a new tool to empower developers create very flat ui-hierarchies for their complex layout. I've been playing around and exploring the new thing and I'll summarize my findings in this post. To be able to access these new features, you need to be running Android Studio 2.2 Preview and Java 8. You can head over to the canary channel to download it. Be sure to run it in parallel with your stable version. It's still in Preview! Layout Editor & Constraints Overview. The new layout editor in Android Studio 2.2 Preview is specially built for the ConstraintLayout. You can specify the constraints manually, or automatically reference within the layout editor. Overview of Constraints? A constraint is the description of how a view should be positioned relative to other items, in a layout. A constraint is typically defined for one or more sides by connecting the view to: An anchor point, or another view, An edge of the layout, Or An invisible guide line. Since each view within the layout is defined by associations to other views within the layout, it's easier to achieve flat hierarchy for complex layouts. In principle, the ConstraintLayout works very similar to the RelativeLayout, but uses various handles (or say anchors) for the constraints. (Source) Resize handle. The resize handle is the seen in the corners of the figure above, and it's used to resize the view. Side handle. The side handle is the in the figure above, and it's used to specify the location of a widget. E.g using the left side handle to always be aligned to the right of another view, or the left of the ConstraintLayout itself. Baseline handle. The baseline handle is the in the figure above. It is used to align the text of a view by the baseline of the text on another view. Getting started w

## Crash reporting in Firebase

DevFeed: [Crash reporting in Firebase](<https://devfeed.tech/articles/crash-reporting-in-firebase-25836.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/firebase-crash-reporting>)

Author: Segun Famisa

Published: 2016-05-26T12:05:30Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Firebase](<https://devfeed.tech/topics/firebase.md>), [Android](<https://devfeed.tech/topics/android.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Development](<https://devfeed.tech/topics/development.md>), [SDK](<https://devfeed.tech/topics/sdk.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [code](<https://devfeed.tech/tags/code.md>), [crash](<https://devfeed.tech/tags/crash.md>), [crash-reporting](<https://devfeed.tech/tags/crash-reporting.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [sdk](<https://devfeed.tech/tags/sdk.md>)

### AI overview

A tutorial on configuring Firebase Crash Reporting in an Android app using Google Play services 9.0, Android Studio, the Firebase console, a google-services.json file, and the Firebase SDK. It explains that fatal errors are reported automatically after setup and that handled non-fatal exceptions can be reported manually.

### Source excerpt

Update: (21st of September, 2016) Since publication of this post, Firebase has changed and evolved, and this post has been updated to the new state of things. Last week, at Google I/O, Google announced a number of interesting new features in Firebase. The new Firebase is said to be a "Unified app platform for mobile developers" adding new tools to help develop faster, improve app quality, engage users and monetize apps. You can check out this intro video here. Some of the new features in the Firebase upgrade include: Firebase Analytics. Firebase Cloud Messaging. Firebase Test Lab and Crash Reporting. Firebase Notifications, Dynamic Links, App Indexing, AdWords, Firebase Invites etc I've been playing around the new product and it's been amazing. In this post, I'm going to show you how to use Firebase for Crash reporting in order to improve the quality of apps that you ship. How to use? The new Firebase works with the new Google Play Services 9.0, and to use it in Android Studio, you need to follow these steps: Setup Firebase 1. Pre-requisites Ensure your development environment meets the pre-requisite requirements. The Pre-requisites as seen here are: An Android device running Google Play services 9.0.0 or later The Google Play services SDK from the Android SDK Manager Android Studio 1.5 or higher An Android Studio project and its package name. 2. Add Firebase to your app Next step is to add Firebase to your app. To do this, you need to create a project on the Firebase console. Click on Create New Project (if you're starting a new project) or import Google Project if you're importing an existing project, and follow through the steps. Now, within your app, click on click on Add Firebase to your Android app. You'll be prompted to add your package name, and also to download a config file. This is the usual google-services.json file. Be sure to add it to your app module's directory. (e.g /app) 3. Add the SDK to your app To use Firebase in your app, you need to add and se

## Android Marshmallow Runtime Permissions: UX Guidelines and Implementation Tips

DevFeed: [Android Marshmallow Runtime Permissions: UX Guidelines and Implementation Tips](<https://devfeed.tech/articles/may-i-have-some-marshmallows-please-25838.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/marshmallow-permissions>)

Author: Segun Famisa

Published: 2016-01-28T03:05:30Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Authorization](<https://devfeed.tech/topics/authorization.md>), [User experience (UX)](<https://devfeed.tech/topics/ux.md>), [App](<https://devfeed.tech/topics/app.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [app](<https://devfeed.tech/tags/app.md>), [code](<https://devfeed.tech/tags/code.md>), [developers](<https://devfeed.tech/tags/developers.md>), [feature](<https://devfeed.tech/tags/feature.md>), [permission](<https://devfeed.tech/tags/permission.md>), [privacy](<https://devfeed.tech/tags/privacy.md>), [qr-code](<https://devfeed.tech/tags/qr-code.md>), [tips](<https://devfeed.tech/tags/tips.md>), [ux](<https://devfeed.tech/tags/ux.md>)

### AI overview

A developer guide to Android Marshmallow runtime permissions, covering privacy, permission timing, user context, and UX practices for requesting access based on how critical and clear a feature is.

### Source excerpt

After a long wait, my AndroidOne finally got it's Marshmallow update yesterday. I finally got a hands on experience of the not-so-new OS, and I must confess, I love it! I love the 'Now on tap', the 'DND' mode, and one of my favourite parts of the update - the new permissions feature. With the new permissions, users now have more control over permissions that apps have. Like in iOS, users can specifically turn off certain permissions like access to contacts, locations etc. So, if you've built your app previously to request for permission to use the camera for example, if users turn off that permission for your app, that functionality will fail. Check here if you want to see more about the 'new' permissions in Android M. This has been out for a while now and, but I thought to put out some tips here for developers yet to update their apps for Android Marshmallow. According to Nick Butcher in this video, the primary purpose of permission, is to protect your users' privacy. Runtime permissions allow you to choose the right time to ask for permission when the user has more context about why you're asking and why they need to grant it. He also described the UX best practices with runtime permissions. I suggest that you check out the video. He talked about determining your permission requirements by how important (critical or not) the permission is to your app, and how clear the need for that permission is. Critical and clear: e.g SMS permission in an SMS app, or Camera permission in a Camera app. This is critical to app functionality and hence, it's good to request for this permission at the beginning. Critical and unclear: when the feature is important, but not immediately obvious. You should educate the users upfront before requesting for permission. Secondary and not clear: offer some explanation and then allow the users opt-in and then should you request. Secondary and clear: If a secondary feature that is clear, you should ask in context. No need to ask too early. Bet