r/android_devs • • Oct 09 '20

Help How would you go about implementing a server-driven UI in production?

12 Upvotes

Hi, I'm gonna be working on an application that will use JSON to decide which UI elements to render on the user's screen.

So, let's say if you have a user auth flow in which the data(email, phone number, etc) that the user needs to enter will be customizable from the backend. So, if we decide that we only need the user's email and name and not his phone number, we can do it from the backend. If we need N number of screens with X UI elements and their data, we should be able to customize them at the backend and that will get reflected in the app.

Jetpack compose is still in alpha, although it solves the problem of building UI on the go. Then there's facebook's litho which has been there for a long time. I'm not sure which one to go with.

Also, for remote config, is there any open-source alternative firebase remote-config which I could use to store the config. I've not been able to find any.

I'm confused about this, and any kind of suggestions/tips would be helpful.

Thanks.


r/android_devs • • Oct 07 '20

Coding Andrew Bailey - Falsehoods Android Developers Believe About Lifecycles (Android Worldwide)

Thumbnail
youtube.com
12 Upvotes

r/android_devs • • Sep 28 '20

Coding The internals of Glide Caching Mechanism - How Glide Cache Key, Memory Cache, and Disk Cache Works?

Thumbnail
youtube.com
12 Upvotes

r/android_devs • • Sep 20 '20

Coding Understanding the internals of Glide Image Loading Library - Analyzing the Source Code

Thumbnail
youtube.com
12 Upvotes

r/android_devs • • Sep 17 '20

Coding The internals of Lottie Animation Library - Article

Thumbnail
codingwithmitch.com
12 Upvotes

r/android_devs • • Sep 12 '20

Article Proto DataStore - Hello DataStore, Bye SharedPreferences

Thumbnail
medium.com
12 Upvotes

r/android_devs • • Sep 09 '20

Coding Functional UI with ViewBinding

Thumbnail
desmondtzq.com
12 Upvotes

r/android_devs • • Aug 28 '20

Resources A continuously updated list of learning Jetpack Compose for Android apps.

12 Upvotes

https://github.com/androiddevnotes/learn-jetpack-compose-android

About: Learn Jetpack Compose Android aims to be your starting point to find the finest learning content for Jetpack Compose suites of libraries.


r/android_devs • • Aug 28 '20

Help Too afraid to ask at this point: What is REST API?

12 Upvotes

For the last few months, I have been scrolling through various websites looking for internships. Almost all of them require all interns to know of REST API.

I tried to Google the terms and checked out a few YouTube videos as well. However, to this date, I have no idea about what REST API is.

I mean, I know that it is used for web services and it involves the various HTTP methods. But I've never completely been able to wrap my head around the concept. Moreover, how do I implement this in my Android applications?

Could you guys give me some sources which helped you with learning about REST API?


r/android_devs • • Aug 22 '20

Off topic WordPress developer said Apple wouldn't allow updates to the free app until it added in-app purchases — letting Apple collect a 30% cut

Thumbnail
businessinsider.com
12 Upvotes

r/android_devs • • Aug 16 '20

Resources My personal library for easy Android development

12 Upvotes

Hey folks, I'm sharing my personal library that I use in every project of mine, it has things found working from StackOverflow to things I've written personally to take shortcuts, copied some from Github and modified them to work as intended just to make the Android development easier.

GitHub link

It lacks documentation at some places, but the methods are quite self explanatory, feel free to contribute or to use it in your projects, pull requests are welcomed as well as if something doesn't work feel free to open an issue or if you find your code add headers/credits that's yours and make a pull request.


r/android_devs • • Aug 13 '20

Store stories Epic is now providing direct mobile payments on Play Store and App Store

Thumbnail
epicgames.com
12 Upvotes

r/android_devs • • Jul 30 '20

Discussion Senior Android Engineer roles interviews, asking for Site-traffic and Scalable-Systems Designs ?

12 Upvotes

How do you Senior Android UI Dev folk handle System Design interviews focusing on Site-traffic and Scalability problems, for Senior Android Engineer roles?

System Design interviews that ask for -

  1. Design Twitter, list out all the possible user-flow features - sign-up, login, post-tweet, home-feed, follow / unfollow user, hashtag etc etc. Discuss data-needs and bandwidth requirements.

  2. Design Amazon Prime Video such that a spike from 20K to 50K http-requests within a second will be scaled suitably.

I mean, the last 9 years, all the Android Application code I'd developed, I only had to deal with 1 User, and 1 Main-thread, apart from the one program-statement

httpResponse = httpClient . execute ( httpRequest ) ;

that necessarily needs to execute in any thread other than the Main-Thread.

Mostly collaborating about the application/json request and response structure, design, parsing logic with dedicated Mobile Service end-point teams, other than that, I have not developed a single line of code that was deployed in servers or server-less containers on the server-side that is.

It follows that, the last 9 years, I'd never dealt with multi-concurrent users, request-response-processing-throughput, read-write-ratios and such? Let alone, designing a normalized relational database table-structure for youtube or even a simple automated parking-lot or elevator system?

