Announcement

Collapse
No announcement yet.

DEVICE Brightness

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    DEVICE Brightness

    Hello, I need to control de android (and ios) device brightness to get the most intense white the device can have. How can I control this? Is there any way to do it in Blueprints? If not, is there a way to do it in C++?

    Thank you!

    #2
    You need to do this in Java using JNI calls. Something like this:

    Code:
     
     WindowManager.LayoutParams params = getWindow().getAttributes(); params.screenBrightness = 255; getWindow().setAttributes(params); getWindow().addFlags(WindowManager.LayoutParams.FLAGS_CHANGED);
    Brightness above can be 0 to 255.

    Comment


      #3
      Thank you Chris, I will check how to do the JNI calls for Java, and test it...

      Comment


        #4
        Originally posted by Chris Babcock View Post
        You need to do this in Java using JNI calls. Something like this:

        Code:
        WindowManager.LayoutParams params = getWindow().getAttributes(); params.screenBrightness = 255; getWindow().setAttributes(params); getWindow().addFlags(WindowManager.LayoutParams.FLAGS_CHANGED);
        Brightness above can be 0 to 255.
        Hi Chris, I looked for ways to make a JNI Call, but I only found some posts with problems, and couldnĀ“t find a clear way to do it. I am working with blueprints, but I supposed that I have to make a C++ function, so I can call it from my Blueprint. My problem is how to make that C++ function for making the JNI call you told me.

        Thank you very much.

        Comment


          #5
          You need to have the Java code inserted into GameActivity.java by UPL then have C++ code call your Java code with JNI. If you want to call it from Blueprint you also need to register a UFUNCTION to call your JNI call.

          Comment


            #6
            Thank you.. I will try it..

            Comment

            Working...
            X