|
What's the practical difference between Fragment onCreateView and onActivityCreated? I've seen some examples were initialization code is split between these two methods, but I'm having a hard time determining when something must wait for onActivityCreated verses when it won't make a difference either way.
|
# ? Jul 29, 2018 00:58 |
|
|
# ? May 23, 2024 17:03 |
|
Splinter posted:What's the practical difference between Fragment onCreateView and onActivityCreated? I've seen some examples were initialization code is split between these two methods, but I'm having a hard time determining when something must wait for onActivityCreated verses when it won't make a difference either way. A common pattern involves referencing the parent activity to get your data model (via injection), so while your views can be all set up and ready you can't do anything with them yet except set default values.
|
# ? Jul 29, 2018 05:12 |
|
I've been out of the Android game for a long time and I've been hoping to get back to it. Is there a good list of new stuff that was added in the last 2-3 years? I hear Kotlin is all the rage these days, for instance. Is there a good guide on how to switch to for a Java dev? Is switching even worth it?
|
# ? Aug 20, 2018 04:31 |
|
Ensign Expendable posted:I've been out of the Android game for a long time and I've been hoping to get back to it. Is there a good list of new stuff that was added in the last 2-3 years? I hear Kotlin is all the rage these days, for instance. Is there a good guide on how to switch to for a Java dev? Is switching even worth it? I've heard good things about the new Big Nerd Ranch Kotlin book, or Antonio Leiva's Kotlin guide. Thanks to the interop with Java, "switching" really just means "write Kotlin for new stuff, and convert Java to Kotlin at your leisure." It's definitely worth it, I find the language to be a joy to work with. Being able to lean more on the compiler has been awesome for reducing NPE-related crashes. Other things to check out if you've been out of the loop - architecture components (there's a lot of helpful stuff with respect to persistence and lifecycle management) - read up on the gradle plugin tooling because a lot's changed - background processing rules have changed in Android 8 and might bite you, so definitely get caught up on that kitten smoothie fucked around with this message at 18:26 on Aug 20, 2018 |
# ? Aug 20, 2018 05:12 |
|
The sunflower sample app is a good starting point for new apps I think, it has all the latest things being used as they're supposed to https://github.com/googlesamples/android-sunflower
|
# ? Aug 20, 2018 05:22 |
|
Thanks, I'll check it out. Hopefully I'll be ruining the Awful app in no time.
|
# ? Aug 20, 2018 14:43 |
|
kitten smoothie posted:- background processing rules have changed in Android 8 and might bite you, so definitely get caught up on that This one is enormous. Background services as they were are effectively gone. You can request to be scheduled at a certain time or with certain criteria (when the network returns etc) but the time at which you run may be drastically different from when you expect to run, and if the user doesn't interact with you that might eventually turn into "never". Tragedy of the commons and all that but it's disappointing.
|
# ? Aug 20, 2018 16:33 |
|
Then some third rate OEMs (Xiaomi, Huawei, Oppo) gently caress with their underlying JobScheduler implementations to further "optimize" battery by not letting anything run at all or randomly killing things.
|
# ? Aug 20, 2018 18:40 |
|
Ensign Expendable posted:Thanks, I'll check it out. Hopefully I'll be ruining the Awful app in no time. lol if you think we're using the new stuff speaking of, anyone used the new Navigation bits? I just wrote my own navigation system for the app that passes event types around, routes them up to the activity and converts to/from Intents, so it'll route where it needs to go and launch the relevant activity if necessary. I like the look of the Navigation library (especially the GUI for it and the backstack generation) but the boilerplate Java code:
quote:When you generate code using the safeargs plugin, simple object and builder classes are created for the action and sending and receiving destinations. These classes are: I might have tunnel vision from doing my own but this feels unwieldy compared to navigate(NavigationEvent(paramsForThisEventType)) and val event: NavigationEvent? = intent.parse(). I'm happy to rework it if it fits but it doesn't feel great
|
# ? Aug 20, 2018 18:50 |
|
Volmarias posted:A common pattern involves referencing the parent activity to get your data model (via injection), so while your views can be all set up and ready you can't do anything with them yet except set default values. Ahhhh, I think what I was missing was in some cases Activity.onCreate finishes before Fragment.onCreateView is called, but in many other cases that isn't guaranteed (at least according to this). Thanks! ~ I'm writing an app using LiveData and Room, and am wondering if anyone has thoughts on the best way to leverage DAO queries that return LiveData when working in a non-lifecycle or background thread situation. Specifically, I have a JobIntentService triggered by the AlarmManager that I use to periodically send notifications. Previously I had a hacky solution using observeForever() to get the LiveData, then immediately removing the observer: code:
|
# ? Aug 20, 2018 21:49 |
|
baka kaba posted:
You have an unnecessary assignation there, you can just Java code:
|
# ? Aug 21, 2018 09:46 |
|
i think u meanJava code:
That was their example code though, I guess they were trying to make it readable. Plus we skipped a bit, you need to pass in the amount with val action = SpecifyAmountFragmentDirections.confirmationAction(amount) and then assign it again with action.amount = amount for some reason? Maybe that's a mistake because the Java version doesn't pass it in when it gets the action
|
# ? Aug 21, 2018 17:58 |
Splinter posted:Ahhhh, I think what I was missing was in some cases Activity.onCreate finishes before Fragment.onCreateView is called, but in many other cases that isn't guaranteed (at least according to this). Thanks! I had the same issue with LiveData and built the exact same hacky immediately remove the observer thing as you, so I'd be interested in other approaches to this. What I ended up doing was moving back to Rx
|
|
# ? Sep 5, 2018 20:20 |
|
Hey guys, I have an old android app I wrote years ago for a client and I got an email saying: Update your Android targetSdkVersion by November 1st to 26 or something and mine was written for 15. But i wrote this in eclipse and I don't even think thats a supported IDE anymore, also I hate android development. How much of a pain in the rear end is the upgrade path going to be? Is this something I could easily outsource to Upwork or something?
|
# ? Sep 19, 2018 23:10 |
Most people I know personally in your position have just abandoned their old apps. Sometimes the swap to Android studio is painless and sometimes it's a sisyphean nightmare, it just depends on your specific project. Maybe just give it a try and timebox yourself to not get carried away with it.
|
|
# ? Sep 19, 2018 23:36 |
|
You don't need to bump the target SDK version until you submit an update. They haven't said they'll issue takedowns or policy strikes for failure to update the version, they're just blocking new APK uploads. Eclipse and the ADT have been unsupported since summer 2015, so I'm guessing it's been at least three years since you've last touched this. If you haven't touched it since then, are you ever going to? I'm betting strong no.
|
# ? Sep 20, 2018 01:07 |
|
Oh believe me I never want to touch it again, but a client paid me to write it and they don't want it to be taken down on November 1st. But.... if Google won't touch a running one then maybe I can get off scott free by never updating again!
|
# ? Sep 20, 2018 01:30 |
|
FateFree posted:Oh believe me I never want to touch it again, but a client paid me to write it and they don't want it to be taken down on November 1st. But.... if Google won't touch a running one then maybe I can get off scott free by never updating again! https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html quote:Existing apps that are not receiving updates are unaffected. There ya go, just carry on with your previous proven "never update" strategy and you're good to go. That said, while it won't get taken off the store, Android 9+ will probably present a warning though, as AFAIK it will start to inform the user "this is designed for an older version of Android" when installing apps that target 16 or lower. kitten smoothie fucked around with this message at 02:06 on Sep 20, 2018 |
# ? Sep 20, 2018 02:04 |
|
Yeah, you should mention to your client that they should eventually prepare to pay someone to handle an upgrade. The simpler the app and less custom the UI, the less work it's likely to be.
|
# ? Sep 21, 2018 00:26 |
|
Anyone have any experience using Unity for Android, or alternately, any kind of AR, with extensive camera use? I'm currently having major battery drain problems, which I think are largely due to the camera, but I haven't been able to nail it down. Android itself claims the app is using almost zero battery. Obviously, the screen being on contributes to this, but not nearly enough to cause the numbers I'm seeing. It's definitely not a graphically or CPU intensive app. I'm not super sure where to start looking. Not much has come up through search.
|
# ? Nov 18, 2018 03:22 |
|
I'm try to make popup calendars to select a day+month+year or to select a month+year or to select a year, so I looked at the Picker class, which then directed me to the DatePickerDialog. I want to make something like this: But I can't seem to force it to show me only months or years. I swear I've been able to do it before with other apps - or maybe it wasn't on Android? Am I crazy? (Yes) If I click part of the calendar that does popup, I can at least get it to show me some kind of year view. Maybe I should just go ahead and make my own version with a GridLayout. Shadow0 fucked around with this message at 10:46 on Jan 16, 2019 |
# ? Jan 16, 2019 10:42 |
|
Unfortunately, yes, you'll likely need to make it yourself. Try to use the Android styling values to have it match the device as much as possible here.
|
# ? Jan 16, 2019 15:15 |
|
Shadow0 posted:I'm try to make popup calendars to select a day+month+year or to select a month+year or to select a year, so I looked at the Picker class, which then directed me to the DatePickerDialog. are those the only date-picking classes in the whole android api? DatePickerDialog and DatePicker are from API level 1. i don't know much at all about this area of the API but there have definitely been some date/time pickers added over the years. for example, the clock-face time picker used in the AOSP Clock app was added (i think) sometime in the android 4.x-6.x range
|
# ? Jan 17, 2019 04:46 |
|
Lutha Mahtin posted:there have definitely been some date/time pickers added over the years. for example, the clock-face time picker used in the AOSP Clock app was added (i think) sometime in the android 4.x-6.x range There is also a TimePicker, but I believe what you're talking about have just been updates to the default DatePicker/TimePicker layouts/styles in newer API levels.
|
# ? Jan 17, 2019 05:11 |
|
Does that mean it is possible to provide what OP is asking for simply through layout/style?
|
# ? Jan 17, 2019 05:56 |
|
I'm pretty sure it goes beyond styling, the analog clock picker is fundamentally different from a spinner like it used to be and needs custom views for drawing / touching. It's possible that there's month/year only functionality lurking somewhere but I wouldn't bet on it
|
# ? Jan 17, 2019 08:04 |
|
Does anyone have a recommendation for a charting/graphing lib? I've been using MPAndroidChart for my demo but it isnt very good in that the way you plot stuff is wonky and the amount of looping i need to do to force it to pull data from firebase is insanity. I was looking at AnyChart but i get code:
|
# ? Jan 28, 2019 21:02 |
|
FAT32 SHAMER posted:I was looking at AnyChart but i get What's your compile/target SDK version? AnyChart is built against 28 so it shouldn't be referencing old stuff.
|
# ? Jan 30, 2019 04:18 |
|
kitten smoothie posted:What's your compile/target SDK version? AnyChart is built against 28 so it shouldn't be referencing old stuff. OH that might be the problem then, compileSdkVersion 27 buildToolsVersion '28.0.2' gently caress
|
# ? Jan 30, 2019 18:14 |
|
I wanna say there was a typo exactly like this in Android Studio’s starter template for build.gradle if I remember right.
|
# ? Jan 30, 2019 22:56 |
|
kitten smoothie posted:I wanna say there was a typo exactly like this in Android Studio’s starter template for build.gradle if I remember right. I upgraded my support stuff to api 28.0.0 and suddenly it couldnt find any of the views in my layouts and I couldnt use the constraint editor. Turns out its a Known Bug for API 28 and afaict they havent gotten around to fixing it yet. I guess i may very well be stuck with MPAndroidChart
|
# ? Jan 30, 2019 23:02 |
|
I want to try to get into android development, and I have an idea for a small project to start with - an app that maintains websocket connection to remote server in background and pops a notification when it gets a message from the server. But from what I'm gathering there are some hard limits on what you are allowed to run in background, so is that possible? And in what direction should I be digging / what keywords should I google to figure out how to make it work?
|
# ? Feb 5, 2019 16:22 |
|
Forgall posted:I want to try to get into android development, and I have an idea for a small project to start with - an app that maintains websocket connection to remote server in background and pops a notification when it gets a message from the server. But from what I'm gathering there are some hard limits on what you are allowed to run in background, so is that possible? And in what direction should I be digging / what keywords should I google to figure out how to make it work? https://firebase.google.com/docs/cloud-messaging/
|
# ? Feb 5, 2019 16:50 |
|
Tunga posted:Use Firebase Cloud Messaging to push the message from the server to the device. The device can then wake up and retrieve further data if it's needed.
|
# ? Feb 5, 2019 18:40 |
|
Forgall posted:I want to try to get into android development, and I have an idea for a small project to start with - an app that maintains websocket connection to remote server in background and pops a notification when it gets a message from the server. But from what I'm gathering there are some hard limits on what you are allowed to run in background, so is that possible? And in what direction should I be digging / what keywords should I google to figure out how to make it work? For reference, you CAN do this, but you have to run as a foreground service so that the user can see that YOU'RE the one loving up their battery life. But, push messaging is by far the right way to go here; the device will let you know when it's time to Do A Thing.
|
# ? Feb 5, 2019 19:46 |
|
Volmarias posted:For reference, you CAN do this, but you have to run as a foreground service so that the user can see that YOU'RE the one loving up their battery life.
|
# ? Feb 5, 2019 19:55 |
|
Forgall posted:I wanted to play around with aws lambda's new websocket capabilities, but it looks like I'll have to use google's equivalent cloud functions instead. https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream This may make whatever specific new thing you wanted to play with redundant though.
|
# ? Feb 8, 2019 00:13 |
|
I'm just junior QA, not a Dev, but I feel like requesting the "draw over other apps" permission to display a password incorrect notification is....... Bad.
|
# ? Mar 6, 2019 17:49 |
|
CaptainJuan posted:I'm just junior QA, not a Dev, but I feel like requesting the "draw over other apps" permission to display a password incorrect notification is....... Bad. Yes it probably is.
|
# ? Mar 6, 2019 20:54 |
|
|
# ? May 23, 2024 17:03 |
|
Other highlights include our entire scheduling system breaking down because our CTO's credit card was maxed out and our offshore devs outright refusing to follow the design scheme created by the recently-hired UX design team. I need a new jooooooob
|
# ? Mar 7, 2019 13:52 |