Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 5 and Android Live Wallpaper

Discussion in 'Android' started by johnnydj, Apr 7, 2015.

  1. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    So now that Unity 5 is out, is there any news if we can build live wallpapers again?
    There was a plugin back in version 3.6-4.0 which was able to export, but in 4.x the developer said that something is not exposed in the Unity API which didn't allow it to work in further Unity versions.

    So if anyone has any info at all, is it possible to build live wallpapers now?
     
    Mihai77 likes this.
  2. johnnydj

    johnnydj

    Joined:
    Apr 20, 2012
    Posts:
    211
    Nothing?
    Could the devs also look into this?
    Why the live wallpaper support was disabled?
     
  3. AlexSien

    AlexSien

    Joined:
    Jun 18, 2013
    Posts:
    3
    I’ve recently mailed the Unity Support, asking if they can put me in touch with someone of the dev team to know if they was any kind of hack to start the Unity Player 5 in a LWP. Here is technical team response, and it’s pretty interesting:


    ''It's a kind of hack and not officially supported by Unity. This hack stopped working after 4.1. The Android team said that in Unity 5 you can attach your own custom surface to the Unity player Java which could do the job. On the UnityPlayer java object there is a function that can be used to attach surface objects either as the primary surface (using index zero) or as secondary surfaces using index 1-15. Of course you need to write your own wallpaper service and handle lifecycle and other on your own.''


    The Unity documentation isn’t exhaustive on the surface object attachment: no documentation on this feature , I only found a public function links to the java Unity Player V5, player.displayChanged(0,surfaceHolder)


    But the big question is still the same… It’s still impossible to start the Unityplayer with the Wallpaper Service Context. So how should we do? we can start the UnityPlayer using an activity before using the UnityPlayer in the Wallpaper Service, but this method sounds terrible and I am not even sure it’s works.


    SO, is somebody has an idea on how to use the player.displayChanged(0,surfaceHolder) in the Java Unity player, and how we can use it to run the Unity Player in the Wallpaper Service?
     
  4. CoredumpLab

    CoredumpLab

    Joined:
    Mar 11, 2014
    Posts:
    14
    Hi,

    is there any news about Unity 5 and live wallpaper service ?

    thanks in advance
     
  5. McKrackeN

    McKrackeN

    Joined:
    Oct 28, 2009
    Posts:
    51
    Are there any news about this?

    Thanks! :)
     
  6. 0xd34d

    0xd34d

    Joined:
    Jan 3, 2016
    Posts:
    1
    Bummed out to see this is still an unanswered issue. I started looking into the feasibility of using UnityPlayer within a Service and have hit the hurdle that is being described in this thread.

    It would seem that while UnityPlayer's constructor takes a Context for it's only parameter, there is a method within UnityPlayer that makes the assumption that the context is an instanceof Activity and casts it as an Activity. This method is called inside UnityPlayer(Context context) and causes a ClassCastException to be thrown immediately.

    I'm going to modify the unity-classes.jar to work around this just to see if I can get any further along with making this happen.


    Cheers!
     
  7. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    963
  8. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83