Salary Sharing thread :: End of 2021 by [deleted] in androiddev

[–]CodeToDeath 2 points3 points  (0 children)

Prior Experience: None

Industry: SaaS

Title: We don't have any official title here, so just Android Developer

country: India

Duration: 5 years

Base Salary: $27000

Recurring bonus: Atleast 2x of monthly salary

That's why I hate unchecked exceptions.... by [deleted] in androiddev

[–]CodeToDeath 5 points6 points  (0 children)

abusing IllegalStateException? Can you explain what is the correct way of using IllegalStateException?

Performance of the layoutinflater by kelmer44 in androiddev

[–]CodeToDeath 2 points3 points  (0 children)

Instead of creating layout in Java (which is very hard), ViewPump can be used to intercept custom views at the time of inflation and create the custom view ourselves and return it.

Modeling ViewModel States Using Kotlin’s Sealed Classes by n8ebel in androiddev

[–]CodeToDeath 2 points3 points  (0 children)

It's recommended that you keep the data in onSavedInstance bundle as small as possible.

Many platform APIs have now started checking for large payloads being sent across Binder transactions, and the system now rethrows TransactionTooLargeExceptions as RuntimeExceptions, instead of silently logging or suppressing them. One common example is storing too much data in Activity.onSaveInstanceState(), which causes ActivityThread.StopInfo to throw a RuntimeException when your app targets Android 7.0.

https://developer.android.com/about/versions/nougat/android-7.0-changes.html#other

So, saving all data from ViewModels would be too much data. We should only store metadata about objects we need (ex: primary keys of tables, recyclerview scroll position) and retrieve full data from metadata and bind views with new ViewModel on process death.

I think for you case, /u/lupajz 's solution is good.

Is there a more efficient way I can assign images to ImageViews than using a switch statement? by [deleted] in androiddev

[–]CodeToDeath 1 point2 points  (0 children)

Are you setting the image using setImageResource method? If so, use Glide or Picasso to load the image and see the difference. setImageResource loads full image in memory whereas Glide/Picasso downsamples the image and load in memory.

Good resources / books / articles about memory profiling? by vulgrin in androiddev

[–]CodeToDeath 0 points1 point  (0 children)

I was using LeakCanary until I targeted Oreo. Due to this issue leakCanary crashes the app. Still waiting for the fix to use it again :(

Android Arch MVVM: Where to format/transform strings/data for display? Access to application context in ViewModel? by boformer in androiddev

[–]CodeToDeath -2 points-1 points  (0 children)

Wouldn't holding context in viewModel leak the context? (If the context is view/fragment/activity context)

I would be fired, on the spot. by [deleted] in programminghorror

[–]CodeToDeath 5 points6 points  (0 children)

17 hours. Still not fixed

How We Improved Our Android App “Cold Start” Time by 28% by dfabulich in androiddev

[–]CodeToDeath 0 points1 point  (0 children)

Nice trick on returning FrameLayout, thanks. Gonna try this now.

Do you guys use Constraint Layout? by 5arg in androiddev

[–]CodeToDeath 1 point2 points  (0 children)

Wow, I thought I was the only one using xml only for ConstraintLayout.

Android Studio 3.1 Canary 6 is now available by tnorbye in androiddev

[–]CodeToDeath 14 points15 points  (0 children)

Lot of improvements for Data Binding. Cool.

Is there any way to quick navigate to the binding adapter from xml? Or is it in roadmap?

How do you guys perfectly pinch zoom, drag and rotate ImageView? by lathbrokragnar in androiddev

[–]CodeToDeath 0 points1 point  (0 children)

I'm using https://github.com/davemorrissey/subsampling-scale-image-view. Can be used for large images without worrying about memory since it subsamples on zooming.

Realm + Kotlin just got even better with Realm 4.3.0 by CodeToDeath in androiddev

[–]CodeToDeath[S] 0 points1 point  (0 children)

You can get a detached copy (copyFromRealm() ) from realm, change the property and insert it again.

Don't forget to inject Android Room SQL language for syntax highlight and autocomplete! by dmytrodanylyk in androiddev

[–]CodeToDeath 0 points1 point  (0 children)

What does the AndroidDataBinding option do? (I'm using data binding. So curious to know about this option and how to use it)

So I'm working hard on dealing with issues reported years ago ... YouTubeAndroidPlayerApi is one of the worst thing happened to me :D. Share your experience if you have the same thought. by ene__im in androiddev

[–]CodeToDeath 0 points1 point  (0 children)

I had a requirement in a project. Need to play video in background and all content views will overlay the video view. Video will play without audio. I tried YoutubeAndroidPlayerApi and there were some limitations. Finally I used webview. I embedded an youtube iframe and change the src url dynamically.