by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jonathan Dick
    @Redth
    I mean if it’s async operations all the way down it shouldn’t block
    Mandrakia
    @Mandrakia
    alright perfect then :)
    Jonathan Dick
    @Redth
    Rather it shouldn’t hang the ui thread
    Mandrakia
    @Mandrakia
    I'm tracking down anr's
    Jonathan Dick
    @Redth
    Of course your call doesn’t return until the await finishes but that’s different than blocking the ui thread
    Mandrakia
    @Mandrakia
    and it's a pain since the stacktrace is hidden behind native code
    if it's not the awaits then i'll have to find another culprit
    Crashes are easier to figure out with mono-symbolicate because we have a full stack trace. But for anr's it's not a real dump
    Jonathan Dick
    @Redth
    I generally would advise against using direct connections to the database from a mobile device too. Unless you’re using ef core for a local SQLite database
    Mandrakia
    @Mandrakia
    local sqlite :)
    I just used ef.core because i'm used to it, i could have used a smaller/simpler orm
    Jonathan Dick
    @Redth
    Yeah it’s a scenario that team is looking to better support in the future too. I was on a call with them not long ago
    Definitely not the most lightweight option but it should work
    Mandrakia
    @Mandrakia
    Otherwise i'm super satisfied with Xamarin.Android
    Dev was a breeze as I know both android and c#, bindings can be a pain but most libs had bindings already
    Jonathan Peppers
    @jonathanpeppers
    @Mandrakia maybe the confusion is you need to actually call Task.Run() for anything you always want to be in the background
    At your database layer, all the calls should start a new Task
    At the UI layer, you can just await
    Jonathan Dick
    @Redth
    Yeah it really depends what the underlying things you are calling do
    Mandrakia
    @Mandrakia
    Apparently since I'm async all the way i can just await from the UI layer
    Jonathan Dick
    @Redth
    But devils advocate to myself, it wouldn’t really hurt that much to wrap it in a Task.Run
    Mandrakia
    @Mandrakia
    It does complicate the code but I'll do that then :)
    Jonathan Dick
    @Redth
    The risk is really just that you start another task unnecessarily
    I mean I would try just awaiting your stuff all the way down first and see what happens
    Mandrakia
    @Mandrakia
    I don't think my ANRs come from the Db actually otherwise it would be more frequent than 1.36%
    So i think async/await works fine if as you said it's async all the way
    Jonathan Dick
    @Redth
    I’m not sure what that would have to do with tasks and async await in any case
    Mandrakia
    @Mandrakia
    Well ANRs are cause by the main thread not being free to process inputs and such
    so if the await/async stuff wasn't working that could cause these issues. But that's not the case so I'm still trying to find what causes my ANRs
    Jonathan Peppers
    @jonathanpeppers
    the issue is if you ran some expensive query, and it wasn't wrapped in Task.Run
    you could see a UI delay
    If there are async versions of whatever ORM you are using, that should also work
    Although I would go look at their code to see what they are doing
    Jonathan Dick
    @Redth
    Yeah that’s the key. Is every code path you hit in ef core doing things properly async
    Mandrakia
    @Mandrakia
    This ANR hunting is driving me crazy I hope one day App Center will have a tool for this
    Bouzid Zakaria
    @BouzidZach11_twitter
    Hi everyone,
    Jonathan Pryor
    @jonpryor
    hi!
    Bouzid Zakaria
    @BouzidZach11_twitter
    How are you ?
    Jonathan Pryor
    @jonpryor
    looking forward to a long US weekend
    Bouzid Zakaria
    @BouzidZach11_twitter
    @jonpryor long weekend, How many days ?
    Jonathan Pryor
    @jonpryor
    4
    Bouzid Zakaria
    @BouzidZach11_twitter
    So, it's long
    Anyone can help me in this :
    I have an issue in Broadcast Receiver, it's not working when I register my Broadcast Receiver in AndroidManifest.xml file
    image.png
    Jonathan Pryor
    @jonpryor
    you should place [BroadcastReceiver] custom attribute on your BroadcastReceiver subclass, and let the custom attribute deal with the XML emission
    you may also want the [IntentFilter] custom attribute on that type as well
    that’ll ensure that the android:name attribute has the correct type name.
    all that aside, iirc “recent versions” of Android (since 7?) won’t send a broadcast to an app until after it has been manually launched by the user.
    Bouzid Zakaria
    @BouzidZach11_twitter
    I have made all this
    image.png
    How I can make broadcast to launched by user ?
    Bouzid Zakaria
    @BouzidZach11_twitter
    @jonpryor Okay Thank you so much, I understand it now ;)