• Breaking News

    Tuesday, April 27, 2021

    Android Dev - Weekly Questions Thread - April 27, 2021

    Android Dev - Weekly Questions Thread - April 27, 2021


    Weekly Questions Thread - April 27, 2021

    Posted: 27 Apr 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]

    Android Studio build speed benchmark results between different laptops and configurations

    Posted: 27 Apr 2021 01:35 AM PDT

    KotlinX Coroutines Release 1.5.0-RC

    Posted: 26 Apr 2021 04:07 PM PDT

    Just added the first Android device (Google Pixel 5) to the tool I am building. Looks neat.

    Posted: 26 Apr 2021 08:09 AM PDT

    WebRTC Sample in Kotlin

    Posted: 26 Apr 2021 10:58 PM PDT

    Hello everyone, I created sample WebRTC android application in Kotlin. I have used Firestore as signaling server.

    Please check and share your reviews.

    https://developerspace.medium.com/webrtc-sample-in-kotlin-e584681ed7fc

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

    Benefit of having multiple google play accounts

    Posted: 27 Apr 2021 04:18 AM PDT

    As the title says, Is there any inherent benefit of having multiple google play accounts to publish apps?
    The reason I ask is I've just purchased a google workspace account with a wordpress plan to use it all with my newly registered LLP for game dev after 6 years of industry experience.

    So having a more professional email ID now, I transferred all apps from my old google play dev to the new dev account. I now have the option to either close the old dev account and get the $25 refund, or keep it for publishing more apps on the side anonymously. Basically publishing games from the main account and normal apps with the old dev account.

    I've seen people on this sub asking questions about is it safe to have multiple google play accounts, people suggesting using VPN, etc.

    What's not clear to me though is why do these people want to have multiple dev accounts? What's the intent? Is it to be able to publish apps which you otherwise can't publicly publish from your main dev account?

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

    Multiple card view elements in XML or recycler view

    Posted: 27 Apr 2021 04:54 AM PDT

    Heya,

    I wanted to ask for some opinions and insight. I want to find the cleanest solution for this scenario ;

    I am planning to show between 1-3 cardviews inside a dialog popup. The content in the cardview will vary depending on conditions and also, the amount of cardviews will vary between 1 to 3.

    I am wondering if it's a cleaner approach to create a recycler view to present these cardviews or just implement the 3 cardview components in the XML file and change the content and visibility of them as appropriate.

    I believe the second approach would be a bit more messy and might lead to confusion in the future.

    Thanks in advance guys!

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

    Scoped ViewModel with Dagger Hilt in a Dynamic Feature Module

    Posted: 27 Apr 2021 06:59 AM PDT

    I am following the official Android guide for Using Dagger in multi-module apps, and I am able to get everything to compile and "work".

    The problem is that I have a viewpager in my dynamic feature module and I need to have a parent "scoped" viewmodel. The documentation shows this example of injecting a ViewModel

    // You want Dagger to provide an instance of LoginViewModel from the Login graph @Inject lateinit var loginViewModel: LoginViewModel 

    While generally I use something like

    val loginViewModel: LoginViewModel by hiltNavGraphViewModels(R.id.parentFragment) 

    Does anyone know of a way to properly scope a shared viewmodel?

    I hope this is allowed here. I have also posted on Stackoverflow.

    Link to Stackoverflow post: https://stackoverflow.com/questions/67283885/scoped-viewmodel-with-dagger-hilt-in-a-dynamic-feature-module

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

    Easy Edge-to-edge support with Insetter Library

    Posted: 27 Apr 2021 02:21 AM PDT

    Finding the min and max value a latitude and longtitude can be, to be within a certain distance, of a different set of coordinates.

    Posted: 27 Apr 2021 07:26 AM PDT

    Hey I need help with some tricky logic. I have a database full of locations, and I need to find all the objects in the database that are within a certain distance to the user. So at runtime I have the user's location, and the max distance they want to be from the objects in the database, so if the distance the user picks is 5km, I want to load all the objects that are within a 0-5km distance from them.

    I found Havsine's formula, but that's for finding distance between two sets of coordinates.

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

    Apple just posted this about data, I wonder how Google will respond. Especially with data mining being the center of many of Google's core businesses.

    Posted: 26 Apr 2021 12:22 PM PDT

    I've made an App using clean architecture which before followed the bad single activity everything, I'd like some suggestions on how I can improve this even more!

    Posted: 27 Apr 2021 06:25 AM PDT

    How to test a time-dependent coroutine

    Posted: 27 Apr 2021 06:23 AM PDT

    My First Podcast: #1 ViewOverlay

    Posted: 26 Apr 2021 08:17 PM PDT

    I'm starting up a new podcast called Android Dev Bits as a way to learn Android. I want to share short episodes on topics as I learn them. I know how hard it is to keep up-to-date with everything in Android so I wanted to provide a concise, no bullshit podcast.

    Everything from the intro, album art, recording quality, script needs a lot of work I know so I wanted to check in with /r/androiddev on how I can do a better job and make this something useful for android developers.

    Feedback is a gift - preferably kept constructive though ;)

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

    Automate replying to android app reviews with this Python Script hosted on Google Collab - less than 15 minutes to setup

    Posted: 27 Apr 2021 04:37 AM PDT

    Hello friends,

    While we really care about our app users and reviews, it may not be always very easy to reply to all reviews on your app.

    I have written a python script to automatically reply to reviews in bulk and save tons of manual effort.

    • The script runs on Google Collab - Hence zero hosting fee
    • Takes about 15 minutes to setup
    • Uses Google Play's Reply to Reviews API
    • You can reply to reviews from the last 7 days
    • You can customize different replies for different star ratings

    You can see the script in action here: https://www.youtube.com/watch?v=IWP7oV_fYUY

    I am offering this script for free to anyone who donates $50 or more to Covid relief-related efforts in India. India is facing one of the worst covid crises in the world right now and this is my attempt to get some help for the needy. I will also provide step-by-step video instructions on setting it up. You can simply donate to any relief effort and send me a screenshot, or you can ask me about any fundraisers where you can donate.

    If you have any questions, I am happy to answer.

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

    Library for Android similar to https://github.com/NextLevel/NextLevel ?

    Posted: 27 Apr 2021 03:44 AM PDT

    I need functionality like: adding text, drawing and put an image (stickers) and export edited video as mp4

    submitted by /u/01egme
    [link] [comments]

    How to build a Live Video Streaming Application? (Android)

    Posted: 27 Apr 2021 02:04 AM PDT

    Hi there 👋, this is Meher from the Agora Developer Relations team.

    I would like to share a blog that I have written which explains the process of how you can easily make a live video streaming application using the Agora Android SDK. In this, a user can set a username and jump into a channel with others as a Host or as an Audience member. Also, using the Agora SDK you can have up to a million users subscribed to your stream.

    If you're interested you can find the complete code here. You can also read about the detailed explanation given here in this blog.

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

    UK company charging VAT

    Posted: 26 Apr 2021 05:05 PM PDT

    I'm finding the guidance on whether Google will pay a UK limited company inclusive or exclusive of VAT very confusing (now the Brexit transition has ended).

    What is the actual experience of people on here? Thanks.

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

    A question regarding user privacy and developers approach.

    Posted: 27 Apr 2021 01:12 AM PDT

    Say I gave a one star rating to a said app on the google play store and then all of a sudden the app developer contacts me using the registration information I put in the app and tells me to change my review cause they have updated the issue. Is this really fair to approach a user directly like this? Isn't this a violation of privacy.

    I understand that they have updated my issue and I am grateful for it but is approaching me on my private phone number and telling me to change the review an ethical way for an app developer and is that in anyway legal?

    For context: The app is supposed to be classroom app in which our professor has created a classroom and for logging into the app we needed to put the phone number and that info was used to contact me.

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

    Fast scroll view with alphabets in Android

    Posted: 26 Apr 2021 08:57 PM PDT

    Fast scroll view with alphabets in Android

    I need to create this view on my Android app. Is there any library I can use?

    I need create this view on my Android app. Is there any library I can use?

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

    Is it possible to run some code parts in cloud?

    Posted: 26 Apr 2021 11:57 PM PDT

    I have an app that performs fuzzy array searching algorithm. It takes pretty long time to make it on smartphone.

    So I would like to know if there is any service that could make this calculations in cloud and return me result like an API or something like this. I looked at Google Cloud Services and even called the sales, but couldn't find anything.

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

    Custom Shape with Jetpack Compose

    Posted: 26 Apr 2021 08:21 AM PDT

    I have a small paid contract opportunity for an Android Dev. Where should I be posting this?

    Posted: 26 Apr 2021 10:29 PM PDT

    Can anyone recommend a good place to post this kind of thing?

    Basically, I have the now shut-down game Tiny Death Star side-loaded onto an Android device, but it's missing some of its assets, like the game music and I think some of the unlockables. It would have downloaded these from the company's server, which has been taken down.

    Maybe the assets can be copied from some device that still has the old game on it. Where might I find a motivated dev willing to give this a shot, and how much might be appropriate?

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

    Getting file path of selected file from file picker

    Posted: 26 Apr 2021 10:26 PM PDT

    I am using this https://drive.google.com/file/d/11CUvFb6do97NeBC2RRXN0MiO4XAdGhJl/view?usp=drivesdk

    For images and videos it works but for PDF, it works when I select internal storage, go to appropriate folder & select file but when I select PDF file from recents or downloads etc it crashes

    E/AndroidRuntime: FATAL EXCEPTION: main

    Process: com.redtone.wanda, PID: 15338

    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=262241, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/document:119 flg=0x43 }} to activity {com.redtone.wanda/com.redtone.wanda.activities.MainActivity}: java.lang.NullPointerException: uri

    at android.app.ActivityThread.deliverResults(ActivityThread.java:5015)

    at android.app.ActivityThread.handleSendResult(ActivityThread.java:5056)

    at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)

    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)

    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)

    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)

    at android.os.Handler.dispatchMessage(Handler.java:106)

    at android.os.Looper.loop(Looper.java:223)

    at android.app.ActivityThread.main(ActivityThread.java:7656)

    at java.lang.reflect.Method.invoke(Native Method)

    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)

    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

    Caused by: java.lang.NullPointerException: uri

    at java.util.Objects.requireNonNull(Objects.java:245)

    at android.content.ContentResolver.query(ContentResolver.java:1157)

    at android.content.ContentResolver.query(ContentResolver.java:1115)

    at android.content.ContentResolver.query(ContentResolver.java:1071)

    at com.redtone.wanda.utils.GetPath.getDataColumn(GetPath.java:314)

    at com.redtone.wanda.utils.GetPath.getPath(GetPath.java:137)

    at com.redtone.wanda.fragments.FragmentTicketDetails.onActivityResult(FragmentTicketDetails.java:271)

    at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:170)

    at com.redtone.wanda.activities.MainActivity.onActivityResult(MainActivity.java:366)

    at android.app.Activity.dispatchActivityResult(Activity.java:8310)

    at android.app.ActivityThread.deliverResults(ActivityThread.java:5008)

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

    Question regarding Google coroutine example

    Posted: 26 Apr 2021 01:29 PM PDT

    I was looking through this Google Navigation UI example where they are currently posting new videos in their MAD Skills playlist.

    While looking through it, I found this coroutine in the DonutEntryViewModel

    fun addData( id: Long, name: String, description: String, rating: Int, setupNotification: (Long) -> Unit ) { val donut = Donut(id, name, description, rating) CoroutineScope(Dispatchers.IO).launch { var actualId = id if (id > 0) { update(donut) } else { actualId = insert(donut) } setupNotification(actualId) } } 

    Why would you ever start a coroutine like this when you have viewModelScope?

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

    New Android Device Actually Shipping

    Posted: 26 Apr 2021 04:13 PM PDT

    Not sure if anyone here is aware of an Android powered gaming device that after years in limbo is shipping. It started as PlayTable but has been rebranded TapTop.

    The frontend GUI is hot garbage but if you access the actual OS and add a launcher it turns it into a massive tablet that is quite fun to use.

    This device could be really great with the correct software support. I seriously don't trust the manufacturer to do this thing any justice.

    Just throwing this out there for those interested. It is a rather unique piece of hardware with a ton of potential.

    Thank you to the person that pointed out I included no link.

    Totally meant to and failed. :facepalm:

    https://www.facebook.com/BlokPartyGaming

    For some reason they only have a Facebook page. Not surprising considering the past of this project. Bit off a dumpster fire but at least they delivered after 4 years!

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

    No comments:

    Post a Comment