• Breaking News

    [Android][timeline][#f39c12]

    Saturday, February 26, 2022

    App Feedback Thread - February 25, 2022 Android Dev

    App Feedback Thread - February 25, 2022 Android Dev


    App Feedback Thread - February 25, 2022

    Posted: 25 Feb 2022 06:00 AM PST

    This thread is for getting feedback on your own apps.

    Developers:

    • must provide feedback for others
    • must include Play Store, GitHub, or BitBucket link
    • must make a top level comment
    • must make an effort to respond to questions and feedback from commenters
    • app may be open or closed source

    Commenters:

    • must give constructive feedback in replies to top level comments
    • must not include links to other apps

    To cut down on spam, accounts who are too young or do not have enough karma to post will be removed. Please make an effort to contribute to the community before asking for feedback.

    As always, the mod team is only a small group of people, and we rely on the readers to help us maintain this subreddit. Please report any rule breakers. Thank you.

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

    UI Kit

    Posted: 26 Feb 2022 05:28 AM PST

    Guys, do you know any material that I can follow to help me create a UI Kit with custom components and custom styles and distribute it as a library?

    submitted by /u/Altruistic-Cattle492
    [link] [comments]

    What important due dates are in 2022 for Android Development.

    Posted: 25 Feb 2022 03:31 PM PST

    I am aware of the below important due dates

    1. Advertising ID Permission (1 April 2022)
    2. Launching Data safety in Play Console: Elevating Privacy and Security for your users (April 2022)
    3. Move target Android SDK to 31 (Cannot find the due date link, suspected Nov 2022)
    4. Discontinuing Kotlin synthetics for views (End 2022)

    Anything I miss above?

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

    Sometimes when our app crashes it immediately restarts from the current activity. Other times it restarts from the launcher activity. What are factors that decide where the crashed app restarts from?

    Posted: 26 Feb 2022 12:39 AM PST

    ViewOutlineProvider and performance

    Posted: 26 Feb 2022 07:45 AM PST

    I'm nearing the end of a fairly big app update and during the optimisation I've noticed that when using ViewOutlineProviders the performance can be significantly impacted.

    It was my understanding after Lollipop outline providers were hardware accelerated. Is this not the case or do they just carry a performance overhead regardless? Does anyone else avoid them?

    Cheers

    Laurence

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

    Does anyone know what is a good "fast scroll" solution for recycler view with different height item?

    Posted: 26 Feb 2022 07:40 AM PST

    AndroidX Recycler View does provide fast scroll feature.

     <androidx.recyclerview.widget.RecyclerView app:fastScrollEnabled="true" app:fastScrollVerticalThumbDrawable="@drawable/fast_scroll_thumb_material_light" app:fastScrollVerticalTrackDrawable="@drawable/fast_scroll_track_material_light" app:fastScrollHorizontalThumbDrawable="@drawable/fast_scroll_thumb_material_light" app:fastScrollHorizontalTrackDrawable="@drawable/fast_scroll_track_material_light" android:requiresFadingEdge="none" android:scrollbars="vertical" 

    However, the solution only work flawless if all items are having same height. If the items have different height, you will observe the following flaws

    1. Initial touch position in the scroll thumb is not retained. For instance, if you press on the center of Thumb and began fast scroll, you will realize the touch region no longer retained in the center of Thumb, after scroll - https://www.youtube.com/watch?v=c9jkI7ryyoA
    2. The hit rect for the scroll Thumb is too narrow. This makes it difficult to initiate the fast scroll, as user need to hit the Thumb rect region precisely.

    Some 3rd party library able to provide a Thumb rect with wide enough hit rect region - https://github.com/zhanghai/AndroidFastScroll

    However, the dynamic height item in recycler view, still remain an issue. It still have the "jumpy" effect when dealing with dynamic height - https://github.com/zhanghai/AndroidFastScroll/issues/40

    I was wondering, does anyone come across a good fast scroll solution, for recycler view with different height item? Thanks.

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

    RasmView: An Android Drawing view

    Posted: 25 Feb 2022 01:47 PM PST

    A must know for an android tech leader & good sites to get value information about development

    Posted: 25 Feb 2022 04:38 PM PST

    Good morning everyone, I've been working in android development for 2 years, about 6 months ago I was changed from development to technical leader (I know it's not ideal, but the company is small, I'm the one with the most experience and they needed to ensure quality of deliveries somehow).

    I want to do my best to "fit" into the position. That is why I come here to ask for advice on what are the fundamental things to learn, if you have pages where you can read updated information about it, everything helps.

    At the moment, to list the things that we implement,we have PullRequest, some unitest, a script that avoids pushing to a remote GIT server if the unitest fails. For some context, the code is made without any pattern, with most of the functions in its activities, mostly in java, with some things rewritten in kotlin.

    Thank you very much for your help, any contribution is useful.

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

    Room library keeps strong references of LiveDatas to "avoid garbage collection", even though the only method of instantiation is by strong referencing them...

    Posted: 25 Feb 2022 02:15 PM PST

    I was wondering what was the purpose of the class InvalidationLiveDataContainer.

    class InvalidationLiveDataContainer { @SuppressWarnings("WeakerAccess") @VisibleForTesting final Set<LiveData> mLiveDataSet = Collections.newSetFromMap( new IdentityHashMap<LiveData, Boolean>() ); private final RoomDatabase mDatabase; InvalidationLiveDataContainer(RoomDatabase database) { mDatabase = database; } <T> LiveData<T> create(String[] tableNames, boolean inTransaction, Callable<T> computeFunction) { return new RoomTrackingLiveData<>(mDatabase, this, inTransaction, computeFunction, tableNames); } void onActive(LiveData liveData) { mLiveDataSet.add(liveData); } void onInactive(LiveData liveData) { mLiveDataSet.remove(liveData); } } 

    The description says:

    We keep a strong reference to active LiveData instances to avoid garbage collection in case developer does not hold onto the returned LiveData.

    The problem is that the only(?)/(maybe not only but definitely) best/ most suitable and intuitive way of instantiating LiveDatas is by Dao instantiation inside a ViewModels.

    Forget about "repositories" (specially those that are nothing more than helper clases) or whatever architecture that makes the process unnecessarily complex.

    In the eyes of the JVM, as long as a LiveData reference is scoped by the observing Fragment, OR by the instanced ViewModel, it will NEVER be garbage collected.

    It does not matter if it becomes scoped by something that will hide it (like a switchMap function), it will simply NOT GET collected.

    And this becomes profoundly obvious by the fact the the created LiveData (with the method LiveData<T> create(String[] tableNames, boolean inTransaction, Callable<T> computeFunction)) is the ONLY ONE that has access to the onActive() and onInactive() methods.

    At first I thougth that the InvalidationTracker class, which is the owner of the InvalidationLiveDataContainer had access to these LiveDatas... maybe a global Activity LifeCycle could shut off these liveData,s .. but no... not only does that NOT happen, but it would be unnecessary since each LiveData can handle that on it's own.

    Another weird thing is that the code aknowledges a possible GCollceting scenario, but it makes it imposible to track the cached items (for later retrieval), and that is the weirdest thing...

    Maybe they thought functionality was going to be made on the upper class and that was the reason why they left it package private... but in the end, nothing was done...

    But maybe I am missing something here...

    The most important fact about all of this is that whenever a tracker becomes active... it attaches a main observer to the Database.

    mDatabase.getInvalidationTracker().addWeakObserver(mObserver); 

    and that line... IF the mObserver was not weaklyReferenced... ONLY THEN would the InvalidationLiveDataContainer would make some sort of sense.

    Since that container (InvalidationLiveDataContainer) could serve as manager for all LiveDatas of the same database table and there would be NO need to instantiate a new Observer with each LiveData created.

    EDIT:

    After giving it a little more thought, I think I found out the reason for this class.

    The main hint is this method which belongs to the InvalidationTracker.observer onInvalidated(@NonNull Set<String> tables)

    If we change the final Set<LiveData> mLiveDataSet so that it becomes a Map<String, Set<Runnable>> we could instantiate a single InvalidationTracker.observer for the whole database, and the reaction time may actually be faster since the response is already designed for multiple tables at once, and the live memory footprint becomes a lot lighter.

    so that we could check for which tables are being invalidated all at once, and send a "refresh" to all LiveDatum ;) under their respective table denominations.

    class InvalidationRefreshContainer { private final Map<String, Set<Runnable>> toRefresh = new HashMap(); private final InvalidationTracker.Observer observer; private final RoomDatabase database; InvalidationRefreshContainer(String[] multipleTables, RoomDatabase database) { this.database = database; observer = new InvalidationTracker.Observer(multipleTables) { @Override public void onInvalidated(@NonNull Set<String> tables) { //get all refresh runnables from the given tables and execute. for(Runnable r:runnableSet) ArchTaskExecutor.getInstance().executeOnMainThread(r); } }; } //called by LiveData void onActive(String ofTable, Runnable liveDataRefresh) { toRefresh.compute(ofTable, etc... .add(liveDataRefresh)); // if first put database.add(observer) } //called by LiveData void onInactive(String ofTable, Runnable liveDataRefresh) { mLiveDataSet.compute(ofTable, etc... .remove(liveDataRefresh)); //if last remove database.remove(observer) } } 

    The above code would be an absolute necessity IF the InvalidationTracker.Observer collection would have not been designed as a weakObserver collection.

    Edit:

    So user u/shlusiak effectively demonstrated the usefulness of the class, but it just makes me wonder "why?".

    A common reactive pattern that does not rely on weakReferencing observers will never be in danger of it's observers being GC'd.

    At the same time, user u/Zhuinden pointed out, people will make mistakes and so, it is a must.

    So this prevention measure creates a secondary problem, if LiveDatum are just weaklyReferenced by the Database, they'll become eligible for getting collected (under that narrow scenario of attaching an observeForever observer immediately after creation and not storing the reference anywhere).

    So the container class prevents this Garbage Collection, the problem is that it invalidates whatever the weakReference was trying to accomplish in the first place.

    A counter-measure that invalidates the first counter-measure... so to speak.

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

    IAP unsupported

    Posted: 25 Feb 2022 10:28 PM PST

    I have an issue where IAP isn't supported in my country, but I need to make purchases to increase my google storage because my developer email can't receive emails because the storage is full, how am I supposed to upgrade the storage in this case?

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

    Developers haven't received Google revenue for three months

    Posted: 25 Feb 2022 10:51 AM PST

    I received an email on the 18th of this month, indicating that the funds in the account have been unfrozen, the transfer will be processed in 2-3 days, and it is expected to arrive next week. This week in the United States is Friday. I don't know when the salaries will be settled, and the salaries cannot be paid. The partner and corporate banking business has been severely affected, and I haven't slept well for three months. Why do they take so long to process things internally. I spend every day in disappointment and hope. Really can't keep up. Email google now and they haven't responded. Why do you treat developers like this?

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

    making an android game in unity

    Posted: 25 Feb 2022 04:35 PM PST

    hey all.

    so i just made my first full length game in unity, for windows. is it alot of work to make it work on android?

    its a 2D platform game, the player can just move right and left, jump, and have 1 attack.

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

    Receiving payments in Georgia (Грузия)

    Posted: 25 Feb 2022 09:00 AM PST

    Hello! Do you know about possibility of receiving payments in Georgia (Грузия)?

    It seems that I can register Google Adsense account and receive income for advertising in applications to a bank account?

    But Google Play in-app purchases don't work in Georgia? So I can't get income from this service?

    Am I Right?

    Thank you very much.

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

    Change viewmodel variables directly

    Posted: 25 Feb 2022 03:45 PM PST

    Hi guys. First of all I'm new to programming in general so sorry If this is a dumb question.

    I have a fragment where you can choose a date and time from date/time picker dialogs. I needed year/month/day/hour/minute variables to initialize those dialogs so I set them up inside the fragment. Everything was working fine but they reset If I navigated away from the fragment.

    To avoid this, I instead moved those variables into my view model. So now every time my override ondateset is called I'm changing those vars directly from my fragment and it works perfectly.

    Is this a bad practice? What can I do instead?

    Edit: please let me know if I should share some of my code

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

    external barcode reader click randomly

    Posted: 25 Feb 2022 08:54 AM PST

    i have barcode reader connected to my device through otg whenever it reads a barcode it keep clicking on views and recyclerview items

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

    HomeKit Accessory Protocol HAP on Android?

    Posted: 25 Feb 2022 11:30 AM PST

    I have an IoT device that only supports HomeKit Accessory Protocol (HAP) over IP.

    I've been surprised to find very few people in the same spot where HomeKit is the only way to talk to a device, and there being no official HomeKit implementation on Android. I haven't found any library to specifically cater to the very proprietary, specific protocol specified by HAP, which is basically HTTP requests encrypted using short term keys, but even the header is encrypted. The requests are then sent over a socket.

    The existing codebase has an implementation which uses Java Sockets + Retrofit 1 to send HTTP Requests over the proxy. The whole thing is a hacky PITA that is causing major issues for us.

    We're looking into using Tinder Scarlet but just thought I'd see if there were any suggestions from the cool members of this community :)

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

    Is there a way to Use Wifi/Bluetooth instead of USB debugging?

    Posted: 25 Feb 2022 06:10 AM PST

    I tried a few Plugins in AndroidStudio but they were incompatible(Only usable in IntelliJ).

    Is there Anyone here who succesfully does it without a cable?

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

    TIL Compose rememberSaveable lifecycle gotcha: it doesn't clean state after dispose

    Posted: 25 Feb 2022 06:55 AM PST

    My hope was that after removing a Composable for good (e.g. when using another layout after rotation or when the list of items on the Ui is refreshed from a backend call), then the stored object in rememberSaveable will also be removed from memory and disk.

    https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-main/compose/runtime/runtime-saveable/src/commonMain/kotlin/androidx/compose/runtime/saveable/RememberSaveable.kt#66

    After some tests and diving into the inner works of the function, I realized that all variables stored in rememberSaveable will be kept in memory as long as the current screen is displayed.

    So I learned that rememberSaveable objects are scoped to the Activity/Fragment/Nav-destination, and not the Composable where they are initialized.

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

    What the significance of adding dependency in android/app/build.gradle?

    Posted: 25 Feb 2022 07:57 AM PST

    //Add this in your android/app/build.gradle dependencies { implementation project(':react-native-video') .... } 

    As listed in react-native-video installation steps we need to add this in build.gradlehttps://github.com/react-native-video/react-native-video#android-installation

    But catch here is, app is still build with or without it? I have skimmed through internet and I am not able to find the answer for this. Can you anyone help me with understanding whats happening here? Why it is working and whats the significance of dependencies in build.gradle.

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

    I'm a Beginner.

    Posted: 25 Feb 2022 03:32 AM PST

    I need to know how can I start Making android apps? What should i learn in programming languages

    and do I need to become a backend dev to make apps?,

    submitted by /u/0Nyx28
    [link] [comments]

    Developers haven't received Google revenue for three months

    Posted: 25 Feb 2022 10:45 AM PST

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel