• Breaking News

    Tuesday, November 30, 2021

    Android Dev - Weekly Questions Thread - November 30, 2021

    Android Dev - Weekly Questions Thread - November 30, 2021


    Weekly Questions Thread - November 30, 2021

    Posted: 30 Nov 2021 06:00 AM PST

    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]

    Is bintray service down ?

    Posted: 30 Nov 2021 05:48 AM PST

    What is the Android Cache Fix Plugin and Why do I need to Solve my Own Cache Misses? | Nelson Osacky

    Posted: 30 Nov 2021 08:47 AM PST

    What map SDK's do you prefer?

    Posted: 30 Nov 2021 07:50 AM PST

    We are using maps in a lot of our apps but the Google Maps SDK fails us in some aspects like animation, gradients, clustering, offline caching, etc. I know that Mapbox is a very nice alternative, but it's also very pricey. This is fine of course, hard work doesn't go unpaid but it seems like there are a lot more alternatives in the webdev world than the Android dev world.

    So, what map SDK's do you like to use? I'm also interested in how many features of the SDK you are using. :)

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

    How does android studio use values inside XML files

    Posted: 30 Nov 2021 11:45 AM PST

    When i set values in strings or colors.xml... in the activity main xml file how does the system know in what xml file i put my naming.. also is it possible to have the exact name of attribute in 2 files ? also can we add a new xml file in the values folder? im really a noob beginner in this ..

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

    Can we utilize the Fragment Result API to replace the ViewHolder callback?

    Posted: 30 Nov 2021 05:18 AM PST

    We're familiar with the displaying UI with Fragment > RecyclerView Adapter > ViewHolder.

    In order for Fragment to receive a click action from ViewHolder, we must pass a callback to the Adapter > ViewHolder > setOnClickListener, which is quite verbose.

    Since there is Fragment Result API, I wonder if we can utilize it?

    The sample code should be like this:

    First, we create an extension method to get the parent Activity of a View fun Context?.getValidActivity(): Activity? { if (this == null) { return null } if (this is Activity) { return this } if (this is ContextWrapper) { return this.baseContext.getValidActivity() } return null } Then, create another extension method to set the Fragment Result: ``` fun View?.setFragmentResult(requestKey: String, result: Bundle) { val activity = this?.context.getValidActivity() as? FragmentActivity ?: return

    if (!activity.isDestroyed && !activity.isFinishing) { activity.supportFragmentManager.setFragmentResult(requestKey, result) } 

    } And, in the ViewHolder, set it on the click event: viewHolderBinding.myButton.setOnClickListener { it.setFragmentResult("my_request_key", bundleOf("btn_action" to "myButton")) } Finally, in the Fragment, listen to the result fun onCreate(...) { parentFragmentManager.setFragmentResultListener("my_request_key", this) { val action = bundle.getString("btn_action", "") } } ``` Technically this would work, and less verbose than passing the callback. But I would like to hear your feedback: should we use this way?

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

    Poco F3 or OnePlus 9R

    Posted: 30 Nov 2021 10:19 AM PST

    Im planning to buy a phone and im confused between these two Poco F3 and Oneplus 9R. Both 8/256GB sells for the same price here. I'll be using custom roms and gcam so software isn't a big deal for me I just need the overall package

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

    Need Help with how to count the scores of an external game on your app

    Posted: 30 Nov 2021 05:25 AM PST

    okay maybe the title was quite confusing lmao but let me elaborate.. So let's say I wanna make an app that gives you rewards if you score 10k Running points in Subway Surfers Game which is an external application. So how to connect that game into your app so that we can record and verify scores?

    Let me explain practical use case : Like, You opens the app then selects a game to play , in this case Subway surfers, then you plays that game and score 10k running points. As soon as you hit that number of scores you will get a notification from the app that you scored 10k points, then you can click on the notification and go to the app and withdraw your rewards.

    I'm asking how to to make a system that connects that game to the app and counts the score?

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

    hi. so in feb 2021 my admob account got disabled now i have an new account i want to add my bank account but im afraid that this will lead to the same thing as the first one should i do it ?

    Posted: 30 Nov 2021 05:56 AM PST

    hi. so in feb 2021 my admob account and google play developer got disabled

    now i have a new dev account since jul 2021

    admob oct 2021

    i want to add my bank account but im afraid that this will lead to the same thing as the first one

    should i do it ?

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

    Aim and Shot app is out now for android users-come try beat my highscore of 81 idare you

    Posted: 30 Nov 2021 07:52 AM PST

    hi. so in feb 2021 my admob account got disabled now i have an new account i want to add my bank account but im afraid that this will lead to the same thing as the first one should i do it ?

    Posted: 30 Nov 2021 05:35 AM PST

    hi. so in feb 2021 my admob account and google play developer got disabled

    now i have a new dev account since jul 2021

    admob oct 2021

    i want to add my bank account but im afraid that this will lead to the same thing as the first one

    should i do it ?

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

    No comments:

    Post a Comment