• Breaking News

    Monday, April 19, 2021

    Android Dev - Weekly Who's Hiring Thread - April 19, 2021

    Android Dev - Weekly Who's Hiring Thread - April 19, 2021


    Weekly Who's Hiring Thread - April 19, 2021

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

    Real-time lifecycle-aware updates in Jetpack Compose

    Posted: 18 Apr 2021 02:46 PM PDT

    How to test if you fully handle the android lifecycle?

    Posted: 19 Apr 2021 04:51 AM PDT

    Crashlytics seems to report me crashs related to Android lifecycle but I can't reproduce them, here is what I tried:

    • Enable developer options on the phone, check the option to not keep the activities
    • Rotate the screen
    • Send app to background and then bring it back to foreground
    • Run the app from Android studio in debug mode, on the phone press the button to see all running apps, kill the app with the "Stop app" button in the debug tab of Android studio, click on the app in the list of running apps on the phone to restore it
    • Crash the app on purpose and click on the "restart the app" button in the "app have stopped working" dialog (this seems to restart the current activity in a certain way)

    Shouldn't this tests cover all the common problems caused by Android lifecycle? Did I miss something?

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

    [Library] Made a small/simple navigation library

    Posted: 19 Apr 2021 07:02 AM PDT

    So I was refactoring one of my old apps containing multiple activities to a single activity approach using Fragments.

    I was looking for something where I had more control over navigation for eg: If I used any navigation library and didn't like some of its implementations I can switch back to the manual Fragment Transaction.

    That's when I decided that I should start writing one which should be decoupled & can be added to the project easily at any time without disturbing any app logic, to make easier navigation covering various gotchas & to make animations even more simple.

    The library is in alpha, you can try it out as all the libraries are published to maven central.

    I wrote some sample apps so you can see the library in action. Overall I'm loving working on it & would love to hear your feedback.

    https://github.com/KaustubhPatange/navigator

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

    I'm assuming a lot of us are frantically implementing SAF this week. What are you all planing on doing if you have to show a directory tree?

    Posted: 18 Apr 2021 09:26 PM PDT

    I have multiple questions regarding this. I've tested most of what I need and I think it'll work but I haven't decided how to do it. Currently my app is targeting API 29 and using the legacy storage flag.

    1. Should I let my android 5 to 9 users continue using the file API to avoid confusion?

    2. The directory picker looks different in every phone I've tried, some just open up on recent and you have to do a silly show internal storage click to see the rest. How are you all handling that? Will I need instructions per Android version? Do different manufacturers handle this different?

    3. Is the recommendation to just have a button always visible for users to change the root they want to start browsing from?

    4. Are there any good examples of apps using the directory picker? Most examples I see are of apps using the file picker.

    Sorry for all the questions, I'm just in a bit of a panic because I'm having to squeeze so much work into just a small amount of time.

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

    Android Environment.getExternalStorageDirectory() API Support

    Posted: 19 Apr 2021 05:25 AM PDT

    Im working on status saver app for whatsapp. WA statuses (image/ videos) are fetched from "/WhatsApp/Media/.Statuses" folder using Environment.getExternalStorageDirectory() API. But, from android 11 sdk 30 usage of this API is restricted so how to change the api accordingly, should I use storage access framework or use "android.permission.MANAGE_EXTERNAL_STORAGE" permission which is also difficult to br granted by google play store. SAF seems difficult for this task. how to solve this ?

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

    Most Popular Backend Frameworks – 2012/2021

    Posted: 19 Apr 2021 07:45 AM PDT

    Has anyone else experienced a sudden significant drop in Explore traffic for their app for no apparent reason?

    Posted: 19 Apr 2021 07:41 AM PDT

    Explore traffic dropped from around 2000 to 100 in early March and has never recovered.

    I think it might have been due to poor conversions from explore traffic, but surely this wouldn't have such a dramatic effect. Ratings have been good and stable.

    Any ideas?

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

    Default Android Studio Jetpack Compose app doesn't even build.

    Posted: 19 Apr 2021 05:48 AM PDT

    As someone new to Android Jetpack Compose, about which we hear so much hype, my initial experience has been underwhelming to say the least. After installing the latest Canary build of Android Studio, as required, I selected a new Empty Compose Activity which promptly crashed during build with the error: java.lang.NoClassDefFoundError: org/jetbrains/kotlin/ir/descriptors/WrappedSimpleFunctionDescriptor.

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

    I created a full functional login template written entirely in Jetpack Compose.

    Posted: 18 Apr 2021 07:55 AM PDT

    I created a full functional login template written entirely in Jetpack Compose.

    Main Components used:

    • Jetpack Compose
    • Navigation Component (Standard)
    • Firebase

    Supported Login methods:

    • Email
    • Google
    • Phone Number

    Github repository: https://github.com/ameencarpenter/login-template

    APK: https://github.com/ameencarpenter/login-template/blob/master/app/release/app-release.apk

    Note: For phone number, you will have to type your country's code first then the number. I will add the option to choose a country later.

    I will appreciate your feedback.

    https://preview.redd.it/7ojra0hw5yt61.png?width=600&format=png&auto=webp&s=f7b36e8a473a67096dc69a6b2d81bce3589928f2

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

    Google Play console / Developer Registration Fee

    Posted: 19 Apr 2021 04:42 AM PDT

    Hello, I have a problem with my registration, I want to upload my first application to Google Play, but when I go to pay, the page throws this error "Correct the information of this card or the one with a different card", the card information is correct, and I tried it with another card, but the error persists. What could be the problem? I use a business @, the account is not gmail, could that be why?

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

    Created a Sample Android Application which includes ConnectionService to handle incoming and outgoing calls.

    Posted: 18 Apr 2021 09:37 PM PDT

    Video information on watching a video from another app/browser?

    Posted: 18 Apr 2021 11:35 PM PDT

    Hi yall, I have a question if this is actually possible. So what I'm trying to find is an app, or a way to get video information, specifically codec, on videos that are currently playing back on the phone.

    For example you are scrolling trough FB or Tik Tok and every time the video start you would get like an overlay of the video information - is that even possible?

    I know there are ways when you download the video and then use VLC or ffprobe, but I would like it done without the video being downloaded and online

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

    Firebase analytics

    Posted: 19 Apr 2021 02:16 AM PDT

    Anyone using Firebase analytics?

    I created custom events which I can see in DebugView, but I can't in Events section..

    Also, I read that if I want to do that, I need to create a Custom Dimension, which I did. I created it with the same name as my custom event, but even after 24h I don't see anything in Events section..

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

    Help with syncing scroll views inside recycler view

    Posted: 19 Apr 2021 01:33 AM PDT

    My apologies if this is not the right place. Please let me know if thats the case and I'll remove this and post it in the correct space

    I'm new to android development and have been learning how to build apps in android studio using kotlin.

    Part of the project I'm working on uses a RecyclerView. The items being dispalyed by the recyclerView each have a scroll view. I want to set it up so that the scrolling on all the scrollviews are synced.

    My solution was to add a onScrollChangeListener to each of the scrollViews and store the position in a LiveData variable. I then add an observer to the LiveData variable and then when ever I detect a change I'll cycle through all the scrollViews in the recyclerView and move them to the correct position.

    Currently I can only get it to start wroking after I add an item to the recyclerView, however when I close the app and start it again I'll have to add another item to the recyclerView before it can work again.

    Here is my code in my MainActivity:

    class MainActivity : AppCompatActivity() { private val dataViewModel: DataViewModel by viewModels { DataViewModelFactory((application as DataApplication).repository) } var vsvPosition: MutableLiveData<Int?> = MutableLiveData() fun updateScrollPosition(scrollY: Int){ vsvPosition!!.value = scrollY } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val container = findViewById<RecyclerView>(R.id.calendar_recyclerview) val calendarRecyclerView = findViewById<RecyclerView>(R.id.calendar_recyclerview) val calendarAdapter = WeekListAdapter() calendarRecyclerView.adapter = calendarAdapter calendarRecyclerView.layoutManager= LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false) vsvPosition.observe(this, Observer<Int?> { for (i in 0 until container.childCount) { val vsv = container.getChildAt(i).findViewById<ScrollView>(R.id.dayScrollView) vsv.smoothScrollTo(0, it!!) } }) dataViewModel.allappointments.observe(this, Observer { appointments -> appointments?.let { calendarAdapter.submitList(it) for (i in 0 until container.childCount) { val hsv = container.getChildAt(i).findViewById<ScrollView>(R.id.dayScrollView) if (hsv != null){ vsv.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY -> vsvPosition!!.value = scrollY } } } } }) } } 

    Any help will be highly appreciated

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

    Can I use LiveData.observe instead of observeAsState in compose functions ?

    Posted: 19 Apr 2021 01:25 AM PDT

    There're cases when I need to observe data that recomposition is not needed when it changes, such as a boolean indicates whether a user is signed in or not to navigate to another screen, or an error message to show a toast. Using observeAsState in such cases doesn't make sense because:

    1. It causes unneeded recompositions.
    2. It creates a side-effect because I need to write an if statement to react to it.

    Example:

    val signedIn by model.signedIn.observeAsState(false) if(signedIn) navController.navigate(Destinations.HOME) 

    So, it would make sense to use observe instead.

    Example:

    viewModel.signedIn.observe(LocalLifecycleOwner.current) { if (it) navController.navigate(Destinations.HOME) } 
    submitted by /u/ameencarpenter
    [link] [comments]

    How to call an API from an Android Widget?

    Posted: 19 Apr 2021 12:23 AM PDT

    Hi guys,I'm an android dev but is my first time working with widgets.I'm trying to create a simple widget (no app, only a widget) to show the current price of a stock.I can't find any example on how to do that. My goal is to refresh the widget every 60 seconds, making an http request and updating the textview. Should I create a class that extends something in particular? The widget refresh is set to 60 seconds. Where should I call my API? (Can i use retrofit?)

    If you have any example that can help me, I'd be very grateful!

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

    How to preload Room Database with prepackaged DB ��

    Posted: 18 Apr 2021 08:51 PM PDT

    Google Play API: Discount for users who cancel purchase?

    Posted: 18 Apr 2021 11:08 AM PDT

    Google Play API: Discount for users who cancel purchase?

    Lately I've started to notice a few apps with IAP will offer a discount if you try to purchase something then decide not to at the last minute (see photo below).

    Is this a default behavior with the Google IAP library? Is there documentation somewhere that explains this behavior? Because I couldn't find any from a quick google search.

    I think it's a neat feature, and I'd like to learn more about it to see if I could use it myself in the future.

    https://preview.redd.it/vaewvl2o1zt61.png?width=878&format=png&auto=webp&s=e4718a436baf6352f63af152d4a1d0e011ad910e

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

    When using navigation component, do you provide a good UX way for user to "quit" the Activity?

    Posted: 18 Apr 2021 08:59 PM PDT

    When we are developing using navigation component, to implement single activity switching between multiple fragment screen, I was wondering, do you provide a good way, for user to quit the Activity?

    For instance, when user has navigated 5 different fragment screens, he need to press the phone back button for 6 times, in order to completely "quit" the Activity.

    It is kind of frustrated, of having to press so many times "back" to quit the Activity.

    I was thinking to add the "X" button, at the top right of the screen, in order to "quit" the Activity.

    The "<-" top left button of toolbar, might be confusing user. Does it mean, "back to previous screen", or "quit this activity" ?

    May I know, when using navigation component, do you provide a good UX way for user to "quit" the Activity?

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

    Paging 3 Library

    Posted: 18 Apr 2021 11:24 AM PDT

    Hey anyone has expert in paging 3 library. I am working on unlimited data with Viewpager 2 and Paging library. I successfully created the logic to create unlimited pages by the help of paging source. I am swiping single pages by buttons in both direction. But some issue like a weird race scenario where the smooth scroll behavior in ViewPager is attempting to do an animated scroll to an absolute position, but Paging is able to PREPEND items to the front of the list faster than the animation can scroll there. Can anyone know how to solve the problem. I asked in stack overflow but i didn't get it?

    https://stackoverflow.com/questions/64890219/viewpager-2-with-paging-3-jumps-too-many-pages-on-button-click-kotlin

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

    Infinite Scroll using FlatList | Inspired by Instagram ⚛️

    Posted: 18 Apr 2021 02:15 PM PDT

    Kotlin Multiplatform vs Flutter // goobar podcast #15

    Posted: 18 Apr 2021 01:51 PM PDT

    Android Kotlin - Create CardView and TextView programmatically

    Posted: 18 Apr 2021 01:39 PM PDT

    No comments:

    Post a Comment