Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

uLiveWallpaper - Develop Android Live Wallpapers with Unity!

Discussion in 'Assets and Asset Store' started by ZimM, Dec 20, 2015.

  1. abotrix

    abotrix

    Joined:
    Oct 21, 2015
    Posts:
    20
    Ok...I did it.. I purchased pro version but with reluctance.o_O
     

    Attached Files:

    Breathtaker and nasos_333 like this.
  2. Breathtaker

    Breathtaker

    Joined:
    May 21, 2015
    Posts:
    22
    Looks like You need to update Gradle version that used it Your project.

    Change distributionUrl in gradle-wrapper.properties.
    Code (CSharp):
    1. #Mon Dec 28 10:00:20 PST 2015
    2. distributionBase=GRADLE_USER_HOME
    3. distributionPath=wrapper/dists
    4. zipStoreBase=GRADLE_USER_HOME
    5. zipStorePath=wrapper/dists
    6. distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
    7.  
    Your version can be different.

    Change gradle version in build.gradle
    Code (JavaScript):
    1. buildscript {
    2.     repositories {
    3.         jcenter()
    4.         google()
    5.     }
    6.  
    7.     dependencies {
    8.         classpath 'com.android.tools.build:gradle:4.1.0'
    9.     }
    10. }
    And maybe you need also update dependencies section in build.gradle
    Code (JavaScript):
    1. dependencies {
    2.     implementation fileTree(dir: 'libs', include: ['*.jar'])
    3.     implementation(name: 'LP_uLiveWallpaper', ext:'aar')
    4. }
     
  3. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    33
    Has anyone come across an issue where the wallpaper freezes if you hit the home button from the settings screen? I tested this issue with two scenarios:

    1. In my own wallpaper app, I have a custom settings Activity. If my live wallpaper is currently set and the user taps the home button from my settings screen, the wallpaper will just freeze in place once the "animate to home screen from current app" animation ends.

    2. To be sure that it wasn't anything I was doing in my own code, I exported a fresh Android Studio with uLiveWallpaper from within Unity with the "Settings Activity - Basic" option set. After inspecting the fresh Android Studio project it generated, I noticed that the onPause() override in the PreferenceActivity contains the code `finish()` at the end. I can tell that this will just kill the Activity when the user leaves that Activity. When I comment that `finish()` code out, and run the same test case (wallpaper running, settings screen open, then I press the home button), the wallpaper freezes.

    If anyone is familiar with this issue, please help! I'm at a loss here as there are no errors being thrown that I can see in the LogCat. I even have this code set within my manifest with no luck:


    <meta-data
    android:name="uLiveWallpaper.VerboseLog"
    android:value="true" />


    I want to finish by saying that calling finish() in the onPause() function seems like a hacky solution to solve this issue =[
     
    Last edited: Dec 7, 2020
  4. ArthurUS83

    ArthurUS83

    Joined:
    Jan 13, 2016
    Posts:
    25
    New Method Code Works Well, not crashing on One UI 2.5 on Start, BUT After Rebooting a Devise the Wallpaper is not starting, just Black Screen.
    :(
     
    Last edited: Dec 20, 2020
  5. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    33
    Hello, I'm glad you found a fix for this. Would you please guide me on how to implement this override? I can't find where to add this method.
     
  6. abotrix

    abotrix

    Joined:
    Oct 21, 2015
    Posts:
    20
    Update of Indie version of uLiveWallpaper:

    Alexa (Unity Technologies)

    Dec 29, 2020, 16:09 UTC

    Hi J,

    I want to thank you again for waiting on me!

    I have received a response from the Publisher. He has let me know that he is working on an update for the Indie version of the uLiveWallpaper that will correr the current errors.

    I have also asked the Publisher to check on your requests. It would be great if you could contact him back on the matter. In case you do not receive a reply, we will investigate further.

    I appreciate your patience while we worked on this!

    @ZimM Thanks a bunch to getting back at Unity and working on a fix for your asset. Better late than never!
     
    nasos_333 and ArthurUS83 like this.
  7. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    33
    Aaah, that's cool. Thanks @ZimM

    Life has a way of stopping us from doing what we love. I'm glad you found your way back around to this. I look forward to an update!
     
    abotrix and nasos_333 like this.
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    Fingers crossed we get this update, will save lot of debug and issue solving time.
     
    abotrix likes this.
  9. MagnusAshish

    MagnusAshish

    Joined:
    Dec 16, 2013
    Posts:
    3
    Hello people, please help me with ulivewallpaper. I'm a beginner at programming and have only worked with c# unity. Please guide me to implement a custom settings where I can put a check box to enable like a game object after showing video ad.
    All I'm asking is that how to add to settings of wallpaper and use reward vedio ads.
     
  10. abotrix

    abotrix

    Joined:
    Oct 21, 2015
    Posts:
    20
    The most simplest way is to first make whatever you want in Unity, export to Android Studio using the asset with a sample settings activity for Android provided and modify the settings.xml as you please and link it to you settings activity class.

    You can use in Android UnityPlayer.UnitySendMessage(Activity, Method, parameter) from your settings activity to make the check box or radio button do something in Unity.
     
  11. MagnusAshish

    MagnusAshish

    Joined:
    Dec 16, 2013
    Posts:
    3
    Thanks abotrix, that was quick and now I know what to look for on Google. What I understood from this is that I should make a toggle switch in setting.xml and then in settings activity class I have to use that method. Am I correct?
     
  12. abotrix

    abotrix

    Joined:
    Oct 21, 2015
    Posts:
    20
    Yah. Sorry for the wait.

    You can use the CheckBox in xml and reference that in the setting activity. Android Studio should help with filling in some of the code for you when setting up the onClick method. Sorry, I got the UnityPlayer.UnitySendMessage wrong at first. Look below.

    Code (CSharp):
    1. // Xml
    2. <CheckBox
    3. android:id="@+id/checkBox"
    4. android:layout_width="wrap_content"
    5. android:layout_height="wrap_content"
    6. android:text="CheckMe" />

    Code (CSharp):
    1. // Java
    2. CheckBox check;
    3.  
    4. check= (CheckBox) findViewById(R.id.checkBox);
    5.  
    6. @Override
    7. public void onClick(View view)
    8. {
    9.     switch (view.getId())
    10.     {
    11.         case R.id.checkBox:
    12.             if (check.isChecked())
    13.                 Toast.makeText(getApplicationContext(), "I have been check!", Toast.LENGTH_LONG).show();
    14.                 UnityPlayer.UnitySendMessage("GameObject", "Method", "value");
    15.             break;
    16.     }
    17. }
    18.  
     
    Last edited: Feb 6, 2021
  13. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    33
    I wonder if anyone has explored the issue where the wallpaper would freeze if you tap the Home button from the wallpaper settings screen. If your app relies on the included PreferenceActivity that gets built from Unity, this issue doesn't exist, and I believe I know why. In the
    onPause
    function, there's a call to
    finish()
    at the end of it. If you remove
    finish()
    , run the app, open settings, then tap the home button, you will see the wallpaper freeze.

    Does anyone have any insight into this issue? I have the pro version of uLiveWallpaper and even though I have access to the codebase, I'm having a difficult time figuring out the cause.
     
  14. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    Hi all,

    In Android 10 and 11 I cant seem to access the default Settings page with the fps and resolution sliders, is there a known fix for this ?

    In Android 9 works ok.

    Thanks in advance
     
  15. appvillas

    appvillas

    Joined:
    Aug 21, 2015
    Posts:
    14
    did You solve The issue? i have same issue
     
  16. todiorkalo

    todiorkalo

    Joined:
    Nov 27, 2018
    Posts:
    3
    Hi, I get another exception on UI 2.5

    Code (csharp):
    1.  
    2. E/AndroidRuntime: FATAL EXCEPTION: main
    3. Process: com.fexware.PV, PID: 3386 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.WallpaperManager.notifyPid(boolean, int, java.lang.String)' on a null object reference
    4.         at android.service.wallpaper.WallpaperService$Engine.attach(WallpaperService.java:1371)
    5. at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:1784)
    6.         at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44)
    7.         at android.os.Handler.dispatchMessage(Handler.java:107)
    8.         at android.os.Looper.loop(Looper.java:237)
    9.         at android.app.ActivityThread.main(ActivityThread.java:8167)
    10.         at java.lang.reflect.Method.invoke(Native Method)
    11.         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    12.         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
    I pasted your library and rebuild the project, but no luck! I noticed your exception is different although the Null Reference may have to deal with the same object!
     
  17. todiorkalo

    todiorkalo

    Joined:
    Nov 27, 2018
    Posts:
    3
    Hello @kkl888! Have you found a solution?
     
  18. kkl888

    kkl888

    Joined:
    Dec 6, 2014
    Posts:
    55
    @todiorkalo, no at the moment, i messed abit with the code, i still got complains from users that the live wallpaper crash after wake up phone from sleep.
     
  19. homerender

    homerender

    Joined:
    Sep 14, 2012
    Posts:
    189
    Hi. Trying to make all by manual, but everything broken on the first stage when I press "Create Project" in the Wizard.

    Unity 2021.2.15f1 (Also tried on 2022.3.0f1)

    Code (CSharp):
    1. AmbiguousMatchException: Ambiguous match found.
    2. System.RuntimeType.GetMethodImplCommon (System.String name, System.Int32 genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <feaaa6313e32495d9f259b175aa6b597>:0)
    3. System.RuntimeType.GetMethodImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConv, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at <feaaa6313e32495d9f259b175aa6b597>:0)
    4. System.Type.GetMethod (System.String name, System.Reflection.BindingFlags bindingAttr) (at <feaaa6313e32495d9f259b175aa6b597>:0)
    5. System.Type.GetMethod (System.String name) (at <feaaa6313e32495d9f259b175aa6b597>:0)
    6. LostPolygon.uLiveWallpaper.Editor.Internal.UnityVersionedReflectionWrapper+PlayerSettings..cctor () (at G:/PROGRAMMING/Repos/BitBucket/uLiveWallpaper/UnityProject/Assets/uLiveWallpaper/Source/Internals/Editor/Utilities/UnityVersionedReflectionWrapper.cs:46)
    7. Rethrow as TypeInitializationException: The type initializer for 'PlayerSettings' threw an exception.
    8. LostPolygon.uLiveWallpaper.Editor.LiveWallpaperProjectBuilder.BuildInitialProject () (at G:/PROGRAMMING/Repos/BitBucket/uLiveWallpaper/UnityProject/Assets/uLiveWallpaper/Source/Internals/Editor/BuildPipeline/LiveWallpaperProjectBuilder.cs:146)
    9. LostPolygon.uLiveWallpaper.Editor.LiveWallpaperProjectBuilder.BuildProject () (at G:/PROGRAMMING/Repos/BitBucket/uLiveWallpaper/UnityProject/Assets/uLiveWallpaper/Source/Internals/Editor/BuildPipeline/LiveWallpaperProjectBuilder.cs:107)
    10. LostPolygon.uLiveWallpaper.Editor.LiveWallpaperBuildGuiUtility.CreateLiveWallpaperProject (LostPolygon.uLiveWallpaper.Editor.Internal.ProjectSettingsContainer projectSettings) (at G:/PROGRAMMING/Repos/BitBucket/uLiveWallpaper/UnityProject/Assets/uLiveWallpaper/Source/Internals/Editor/LiveWallpaperBuildGuiUtility.cs:134)
    11. LostPolygon.uLiveWallpaper.Editor.LiveWallpaperBuildWindow.CreateLiveWallpaperProject () (at G:/PROGRAMMING/Repos/BitBucket/uLiveWallpaper/UnityProject/Assets/uLiveWallpaper/Source/Internals/Editor/LiveWallpaperBuildWindow.cs:602)
    12. UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at <2919c21692194bd4aadcc86b58da6722>:0)
    13.  
     
    nasos_333 likes this.
  20. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    Having the same issue