mez,
@mez@androiddev.social avatar

Curious to know how other (or ) libraries handle Android process death. Or do they?

I have an SDK that requires a suspended initialisation before being allowed to access other functions for that library. This is because a data set needs to be loaded. On process death the usual initialisation seems to be skipped causing users of my SDK issues.

I'm convinced this isn't something the SDK should be aware of but want to cover all bases thoroughly.

gryzor,
@gryzor@androiddev.social avatar

@mez do you care to know if it was fully initialized before the user can call your public API? Does the library work or tries to initialize again automatically when used? I'd say the library doesn't care about the outside world, but should keep track of its internal state and whether it's correct or not.

mez,
@mez@androiddev.social avatar

@gryzor The initialisation is a suspend function (loads resources into memory) but the rest of the SDK operations are regular blocking. Users can query the initialisation state and so can the SDK internally, but the SDK initialising itself would require suspend functions on all operations. The SDK will "work" but it will return some default value if not initialised.

I don't necessarily mind if that's the correct answer but I wanted to hear different opinions on this.

Thank you 🙏

gryzor,
@gryzor@androiddev.social avatar

@mez I don't think there's a right or wrong answer here, it really depends on your use-cases and the expectations. I'd absolutely make sure that your SDK cannot become "corrupted" in any way, which you seem to have covered well. Good luck! :)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • android
  • ngwrru68w68
  • rosin
  • modclub
  • Youngstown
  • khanakhh
  • Durango
  • slotface
  • mdbf
  • cubers
  • GTA5RPClips
  • kavyap
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • JUstTest
  • osvaldo12
  • tester
  • tacticalgear
  • ethstaker
  • Leos
  • thenastyranch
  • everett
  • normalnudes
  • anitta
  • provamag3
  • cisconetworking
  • megavids
  • lostlight
  • All magazines