Search Unity

Background app in android?

Discussion in 'Scripting' started by Alexeyka, Nov 10, 2021.

  1. Alexeyka

    Alexeyka

    Joined:
    Jul 3, 2013
    Posts:
    3
    I want to make an audiobook. How to make the application work on the turned off screen and the player is in the notification curtain?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,688
    This will all be very platform specific stuff.

    Start here:

    https://developer.android.com/guide/background

    It might be integrate-able with Unity as a plugin or library, or even directly with the Android classes.

    Let me also warn you before you go too far down this rabbit hole: making any kind of background app in Unity is going to have all kinds of performance issues.

    Unity is really engineered first and foremost as a high performance graphics presentation mechanism.

    Even a Unity app in the background rendering nothing at all on the screen is going to probably burn 100x or even 1000x the amount of battery life as the typical audiobook application, which will just barely sip battery juice.

    If you feel like making an audiobook app, just do it in native Android already, otherwise it will burn through battery power incredibly fast.
     
    Last edited: Nov 10, 2021
    DevDunk and Bunny83 like this.
  3. Alexeyka

    Alexeyka

    Joined:
    Jul 3, 2013
    Posts:
    3
    I just met a lot of applications where the unity logo is shown at startup. And when I came to the implementation of my project, I ran into difficulties, at first it does not work in the background, then it is not displayed in the notification curtain.