• Breaking News

    Tuesday, July 27, 2021

    Android Dev - Weekly Questions Thread - July 27, 2021

    Android Dev - Weekly Questions Thread - July 27, 2021


    Weekly Questions Thread - July 27, 2021

    Posted: 27 Jul 2021 06:00 AM PDT

    This thread is for simple questions that don't warrant their own thread (although we suggest checking the sidebar, the wiki, our Discord, or Stack Overflow before posting). Examples of questions:

    • How do I pass data between my Activities?
    • Does anyone have a link to the source for the AOSP messaging app?
    • Is it possible to programmatically change the color of the status bar without targeting API 21?

    Large code snippets don't read well on reddit and take up a lot of space, so please don't paste them in your comments. Consider linking Gists instead.

    Have a question about the subreddit or otherwise for /r/androiddev mods? We welcome your mod mail!

    Also, please don't link to Play Store pages or ask for feedback on this thread. Save those for the App Feedback threads we host on Saturdays.

    Looking for all the Questions threads? Want an easy way to locate this week's thread? Click this link!

    submitted by /u/AutoModerator
    [link] [comments]

    Question from an Old Android Dev... What tools/libraries helped you streamline/speed up your app development?

    Posted: 26 Jul 2021 09:53 PM PDT

    I'm a Java developer interested in using Kotlin this time and have a new app idea now. I remember discovering tools like Butterknife at the time, and lately heard of Bitrise as a way of simplifying my CI/CD pipeline...

    I haven't kept up with Android news enough in the last decade, but I guess I just want to streamline my development with the least effort possible, and want to know what helped you develop better and faster, anything, please let me know.

    That question also alternatively works for what slows you down too I guess...

    Thank you

    submitted by /u/Aeonitis
    [link] [comments]

    Mocking Retrofit API Responses with MockWebServer + Hilt – Bloco

    Posted: 27 Jul 2021 03:21 AM PDT

    What exactly is Jetpack AppSearch? And can it be used to store large structured data in place of sqlite based databases such as Room?

    Posted: 27 Jul 2021 06:36 AM PDT

    As the official documentation clearly says it is an on-device search library. It can be used to save structured data and later on search in that data efficiently. But search can also be implemented in sqlite based databases, then how it is better than traditional databases such as Room.

    And if it provides better search functionality, then do I need to save data both in AppSearch (for searching in the data) and in Room Database (such as for offline caching).

    submitted by /u/2307viveksingh
    [link] [comments]

    Jetpack Compose vs Traditional XMLs

    Posted: 27 Jul 2021 04:49 AM PDT

    Hi everyone, I'm putting together the UI for my first app, which utilises OpenGL ES. I'm studying Jetpack Compose right now, but recently found that transition animations (e.g. card into an expanded details view) aren't something part of the current toolkit.

    I do like the declarative concept, but at the same time I'm unsure what other limitations it may have if I were to base my app solely on Compose.

    Would thus love to hear your plans for migration to Jetpack Compose - rebasing parts of your UI progressively etc, and also any advice for someone who has the choice to go with either.

    submitted by /u/ock88
    [link] [comments]

    Creating & styling dropdown menus on Android

    Posted: 26 Jul 2021 04:28 PM PDT

    No Android test XML reports

    Posted: 27 Jul 2021 05:07 AM PDT

    We make use of the Android test reports for our CI, and it looks like they're no longer being produced - potentially after an update to the AGP. Has any got any ideas as to why? Thanks!

    submitted by /u/qazplmo
    [link] [comments]

    perform(click()) is not working in Android 11 but working in Android 10

    Posted: 27 Jul 2021 08:02 AM PDT

    I have one test case where I want to click fragment button which will navigate me to different screen.

    This is my test case in feature file.

    @abc Scenario: As a RM, I should be able to see accepted on coming to admin approval screen Given User is at XYZ screen for scenario "approved" And User is able to see that verification is accepted When User clicks on next button Then User will be navigated to abc screen 

    When "User clicks on next button" test case is executed this method will call with the button id.

    Espresso.onView(ViewMatchers.withId(R.id.add_button)) .perform(ViewActions.click()) 

    And after that "Then" situation will execute with this method where I'm navigating to different fragment.

    /** * Match destination to which user will be navigated. * Assert that mock nav controller has action for destination. * * @param id : This is fragment action id */ fun matchIntendedDestination(id: Int) { SystemClock.sleep(1000) val idCapture = ArgumentCaptor.forClass(Int::class.java) Mockito.verify(BaseHelper.getMockNavController()).navigate(idCapture.capture()) Assert.assertEquals(id, idCapture.value) } 

    Gradle version

    classpath 'com.android.tools.build:gradle:4.2.1' 

    Espresso libraries

    testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0' androidTestImplementation "androidx.test.espresso:espresso-contrib:3.2.0" androidTestImplementation('androidx.test:runner:1.1.0') androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'io.cucumber:cucumber-android:4.3.1' androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.6.0' debugImplementation 'androidx.fragment:fragment-testing:1.2.4' androidTestImplementation "org.mockito:mockito-android:3.3.3" 

    But the problem is this code is executing successfully in android 10 but not in Android 11. Can anyone please help me what I'm missing here for Android 11. I have also checked with updating all the libraries.

    And when I debugged the code I found that perform(click()) is not calling anything in the fragment.

    https://stackoverflow.com/questions/68547182/performclick-is-not-working-in-android-11-but-working-in-android-10

    submitted by /u/pintuag
    [link] [comments]

    Do you put repositories/data source in its own module?

    Posted: 27 Jul 2021 07:07 AM PDT

    I'm trying to come up with ideas for an architecture for my app. I saw a few articles where the author(s) put repositories and data sources into separate modules pertaining to the given feature. It seemed nice that everything related to a feature is at the same place.

    But I'm also wondering if it wouldn't be better to implement the data sources in a single repository/database module. This way only one module would have to be touched if we migrated from one cloud service to another.

    submitted by /u/MorningBusGuy
    [link] [comments]

    Quick article I wrote after upgrading to using App Bundles instead of APK. Hope it helps.

    Posted: 26 Jul 2021 02:30 PM PDT

    Making the best PDF Unlocker / Decryptor App

    Posted: 27 Jul 2021 05:06 AM PDT

    Mastering Dart Collections

    Posted: 27 Jul 2021 03:31 AM PDT

    Surely it is possible to have an AndroidX library to make this work much easier and concise across all versions?

    Posted: 26 Jul 2021 08:18 PM PDT

    The Lateral Pass (Higher Order Code Smells, Part 2)

    Posted: 26 Jul 2021 12:41 PM PDT

    Gradle DevProdEng Showdown S1E6: Android Builds and Tests at Scale

    Posted: 26 Jul 2021 06:06 PM PDT

    Is there any real difference in getting paid subscribers if the first 3-7 days are free?

    Posted: 26 Jul 2021 03:52 PM PDT

    My app has a monthly subscription OR ad supported model for premium features that does ok but I'm going to try offering the first 7 days for free using the built in google subscription flow. Has anyone tried both and do you get a lot more monthly subs overall (or do most of them quit before the trial is over)?

    My app already offers the premium stuff for a few days for free for new users anyway so in my case it might not matter as much. I'm just curious about people being more willing to use their CC in the first place if the first 3-7 days are free before it charges the monthly rate

    submitted by /u/Xstream3
    [link] [comments]

    Google Android 13 T internal code leaked

    Posted: 27 Jul 2021 12:22 AM PDT

    How to detect user creating multiple accounts?

    Posted: 26 Jul 2021 04:32 PM PDT

    How would you go about detecting if a user has registered more than once, if they are using a different email/phone number? How do large apps like uber do this? I would need something to prevent this and obviously I did not find how these apps are doing it. Can they somehow detect the same device? Mac address?

    submitted by /u/Csabbb
    [link] [comments]

    No comments:

    Post a Comment