Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
PokeJoe
Aug 24, 2004

hail cgatan


Yeah this thread made me read up a bit on Chinese app stores and lol

Adbot
ADBOT LOVES YOU

PokeJoe
Aug 24, 2004

hail cgatan


I like the new recommended architecture things even though I probably won't be using them anytime soon.

PokeJoe
Aug 24, 2004

hail cgatan


I'm working through some of the Architecture components stuff and it's pretty good. LiveData is essentially lifecycle aware Rx and it couples nicely with Room.

PokeJoe
Aug 24, 2004

hail cgatan


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'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:
LiveData<List<Task>> observableTasks = ((MyApp) getApplication())
        .getRepository()
        .loadOutstandingTasksWithNotifications();

Observer<List<Task>> observer = new Observer<List<Task>>() {
    @Override
    public void onChanged(@Nullable List<Task> tasks) {
        if (tasks != null && !tasks.isEmpty()) {
            // do stuff with tasks
        }
        observableTasks.removeObserver(this);
    }
};

observableTasks.observeForever(observer);
However, calling observeForever() on a background thread is no longer allowed (believe this is part of version 2 of the lifecycle extensions). An easy solution is to add another DAO method using the same query that returns a List instead of LiveData, but it seems smelly to me to have to duplicate any queries that need to be run in both lifecycle and background situations. One idea I had is to have separate repository subclasses for LiveData and non-LiveData (to avoid having to have all method names clarify whether or not LiveData is returned), but I'm not in love with that approach. Anyone have any thoughts on how to approach this, and/or is there a standard or straightforward way to handle this that I'm missing?

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 :shrug:

PokeJoe
Aug 24, 2004

hail cgatan


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.

PokeJoe
Aug 24, 2004

hail cgatan


Not too familiar with jackson's specifics but it sounds like you might be able to write a type converter that will place the object in a list of 1 or something like that. That's what I would do with logansquare or moshi

PokeJoe
Aug 24, 2004

hail cgatan


Yeah you're passing
code:

this
to the mapview, which may be leaking that context. Try forwarding the life cycle methods to the view so it can clean itself up.

PokeJoe
Aug 24, 2004

hail cgatan


Write kotlin if it's a new app imo

PokeJoe
Aug 24, 2004

hail cgatan


same and the kotlin classes are shorter and easier to debug

PokeJoe
Aug 24, 2004

hail cgatan


melon cat posted:

Android dev job question. I'm a video production guy with some coding aptitude (I've done VBA programming and website development). I came across this local job posting for an Android Multimedia Developer. I'm really intrigued by it and didn't even know that this type of field exists in Android Development. But I'm also brand new to Android development. What would be the best way for me to start training up for this kind of career? Just go through the 'Learning Android' recommendations in the OP while exploring the Android Multimedia Framework?

It sounds really interesting and also sounds as if it'd combine my video production expertise with my (admittedly light) coding capabilities and interest in cars. Just not sure where the best place to start is, especially given that I don't have a Comp Sci background/degree.

I believe FAT32 SHAMER (few posts up) actually works in this exact specialty but id imagine it's relatively similar to routine android dev if you're working on the car's entertainment system.

PokeJoe
Aug 24, 2004

hail cgatan


Yeah you can email the APK to them and they can install it directly from their email client on their phone. Very useful

PokeJoe
Aug 24, 2004

hail cgatan


yes it does. are you sure the code you're break pointing is actually running?

PokeJoe
Aug 24, 2004

hail cgatan


Vesi posted:

I don't know if this is related but I use Code->Reformat Code a lot and I noticed it was rearranging tags making it useless for linearlayout

I fixed it by setting Settings->Editor->Code Style->XML->Set from...->Predefined Style->Android

Yeah same, I had to do this too. Very annoying

PokeJoe
Aug 24, 2004

hail cgatan


I'll take a look if you post it here. Is it on Google play?

PokeJoe
Aug 24, 2004

hail cgatan


Anne Bonny posted:

It's a camera application. Thanks!

edit: Apparently my initial release was compatible with 0 devices. I've just submitted a new version which should show up soon.

Cool camera effects. The UI isn't very intuitive and the guide could be more helpful but if it's just for you to use that stuff isn't so important.

Somebody fucked around with this message at 00:19 on Nov 9, 2019

PokeJoe
Aug 24, 2004

hail cgatan


Most of the native devs I know hate react. my last job tried to build an app with it and it took the team twice as long to make a shittier app with fewer features than it's native equivalent

E: the team is approaching 3 years of dev to replace a native app that was built in 10 months lol

PokeJoe fucked around with this message at 18:20 on Oct 8, 2020

PokeJoe
Aug 24, 2004

hail cgatan


Is there a simple way to set up a standalone emulator? My goal is to get someone non technical an emulator they can install apks on via click and drag. Im trying to figure out the command line tools but they require essentially the same android sdk and java home setup as Android studio, which I'm trying to avoid. I also don't want to use some 3rd party thing full of ads. Any suggestions?

PokeJoe
Aug 24, 2004

hail cgatan


Hmm I'll see if I can get it working that way, thanks. I want to get it going for mac + pc so I would be interested in your bat file.

PokeJoe
Aug 24, 2004

hail cgatan


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

PokeJoe
Aug 24, 2004

hail cgatan


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

PokeJoe
Aug 24, 2004

hail cgatan


What do you mean scrolls, does it center over the view? Are you using a snap helper?

Adbot
ADBOT LOVES YOU

PokeJoe
Aug 24, 2004

hail cgatan


Welcome to the wonderful world of the google play store lol. It's been like that for years

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply