Search Unity

uLiveWallpaper - Develop Android Live Wallpapers with Unity!

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

  1. resheez

    resheez

    Joined:
    Mar 22, 2013
    Posts:
    66
    hellaandrew likes this.
  2. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    23
    I would assume I could speak for Zim, but this sort of functionality should up to you, the developer. It's a really cool idea, one that I might want to steal :p, but what you're asking seems like it would be an asset all on it's own, and takes away from the main functionality that Zim provided with his wallpaper asset.
     
    resheez likes this.
  3. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    23
    resheez likes this.
  4. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Basically, what @hellaandrew said. I do plan to make a tutorial on the subject, but this is not a priority. Basically, integrations with other services are your job as a developer.
    After you've built the Android Studio project, you really should stop thinking about it in terms of Unity, and instead think in terms of Android, as in the end, you are building an Android application. Of course, there are tons of libraries for Android, including official from Google:
    http://developer.android.com/google/play/billing/billing_integrate.html
    You'll need some Java and Android knowledge, though, but uLiveWallpaper itself is not stopping you from doing anything you want in any way.
    Looks really cool :) The animation is very smooth and fluid.
     
    Last edited: Mar 4, 2016
    resheez likes this.
  5. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    uLiveWallpaper 1.1.1 is now live on Asset Store!

    Change log:


    Improvements and fixes
    • Fixed that in basic preference Activity, Theme.DeviceDefault.Settings theme was used on API >= 14, when it should only be used on API >= 21. This should fix all strange issues with the preference screen, like menu items being disabled, crashes, etc.
    • Fixed issues with project files templates.
    • Files from StreamingAssets folder are now updated in Android Studio project.
    • Fixed not being able to override UnityWallpaperEngine when using an .aar library.
    • Fixed build issue on platforms other than Android.
    • Increased reliability for IO operations and improve error messages.
    • Other minor fixes.
    If you are using the generated Basic preferences screen, it is highly recommended to open SettingsActivity.java and change this block of code
    Code (CSharp):
    1.         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    2.             setTheme(android.R.style.Theme_DeviceDefault_Settings);
    3.         } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    4.             setTheme(android.R.style.Theme_Holo);
    5.         } else {
    6.             setTheme(android.R.style.Theme);
    7.         }
    into
    Code (CSharp):
    1.         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    2.             setTheme(android.R.style.Theme_DeviceDefault_Settings);
    3.         } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    4.             setTheme(android.R.style.Theme_DeviceDefault);
    5.         } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    6.             setTheme(android.R.style.Theme_Holo);
    7.         } else {
    8.             setTheme(android.R.style.Theme);
    9.         }
    This fixes numerous issues with preferences screen on devices with Android 4.x, such as crashes and menu items being disabled.
     
    Last edited: Mar 4, 2016
  6. egem2015

    egem2015

    Joined:
    Oct 27, 2015
    Posts:
    54
    Hi Zim

    This tool is just amazing ann never compare to other any asset for me.

    I did not buy yet.But I have a plan to buy it.

    But There is a problem for me.

    I want to add ads to my lwp.

    can i add ads to lwps when creating a lwp with this tool?

    maybe when user clicked "set wallpaper" button.is this possible?

    thanks in advance
     
  7. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    23
    Hi Zim,

    I use Debug.Log a lot as you can imagine. When viewing the logs in the logcat in Android Studio, each log get printed out in this fashion:

    03-06 20:05:09.474 5867-5903/com.space.hexorb I/Unity: Double Tapped!

    (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
    03-06 20:05:14.572 5867-5903/com.space.hexorb I/Unity: Double Tapped!

    (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
    03-06 20:05:15.540 5867-5903/com.space.hexorb I/Unity: Double Tapped!

    (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
    03-06 20:05:16.506 5867-5903/com.space.hexorb I/Unity: Double Tapped!

    (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

    Is there some way I can remove the last two lines (the blank line and the "Filename: ...." line)?
     
  8. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    23
    I have another question, hopefully you can answer it when you return back to this thread.

    I'm trying to set some stuff up in the LiveWallpaperService class, and I need the context of the LiveWallpaper in order to get some things to function properly. Do we have any access to the context of the LiveWallpaper? And if so, how can I access it?

    Thanks @ZimM !!!
     
  9. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Well, this is not uLiveWallpaper-related, but no, you can't really do anything about that. That's just the way Unity prints out logs to logcat. These lines might not be useful if you are making a release build, but if you do a Development build, you actually get the full stacktrace, which is often useful for debugging complex stuff.
    You can, however, use Android logging system directly with the power of AndroidJavaClass, but it's probably not worth the effort. Keep in mind that Debug.Log calls are quite expensive, especially when you have a lot of them, so it's probably better to remove any non-essential logs in the release.
    LiveWallpaperService is Context. Or, if you need the application context, you can use Service.getApplicationContext() method. Standard Android stuff.
     
  10. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    What kind of ads? Pretty much the only place you realistically can place ads is the settings screen. The settings screen is a regular Android Activity, so nothing stops you from integrating apps there in the same manner they are integrated in regular Android apps.
    But really, ads do not work so well with live wallpapers. It's usually a much better idea to have a separate paid version or in-app purchases.
     
  11. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    23
    Great, thanks a ton Zim! I enjoy using your plugin.
     
  12. puravankara

    puravankara

    Joined:
    Mar 17, 2016
    Posts:
    3
    I purchased it today morning and download is stuck at 22%. What should I do?
     

    Attached Files:

  13. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Try the usual stuff: reboot your computer, reboot your router. I've just tried to download it myself and had no problems. I have no control over the Asset Store, so I can't help you any more than this. If the problem persists, forward your issue to Asset Store support team.
     
  14. puravankara

    puravankara

    Joined:
    Mar 17, 2016
    Posts:
    3
    Thank you
     
  15. puravankara

    puravankara

    Joined:
    Mar 17, 2016
    Posts:
    3
    Guys anyone knows any .pdf or websites explaining how to use LWP? I'm an absolute beginner to unity. Saw video tutorials about games and all. But couldn't find uLiveWallpaper tutorial. Thank you
     
  16. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    uLiveWallpaper only wraps Unity into Android live wallpaper service, there's nothing really special about development process. Therefore, there are really no uLiveWallpaper-specific tutorials. Just treat your live wallpaper as a kind of a game. What you need are Unity tutorials, and there are plenty of them on the Internet. You can start with official Unity documentation:
    http://unity3d.com/learn

    uLiveWallpaper does exposes some live wallpaper specific APIs, but they are explained in the online API reference (http://cdn.lostpolygon.com/unity-as...html/48236cf1-386d-4372-94e7-451d8b967243.htm), and there are also demo examples inside the uLiveWallpaper package.
     
    Last edited: Mar 18, 2016
  17. Philosoraptr

    Philosoraptr

    Joined:
    Apr 1, 2016
    Posts:
    7
    Hi there,

    I've downloaded uLiveWallpaper and I'm having issues with Step 4 of the User Manual. There's no app module as stated in the below step:

    Step 4
    Click “File → Project Structure...” to open the “Project Structure” window.
    In the “Modules” list (on the left), select the “app” module.
    Switch to “Dependencies”
    tab. Click the green “+” button at the right side and add module dependency
    “LP_uLiveWallpaper.aar”.


    Can anyone please give me a hand to suggest what I'm missing? The problem appears to be associated with Gradle, as I'm receiving a message after step 3, (importing the “LP_uLiveWallpaper.aar” library) that tells me that the project isn't compatible with Gradle or something, and unfortunately I'm too unfamiliar with Android Studio to know what that means.

    Cheers
     
  18. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    It's impossible to say what exactly went wrong with this little information, but it's very likely that you've done something wrong. The "app" module is created by Android Studio automatically, so there's no way it could be missing.
    What exactly are the errors you are getting? Does the project import succeeds?
     
  19. Philosoraptr

    Philosoraptr

    Joined:
    Apr 1, 2016
    Posts:
    7
    Sorry for the lack of information and thanks for responding so quickly!

    I've attached a zip file containing screenshots of the steps that I take. Could you please take a look and let me know if anything else would be helpful?

    Capture8.jpg is the Project Structure screen prior to importing the “LP_uLiveWallpaper.aar” library in step 3. Capture9.jpg is after step 3. Notice that it changes and selecting the Module shows nothing to the right.

    Also, prior to step 3, I receive a message suggesting that I migrate the project to Gradle and after step 3 I receive a Project Sync warning message saying that the project is not a Gradle-based project once I import the “LP_uLiveWallpaper.aar” library.

    Thanks in advance for your help.
     

    Attached Files:

  20. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Uh... This is weird. How are getting the window from the very first screenshot (Capture.jpg)? It is completely different from what is supposed to be there. After I click "File... → New → Import Project...", I get this:
    upload_2016-4-2_2-13-40.png

    Window on your screenshot looks completely different, in fact, I have never seen it before. The rest of the import wizard is also completely different.
    I'm somewhat puzzled, since you are the first person with this problem. Perhaps there is something wrong in your Android Studio installation?
     
  21. Philosoraptr

    Philosoraptr

    Joined:
    Apr 1, 2016
    Posts:
    7
    I missed a few screens prior to that; capture.jpg is the window following the one that you just posted, after selecting the project folder created in Unity in the ULiveWallpaper window. Perhaps I have a newer version of Android Studio? I've got 1.5.1 Build 141.2456560.
     
  22. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Ah, I've reproduced it. It seems like you are simply selecting the wrong folder, as your project got split in two - EeveeRun and ovrplugin. Judging from the screenshots, you should be importing "D:\Users\Ben\Development\Unity\EeveeRunner\EeveeRun" instead. I'm not sure if Android Studio will also import the ovrplugin library as well, but if it doesn't - just add it as a module as well. It is located in "<Unity installation directory>\Data\VR\oculus\android\ovrplugin.aar"
     
  23. Philosoraptr

    Philosoraptr

    Joined:
    Apr 1, 2016
    Posts:
    7
    Brilliant, that seems to have done it. I've been able to build the project successfully and run it on my device now! Thanks for all your help! It's great to receive such great support.

    Now I just have to figure out why I'm just getting a black screen for my wallpaper...
     
  24. mayTree

    mayTree

    Joined:
    Apr 6, 2016
    Posts:
    1
    @ZimM
    I want to show the picture user selected as a background of wallpaper.
    Do you think it's possible with uLivewallpaper?
    For example, if I save an image uri to shared preferences, is it possible to load the photo from the uri and use it on Unity?
     
  25. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    uLiveWallpaper itself is irrelevant here, it imposes no limitations. The real question is - is it possible with Unity? And the answer is - yes, it is possible :)
     
  26. Philosoraptr

    Philosoraptr

    Joined:
    Apr 1, 2016
    Posts:
    7
    Hi there,

    Has anyone experienced issues with the top half of the screen going black? It happens when the screen rotates while being unlocked. When I rotate it back to landscape and back to portrait it goes away.

    The game loop continues as usual when the screen is half black. The game uses simple textures, which I've tried with lights and as unlit but with no change. I've also tried changing a number of graphical settings in unity.

    Could this be caused by ulivewallpaper? When I create the app normally with unity I don't see the issue.

    Cheers
     
  27. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    It could be a lot things. But, given the fact that no one else has reported this issue before, I'll assume it's something device-specific.
    Could you please send me a screenshot of the bug? What device do you use? What Android version does it has? What version of Unity do you use?
     
  28. Navid

    Navid

    Joined:
    Sep 3, 2012
    Posts:
    39
    Hi,
    what do i have to do if i want change the texture at runtime. Is it possible with the indie version?
    My problem at the moment is , after i changed the texture with
    Resources.Load(filename)
    the texture appears black ... and i i have to reset my live wallpaper to show the new texture.
     
  29. GDHobbs

    GDHobbs

    Joined:
    Apr 4, 2014
    Posts:
    4
    Hi, I'm working through your plugin with anticipation. I struggled with android studio and my slightly messy SDK installation but that's all in the past as of this morning.

    My question is about the custom settings page. I'm not quite getting the process from the instructions alone.

    I have a custom UI, with settings such as foreground and background colours, animation speed etc and I can see from the instructions that I need to use the invisible self-closing option in the plug-in. I'm just not really sure where to go after that.

    I assume my settings UI has to sit in the same scene as the main wallpaper objects and the settings UI will overlay that when they're active. But how to I 'subscribe to LiveWallpaper.PreferenceActivityTriggered event in your code'? This might sound easy to a c# coder but I only know java (and regretting it a bit) but I really don't get the terminology and an internet search didn't help me.

    Many thanks in advance. Shout if you need more info from me.

    GIles
     
  30. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    uLiveWallpaper does not modifies anything in the way Unity works. Resources.Load is a Unity API, so I am not sure why are you asking this here. If you are having some problem with Resources.Load, it means that either you are doing something wrong, or this is a Unity bug.
     
  31. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    You are correct. Here's the example code to switch the GameObject on\off when LiveWallpaper.PreferenceActivityTriggered is invoked:
    Code (CSharp):
    1. using System;
    2. using LostPolygon.uLiveWallpaper;
    3. using UnityEngine;
    4.  
    5. public class PreferenceActivityGameObjectTrigger : MonoBehaviour {
    6.     public GameObject TriggeredGameObject;
    7.  
    8.     private void OnEnable() {
    9.         LiveWallpaper.PreferenceActivityTriggered += LiveWallpaperOnPreferenceActivityTriggered;
    10.     }
    11.  
    12.     private void OnDisable() {
    13.         LiveWallpaper.PreferenceActivityTriggered -= LiveWallpaperOnPreferenceActivityTriggered;
    14.     }
    15.  
    16.     private void LiveWallpaperOnPreferenceActivityTriggered() {
    17.         TriggeredGameObject.SetActive(!TriggeredGameObject.activeSelf);
    18.     }
    19. }
    Code (JavaScript):
    1. import LostPolygon.uLiveWallpaper;
    2. import UnityEngine;
    3.  
    4. class PreferenceActivityGameObjectTrigger extends MonoBehaviour {
    5.     public var TriggeredGameObject : GameObject;
    6.    
    7.     function OnEnable() {
    8.         LiveWallpaper.PreferenceActivityTriggered += LiveWallpaperOnPreferenceActivityTriggered;
    9.     }
    10.    
    11.     function OnDisable() {
    12.         LiveWallpaper.PreferenceActivityTriggered -= LiveWallpaperOnPreferenceActivityTriggered;
    13.     }
    14.    
    15.     function LiveWallpaperOnPreferenceActivityTriggered() {
    16.         TriggeredGameObject.SetActive(!TriggeredGameObject.activeSelf);
    17.     }
    18. }
     
    jerry2157 likes this.
  32. GDHobbs

    GDHobbs

    Joined:
    Apr 4, 2014
    Posts:
    4
    Hi,

    That's amazing and it's solved all my problems. Thanks so much for the advice.

    Giles
     
  33. GDHobbs

    GDHobbs

    Joined:
    Apr 4, 2014
    Posts:
    4
    So it's all working, except one small issue. My custom settings screen still has the android system 'settings' and 'set wallpaper' buttons at the bottom. This wouldn't be a problem but if you set the wallpaper while in the settings screen the settings screen gets set as the wallpaper.

    The settings screen on Aether's wallpaper at the top of this forum page fills the screen and the buttons go away. What am I missing?

    Thanks
     
  34. kiaxseventh

    kiaxseventh

    Joined:
    Jan 24, 2015
    Posts:
    6
    I needed When Run Setting Dialog on Preview LiveWallpaper Service Dont running OnPause Event
    Can Help me ?
     
  35. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    I'm not sure I understand you entirely. How are implementing the settings screen, by using an Android Activity, or by listening the LiveWallpaper.PreferenceActivityTriggered event and implementing the settings UI in Unity?
    Aether uses the standard Android Activity method, which opens a whole new window on top of the wallpaper selector UI. If you are implementing the setting screen in UI, just subscribe to LiveWallpaper.IsPreviewChanged event or observe the value of LiveWallpaper.IsPreview property, and hide the settings UI when wallpaper is not in the preview mode anymore.
     
  36. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Sorry, but I can't understand you. Could you please reword your question?
     
    ethanwgross likes this.
  37. ArthurUS83

    ArthurUS83

    Joined:
    Jan 13, 2016
    Posts:
    21
    Hey Zim I need to make 3 different checkboxes in my settings activity but i need that when one is selected the other ones are automatically deselected. Can I use CheckboxPreferenceObjectEnabled Script for that? i don't have enough knowledge in android studio.. Can You help me with that pleas?
    Thanks
     
  38. ScreamingSnail

    ScreamingSnail

    Joined:
    Oct 4, 2014
    Posts:
    4
    Hi ZimM, I recently published a live wallpaper but I'm having a small issue with the responsiveness of the double tap settings screen showing up. I'm using the standard settings screen. After the first double tap, all subsequent attempts to bring up the settings screen require 3 taps. Also, it sometimes takes 2-3 full seconds for the settings screen to show up. It has been tested on Galaxy S7, Nexus 5, HTC M7, and LG V10 devices so processor speeds should not be the issue. Is there anything you can suggest that I can implement with the Tap To Open Settings script to fix this?

    Thanks,
    Scott
     
  39. Navid

    Navid

    Joined:
    Sep 3, 2012
    Posts:
    39
  40. resheez

    resheez

    Joined:
    Mar 22, 2013
    Posts:
    66
  41. Keitaro3660

    Keitaro3660

    Joined:
    May 20, 2014
    Posts:
    86
    yay another sample!!
    i already instal it on my xiaomi redmi note 3, it's works well, not too lag.
    the quality is REALLY GOOD, but as above me say, WOW 50mb just for LWP?? that's crazy man haha..

    do you know what make it size so big btw?? 3D asset? effect?
     
  42. Navid

    Navid

    Joined:
    Sep 3, 2012
    Posts:
    39
    Thanks resheez and Keitaro3660,
    i know 50mb is bad.
    I´ve got over 150 flag textures :-(.
    My build tool says over 80% are textures.
     
  43. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
  44. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    CheckboxPreferenceObjectEnabled can't be used for this, it's a C# script that enables or disables GameObjects depending on the value of a boolean preference.
     
  45. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    This issue is surprisingly much more complex than you could think. There are two things that can contribute to "double tap to open settings" feature being less responsive than expected.
    1) TapToOpenSettings script uses Unity's Input API to detect the touches. This is fine when you run at 60 FPS and detect singular taps. The issue with Unity Input API is that it is framerate-dependent - input data is only updated once per frame. Basically, as FPS goes lower, input responsiveness goes down as well, and it is very common for live wallpapers to decrease the FPS (as low as 15 sometimes). To workaround this, you can increase Max Time Between Taps property of TapToOpenSettings script, with the possible side of effect of some false positives.
    Pretty much the only way to entirely fix this issue is to not use Unity at all for this feature, and instead implement it in Java code. I'll see if I can do that in an update to uLiveWallpaper - it shouldn't be very hard to implement, but will add some messiness to the code...
    2) Android has a security feature that delays the start of new Activities from within services after pressing the Home button. In other words - if you tap the Home button and immediately double-tap to call the wallpaper settings, Android will acknowledge your intent, but will only start the Activity in a few seconds. Same happens if you attempt to open Activities too often - Android won't allow you to do that.
    This is a limitation that Android itself imposes, and it can't be fixed, unfortunately. Good thing is that your settings screen will still open, even if you'll have to wait a few seconds. This is probably what you are observing.

    So as you can see, even if point 1 will be fixed somehow, point 2 will always be there, and there's nothing that can be done about it. Right now, the only thing you can do is increase Max Time Between Taps.
     
  46. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Congrats on releasing your LWP! Looks real nice and works smooth on my old Nexus 4 :) It might be a bit heavy, but the quality is worth it! You might try to download the flags in runtime from a server to reduce the APK size - after all, no one needs 150 flags at the same time.
    Requirements are the same as Unity. If Unity games work on your devices - live wallpapers built with uLiveWallpaper will work as well. Basically - all OpenGL 2.0 ES compatible devices with Android 2.3 or newer.
     
    Navid likes this.
  47. resheez

    resheez

    Joined:
    Mar 22, 2013
    Posts:
    66
    @ZimM
    What you have created is awesome plugin man.
    There is unlimited capacity if what you can archive with this beauty.
    Thanks alot man.

    The plugin itself is almost perfect but do you have/working any more update/features, tutorials.(just curious;))

    I know we have spoke about this and you have stated it very clearly but still the gyroscope/accelerometer controlled camera feature will be an awesome feature to complete this beautiful plugin man.

    Thanks.:cool:
     
  48. Keitaro3660

    Keitaro3660

    Joined:
    May 20, 2014
    Posts:
    86
    yeaaaaah i waited for long lol
    but it's pro, hmmm.. do i need indie or pro? :/
    ah whaterver, i'll just buy the pro then.

    can't wait to play with this ^^
     
  49. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Just two more hours left of uLiveWallpaper Pro at a 33% discount! Hurry up if you still want to get it ;)
    Thank you for the kind words! :)
    I am working on my own LWP in my free time, and probably parts of it will be included into uLiveWallpaper as a demo. Stay tuned!
     
  50. resheez

    resheez

    Joined:
    Mar 22, 2013
    Posts:
    66
    Wow..!! the developer him self working on a LWP..great news..can't wait for it.
    Is the gyroscope/accelerometer controlled camera feature will be available too?..hehe:D
     
unityunity