Search Unity

Announcing ALPS - Easy live wallpaper integration for Android

Discussion in 'Assets and Asset Store' started by androbeanstudio, Sep 30, 2017.

  1. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Please accept my sincere apologies for the delay !

    I am still investigating the initial problem with background usage. Unfortunately not an easy one to solve without affecting some other functionalities of ALPS. Sorry to ask you for some more time to find a solution for this.

    As for the latest question from you regarding the crash, I am not able to reproduce it using the ALPS demo app. Can you help me by sharing a sample Unity project that reproduces the issue?

    Regards,
    -Androbean.
     
  2. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83

    Hi,

    Please accept my sincere apologies for the delay !

    There exists an API internally to do this, but not yet exposed though ALPS.cs script.
    I will make this available in the next release in 2 weeks time.

    In the meantime, you may try adding the following piece of code to ALPS.cs and use.

    /********************************************************************************************************/
    /**
    * Applications may use this api to programatically launch the live wallpaper preview.
    * Note that live wallpaper preview is a system app and we cannot programatically close it.
    * You can however bring the main activity back on top using the launchMainActivity API.
    */
    public static void launchWallpaperPreview(){
    //Initialize if not already done.
    if (sAlpsInterface == null) {
    init();
    }

    sAlpsInterface.CallStatic("launchWallpaperPreview");
    }
    /********************************************************************************************************/


    Regards,
    -Androbean.
     
  3. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    In the meantime the background issue is being looked at, please find answers to your other questions below.

    [1] The icons used by SupportPreference are at: alps_core\res\drawable-xxhdpi. You can replace them without changing names.

    [2] You can edit the layout for the main activity easily by altering the alps_core\res\layout\alps_activity_layout.xml file. However there is currently no way to attach a new click listener to your newly added views. You will ghave to build a library project of your own in AndroidStudio, build it and then bring the artefacts into your Unity project in order to get this working.

    [3] The layout used by Preference classes are under alps_core\res\layout. You can edit them and customize. ALPS Preference classes use setWidgetLayoutResource API to apply custom layout. If this doesn't suit you, then you may have to create an AndroidStudio library project, build it and then bring the artefacts into your Unity project.

    Please let me know if you think there is a GENERIC way of accommodating these requirements into ALPS so that other users may also benefit.

    Regards,
    -Androbean.
     
  4. okanust

    okanust

    Joined:
    May 22, 2017
    Posts:
    14

    Hi again,

    Your understanding of my question is incorrect. :) I already removed settings button. My problem is simple. I don't want ALPS start on the begining of my application. I want it when I activate a different panel.

    I am sending you some screenshots below.

    Witing for reply ( Not in a very long time please)

    Screenshot1.jpg Screenshot2.jpg Screenshot3.jpg
     
  5. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    This was a difficult one to solve, as most of the approaches had some side effects.

    But I believe, I now have a solution that fixes the issue with out any side effects. This demanded a significant part of UnityPlayer lifecycle handling to be rewritten, but I think it does work !

    It has passed all of my tests so far. I have uploaded the same to asset store, and it will be available as soon as its approved by Unity. The version number is 6.5.

    Kindly try this one, and let me know if you face any further issues. Please don't forget updating your comments in the asset store page if your perception changes.

    Regards,
    -Androbean.
     
  6. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Thanks for attaching the screenshots and explaining the requirement in detail.

    In Android, an app cannot apply live wallpaper without sending the user to the live wallpaper picker, which is a system app that lives outside of our app.

    What we can do in your case would be to start the app in Activity mode instead of live wallpaper mode. This is the default behavior in the bundled demo app as well. Please have a look. But since your app seems like a fullscreen one, you have to adjust the "theme" for the main activity to one of the fullscreen android themes.

    Now, when it is time to give users an opportunity to run the app as a live wallpaper, you can call the newly introduced API in version 6.5(pending for Asset store review as of now) ALPS.launchWallpaperPreview to present the app in live wallpaper mode to the user.

    Again, Android has no means for us to programatically close the live wallpaper preview. What we can do instead is to call the ALPS.launchMainActivity() API that will bring the Activity mode to the foreground.

    Please let me know if you face issues getting this done.

    NOTE: What you are trying to achieve is a very non-trivial thing to do in Android because of the lack of necessary system support. ALPS does a lot of heavy lifting to make this happen controlling the lifecycle of UnityPlayer and the stack of multiple graphics surfaces behind the scenes. I will not be surprised if you hit some more bumps down this road. But, I can assure you that I will support it, even if there may be some occasional delays there doesn't exist a better option than ALPS today for getting this done.

    Regards,
    -Androbean.
     
  7. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Kindly note that I have released an updated version(6.5) to asset store and is pending for review by Unity. It must become available for download in a couple of days.

    This version has improved stability, has fix for background battery usage as well as has new api added to programatically launch the live wallpaper preview.

    Please update and have a look.

    Regards,
    -Androbean.
     
  8. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi

    I have figured out a way for you to attach event listeners to your own newly added views in the Activity layout.

    This can be achieved making use of the ALPS.getContext() API. This api will return the Activity object while the app is in Activity/PreferenceActivity mode. From there, you can use Unity's Java interfacing APIs to get this done.

    I have created a sample code for you. This is tested and is working.

    Code (CSharp):
    1. if(state == ALPS.State.ACTIVITY){
    2.             AndroidJavaObject activity = ALPS.getContext();
    3.             AndroidJavaObject resources = activity.Call<AndroidJavaObject>("getResources");
    4.             AndroidJavaObject packageName = activity.Call<AndroidJavaObject>("getPackageName");
    5.  
    6.             int viewId = resources.Call<int>("getIdentifier", "alps_id_activity_title", "id", packageName);
    7.             AndroidJavaObject view = activity.Call<AndroidJavaObject>("findViewById", viewId);
    8.  
    9.             view.Call("setOnClickListener", new ClickListener());
    10.         }
    The listener can be implemented as"
    Code (CSharp):
    1. class ClickListener : AndroidJavaProxy {
    2.     public ClickListener() : base("android.view.View$OnClickListener") {
    3.     }
    4.  
    5.     public void onClick(AndroidJavaObject view){
    6.         ALPS.showToast("Clicked on title");
    7.     Debug.Log("Clicked on title");
    8.     }
    9. }
    10.  
    Using this approach, you can fullfil requirement [2] as well.

    Regards,
    -Androbean.
     
  9. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi All,

    Starting ALPS 6.5, all ALPS callbacks except onScrollChanged(for performance reasons) are fired in a non-Unity thread. This is necessary in order to be able to make callbacks from Preference Activity and other cases while UnityPlayer is paused.

    This means that apps must not try to directly change/mutate their Unity Scene objects from the callback methods (Except onScrollChanged).

    ALPS 6.6 has added a new API "public static void runInUpdate(Action action)" that apps may use to execute pieces of code in the Unity's thread. Please have a look at the demo code(ALPSDemoListener.onScrollChanged & ALPSDemoListener.applyAllPreferences methods) for sample usage.

    ALPS 6.6 is under review by Asset store, and should be available in a couple of days. Kindly update and refactor scene mutation code.

    Please get back to me if you have questions.

    Regards,
    -Androbean.
     
    nasos_333 likes this.
  10. pietrina

    pietrina

    Joined:
    Aug 22, 2015
    Posts:
    15
    Thanks Androbean for update 6.5 I tested it and works, no lost EGL context present or lost surface. Error loop is gone.
    Thanks!
     
  11. pietrina

    pietrina

    Joined:
    Aug 22, 2015
    Posts:
    15

    This is interesting code Androben, may be useful in the future. Thanks.
    I waited long time for your answer for my questions, and just not to waste time I returned to Android Studio and wrote my own Libraries and solved my problems from questions.
    But thanks for updates and answer.
     
  12. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Thanks a lot for verifying, and confirming.
    I really appreciate updating the comment in Asset store as well. Very professional !

    Thanks,
    Androbean.
     
  13. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    That is what happens when you keep good developers waiting ;p

    Once again, sorry for the delay, my day job is a little unforgiving at times !
    -Androbean.
     
  14. Clow_Lead

    Clow_Lead

    Joined:
    Dec 4, 2017
    Posts:
    11
    Can I show the unity scene at preference activity?
    or preference setting at Unity GUI?

    I copied the surfaceView from alps_activity_layout and added it to alps_preference_activity_layout. However, SurfaceView only shows a black screen and does nothing.

    PS. ReadMe.pdf(ver. 6.6) doesn't contains previous api documents. it just update logs.
     
    Last edited: Jan 3, 2020
  15. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Thanks for posting here.

    As of now, you can have the rendering on live wallpaper, or on the surface inside the AlpsActivity.
    However, if you want to show a preview to users while they edit settings, you have the following options with ALPS 6.6

    1] Use AlpsActivity as your preference activity. You can edit its layout file and add a PreferenceFragment to get this working. Please let me know if you face any difficulty with this approach, as this hasn't been tried earlier. You use the ALPS callbacks to detect when user has pressed the settings button and launch AlpsActivity.

    2] Build your own preference screen in Unity itself, and use the ALPS callbacks to detect when user has pressed the settings button. The preferences may be applied using Unity's inbuild apis or various setPreferenceXXX apis from ALPS.cs. Note that mixing Unity preference apis and ALPS preference apis hasn't been tested.

    Please let me know if you face difficulties with any of these approaches.

    I see that it can make your life easier if PreferenceActivity itself can support this. I will add this support in the next release; but in the meantime, please try the above mentioned approaches.

    Regards,
    -Androbean.
     
  16. ArthurUS83

    ArthurUS83

    Joined:
    Jan 13, 2016
    Posts:
    25
    That Will be great if we can make settings screen by using Unity UI.
     
  17. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    I see no reason not to be able to do so.
    Please let me know if you face any difficulties in regard to this.


    Regards,
    -Androbean.
     
  18. Clow_Lead

    Clow_Lead

    Joined:
    Dec 4, 2017
    Posts:
    11
    MainActivity as preference activity is works.
    I tried Spinner with onItemSelectedListener and get/set selected value and it works well. I expect other components work too.

    but has some bugs.

    case back button
    1. call launchMainActivity at onPreferencesOpened or onStateChanged.
    2. press back button At MainActivity.
    3. ALPS relaunch MainActivity.
    loops (preference Activity open -> launchMainActivity -> main Activity -> back button will open preference -> call launchMainActivity again.)
    repeatly pressing back button will sometimes showing preference activity.

    case start with mainActivity
    1. Start ALPS with AppIcon
    2. launching MainActivity.
    3. not work components.
    4. preference or Preview Wallpaper and relaunch mainActivity.
    5. works components.
    components Listener is set at onStateChanged.
    but it wont call launching.
    alps_config_start_with_activity to false in alps_config.xml will temporary solution.
    It would be nice to have a way to check the current activity state.
     
    Last edited: Jan 14, 2020
  19. ntjson406

    ntjson406

    Joined:
    Aug 3, 2018
    Posts:
    8
    FYI, using the demo scene with ALPS 6.6 on my tested device (Note 8, Android v.9) the preview settings screen on the phone locks up, blacks-out when I set the FPS and Resolution to max. Also the Readme.pdf in the assets folder only has three entries. Is the API supposed to be in this file?
     
  20. woodsun

    woodsun

    Joined:
    Sep 16, 2013
    Posts:
    4
    Hi androbean.
    Thank you for nice App. I am enjoying use it.

    Could you explain how to use AdMob for interstitial. I am beginner about android and native part.
     
  21. Clow_Lead

    Clow_Lead

    Joined:
    Dec 4, 2017
    Posts:
    11
    See the ALPSDemoCube.cs and ALPSDemoIAPListener.cs, ALPSDemoListener.cs it will help you.

    ALPS.adMobInitialize()
    ALPS.adMobShowInterstitial()

    these functions works for admob interstitial.

    non-edited demo build will not work interstitial Ads because IAP not setted.
    ALPDemoIAPListener.cs:15 will throw exception.
    can't reach 27th line.
     
    woodsun likes this.
  22. woodsun

    woodsun

    Joined:
    Sep 16, 2013
    Posts:
    4
    Thank you Clow_Lead!! It helped a lot. I am going to figure it out.
     
  23. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Is it possible to start the Unity App both as a normal app and as a Live Wallpaper?
    I would like to make an app where you can choose between different wallpapers and set them as a background.

    • Is there a way to find out if the app is running/was started as a normal app or as a wallpaper? (and possibly load a different scene based on that)
    • Is there an API in the Plugin from within Unity to set itself as a wallpaper?
     
  24. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83

    Hi,

    Thanks for your patience !

    I have just finished adding Preview into PreferenceActivity. This will be released as version 6.7 today, and the same shall get approved within a couple of days.

    PSB a screenshot of this in action.
    device-2020-01-29-082212.png device-2020-01-29-082236.png


    Regards,
    -Androbean.
     
  25. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Sorry for the delay !

    ALPS 6.7 will be released today and will be available for you in a couple of days. Kindly check the freezing issue once again in this updated version. Also please let me know if this happens with the bundled demo project itself.

    About ReadMe.pdf, it is meant to help you setup the project and add customizations. It doesn't list all the available APIs which a fairly long list. For API reference, please take a look at ALPS.cs file. It is well commented code and all APIs carry documentation.

    Please get back to me of you have more questions.

    Regards,
    -Androbean.
     
  26. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Sorry for the delay !
    Thanks @Clow_Lead for the comments.

    Please post here, or email me if you need more help.

    Regards,
    -Androbean.
     
  27. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    This is absolutely possible with ALPS.

    ALPS can be started as a live wallpaper from the live wallpaper picker, or as an Activity by clicking on the app icon from app drawer.

    It is possible to detect current mode using the ALPS.getState() api.
    You can switch to live wallpaper from Activity using the ALPS.launchWallpaperPreview() api.
    You can switch to main Activity from live wallpaper using the ALPS.launchMainActivity() api.

    Please post here, or email me if you need more help.

    Regards,
    -Androbean.
     
  28. neojzs

    neojzs

    Joined:
    Oct 11, 2012
    Posts:
    3
    Hi,

    I used 6.7

    Admob is not working.
    I have already read readme.pdf
     
  29. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    AdMob works fine in my test devices.

    Kindly check the following:
    1] Did you follow the ReadMe.pdf exactly?
    2] Have you tried the bundled demo app only with no modifications?

    If still not working, please share some more details on what is going wrong such as the log, error message, or a video showing the issue to androbean@gmail.com, and I will be happy to help.

    Thanks and regards,
    -Androbean.
     
  30. Clow_Lead

    Clow_Lead

    Joined:
    Dec 4, 2017
    Posts:
    11
    Hello androbean.

    I understand that in order to control the Scene in the preference it must be run via the ALPS.runInUpdate() function.
    that function works enqueue the action. and action was invoke at ALPS.Update() but nowhere to dequeue the action.
    the action enqueued at ALPS.runInUpdate() function is execute everyframe.

    in Demo, if setting change twice to text and color will change twice everyframe.

    In my case solved it replace
    Code (CSharp):
    1.             foreach (Action action in queue)
    2.             {
    3.                 action.Invoke();
    4.             }
    to
    Code (CSharp):
    1.             while(queue.Count > 0)
    2.             {
    3.                 queue.Dequeue().Invoke();
    4.             }
    in ALPS.Update() function.
    but since I think this is a bug, I report it.
     
  31. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Thanks a lot for pointing this out, with clear information and a possible fix !

    I will release an update in a couple of days.

    Thanks and regards,
    -Androbean.
     
  32. neojzs

    neojzs

    Joined:
    Oct 11, 2012
    Posts:
    3
    Hi

    It's my mistake. I'm sorry.

    Now ads displayed. but this plugin has some bugs.

    - The touch position is reversed in wallpaper / preview mode.
    - Unity Ads is not work.

    It would be better if this was fixed.

    Anyway, I made this app using your plug-in. Thank you

    https://play.google.com/store/apps/details?id=com.terranova.vfxlive
     
  33. Clow_Lead

    Clow_Lead

    Joined:
    Dec 4, 2017
    Posts:
    11
    Hi, androbean.

    I founded some minor bug.
    Black screen appear in wallpaper preview at specific control
    here is reproduce step
    1. Open Wallpaper Preview.
    2. press Home button at Wallpaper Preview state.
    3. press Menu button at home screen.
    4. select Wallpaper Preview window.
    5. wallpaper preview is black screen.

    In the black screen state, the following error log continues.
    Code (Boo):
    1. 02-10 17:25:09.971 851 942 Error BufferQueueProducer: [com.androbean.android.unityplugin.alps.AlpsWallpaperService#2] connect: BufferQueue has been abandoned
    2. 02-10 17:25:09.972 12108 12140 Error libEGL: eglCreateWindowSurface: native_window_api_connect (win=0x71a9aa8010) failed (0xffffffed) (already connected to another API?)
    3. 02-10 17:25:09.972 12108 12140 Error libEGL: eglCreateWindowSurface:720 error 3003 (EGL_BAD_ALLOC)
    4. 02-10 17:25:09.974 12108 12140 Error Unity: [EGL] Failed to create window surface: EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation.
    5. 02-10 17:25:09.974 12108 12140 Error Unity:
    6. 02-10 17:25:09.974 12108 12140 Error Unity: (Filename: ./Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 164)
    7. 02-10 17:25:09.974 12108 12140 Error Unity:
    8.  
     
  34. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Thanks a lot for the update. It really helps !

    About touch position, the Y axis in ALPS is always increasing from top to bottom in all the modes. Please check once again and let me know if the see it different.

    Unity ads cannot work while an app is running as a Service(Live wallpaper) instead of Activity(Game). That is why ALPS has Admob support build it into. Please make use of this feature.

    Also, thanks for sharing the link to your app, it looks pretty !

    Please get back if you need more help.

    Thanks and regards,
    -Androbean.
     
  35. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    This is a known issue with latest Android versions.

    I am not sure since which version this behavior has changed. Basically, the Android platform won't send some SurfaceView callbacks(which it should have) making the app unaware of the transitions involved during this sequence.

    You can see the same issue happening with any 3D wallpapers in the PlayStore.

    That being said, it is entirely possible that I am wrong, and if you think so, please post here and let me check further.

    Thanks and regards,
    -Androbean.
     
  36. ArthurUS83

    ArthurUS83

    Joined:
    Jan 13, 2016
    Posts:
    25
    Hello
    -Androbean
    Can You Help me Pleas with following questions?
    How can I for example not just cube but multiple objects plus selecting in settings?
    How can i Enable or Disable game object in Settings?
    How can i Enable or Disable script that attached on game object?
    And Finally Can You Make Double Tap Optional?
    Many Thanks :)
     
  37. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Thanks for posting here !

    ALPS core files are under the folder "Assets\ALPS\Core". All files in "Assets\ALPS\Demo" are application files (Demo app in this case).

    It is totally up to you on what is done in your applications files. There is even no need to use the files inside "Assets\ALPS\Core" to create an ALPS app.

    All of your questions can be addressed by editing the files in "Assets\ALPS\Demo" if you are using them. Or if you are not using them, then it comes down to the code in your own files.

    Regards,
    -Androbean.
     
  38. ArthurUS83

    ArthurUS83

    Joined:
    Jan 13, 2016
    Posts:
    25
    Hello Androbean!
    Demo it's nice example for me. All I want to do , to choose between two objects for example between cube or sphere.
    Can You give me some example? , how to do that?
    Many Thanks !!
     
  39. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Please have a look at how "SpinnerPreference" is used in the Demo app to allow user to make a selection from among a set of predefined options. In your case, based on this selection, you will show/hide your cube/sphere.

    Hope it helps.
    -Androbean.
     
  40. ArthurUS83

    ArthurUS83

    Joined:
    Jan 13, 2016
    Posts:
    25
    Thanks for replay Androbean ! slowly getting used to it...
     
  41. ggonzo47

    ggonzo47

    Joined:
    Jul 2, 2015
    Posts:
    2
    Hi Androbean,

    I have a feature request. Can you prove a boolean switch in the next release so that I can hide the "settings" button in the demo?

    Thanks.
     
  42. DoMath

    DoMath

    Joined:
    Oct 20, 2016
    Posts:
    4
    Hi Androbean

    Please what is the best way (step by step) in order to have 3 wallpapers for select? Can i use many scenes or only one scene with disable objects?

    thanks

    Renzo
     
  43. Clow_Lead

    Clow_Lead

    Joined:
    Dec 4, 2017
    Posts:
    11
    Hi Androbean.

    I have problem at Unity default feature.
    I want Oauth Login Service.
    so I did import ALPS on Oauth login sample project.
    It seem won't launch web browser.
    I checked Application.OpenURL() on only ALPS. it nothing happened. not open browser and no error, no exception throwed.
    I can't understand why this happening occurred. I need help.

    -----
    it did browser open with ALPS.sendIntent().

    I successed return to app by url scheme.
    but can't recieve getData from Intent.
    Code (CSharp):
    1. var context = ALPS.getContext();
    2. AndroidJavaObject intent = context.Call<AndroidJavaObject>("getIntent");
    3. AndroidJavaObject intentUri = intent.Call<AndroidJavaObject>("getData");
    intentUri is returned Null
    how can I recieve intent data from url scheme with ALPS?

    -----
    when activity change was too fast, return null from ALPS.getContext().
    and when return to ALPS Activity from home screen or other activity, sometimes get Data successfully.

    it used OnApplicationFocus, but sometimes not calling that function.
     
    Last edited: Mar 15, 2020
  44. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Have a few questions:
    1) Is there a specific reason why ALPS is setting FPS to 40 and resolutionScale to 0.67?
    upload_2020-3-29_8-51-54.png

    2) The plugin is overwriting the AndroidManisfest and mainTemplate.gradle - my project is already quite big with many Android plugins. Could you give a more detailed guide regarding which fields should I modify in these files? Also the mainTemplate.gradle is using an old format which is not supported in Unity 2019.3

    3) I already have AdMobs in my project, what would be the steps to import ALPS without any additional libraries (admob and IAPs)?
     
  45. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    What I'm trying to achieve is have the Unity Activity start when you open the app from the icon and a separate Wallpaper Activity start when you open it from the wallpaper settings.
    And I would like to be able to start the WallpaperService from the Unity Activity (wallpaper selection screen)
    Right now it seems that the plugin is always starting a Wallpaper service, which makes many of my plugins not work.
     
    Last edited: Apr 4, 2020
  46. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Sorry for the delay.

    I believe it is not possible to programatically enable/disable the settings button in Android's live wallpaper preview.

    Instead, you can try to display different settings screen based on your conditions. You can achieve this using the ALPS.
    setPreferenceLayoutName API

    Regards,
    -Androbean.
     
  47. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Sorry for the delay.

    I would proceed with multiple Unity scenes and then programatically selecting between them.

    Note that you could make use of "SpinnerPreference" to let user choose between some options. Please have a look at the demo code to understand how to use "SpinnerPreference".

    Regards,
    -Androbean.
     
  48. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Sorry for the delay.

    I think it would be better for you if ALPS had a ALPS.startActivityForResult() API. Note that this can work only when you are in the ALPSActivity. Please let me know if think this can help you.

    Regarding getContext being null, please let me know the time when you are calling the getContext api. Ideally, it must be on the "void onStateChanged(State state);" callback so that your app remains in sync with ALPS.

    Regards,
    -Androbean.
     
  49. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Sorry for the delay.
    Please see answers for your questions below:

    [1] These numbers are defaults which seemed good for many wallpapers. You are free to choose what is appropriate for your live wallpaper keeping battery usage in mind.

    [2] AndroidManisfest is generated by merging multiple of them from all the plugins added to the project. You can try to add a dummy plugin folder with its manifest holding your contents. This way your AndroidManisfest will also get merged during the build.

    Regarding the gradle file, there is only a small edit that needs to be done. Please see the ReadMe.pdf for the details.

    [3] Only the alps_admob and alps_billing modules use dependencies. If you are not using these modules, just delete them from the project and also delete the dependencies added in the gradle file for these modules(refer ReadMe.pdf) and you should be good to go.

    Please write back if you need more clarification.

    Regards,
    -Androbean.
     
  50. androbeanstudio

    androbeanstudio

    Joined:
    May 2, 2017
    Posts:
    83
    Hi,

    Sorry for the delay.

    When you tap on the app icon from the app tray of your launcher, ALPSLauncherActivity is what is started. It checks the "alps_config_start_with_activity" boolean value(defined in alps_config.xml in alps_app) and launches either the ALPSActivity which displays the visible UI with the description of ALPS along with a live wallpaper preview. Note that no live wallpaper service is started even though you are seeing a preview. It is running on a SurfaceView that is managed by ALPS itself.

    If this boolean doesn't exist or if its value is false, then ALPSLauncherActivity launches the system's live wallpaper preview. This will start the live wallpaper service.

    Please write back, if your observation is not consistent with this information, or if you need more clarification.

    Regards,
    -Androbean.