|
brand engager posted:We have a multi-process app, and recently we found out that a bunch of classes that implement Parcelable were being stored to the filesystem and in a database in the marshalled form. Don't do this, it really sucks to fix ... Parcelable's documentation is pretty explicit that this is a bad idea and that you should never do this. I'm impressed that someone did it anyway. You'd think whoever had this idea would have at least gone with serializable...
|
# ? Jul 21, 2021 08:10 |
|
|
# ? May 10, 2024 19:20 |
|
Volmarias posted:... Parcelable's documentation is pretty explicit that this is a bad idea and that you should never do this. I'm impressed that someone did it anyway. You'd think whoever had this idea would have at least gone with serializable... real coding heroes figure everything out by stackoverflow questions and scrolling through function lists on objects that sound like they may do what they want
|
# ? Jul 21, 2021 14:09 |
|
Does DataStore<Preferences> not work across processes? Getting the feeling that google really wants people to stop using multiple processes for a single app
|
# ? Sep 30, 2021 21:46 |
|
brand engager posted:Does DataStore<Preferences> not work across processes? Getting the feeling that google really wants people to stop using multiple processes for a single app wasn't the point of DataStore to be asynchronous vs doing it directly on the UI thread? according to the docs (https://developer.android.com/topic...cB&gclsrc=aw.ds) you can run it synchronously and either scope the coroutine as blocking or scope it to the lifecycle of your current view. If you wanted to you could probably do withContext(Dispatchers.IO) { ... } inside of your launch lambda
|
# ? Sep 30, 2021 22:21 |
|
brand engager posted:Does DataStore<Preferences> not work across processes? Getting the feeling that google really wants people to stop using multiple processes for a single app I know it's not an answer, but I'm genuinely curious what your reason is for multiple processes in your application.
|
# ? Oct 1, 2021 01:22 |
|
Volmarias posted:I know it's not an answer, but I'm genuinely curious what your reason is for multiple processes in your application. We have one of those apps that runs other apps in a container. Other apps get spawned as separate processes. But in this case I was trying to use datastore from the normal app process and a second process we have a bunch of our backend code running in. E: anyways I ended up putting the datastore access in a content provider and writing the boilierplate stuff to do contentresolver calls interacting with it
|
# ? Oct 1, 2021 01:35 |
|
That sounds horrifying to maintain lol
|
# ? Oct 1, 2021 02:32 |
|
Cool if you try to dismiss a DialogFragment from an activity's onStop the dialog throws a runtime exception. loving clown OS
|
# ? Oct 1, 2021 22:04 |
|
brand engager posted:Cool if you try to dismiss a DialogFragment from an activity's onStop the dialog throws a runtime exception. loving clown OS dismissAllowingStateLoss Clown developer, not reading docs, smh And, as the first stack overflow post notes, if you need to cancel after onStop, you might want a plain old dialog instead.
|
# ? Oct 2, 2021 22:21 |
|
Hello Goons - I wrote out an idea for a turn-based boardgame-style game and was interested in converting it into an App for a small audience. While I have done lots of scripting, particularly in Python with a bit in C++, I've never really touched graphics before. Are there any easy game-making templates to have pre-made graphical pieces assigned to various spaces on the board that I could script or would most any app have to take a lot of graphics and background coding from scratch?
|
# ? Oct 9, 2021 18:45 |
|
Your best bet is probably unity, which uses C# There’s probably other frameworks but Unity is the most common one I see
|
# ? Oct 9, 2021 18:54 |
|
Unity also gives the benefit of allowing you to build for iOS as well. It depends on the type of game too, it may be simpler to throw together a UI from basic components than to learn Unity, but that's unlikely.
|
# ? Oct 9, 2021 20:26 |
|
does anyone remember how to make a material slider have discrete values but not multiple thumb thingos? i started out with Slider, but all you could do is set valueFrom and valueTo, while RangeSlider allows you to set a list of possible values such as listOf(1f, 2f, 5f, 10f, 25f), but then you have a thumb controller for each point, and i just want/need one
|
# ? Dec 2, 2021 19:11 |
|
FAT32 SHAMER posted:does anyone remember how to make a material slider have discrete values but not multiple thumb thingos? i started out with Slider, but all you could do is set valueFrom and valueTo, while RangeSlider allows you to set a list of possible values such as listOf(1f, 2f, 5f, 10f, 25f), but then you have a thumb controller for each point, and i just want/need one I'm not sure what you mean by multiple thumb controllers? Stopping at certain points? It sounds like you want a continuous slider with an interpolator for what to map that value to.
|
# ? Dec 3, 2021 02:47 |
|
I'm trying to setup Crashlytics for Android NDK such that in my Crashlytics console, I receive a stack trace, instead what I have now...code:
code:
code:
code:
code:
I would appreciate any guidance.
|
# ? Dec 3, 2021 05:24 |
|
Anne Bonny posted:According to https://firebase.google.com/docs/crashlytics/ndk-reports I need to "explicitly invoke the uploadCrashlyticsSymbolFileBUILD_VARIANT task after each build of your NDK library." for method names to appear in my stack traces.... there's gradlew and gradlew.bat in the project directory (same as the toplevel build.gradle) you don't have any variants so you'd be running from the commandline: gradlew assembleRelease uploadCrashlyticsSymbolFileRelease or Debug instead of Release for debug build
|
# ? Dec 3, 2021 11:33 |
|
Volmarias posted:I'm not sure what you mean by multiple thumb controllers? Stopping at certain points? It sounds like you want a continuous slider with an interpolator for what to map that value to. yes, exactly that the range slider has like n number of thumb slider thingos that lets you set a range (as the name should have implied to me!!), but i havent found anything that suggests how to do what you just described
|
# ? Dec 4, 2021 09:45 |
|
Use a Slider with a step size of 1, and give it a LabelFormatter to map that to your custom values for display. This has the extra upside of making your tick marks evenly spaced out so it's easy to hit them, instead of being all bunched together at one end and really far apart at the other.
|
# ? Dec 4, 2021 14:03 |
|
Just getting back into Android Dev things and Compose is pretty neat. Any overall opinions or trip reports about using Composables? Any warnings or advice I should keep in mind while migrating view based uis to the new way? I'm looking for general sentiments if anyone cares to share their experiences here.
|
# ? Dec 15, 2021 07:39 |
|
Based on what I’ve read, Compose is a great opportunity to begin migrating away from fragments, so brace urself for that
|
# ? Dec 15, 2021 08:04 |
|
I've used compose a bit, and think it's pretty neat. However, I haven't had much call to use it since there haven't been any particularly new UI flows to work on, so my experience is limited. I do recommend using it though, unless you have a reason not to.
|
# ? Dec 16, 2021 05:10 |
|
Anne Bonny posted:I'm trying to setup Crashlytics for Android NDK such that in my Crashlytics console, I receive a stack trace, instead what I have now... Vesi posted:there's gradlew and gradlew.bat in the project directory (same as the toplevel build.gradle) I finally got around to testing this. On a native crash, in Crashlytics, instead of: code:
code:
What's the error? This crash is caused by an OpenCV function within a Native function. Also, is it possible to surround certain sections of my native code with a try catch and the say something like Crashlytics::log()?
|
# ? Dec 16, 2021 20:12 |
|
Here's another question: I'm trying to rotate a RelativeLayout, such that it looks exactly like it would when the device orientation is changed. Essentially, I want to rotate my RelativeLayout, such that after a call to rotate(), it retains its original boundaries. It's very similar to this question... https://stackoverflow.com/questions/21355784/android-rotate-whole-layout But the accepted solutions do not work, because my RelativeLayout is not the root layout. If I attempt to rotate, translate, and scale to the RelativeLayout's previous boundaries, it sometimes works but often times refuses to scale down beyond a certain amount. How can I make this work? Seems like a very straightforward kind of thing, but I haven't been able to hack it.
|
# ? Dec 16, 2021 20:25 |
is it one layout inside more of them that aren't rotated? i tried to do something similar for a fullscreen video player and i ended up just programmatically swapping to landscape and portrait mode
|
|
# ? Dec 17, 2021 01:37 |
|
If I was doing this, I would just write a "wrapper" viewgroup that handles the rotation. Just have it measure and lay out its one child according to the specific rotation you want it to have.
|
# ? Dec 17, 2021 01:45 |
|
Anne Bonny posted:Also, is it possible to surround certain sections of my native code with a try catch and the say something like Crashlytics::log()? Not within the Java end of things at least, who knows what C allows you to do. At this point it's the runtime sending a message that the JVM (or whatever it's called now, ART?) is unable to continue correctly and deliberately aborting. You might have more help looking here: https://source.android.com/devices/tech/debug/native-crash but I think the real answer is "you need to be able to transform the release binary info into something you can use, when you made your build hopefully the symbol list library that you stripped was saved somewhere" but it's been a very long time since I had to think about this
|
# ? Dec 18, 2021 02:28 |
My phone updated to android api 31 and now the widget i've been working on doesn't seem to respect visibility changes in the remoteviews. It still works on older devices . Anyone else notice this? theres not much online I've found.
PokeJoe fucked around with this message at 13:11 on Jan 7, 2022 |
|
# ? Jan 7, 2022 13:04 |
|
When I load images into my grid-based RecyclerView, such that there are more images that can fit on the screen at one time, the RecyclerView scrolls to show the image it is loading. If I remove any of the following things, this error does not occur...
Thanks.
|
# ? Feb 17, 2022 10:09 |
What do you mean scrolls, does it center over the view? Are you using a snap helper?
|
|
# ? Feb 17, 2022 10:55 |
|
It could be a bunch of things. Have you got a git repo to look at? As a general point Ive been loving Compose after years of recyclerview bullshit. I appreciate it’s probably not practical to switch for whatever you’re working on now, but seriously consider it for future stuff.
|
# ? Feb 17, 2022 11:29 |
|
https://github.com/kraftski/RecyclerViewError Here we go. I made a small project that demonstrates the error. There are some screenshots in the readme. You press the center button to load some images from your device and the program loads the images into two recyclerviews, the one on the left which loads properly, and the one on the right which scrolls up as new images are loaded into it. You'll see that I've made it so that the later images are in the dataset, the more of a green tint they have to them. You can see what I mean in the error screenshot, which also demonstrates the error kind of. It's not that the recyclerview on the right simply scrolls a little bit once after you load your images, it continually scrolls at any time images are loaded. Very frustrating and confusing. The files which are of interest here are: MainActivity.java, activity_main.xml, ImageAdapter.java.
|
# ? Feb 20, 2022 12:03 |
|
Anne Bonny posted:https://github.com/kraftski/RecyclerViewError Got it to work by replacing the right hand RelativeLayout with a ConstraintLayout, like this: code:
ConstraintLayouts are generally better then RelativeLayouts though, they are more powerful and you don't need to nest views so much, which is bad for performance.
|
# ? Feb 21, 2022 22:19 |
|
Thank you! This solves my problem. However, now the end of the RecyclerView spills offscreen (The last row (or more?) of images is chopped in half). This should be prevented by the constraints but it isn't. I haven't been able to find a good solution to this, as I need by RecyclerView to only wrap it's contents, not fill the screen no matter what (say, if there was only one image loaded). Any ideas?
|
# ? Feb 23, 2022 09:21 |
|
Anne Bonny posted:Thank you! This solves my problem. However, now the end of the RecyclerView spills offscreen (The last row (or more?) of images is chopped in half). I get this problem all the time, and usually what I have to do is give it a moderately sized marginBottom with a constraint to parent bottom
|
# ? Feb 23, 2022 12:14 |
|
Unfortunately, this doesn't seem to work. Neither does any other solution I tried. It appears that when the RecyclerView is rendered, it for whatever reason calculates it's height without considering either the bottom margins or the bottom constraints I put on it, thus making it bigger than needed, and THEN shifts it up. I'm not really sure how to work around this. I also don't understand what's wrong with my problem solving approach because this seems like a very simple thing I'm trying to do and Android is determined to make it impossible.
|
# ? Feb 26, 2022 11:24 |
|
Java and RecyclerView are old hat in the Android world now. I don't know what time/cost constraints you are operating under, but long term, adopting kotlin and compose will make your Android dev experience a lot more enjoyable.
|
# ? Feb 26, 2022 15:11 |
|
we're eventually going to switch to compose, but we're not too keen on the conversion process being convert xml -> compose with fragment, get all screens converted, then eventually convert all fragments to one activity that hosts all composables. and the refactor time on simply converting xml -> composables w/ single activity composable host is too big to justify rn and based on what i've read, doesnt play very nicely with having the activty manage both composables and fragments, and it breaks the poo poo out of everything if you use jetpack navigation
|
# ? Feb 26, 2022 22:24 |
|
FAT32 SHAMER posted:we're eventually going to switch to compose, but we're not too keen on the conversion process being convert xml -> compose with fragment, get all screens converted, then eventually convert all fragments to one activity that hosts all composables. and the refactor time on simply converting xml -> composables w/ single activity composable host is too big to justify rn and based on what i've read, doesnt play very nicely with having the activty manage both composables and fragments, and it breaks the poo poo out of everything if you use jetpack navigation Definitely a concern I've had with this, I really do wish there was a nicer way to handle fragments but I guess there's only so much that can be done.
|
# ? Feb 26, 2022 22:29 |
|
compose navigation on the surface looks super promising since it's just a map of composables for the activity to begin displaying, and it would make sense that it would be more stable, especially for deeplinking, than the current xml jetpack navigation that does blackbox bullshit with fragment transactions that being said though, im not at all a fan of what as far as i understand is the use of URIs to handle deeplinking versus just keys, and i think the only really proper way to force developers off of xml would be to have an API update that deprecates Fragment and forces devs to compose, but i also would be willing to be that this wont happen at any point in the future due to the level of effort currently required. If they were to come up with a migration tool to convert layout files to composables, it would help, and if i understand the foldable api correctly, theyve made it a shitshow to do using xml. Speaking of the foldable lib, how hard is Android going into that? i think i saw docs saying that supporting foldables will be mandatory for all new apps, but it strikes me as yet another feature that nobody actually wants and not many people will have. Has anyone dug into that much?
|
# ? Feb 26, 2022 22:41 |
|
|
# ? May 10, 2024 19:20 |
|
FAT32 SHAMER posted:i think the only really proper way to force developers off of xml would be to have an API update that deprecates Fragment and forces devs to compose, but i also would be willing to be that this wont happen at any point in the future due to the level of effort currently required. The change from MVC to MVI is a pretty rough one to try to shoehorn in, and I get the feeling that any generated results would be hideous at best.
|
# ? Feb 26, 2022 22:47 |