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. Dismiss Notice

Uni2LwP : Create Live Wallpapers with Unity 3.4.2 /3.5.7/ 4.0/4.0.1

Discussion in 'Assets and Asset Store' started by shinx, Feb 28, 2013.

Thread Status:
Not open for further replies.
  1. resheez

    resheez

    Joined:
    Mar 22, 2013
    Posts:
    66
    nice lwp....can you tell me how you inserted a picture...do you attached it in a plane??
     
  2. luvcoolstuff

    luvcoolstuff

    Joined:
    Dec 19, 2012
    Posts:
    29
    Success! Thank you very much. Some final step to publish on Google Play.:D
     
  3. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Glad to hear :) Don't forget that before publishing on Google Play you must remove the testDevices tag.
     
  4. invisiblesense

    invisiblesense

    Joined:
    Jan 21, 2013
    Posts:
    41
    Hello Shinx,

    I am just playing with the the plugin and build and exported the lwp to Eclipse. I am getting lots of errors on Settings.java file. Basically at this stage I just wanted to test my lwp and not bother with any settings option. How would I do that?

    I am sorry if my question sounds stupid but I dont progrmming knowledge.

    Excellent plugin, by the way!

    Regards
     
  5. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hello,

    Please make sure that you have Android SDK from version 4.0 up. If you don't have it installed, open Eclipse go to menu Window->Android SDK Manager and install it. Restart Eclipse.
    After that right-click on lwp project and choose : Android Tools-> Fix Project Properties or go to menu Project->Clean

    Let me know if it worked.
     
  6. Horror

    Horror

    Joined:
    Jul 18, 2011
    Posts:
    207
    My wallpaper is just about ready to go. Not sure how much of an issue the Media Vs Ringer volume would be for people, though.

    Have you made any progress on that one, Shinx? Thought I'd check before uploading it to Google Play :)
     
  7. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Not yet. I already found a way to change it, but it only works after the user stops pressing the volume keys and it changes both volumes (media and ringer), so it's not really a solution :( I still haven't given up ...
     
  8. invisiblesense

    invisiblesense

    Joined:
    Jan 21, 2013
    Posts:
    41

    Thank you, that worked!
    I have a couple more questions:

    1. The screen offset only moves on 3 swipes, e.g. where theres 7 home screens it only moves once to the left, once to the right and centre. How can I change that?

    2. The LWP seems very large in size, its 19mb as lwp and is taking 23mb device running space. Unity2Eclipse takes 6mb for the same lwp, but internally it was taking the same memory. Any ideas on how the size can be reduced?

    I was very pleased to see the swipe working on my Galaxy Note 2.

    Thanks.
     
    Last edited: Apr 6, 2013
  9. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hi,

    Both answers are quite difficult to explain. Let me see if I can explain this correctly ...

    Regarding your first question, if you use normal swipe everything works even if you have 7 home screens because Android passes values from 0 to 1 using the onOffsetsChanged method.

    However, if you are using the simulated swipe no values are passed from Android to Unity. You only know if the user swipes left or right and nothing more and you don't know on which home screen the user is ...

    Now, as an example I only added simulated swipe for 3 screens (check "SetSimulateCamOffset" inside HomeSwitch.cs file) but you can change this by creating intermediate offset camera values (ex. SetCamOffset ("0.25")).

    From what I have read, the real problem is that you need to know how many home screens does each Android device has. I didn't found any solution that detects the exact number of screens in devices that can't use the onOffsetsChanged method :(
    So, my advice to you is : define a minimum number of home screens (let's say 3) , then ask the user how many home screens does he have (do this inside the settings menu) and then change the SetCamOffset method accordingly .... yes a lot of trouble i know !!!


    Regarding the second question(more difficult to explain): if you use Unity 3.4.2 with my plugin, you will have the exact same filesize as any other plugin (6mb+-). This happens because the libraries (libmono.so and libunity.so) on that specific version of Unity were prepared to work "as livewallpapers" and we could use their proxy libs to reduce the APK filesize.

    This doesn't happen with Unity 3.5 and 4.0/4.01 and we need to use the full size libraries of Unity and they are HUGE (12mb just in .so libraries !!!). Add that to your assets, plus the DLL libraries (Assembly-CSharp.dll, mscorlib.dll and UnityEngine.dll) and you will get a live wallpaper with 15/16 MB +- (just in libraries !!!)

    When you compile your live wallpaper into a APK file you should still have 7/8mb APK file because it's compressed (this will be the size that the users will download from Google Play Store). After installing it in your Android device, it will decompress/expand and it will use 17mb+- of space or more depending on the size of your assets (images,scripts, etc).
     
    Last edited: Apr 7, 2013
  10. Horror

    Horror

    Joined:
    Jul 18, 2011
    Posts:
    207
    You'll work something out :)
    I might release it today and mention in the description that you have to go to the settings menu to adjust the ringer volume.
     
  11. potkpot

    potkpot

    Joined:
    Mar 8, 2013
    Posts:
    17
    Hi. Please help to fix bugs $gestureerror.jpg It seems asking gesture class. In first i create project with character controller, but after delete all char.control scripst situation has not changes.
     
  12. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hello,

    Please try this:
    Right-click on lwp project and choose : Android Tools-> Fix Project Properties or go to menu Project->Clean

    Let me know if it worked.
     
  13. potkpot

    potkpot

    Joined:
    Mar 8, 2013
    Posts:
    17
    I was try this. After menu Project->Clean list of errors cleaned, but after run project also displays all of 10 errors
     
  14. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    That's strange. Sometimes Eclipse can be very problematic...
    Are you sure that you have Android SDK 4.0 properly installed ? Can you send me your Eclipse project (mirage.unity@gmail.com) ?
     
  15. Horror

    Horror

    Joined:
    Jul 18, 2011
    Posts:
    207
  16. rdias

    rdias

    Joined:
    Oct 9, 2012
    Posts:
    7
    Horror, I tested your LWP on a Galaxy Nexus and it was pretty smooth. Specially when turning the screen on, almost no lag. The only thing is that it took long time to load and also the APK size is huge. Have you tried to build with unity 3.4 to get a smaller apk?
     
  17. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Actually... I'm just using GUI.DrawTexture and scaling everything on my own using a simple standard scaling system based on the height of the device. Then it takes the width of the screen, subtracts that from the width of the image. This gives you the amount of space to scale the 0 to 1 value of the offset.

    I like using GUI.DrawTexture more then using GUI objects in 3d space. I am more of a programmatic person then a visuals person when it comes to setting up a gui. Kind of odd, I know, but it makes sense in my head.
     
  18. resheez

    resheez

    Joined:
    Mar 22, 2013
    Posts:
    66
    I'm sorry.. can you explain me with more details since im new to unity and programing...
     
  19. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Ok... I'll try to explain the scaling.

    Let's say we want to make an image like mine was, where we want to make it scale so that it's always filling the height of the screen. To do that we can do a simple cross multiplication system. We have 3 values that we need to determine the wanted width. The height of the screen, and the width and height of the image (for example our screen is 800x480, and the image is 1920x1080) So, we can take our height values to get the percentage that the screen height is compared to the image.

    That's 800/1080 which means the screen height is roughly 74% of the image's height. So, to get the properly scaled width, we multiply the starting width by the percentage. 1920 * .74 = 1422.22222222 (rounded to 1422)

    So, that got our width of the overall image. Simple right? That's how you can scale. You can just use that same scale on all images to get everything to look right.

    Now, the other part. We want our background to move left and right to display the entire image over all the pages. Since we now know our acting width is 1422 we can take our screen width (480) and subtract the width of the screen from the width of our image (1422-480 = 942). This value is number value of all available space left to move the screen around. We want to subtract the width from this, so that on the last page, the image isn't off the screen.

    So, we just take our page offset (sent to us through the function made in the LWP script) times our possible left positions (0-942) and subtract that from the x drawing position so it moves the image off to the left of the screen.

    O-o Did that all make sense?
     
  20. resheez

    resheez

    Joined:
    Mar 22, 2013
    Posts:
    66
    yup.. now that make sense... thanks
     
  21. Horror

    Horror

    Joined:
    Jul 18, 2011
    Posts:
    207
    Thanks rdias,

    I haven't tried 3.4.2 yet. I started on 3.5.7, which created a slightly smaller APK than what I have now (2mb or so less). I jumped to Unity 4.0.1 to get the dynamic shadows. Haven't tried any stripping yet... that could shave off a couple of megs; although it seemed to break things when I tried it in my last project.
     
  22. Empantie

    Empantie

    Joined:
    Apr 9, 2013
    Posts:
    14
    Hey,

    i have a problem, if i import the LwP test project into Eclipse. I have Android 4.0 installed,Unity 4.0.1. Project clean was also done.

    In the following line he said that the R is unresolved.
    addPreferencesFromResource(R.xml.wallpaper_settings);

    And the *.meta in the res folder are also market as ERROR with the reason "invalid resource directory name".

    If i export the data as Application and not lvl it works perfect...

    can you help me solving the problem?
     
    Last edited: Apr 9, 2013
  23. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hello,

    Are you using Uni2LwP 1.2a ? or a previous version?

    What's the name of your project ? Did you use some "special chars" in the name ?

    Edited: in "R.xml.wallpaper_setting s" you have a space. it should be "R.xml.wallpaper_settings"
     
    Last edited: Apr 9, 2013
  24. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hello Horror,

    Great LWP :)
    Works very well on my low end device (Ascend G300). How about killing the zombies (on touch) ? hehehe Just a suggestion :)

    Regarding the size. Have you tried to compress and reduce the size of your textures ? I have also noticed that even using the pro version of Unity, sometimes the assets that are not being used are also included in your project, so you should just delete any asset that you don't use...

    Best regards.
     
    Last edited: Apr 9, 2013
  25. drunknbass_

    drunknbass_

    Joined:
    Apr 8, 2013
    Posts:
    5
    Has anyone tried the eclipse project with IntelliJIDEA?
     
  26. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Just tried with IntelliJ IDEA Community Edition 12.1 and it works. Import project from external model (Eclipse) and everything will work :)
     
  27. Empantie

    Empantie

    Joined:
    Apr 9, 2013
    Posts:
    14
    Ok we found the problem. Is it possible that you dont support meta files?
     
  28. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hello,

    Inside the /res folder Android only allows certain folders/files. Meta files aren't allowed and they are not included in Uni2LwP. You are probably using some sort of external version control (svn) that is creating those files inside your Unity project and wen you create a new LWP using Uni2LwP everything inside the template folder is copied.
    See this page for more information.

    But now that I am aware of that, i will create some sort of filtering, or only copy my template files excluding everything else inside the Uni2LwP template folder.
    Thank you for your feedback :)
     
  29. Empantie

    Empantie

    Joined:
    Apr 9, 2013
    Posts:
    14
    yeah we are using svn. Great to hear that you will solve the problem *thumbs up*
     
  30. drunknbass_

    drunknbass_

    Joined:
    Apr 8, 2013
    Posts:
    5
    Awesome, paypal-ed you payment from drunknbass@me.com
     
  31. Horror

    Horror

    Joined:
    Jul 18, 2011
    Posts:
    207
    Thanks, I should definitely do that in the next release. The zombies already have death animations :)

    The textures are compressed, 512X512 and 1024X1024. I could reduce it further but you definitely notice the quality drop. There aren't really any unused assets to speak of, since I only imported what I needed. There are unused animations on the zombie that I could lose.
     
    Last edited: Apr 10, 2013
  32. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Thank you. Email sent with the latest version.
     
  33. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Just submitted version 1.2b to the asset store.

    Email sent to everyone who purchased Uni2LwP using PayPal.

    Change log:
    + Fix: issue with .meta files;
    + Fix: numbers and special chars are now removed when creating/exporting class names;

    Best regards,

    Shinx
     
  34. potkpot

    potkpot

    Joined:
    Mar 8, 2013
    Posts:
    17
    Hello,

    Can AdMob displays ad in push notification? Or can Unity3d using some inside billing system?
     
  35. electricseed

    electricseed

    Joined:
    Sep 23, 2012
    Posts:
    17
    I think this is quite off-topic here. Please use the android sub-forum for such questions.
    (no, admob does not do push notifications, you could use a service like http://www.airpush.com/ for that.)
     
  36. potkpot

    potkpot

    Joined:
    Mar 8, 2013
    Posts:
    17
    Than how about create new thread about making LWP? Not technical uni2lwp feature and issues, only creative moments in working projects.
     
  37. invisiblesense

    invisiblesense

    Joined:
    Jan 21, 2013
    Posts:
    41

    Thank you Shinx, you're very helpful! Also, thanks for the new version (1.2b).

    Regards
     
  38. luvcoolstuff

    luvcoolstuff

    Joined:
    Dec 19, 2012
    Posts:
    29
    Last edited: Apr 13, 2013
  39. rdias

    rdias

    Joined:
    Oct 9, 2012
    Posts:
    7
    shinx, do you have any forecast about solving the ringtone volume issue?
     
  40. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
  41. feracon

    feracon

    Joined:
    Mar 4, 2013
    Posts:
    84
    I built the test scene that came with the plugin, directed the plugin to the SDK and after importing the project to eclipse i had the three errors below:


    The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project PlugInTest


    The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files PlugInTestSettings.java /PlugInTest/src/com/DKP/PlugInTest line 1 Java Problem


    Unable to resolve target 'android-14' PlugInTest Unknown Android Target Problem


    Any idea whats going on?
     
  42. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Not yet. This is proving to be more difficult than I initially thought. Without modifying Unity jar file (classes.jar) I don't think it's possible to fix this... at least I still haven't found a way :(




    Please make sure that you have the latest version of Eclipse installed. Also check if you are using at least JAVA SDK 1.6. and Android SDK 4.0 (API 14).
    After all that, in Eclipse, clean you project (Project->Clean...).

    If you are still having problems please contact me by email (mirage.unity@gmail.com) and I will help you in more detail.
     
  43. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295


    Really liked both live wallpapers :) Just one question to luvcoolstuff and one suggestion Caliber.

    luvcoolstuff, home switch didn't worked on my device. Did you disabled it ?

    Caliber, your live wallpaper is still using the uni2LwP default icon. Android users normally download live wallpapers with pretty icons :)
     
  44. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    O-o I changed the icon in unity and such. I don't know how to change it in eclipse, perhaps that could be something that is automagically done with uni2lwp as well? I changed the icon, the hd image, and everything in unity. T_T I just don't know how otherwise.
     
  45. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    You have to manually changed it in Eclipse.
    Open your Eclipse project. Locate the folder "res/drawable". Inside you will find a file "icon.png". Replace it with your own :)


    Edited:
    Yes. Next version :)
     
    Last edited: Apr 15, 2013
  46. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Just an idea:

    If you have an Android device that's very fast (ex. Galaxy S3) and you are having issues with the "Emulated Swipe" you can try changing the swipe threshold velocity. In Eclipse, open the file "GestureLstr.java" and you should see this:

    Code (csharp):
    1. private static final int SWIPE_MIN_DISTANCE = 6;
    2. private static final int SWIPE_MAX_OFF_PATH = 125;
    3. private static final int SWIPE_THRESHOLD_VELOCITY = 100;

    now, change the value 100 to 25 (or less) and see if that works for you :)

    Code (csharp):
    1. private static final int SWIPE_THRESHOLD_VELOCITY = 25;
     
  47. luvcoolstuff

    luvcoolstuff

    Joined:
    Dec 19, 2012
    Posts:
    29
    Thanks, I don't know what home switch does. I thought it was for switching camera locations in unity, since the view you see is all the graphic I have, so I guess I deleted that part of code. Do you think I should add it back?
     
    Last edited: Apr 16, 2013
  48. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Just because you complained... Icon is now fixed (whenever the play store feels like updating it that is).

    I also added a frames per second option, so people can lower it to try and save battery.

    Lastly, I added a link to my user profile on the play store, so people can find other things I end up making. That was a little more tricky then I thought it would be since I don't know the base android programming. For those that want to do the same, here:
    Code (csharp):
    1.  
    2. <Preference
    3.         android:summary="@string/linkSummary"
    4.         android:title="@string/linkTitle">
    5.         <intent
    6.             android:action="android.intent.action.VIEW"
    7.             android:data="https://play.google.com/store/apps/developer?id=Caliber+Mengsk"
    8.         />
    9.     </Preference>
    10.  
    Add that to the wallpaper_settings.xml and change where it says "Caliber+Mengsk" to your play store user id. After that, just change the linkSummary and linkTitle to your own strings. (or you could just add them to your strings.xml.)


    Lastly, Another suggestion to add to uni2lwp is to update the version name and version code from Unity. I didn't realize I had to change that in the manifest file when updating it, so I had to re-export from eclipse after updating that.
     
  49. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    I probably named it wrong ... home switching isn't the best name for it. Perhaps Homescreen panning or swiping between homescreens are better fits.

    Should you add it back ? If the view that we see is all the graphics you have, then I don't think you should add it back.




    I thought of adding that feature but at the time it didn't make sense to me because a lot of developers just need to change the java code without changing anything in Unity. However, I can probably add it too on the next release as an option ...
     
  50. feracon

    feracon

    Joined:
    Mar 4, 2013
    Posts:
    84
    In case anyone has similar problems to me, here's how I fixed them.


    ERROR: The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project

    ERROR: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

    ERROR: Unable to resolve target 'android-14'


    -Right click on project and go Android Tools>Fix Project Properties
    -Go Project>Clean...

    This should return the R.java which was missing and causing errors.
     
Thread Status:
Not open for further replies.