Announcement

Collapse
No announcement yet.

Augmented Reality for UE4

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

    Hello,

    Try to add new permissions to the ARToolkitPlugin_APL.xml located in:
    SampleProject\Plugins\ARToolkitPlugin\Source\ARToolkitPlugin\ARToolkitPlugin_APL.xml

    Currently it has the following:

    <androidManifestUpdates>
    <addPermission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
    <addPermission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <addPermission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <addPermission android:name="android.permission.CAMERA" />
    <addPermission android:name="android.permission.FLASHLIGHT"/>
    <addFeature android:name="android.hardware.camera" />
    <addFeature android:name="android.hardware.camera.autofocus" android:required="false"/>
    <addFeature android:name="android.hardware.camera.flash" android:required="false"/>
    </androidManifestUpdates>


    Can you please send me your logs when you get the white screen ? Does it happen only if you install it from google play?



    Originally posted by WillLeap View Post
    I have narrowed the problem down to the permission changes in Android SDK 23+. If I go into settings -> apps -> myapp -> permissions and enable both the camera and storage, then my app will load and the camera works. I tried to request android.permission.CAMERA and android.permission.READ_EXTERNAL_STORAGE at runtime using the Request Android Permission blueprint node before ARToolKit Component Init inside of the ARToolkitBaseAdvanced blueprint, I get a white screen until i restart the app at which point everything works correctly. I'm guessing I need to call the permission request even earlier but I'm not sure where to put it or if it needs to be done somewhere in code.

    AdamHorvath, any ideas on how to solve this?
    AR plugin for UE4
    AR Virtual Mirror plugin for UE4
    Red Alert 2 VR remake
    Armed Island VR RTS

    Comment


      Originally posted by AdamHorvath View Post
      Hello,

      Try to add new permissions to the ARToolkitPlugin_APL.xml located in:
      SampleProject\Plugins\ARToolkitPlugin\Source\ARToolkitPlugin\ARToolkitPlugin_APL.xml

      Currently it has the following:

      <androidManifestUpdates>
      <addPermission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
      <addPermission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
      <addPermission android:name="android.permission.READ_EXTERNAL_STORAGE" />
      <addPermission android:name="android.permission.CAMERA" />
      <addPermission android:name="android.permission.FLASHLIGHT"/>
      <addFeature android:name="android.hardware.camera" />
      <addFeature android:name="android.hardware.camera.autofocus" android:required="false"/>
      <addFeature android:name="android.hardware.camera.flash" android:required="false"/>
      </androidManifestUpdates>


      Can you please send me your logs when you get the white screen ? Does it happen only if you install it from google play?


      This was happening when launching from within the editor, publishing and deploying using the install script, and on the Google Play Store. I found a few posts talking about the storage issue and it sounds like that might only be related to certain Samsung phones which is what I am using to test.

      The problem ended up being that Android requires you to request at run time the permissions to access the camera and storage when using SDK 23 or higher. The Google Play store requires a minimum target SDK of 26 so the app was never requesting permission since it has to be added in code and not just the manifest like it use to be prior to SDK 23.

      I was on the right track but didn't realize the blueprint node Request Android Permissions did the request asynchronously so the app wasn't waiting for the user to make a choice before continuing initializing the plugin. That blueprint node returns a callback proxy object that allows you to bind an event. Calling the ARToolkit plugin's Init function and setup in my bound event was then throwing an error saying the plugin code needed to run on the game thread.

      I got it all working by using a boolean variable to determine if the user had given all of the proper permissions yet and then have it check on the tick event. Once a user gives permission the next call to tick allows the plugin init code to run once and it's in the correct thread so it works.

      Comment


        Hello Adam This plug-in does not support Chinese, does it?
        I put the published files in the Chinese directory. Then he could not find the camera.

        Comment


          Unfortunately not. I could not managed to use directories with special characters,

          Originally posted by 少爷骑龙到你家 View Post
          Hello Adam This plug-in does not support Chinese, does it?
          I put the published files in the Chinese directory. Then he could not find the camera.
          AR plugin for UE4
          AR Virtual Mirror plugin for UE4
          Red Alert 2 VR remake
          Armed Island VR RTS

          Comment


            Thanks for the solution, and the detailed explanation! I'll do some tests with this, and update the sample projects accordingly.

            Originally posted by WillLeap View Post

            This was happening when launching from within the editor, publishing and deploying using the install script, and on the Google Play Store. I found a few posts talking about the storage issue and it sounds like that might only be related to certain Samsung phones which is what I am using to test.

            The problem ended up being that Android requires you to request at run time the permissions to access the camera and storage when using SDK 23 or higher. The Google Play store requires a minimum target SDK of 26 so the app was never requesting permission since it has to be added in code and not just the manifest like it use to be prior to SDK 23.

            I was on the right track but didn't realize the blueprint node Request Android Permissions did the request asynchronously so the app wasn't waiting for the user to make a choice before continuing initializing the plugin. That blueprint node returns a callback proxy object that allows you to bind an event. Calling the ARToolkit plugin's Init function and setup in my bound event was then throwing an error saying the plugin code needed to run on the game thread.

            I got it all working by using a boolean variable to determine if the user had given all of the proper permissions yet and then have it check on the tick event. Once a user gives permission the next call to tick allows the plugin init code to run once and it's in the correct thread so it works.
            AR plugin for UE4
            AR Virtual Mirror plugin for UE4
            Red Alert 2 VR remake
            Armed Island VR RTS

            Comment


              any chance you could increase the types of barcodes? such as AR_MATRIX_CODE_5x5 instead of 3x3. I want to inventory a lot of items.

              Comment


                Hi everyone!,

                I need help please. I try to oppen my ARapp on my LgG4, but the app crash when i will open it. The msn is "error unfortunately [App] has stopped". I test the proyect on my pc with webcam and its run good. I was testing too with UNREAL4AR app, and its run good. Its should be the same app right?

                I have got paid Version.

                Ty for all!
                Last edited by ChipironBoy; 09-03-2018, 07:21 AM.

                Comment

                Working...
                X