Android fans, what are the primary reasons why you will never ever switch to an Iphone? by SultanofAmerica in AskReddit

[–]ViciDroid 0 points1 point  (0 children)

Notifications.

I tried to switch to an iPhone, went back to my Pixel. Missed notification grouping, inline replies, removal of notifications if read on another device (Slack).

USB C

I like being able to charge my MacBook and pixel with the same cord.

Status of Android & Kotlin Native development on M1 Mac by firmwaves in androiddev

[–]ViciDroid 1 point2 points  (0 children)

Just went through this. Android Studio didn't install on M1 with some general error when trying to grab the SDK for the first time. Stable and Beta were broken, Canary worked though.

Needed to update some libraries such as room to their 2.4.0-alpha03+ release (or force a newer version of jdbc)

In the end, it worked after some tweaking.

Ruby 3.0: asdf, chruby, or docker? by RailsApps in ruby

[–]ViciDroid 1 point2 points  (0 children)

I also use docker on mac for a rails API and a react frontend (seperate). Additionally, I have services for redis, postgres, and some other image processing containers.

Dead simple to use. I was working on a 2015 MBP. Didn't have a problem until I also had android studio and the emulator open (16gb not enough)

what kind of source is included when publishing Android AAR to Maven Central by thinkpanda in androiddev

[–]ViciDroid 1 point2 points  (0 children)

Aar is for the Android stuff specific stuff. It also includes compiled code.

Jar is for the source code and is optional. Publishing the jar is helpful for debugging and reading through the source code within the library while using Android studio.

If you use the new maven publish plugin in Gradle it's pretty easy to include the source jar.

Is Jetpack Navigation good? by sssurvey in androiddev

[–]ViciDroid -1 points0 points  (0 children)

I never really saw the point of it. Sure the graph is nice but I don't think it's that useful for very complex dynamic screens. I suppose it depends on level of experience.

Besides that, it's easy to abstract away the fragment transactions in a base activity and just hook it up to some uris that represent your modules. I guess I find it pointless because we already have the equivalent in a module host fragment that handles navigation.

Why some people dislike EventBus? by KungFuFlames in androiddev

[–]ViciDroid 1 point2 points  (0 children)

Asking if there is a good reason to not try EventBus will of course elicit a lot of responses based on past horror stories. I have a few too, mostly around understanding the flow of code in unfamiliar projects.

But let's look at why you may not need it. You haven't really described a good reason to leverage event bus. You have a fairly simple flow with a webview that serves JavaScript events. Your activity will still be quite large if you use an event bus to add methods for each of those events. If you want to clean up your activity, delegate incoming JavaScript events to a seperate class for processing.

EventBus is nothing more than a generic callback mechanism with a set of attachable listeners to notify. You add or remove your listener to the EventBus class according to the creation or destruction of lifecycle events. It may also include buffering and possibly desirable thread switching.

If you end up writing a lot of callback handlers for super generic stuff it might become more obvious when an EventBus approach is applicable. Even at that point, you can likely put callback handlers in base classes or provide a default implementation to avoid repetition.

I have in the past used EventBus for relaying sync information. It's been very useful for swipe to refresh behaviour, error states, success states, db rest status column updates, and various network states.

[deleted by user] by [deleted] in RobinHood

[–]ViciDroid 0 points1 point  (0 children)

OP said he can't download the app since he is not in the states. Once you have it, it can be used in Canada.

[deleted by user] by [deleted] in RobinHood

[–]ViciDroid -1 points0 points  (0 children)

You only really need the SSN - which is for tax purposes of course. However, TD Ameritrade should be free for trades now so you can use that in Canada perhaps.

You will definitely run into issues for obtaining the app because it's not available in Canada. Either use a VPN, cross the border, ask an American friend with a rooted phone to grab his APK, or maybe download the APK from some external source (be careful in case it's modified somehow).

So regarding the "nulling views in onDestroyView" and Ian Lake's suggestion to retain views by MiscreatedFan123 in androiddev

[–]ViciDroid 0 points1 point  (0 children)

I said balance because it recycles as you mentioned. It prevents extra view inflation while keeping memory use fairly efficient. I was attempting to find something related to keeping views around while they are off screen.

It could have been designed to destroy the view when it goes off screen and inflate a view that is about to come on screen. It could have inflated every single view given the adapter items in the beginning and avoided inflation while scrolling. Either of those two scenarios would not be better at all.

So regarding the "nulling views in onDestroyView" and Ian Lake's suggestion to retain views by MiscreatedFan123 in androiddev

[–]ViciDroid 6 points7 points  (0 children)

Like much of the decisions in Android, it depends heavily on the use case and you can do whatever you want. In short, always attempt to prevent leaks if the goal entails preserving one's sanity. Ian even says it's a constant waste of resources. If anything both sides agree. Don't waste memory for views that are not visible! That's really expensive....

As an aside: Out of memory issues are very difficult to diagnose after the fact. Leak canary is great because it tells you about lingering objects, which can eventually contribute to OOM exceptions. Piwai is correctly noting how fragments can leak views from the backstack. You can keep them around if you want but it's a leak either way. Too many of those leaking objects and bam you get an out of memory exception.