Am I unsuitable for "Senior Android Engineer" roles, is my "Specialization" with Android a dead-end career, if I am not "Full-stack" / "Generalist" ?


r/android_devs • • Jul 21 '20

Coding Getting on the same page with Paging 3

Thumbnail
android-developers.googleblog.com
12 Upvotes

r/android_devs • • Jul 09 '20

Store stories This is a spam store listing. How does Play store show only 5 star reviews on top instead of app having 1.3 star rating and every single review saying that it's a fake? (Check out his other apps too, obvious spam)

Thumbnail
play.google.com
12 Upvotes

r/android_devs • • Jul 08 '20

Publishing All Files Access Permission - Updated Play store policies

12 Upvotes

Files and directory attributes on a user’s device are regarded as personal and sensitive user data subject to the Personal and Sensitive Information policy and the following requirements:

Apps should only request access to device storage which is critical for the app to function, and may not request access to device storage on behalf of any third-party for any purpose that is unrelated to critical user-facing app functionality. 

Android devices running R (Android 11, API Level 30) or later, will require the MANAGE_EXTERNAL_STORAGE permission in order to manage access in shared storage. All apps that target R and request broad access to shared storage (“All files access”) must successfully pass an appropriate access review prior to publishing. Apps allowed to use this permission must clearly prompt users to enable “All files access” for their app under “Special app access” settings. For more information on the R requirements, please see this help article.

upd https://support.google.com/googleplay/android-developer/answer/9956427


r/android_devs • • Jul 06 '20

Announcement We need more moderators

12 Upvotes

Since almost all the sub's moderation goes through me I would need you to propose someone to become a moderator. Since the sub is very lax about the type of posts allowed, moderation usually consists of looking at whether there have been posts/comments deleted by the automatic moderator provided by Reddit and deciding whether they were deleted by mistake and need to be readmitted. And set the right post flair.

For current moderators: if you want to continue to have this role please reply to this message in the coming days.

Thank you.


r/android_devs • • Jun 16 '20

Help Nested ViewPager2

12 Upvotes

I have a view pager with 2 fragments, and the 1 fragment contained another view pager with 3 views and the swipe detections worked fine with the individual swipes on both the view pagers, but then I migrated those view pagers to viewpager2, so the parent viewpager2's adapter is a descendent of fragmentStateAdapter and the child viewpager2's adapter is a descendent of the plain old recycler view adapter, now my swipes have gone for a toss, the inner viewpager2 is not detected at all, only the outer one swipes.

EDIT: Found the solution, go through this https://issuetracker.google.com/issues/123006042

in short, wrap you nested view (recycler view or viewpager2) with this view as a workaround https://github.com/android/views-widgets-samples/blob/master/ViewPager2/app/src/main/java/androidx/viewpager2/integration/testapp/NestedScrollableHost.kt

can go through the sample for better understand.


r/android_devs • • Jun 10 '20

Store issue App rejected for Payments violation

12 Upvotes

Edit: The issue was that there was a donate button that takes the user to the Patreon page

My app was rejected from the play store for the following reason:

"Your recent app submission is not compliant with the Payments policy. Apps that employ in-store or in-app purchases must comply with the guidelines listed under our Payments policy. Please make appropriate changes to your app, then submit the updated app for another review. If you submitted an update, the previous version of your app is still available on Google Play. "

The issue is that I do not have any IAP, or Ads. I do have a WebView inside of one of the activities. And I show a custom Dialog when you open the app, with the option to hide it.

Can someone help me figure it out? How can I contact someone at Google?

Here's my gradle

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'com.google.android.material:material:1.2.0-alpha06'
implementation 'androidx.recyclerview:recyclerview:1.1.0'

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.paging:paging-runtime-ktx:2.1.2'

implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.google.firebase:firebase-analytics:17.4.2'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
implementation 'com.google.firebase:firebase-firestore:21.4.3'

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
implementation 'com.squareup.moshi:moshi-kotlin:1.9.2'
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.muddzdev:styleabletoast:2.2.3'
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.9.2'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'

testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

r/android_devs • • Jun 09 '20

Update Weekly topic

12 Upvotes

One of the ideas proposed in this post is to have a post about a topic that will be pinned for a week, commonly called "Weekly topic".

I would like to make it clear that this post is not a post to segregate "whatever I consider low level posts" to avoid the contamination of "whatever I consider intelligent posts". TIP: you can filter posts by flair and ask for help in the chat if you don't want to create a post.

This post serves to highlight a topic. Remaining at the top of the list for a few days will give everyone a chance to notice it and give more emphasis to its discussion.

The right time to create the post could be between Thursday evening (22:00) and Friday morning (11:00), GMT time. If it hasn't been created by whoever proposed it, it will be created and pinned by a moderator on Friday morning, who will also add a pinned comment in which we can decide the next weekly topic.

The first topic will be this one.


r/android_devs • • Jun 08 '20

