Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    Android, Flic2 and background...

    Developers
    2
    2
    581
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pistonep
      pistonep last edited by

      Hi,
      I m a currently trying to develop an application on Android that responds to Flic2 click.
      It works well when application is in foreground and responds during certain time when application is in background.
      But after one hour or so in background, the application stop responding to click (Flick Button led blink orange instead of green).
      I do know about Phone killing background app so :

      • I have a foreground service that uses : PARTIAL_WAKE_LOCK
      • I have set my app to NO RESTRICTION in battery settings
      • I have set my app to START when device start

      Still... it s not working..
      Can someone help me with that ? Is it a flic config problem ? Is it android's OS fault ? Is it a coding issue 😞
      Thanks for your help

      1 Reply Last reply Reply Quote 0
      • Emil
        Emil FlicTeam last edited by

        A foreground service should be enough (at least according to Android's official documentation). A wake lock should not be used/needed. This works perfectly fine on "original" Android devices such as Google Pixel devices. Some chinese phone manufacturers might neglect the intended behaviour for a foreground service and kills the process anyway though after some undocumented rules, unless the app is white listed or similar.

        The sample application at https://github.com/50ButtonsEach/flic2lib-android-sample uses a foreground service. You can check that out.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post