• Breaking News

    Monday, May 17, 2021

    Android Dev - Weekly Who's Hiring Thread - May 17, 2021

    Android Dev - Weekly Who's Hiring Thread - May 17, 2021


    Weekly Who's Hiring Thread - May 17, 2021

    Posted: 17 May 2021 06:00 AM PDT

    Looking for Android developers? Heard about a cool job posting? Let people know!

    Here is a suggested posting template:

    Company: <Best Company Ever>
    Job: [<Title>](https://example.com/job)
    Location: <City, State, Country>
    Allows remote: <Yes/No>
    Visa: <Yes/No>

    Feel free to include any other information about the job.

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

    Weekly Questions Thread - May 11, 2021

    Posted: 11 May 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]

    Why do internal releases get reviewed when google states otherwise?

    Posted: 17 May 2021 05:25 AM PDT

    Have you had to deal with a negative review campaign against your app? What's the recourse?

    Posted: 16 May 2021 05:09 PM PDT

    About a week ago, my app started to get a steady stream of 1-star reviews from people with broken English who clearly had never used my app.

    Today, I got a "Does Not Recommend" notification from a clearly fake Facebook profile. All this account does is write one of two copy/paste recommendations, either: "Wow amazing great great service" or "Crap service bad service do not recommend"

    After seeing this, I'm now convinced that a competitor has put out a hit on me.

    So what's going on? How do I combat it?

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

    Jetpack Compose: Styles and Themes

    Posted: 17 May 2021 12:29 AM PDT

    My first android app (Kripto)

    Posted: 17 May 2021 03:23 AM PDT

    Hi everyone!

    I just created an android app using mvvm architecture, for cryptocurrency using the popular coingecko api.

    It's open source (you can find it here) and I need suggestions for this on what can I improve and what am I doing wrong :)

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

    How you promote your app?

    Posted: 16 May 2021 09:14 PM PDT

    Hii I have launched an app on play store and there are 0 downloads/day so I want to promote it so it reaches more audience. What are the ways you use to promote your app? Thank you!

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

    Why is Explicitly setting initial values is a bad pattern in Android? Example in the description

    Posted: 17 May 2021 07:44 AM PDT

    From the Google Codelabs:

    ```

    // TODO: Explicitly setting initial values is a bad pattern. We'll fix that.

    updateName() updateLikes() ```

    Link: https://github.com/googlecodelabs/android-databinding/blob/19246a458e21f475cd806d9623120fb9c29e9dad/app/src/main/java/com/example/android/databinding/basicsample/ui/PlainOldActivity.kt#L48

    Why is that the reason and how do you do otherwise?

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

    Build Powerful Apps with low-cost budget: Essential Tips

    Posted: 17 May 2021 06:16 AM PDT

    How do you update app UI if you are currently running a task using foreground service?

    Posted: 17 May 2021 06:05 AM PDT

    I was wondering, how do you usually update your app UI, when your app is active, and you are running a task using foreground service (With notification on the top)

    The foreground service can be launched either by

    • ContextCompat.startForegroundService
    • Or implemented using WorkManager

    I do not find a straightforward way.

    I came across this rather cumbersome technique - https://stackoverflow.com/a/53205578/72437 (Make use of mWorkManager.getStatusByIdLiveData)

    I was wondering, whether this is a right way to do so? Or, you have founded a simpler technique?

    Thanks.

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

    Android emulator for the web in docker

    Posted: 17 May 2021 04:46 AM PDT

    Hi :)

    I hope this is the right sub and flair.

    I am developing an app with a team and we need to show the progress of our development, but the person who we need to report to is too stupid and or lazy to install the apk that our ci produces.

    I thought maybe there is a docker container that I can give the apk and it runs an emulator making it available as a website. Does something like that exist ?

    I tried googling it but only found vnc accessible emulators or mobile testing.

    Gib thanks in advance 🤓

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

    [Discussion] Why don't ViewModels have nullable activities the same way that Fragments do?

    Posted: 17 May 2021 04:29 AM PDT

    I'm going to write Activity for simplicity, but same goes for Fragments/Single Activity

    Just noticed this, Fragments have getActivity (which is sometimes null), but what reason could there be for ViewModels to not do the same (nullable activity/fragment getter)? Seems pretty similar, (most) ViewModels use Activities on creation so they have access to it at least at that point. Even the ones that are less related to actual Activities/Fragments can just return null.

    Why not just have a (nullable) getActivity method which returns the activity/fragment that created the ViewModel (or the last one that did etc.)?

    I know architecture this that seperation of stuff but... the way it currently is is far from perfect.

    Want to handle logic and then decide if you want to navigate somewhere?

    Sure, handle/pass the logic to the ViewModel, then create a LiveData that tells the activity if it should start another activity/fragment and... observe that LiveData in the Activity because only that is allowed to navigate somewhere.

    It just doesn't make much sense, saying activity?.startActivity in a viewModel seems way better and I don't see any downsides if the activity is nullable - Memory leaks would be solved by the SDK unlike cases where people actually have a activity member variable (which I agree is bad).

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

    Hand over a List of composables

    Posted: 17 May 2021 03:18 AM PDT

    Hey Guys!

    Im working now with jetpack compose and want to make a dynamic button row. I have to say im quite new to this and have not a solid knowledge of kotlin. However, Im trying to build a Composable ButtonRow which builds itself over the whole width depending on how much buttons are in this row.

    ```

    ButtonRow<Button>(
    buttonList = listOf(
    Button(
    onClick = { navigation.popBackStack() },
    modifier = Modifier.width(IntrinsicSize.Max)
    ) {
    Text("Back")
    },
    Button(
    modifier = Modifier.width(IntrinsicSize.Max),
    onClick = {
    task.assignedUser = user.username
    task.assignedUserId = user.userId
    executable(task)
    }
    ) {
    Text("Assign")
    }
    )
    )

    ```

    Like this.

    But I cant hand over a List of Buttons. Can anyone help me out here?

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

    Android recyclerView: how to retain the selectableItemBackground to keep the row highlighted?

    Posted: 17 May 2021 02:29 AM PDT

    I am successfully able to show a ripple effect on click of a recycler view item by setting this to the row:

    android:clickable="true" android:background="?attr/selectableItemBackground" android:focusable="true" 

    When clicked, I am presenting a detail activity. How can I retain the ripple effect background when clicked? i.e. when a cell is clicked, the ripple animation occurs. I want the ripple to stay there after competition until I manually remove it (when I return back to this activity). Sort of like keeping that row highlighted until I remove the highlight after returning to the activity. How can I achieve this?

    I tried setting focusableInTouchMode to true for the row and this does keep the row highlighted but then the onClick never gets called.

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

    What problems do you guys face?

    Posted: 17 May 2021 04:30 AM PDT

    Hi!

    I'm trying to understand the common problems faced by you guys so I created this survey.

    https://docs.google.com/forms/d/e/1FAIpQLSey6G3fUrlTtiKgLPYaxdumTB2aNAaed-YKw1S7dheUQvLEAA/viewform?usp=sf_link

    I'd be really glad if you could fill it out. (It's anonymous)

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

    Google I/O 2021: What developers can expect on Android 12, TensorFlow, Material Design

    Posted: 16 May 2021 11:18 PM PDT

    Do all architecture components really make development easier?

    Posted: 16 May 2021 06:27 PM PDT

    I find viewbinding, livedata, viewmodel (if the app needs to survive configuration changes), lifecycle observer useful, I feel like the navigation component & paging library writing too much code for simple task. I am easily able to implement paging by a scroll listener. Also the navigation component seems only able to replace fragment, not adding with add to backstack (it is not a good UX if the previous fragment is created again on back press loads data from internet) & seems we have to write workaround code for the same.

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

    Kotlin withContext() is very slow

    Posted: 16 May 2021 12:02 PM PDT

    As the documentation says, suspending functions should be safe to call from the main thread. I decided to refactor some of my code that deals with reading some data from audio files to make it main-safe but there was a surprising drop in performance. Normally it would take about 50 ms but using withContext(Dispatchers.IO) makes it much slower. To show a simpler example, let's say we have these 2 methods: one is supposed to be main-safe and uses withContext(), the other one doesn't.

    suspend fun testWithContext() : Int = withContext(Dispatchers.IO) { delay(50) 1 } suspend fun testWithoutContext() : Int { delay(50) return 1 } 

    Now let's call these methods in a ViewModel:

    viewModelScope.launch(Dispatchers.IO) { measureTimeMillis { testWithoutContext() }.also { Log.d("testWithoutContext", it.toString()) } 

    This executes in about 52 ms, so it totally makes sense.

    Now the other one which uses withContext(Dispatchers.IO):

    viewModelScope.launch { measureTimeMillis { testWithContext() }.also { Log.d("testWithContext", it.toString()) } } 

    This one will take about 160-220 ms to execute, so it's pretty much pointless to write code like this if it would normally execute in less than 200 ms. Above this threshold, there's almost no difference between using withContext() or not.

    Am I missing something or is it normal that switching from Main to IO/Default makes fast code much slower but doesn't affect slow code?

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

    I am looking for a free API for streaming music.

    Posted: 16 May 2021 02:18 PM PDT

    Hello, dear subreddit. I am planning to create a music streaming application as a part of my state exam. Somebody knows how can I get the music for streaming? Firstly I want something free where I can found at least 1,000 songs. Somebody who already made a similar application can recommend Music Streaming APIs or Online Music Libraries? Thank you!

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

    What do you think about Panoramic screenshots for Play Store?

    Posted: 16 May 2021 05:39 PM PDT

    What do people think about these types of screenshots, that need to be scrolled because they span 2 or more screens. For me, I think I prefer the standard screenshot - 1 screen on each image, because I can see more information about the app quickly. But I've seen these "panoramic" screenshots appearing more often. I guess it's more hip or something; what does everyone think?

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

    Can't find Sha -1 key

    Posted: 16 May 2021 04:49 PM PDT

    I am currently using android studio version 4.2 and I can't find anything in gardle section other than just dependencies ( no tool , no task and no sign in report ).

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

    Easy way to create a virtual keyboard?

    Posted: 16 May 2021 04:33 PM PDT

    Is there an easy way to create an app that acts like a keyboard for windows. I want to create a ui with a double of buttons that when pressed send letters to a windows PC just like a normal keyboard would do. The tablet can be connected to the PC via USB Thank you in advance

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

    How to Update RecyclerView Item upload/download progress after fragment replaced?

    Posted: 16 May 2021 01:56 PM PDT

    Hello guys,

    I'm an android developer and I came to a requirement few days ago that I don't know how to solve efficiently.

    My app have single activity and two fragments that show local and cloud videos in recyclerview. User can upload local video and download cloud(backup) video. I have two buttons LocalVideos & CloudVideos in parent fragment that is hosted in MainActivity and upon each button's click, I show corresponding fragment in parent fragment. So I have

    MainActivity -> Parent Fragment with LocalVideos & CloudVideos Buttons -> Local/CloudVideosfragment.

    I also have other fragments that are not related to my requirement so I'm skipping them here. Now, the problem is, whenever user uploads/downloads the video, I show progress indicator on recyclerview item, but during upload/download, if user clicks on other button, then first fragment is replaced with second but upload/download keeps happening in the background. But when the user goes back to the first fragment, the upload/download successfully completes but I'm unable to update the recyclerview item progress.

    I hope I explained my problem so that you guys can understand.

    Any idea how I can do this?

    I'm replacing fragment on LocalVideos & CloudVideos button's click.

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

    No comments:

    Post a Comment