How to filter sub posts using multiple flairs

12 Upvotes

Here is an example on how to see only posts with flairs containing the word "Coding", "Designing', 'Publishing', excluding those containing the word 'Fifty', sorted by new:

https://www.reddit.com/r/android_devs/search/?q=(flair%3A%27Coding%27%20OR%20flair%3A%27Designing%27%20OR%20flair%3A%27Publishing%27)%20AND%20(NOT%20flair%3A%27Fifty%27)&restrict_sr=1&sort=new

Basically, you can combine logical conditions using AND, OR and NOT.

In the following example the messages are filtered by flair "Help", containing the text "hilt":

https://www.reddit.com/r/android_devs/search/?q=hilt%20flair%3A%27Help%27&restrict_sr=1&sort=new

More about search functionality in Reddit: https://www.reddit.com/wiki/search


r/android_devs • • Jun 01 '20

Help BaseActivity vs. ActivityLifecycleCallbacks

12 Upvotes

Hi, devs!

So... I'm starting to make an architecture from scratch in order to learn how to do it (and having one done for personal projects). At my current job I started to understand how the arch is made, and my boss always explains to me the decissions he took to make it so.

But recently I read this article, so you can guess I never heard of ActivityLifecyclesCallbacks before (the same applies to fragments). I understand both of the approaches, but I want to ask you: what would you prefer, BaseActivity and BaseFragment of ActivityLifecycleCallbacks and FragmentLifecycleCallbacks?

I'd love to read some why, because, from my point of view, having a BaseActivity and then extending to another activity to add, for example, a menu drawer or fragments navigation, or whatever, seems to be a better approach, but again, I'm really new to this world and am trying to learn also from people with more experience.

Thank you all, cheers!


r/android_devs • • May 28 '20

Coding How to handle so many Factories?

12 Upvotes

Hi everyone,

I have been using Android X + Jetpack for quite some time and I have noticed that the number of "factories" is increasing constantly.

  • I have a custom `ViewModelProvider<out ViewModel>` which is backed by Dagger and does the work well. You can find my implementation here: ViewModelFactory.

  • I have a `CompositeFragmentFactory` where you can use a `FragmentKey` to inject a `Fragment` with a custom constructor. It is basically multi binding.

This was fine for me but now I decided to move away from a custom way to the "official-way" to handle process death: SavedState module for ViewModels. However, to inject a `SavedStateHandle` I basically need a new `Factory` of factories.

I didn't like most of the implementations over there. I wrote a prototype to play around to support this, you can check it here: SavedStateViewModelFactory. I'm not happy with it either.

But now I'm having a feeling that I have been forced to create more and more different factories abstractions and this has annoyed me a little.

To try to go out of this, I created a prototype of a "Coordinator" on top of Fragments which would coordinate the communication between Fragment and ViewModel and take care of initialization. You can check the draft code here: Coordinator.

My draft idea would look like this:

class ExampleCoordinator : Coordinator() {

    // Create your component.
    private val component = ExampleComponent.factory().create()

    override fun <T : Fragment> createFragment(
        fragmentClass: KClass<out T>
    ): Fragment? = when (fragmentClass) {
        ExampleFragment::class -> component.exampleFragment
        else -> null // null fall back to default implementation
    }

    override fun <T : ViewModel> createViewModel(
        key: String,
        modelClass: KClass<out T>,
        handle: SavedStateHandle
    ): ViewModel? = when (modelClass) {
        // SavedStateHandle is been "Assisted Injected"
        ExampleViewModel::class -> component.exampleViewModelFactory.create(handle)
        else -> null // null fall back to default implementation
    }

    override fun onViewCreated(
        fragment: Fragment,
        viewModelProvider: ViewModelProvider
    ) {
        // Setup your Fragment and ViewModel(s).
        if (fragment is ExampleFragment) {
            val viewModel = viewModelProvider.get<ExampleViewModel>()
            viewModel.state.observe(fragment.viewLifecycleOwner, fragment::onState)
            viewModel.event.observe(fragment.viewLifecycleOwner, fragment::onEvent)
            fragment.action.observe(fragment.viewLifecycleOwner, viewModel::onAction)
        }
    }
}

My initial goal was to use this "Coordinator" class to handle the creation of `ViewModel`, `Fragment` and `Component`, as well as coordinate the communication between `Fragment` and `ViewModel` setting binds between both of them. This way all the "wiring" code between these two classes would be isolated and the Fragments and ViewModels would be simple. Also, to test these classes you would just hit against the observable methods (onAction, onEvent, onState). Note this is just a draft.

But now looking back looks like I just reinvented the wheel and I'm not sure if it is worth it.

That's why I'm reaching you here: I would be glad to hear your feedback about my 'experiments' and I would be happy to hear about how you are handling all these factories / wiring.

Thank you in advance!


r/android_devs • • May 24 '20

Coding Refactoring my backup and restore feature to comply with Scoped Storage

Thumbnail
medium.com
12 Upvotes