• Breaking News

    Tuesday, June 29, 2021

    Android Dev - Weekly Questions Thread - June 29, 2021

    Android Dev - Weekly Questions Thread - June 29, 2021


    Weekly Questions Thread - June 29, 2021

    Posted: 29 Jun 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]

    Can anyone guide me little on how whatsapp plays Youtube videos in a floating window?

    Posted: 29 Jun 2021 04:46 AM PDT

    There's a YouTube Android Player API which has not been updated for a very long time,

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

    Facing this issue while using Scoped Storage in Android 10 (Works fine for Android 11 devices)

    Posted: 29 Jun 2021 05:17 AM PDT

    Shared Element Transaction with AppBarLayout

    Posted: 29 Jun 2021 05:08 AM PDT

    I'm trying to copy TripAdvisor, but I've got a problem:

    https://reddit.com/link/oa6yet/video/kx5llklw27871/player

    As you can see, when the AppBarLayout is expanded, the transition is smooth as expected, however, when the AppBarLayout is not expanded the Recyclerview makes a downwards jerk which is really annoying to see.

    I've tried different things but nothing works.

    Any suggestions? 🙃

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

    I want to implement Achievements features like Nike Run club app. Any suggestions or tutorial which can be followed.

    Posted: 29 Jun 2021 09:04 AM PDT

    Providing AssistedInject supported ViewModel for Composable using Hilt

    Posted: 29 Jun 2021 07:55 AM PDT

    Does google take 30% cut even if you application has a subscription model outside playstore ?

    Posted: 28 Jun 2021 11:25 PM PDT

    I am working on a self-publishing platform similar to Medium. If I include subscription model, should I pay 30% cut to google ? If I collect payments externally through my web portal, can I bypass the 30% cut ?

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

    Google releases WifiRttLocator App as Wifi-RTT demo on Play Store

    Posted: 28 Jun 2021 03:36 PM PDT

    Data Binding

    Posted: 29 Jun 2021 06:52 AM PDT

    Is it okay to use dataBinding in a android project nowadays If not why so ?

    What are the problems with data Binding ?

    Is it bad to implement logic inside xml by calling viewmodel functions using Data Binding ?

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

    Yet another adapter library

    Posted: 29 Jun 2021 12:09 AM PDT

    Created this library some time ago, may be it will be usefully for someone before Compose render RecyclerView obsolete. The core idea is to use ViewBinding as holder (kind of) and register callbacks for init/bind/click with binding as a parameter. It also supports regular view holders. https://github.com/sergeshustoff/diffadapter

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

    Getting device width info for lots of devices

    Posted: 29 Jun 2021 08:31 AM PDT

    Hey folks,

    My design team and I are looking to develop an Android app and because many are so centered in iOS the Android understanding is greatly less. (I'm on of 3 out of 100 that daily drive an Android-powered device)

    To my understanding the design viewport varies a lot between devices. Samsung used to be 360 across many of their devices, but thats no longer the case as it can be 360, 411, 412, ect. I was curious if there was an easy way to check for this in a easy-to search manner.

    My go-to is to load up somewhere like PhoneArena, search devices, look at resolutions, and doing a little math from there. However I know this isn't as reliable as I know this can change depending on the device too.

    For example: Would an S20 be 360, or 411? Would the S20+ vary as well?

    Is there a database or site that has these easily listed this info? I know native screen res is pretty easy to find, but, what the viewport width is using is a lot harder.

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

    Doubt regarding my implementation

    Posted: 29 Jun 2021 05:19 AM PDT

    Hello guys, I was trying to implement Fragments and was following "developers.android" documentation for it (https://developer.android.com/guide/fragments/create#add-programmatic).
    I have "FirstFragment.kt" as my fragment class and "fragment_first.xml" for its layout.
    In the main activity's layout file "activity_main.xml" I have used FragmentContainerView as mentioned in the docs. Also I have enabled viewBinding in the gradle.

    This is my code for applying Fragment programmatically in "MainActivity.kt"

    binding.fragmentButton1.setOnClickListener { if(savedInstanceState == null) { supportFragmentManager.commit { setReorderingAllowed(true) add<FirstFragment>(R.id.FragmentConatiner) } } } 

    *(language kotlin)
    *(FragmentConatiner is the ID for my FragmentContainerView)

    The problem I'm encountering is when I try to use viewBinding in

    add<FirstFragment>(Binding.FragmentConatiner) 

    it gives me error that my arguments are wrong, that "none of the available functions can be called with the arguments supplied". I can't understand why. Any help will be greatly appreciated

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

    Looking for a library or cell phone verification tool

    Posted: 29 Jun 2021 05:00 AM PDT

    Looking for a library or cell phone verification tool

    Hello, I need to save the cell phone number entered by the user and I want to know if this number is valid. Something like this image, with country code, like + 1-123-456-7890

    https://preview.redd.it/bi6rj5oe27871.png?width=513&format=png&auto=webp&s=27b6f2bf6dba27e06ddab9930a5c028d69545cf6

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

    Scope Storage Myths

    Posted: 28 Jun 2021 05:19 PM PDT

    How do you change bottom navigation bar when keyboard appears only?

    Posted: 29 Jun 2021 04:31 AM PDT

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getActivity().getWindow().setNavigationBarColor(android.graphics.Color.parseColor("#ffffff"));
    }

    Only changes navigation bar before and after keyboard is up

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

    Play Dev ID requirements + 2-Step Verification [Google's Android Developers Blog]

    Posted: 28 Jun 2021 11:42 AM PDT

    How do I cancel Android OS update on Pixel 3?

    Posted: 29 Jun 2021 12:50 AM PDT

    I've had developer mode on, had all auto-updates off and the whole shebang, and I just discovered the Pixel 3 I work with updated the OS without my permission. Now, it prompts me to restart.

    What should I do? Is there any way to reverse the Android 11 installation?

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

    ViewModel as a variable in XML

    Posted: 28 Jun 2021 12:54 PM PDT

    I'm studying "Android App Development with Kotlin" by Google at Udacity. In one of the lessons, you are taught how to handle clicking items from a RecyclerView in the fragment, using a callback function, like this: val clickListener: (sleepId: Long) -> Unit) , and from the fragment calling any methods of your ViewModel. Studying this project https://github.com/android/architecture-samples, the pattern used to handle clicks is to send the ViewModel to the ViewHolder and add it to the binding as a variable and make all the XML method calls, like this: android: onClick = "@{viewModel.taskComplete(task)}".Performatively, which of these ways is faster?

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

    How much to pay a musician whose music I'm using on my app?

    Posted: 28 Jun 2021 05:15 PM PDT

    What's the best method and how much would it be (roughly)?

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

    No comments:

    Post a Comment