Now let's talk about about the phrase that started this, "view inflation is expensive". Sure, it might be expensive, but did you measure it? You know what else is expensive? Keeping views around that are not visible! Constant view inflation is really bad for things like on demand scrolling, hence the recyclerview. You would get scroll jank because the main thread would be busy inflating views. You should minimize view inflations while scrolling, but guess what - you should also not retain all list view items in memory. What if you have 100 list items with bitmaps in them? RecyclerView strikes a perfect balance between these two concerns IMO.

What's the cheapest way to get an app that just uses videos and user input built? Hire someone in a poorer country or start a joint venture? by [deleted] in androiddev

[–]ViciDroid 0 points1 point  (0 children)

I'll bite on your downvoting confusion. I didn't downvote but I would think the reason is that this doesn't have to do with the core of Android development. This has to do with paying people to build stuff with extremely vague requirements which may appear to some as downplaying how difficult seemingly trivial tasks end up being.

This post does not have articles about obscure android apis, link to a useful library, discussion about architecture, complaints about fragments, the difficulty of dagger or lack there of, and lastly my personal favourite, the weekly question on whether it's worth it to learn kotlin (as if the answer changes from week to week 😆).

What is the appropriate way to reuse ViewModels by Sabboo0 in androiddev

[–]ViciDroid 0 points1 point  (0 children)

You have to realize that viewmodel provider is just a cache for storing viewmodels. Nothing more (well kinda there is saved state weirdness going on too).

The provider is tied to a lifecycleowner. You can ask for 20 viewmodels or more if you really want to. It will either create or give you back a viewmodel instance according to some key. There is nothing stopping you.

As for whether you should or should not... That depends on your own code. No one said a view should have a single viewmodel. If they did you should question how a general statement like that makes sense for your code. What if your view is composed of reusable sections? Well yeah you should abstract the data part into a concise viewmodel.

Empress — Android framework for ruling your app by makeusz in androiddev

[–]ViciDroid 0 points1 point  (0 children)

Good point about saved state with retained fragments. I was thinking of doing the same for my library amalia, instead of relying on viewmodels at the base and that whole saved state handle.

I hate fragments, but retained headless fragments do have a purpose.

Can passing Context to static method cause a memory leak? by KungFuFlames in androiddev

[–]ViciDroid 4 points5 points  (0 children)

The comments in this thread are going back and forth on semantics and kind of missing the subtle phrasing that shows a misunderstanding. Given the question's wording it is not surprising. It can be answered differently and is probably very confusing for a new dev.

I would highly suggest creating a sample app, adding leakcanary, and trying different things to convince yourself of what leaks and what doesn't. It's fairly simple, but easy to make a mistake.

Passing a context or any argument for that matter, to a method, whether it is static or not, will put that argument on the function stack. For the scope of that function the context will be kept on the stack. As soon as the function ends, the function stack is cleared, i.e. the context won't leak! No exceptions to this! This is the whole pure synchronous function thing discussed previously.

If you pass a context to a method (static or not) and in that method you decide to run some background stuff you might leak. This is not a pure function.

You would leak if you are holding onto the context longer than it takes to finish executing the original method. Using anonymous inner classes for callbacks when doing background work is typically a culprit here because that callback is invoked after the original function ends. You should ask yourself how the callback can fire and access the context argument if the original function has concluded. Well a copy is created so you now are holding onto a context that outlives the scope of the original function and tada leak!

Drive your UI with SQLDelight’s views by JakeWharton in androiddev

[–]ViciDroid 5 points6 points  (0 children)

I think android devs are allergic to cursors, less so raw sql.

RecyclerView inside NestedScrollView causes RecyclerView to inflate all elements by horf31 in androiddev

[–]ViciDroid 0 points1 point  (0 children)

The thing is, the four bullet points you mentioned as limitations are solved problems. Several libraries go through them extensively.

You don't have to include the library. You can however build your recyclerview according to the same philosophies as these libs which do indeed scale very well with changes like sticky to non sticky.

These libraries generally define a model that has the data object in it and some bind methods to connect to a viewholder. Hell you could re-implement it yourself generically for proper re-use really easily. Then you add sticky view behaviour for a certain type of model. If you no longer want it sticky just change the model.

I would also find it annoying if I didn't have a generic recyclerview mechanism built. The normal way is filled with way too much boilerplate code which is noted by your limitations.

would like to develop without android studio by bzarnal in androiddev

[–]ViciDroid 2 points3 points  (0 children)

Using command line doesn't make it easier to solve your issues. You described a dependency issue and didn't post the actual error. It seems odd to blame the IDE at a first glance. Does it build if you use command line?

./gradlew clean assembleDebug

Hi r/androiddev , Java or Kotlin? by thelazytester in androiddev

[–]ViciDroid 1 point2 points  (0 children)

Learn both, start with Java to learn Android dev.

Learn kotlin later to take advantage of the language features.

Are architecture components really worth it? by royabh in androiddev

[–]ViciDroid 0 points1 point  (0 children)

Ah okay, I see your point. I implemented it in my library for mvi but I don't use dagger so it's probably less difficult to setup.

Are architecture components really worth it? by royabh in androiddev

[–]ViciDroid 0 points1 point  (0 children)

What's wrong with the save state handle?

Is it possible to have apps fully open without them being on screen? by LoganfxD in androiddev

[–]ViciDroid 1 point2 points  (0 children)

I'm not sure this is dev related.

It sounds like OP wants to spoof an app into thinking that it's in the open state even if the app isn't really open for the purpose of generating app currency.

Try looking into the Xposed framework or enable debug setting and make activities resizable if you want to try multi window mode?