# \[Plugin\] Android Camera

**URL:** <https://forums.unrealengine.com/t/plugin-android-camera/69320>\
**Category:** C++\
**Tags:** unreal-engine, Engine-Source-Code, GitHub, Engine-Source-GitHub\
**Created:** [July 18, 2016, 9:41pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320 "2016-07-18T21:41:47Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![MasterOfShapes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MasterOfShapes](https://forums.unrealengine.com/u/MasterOfShapes)\
**Post date:** [January 2, 2017, 7:58pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/23 "2017-01-02T19:58:35Z")

</div>

Has anyone been able to get this to work on Unreal 4.14.1

---

<div class="post-metadata">

**Author:** ![ZkarmaKun](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zkarmakun/32/1194545_2.png) [@ZkarmaKun](https://forums.unrealengine.com/u/ZkarmaKun)\
**Post date:** [January 3, 2017, 4:26pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/24 "2017-01-03T16:26:39Z")

</div>

Hi, everybody, I just update the full project for 4.14.1 enjoy

---

<div class="post-metadata">

**Author:** ![TroJanVirusLive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TroJanVirusLive](https://forums.unrealengine.com/u/TroJanVirusLive)\
**Post date:** [January 4, 2017, 3:15pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/25 "2017-01-04T15:15:44Z")

</div>

Quick question, I have set up a cube exactly the way you have. Everything seems to be in order but my camera doesn’t seem to be triggering at all?

_edit_ After posting this I noticed something very odd.

If I tab out of my packaged android project using the same set-up you have, and tab back into the app, for less than a second (only sometimes), the camera works and then defaults back to the basic cube material. Unplugging my usb cable and plugging it back in also flickers the camera activation momentarily for some reason.

Any ideas?  
note: I’ve chosen to use sdk 21. Is this wise for my HTC One M8?

---

<div class="post-metadata">

**Author:** ![xmak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xmak](https://forums.unrealengine.com/u/xmak)\
**Post date:** [January 4, 2017, 4:09pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/26 "2017-01-04T16:09:52Z")

</div>

Great work it will be very usefull!

The sample projects that are shipped with the plugin don’t have a material chosen in CreateDynamicMaterialInstance node od the CameraCUBE blueprint. So in order for this sample projects to work you have to select Cube\_mat as SourceMaterial for CreateDynamicMaterialInstance node.

Also, in UE 4.14 it doesn’t work when launched from the Project Launcher in editor, but only when it’s packaged. When trying to launch it with the Project Launcher, it starts te game on the smartphone, but it gets stuck on the splash screen with this in the error log:

[2017.01.04-16.01.40:840] 0]LogCook:Display: Mobile HDR setting 1  
[2017.01.04-16.01.40:964] 0]LogCook:Display: Done creating registry. It took 0.11s.  
[2017.01.04-16.01.42:960] 0]LogCook:Display: Sandbox cleanup took 1.986 seconds  
[2017.01.04-16.01.42:993] 0]LogCook:Display: Generated asset registry size is 848.62kb  
[2017.01.04-16.01.43:122] 0]LogFileServer:Warning: Unreal Network File Server starting up…  
[2017.01.04-16.01.43:141] 0]LogInit: WinSock: I am DESKTOP-2B2O56V (192.168.56.1:0)  
[2017.01.04-16.01.43:154] 0]LogFileServer:Display: Unreal Network File Server is ready for client connections on 0.0.0.0:41899!  
[2017.01.04-16.01.43:164] 0]LogCookCommandlet:Display: GC…  
\<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
\<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
\<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
\<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
\<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
\<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…

Any clues why it doesn’t work?

---

<div class="post-metadata">

**Author:** ![ZkarmaKun](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zkarmakun/32/1194545_2.png) [@ZkarmaKun](https://forums.unrealengine.com/u/ZkarmaKun)\
**Post date:** [January 5, 2017, 12:05am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/27 "2017-01-05T00:05:53Z")

</div>

;645938]  
Quick question, I have set up a cube exactly the way you have. Everything seems to be in order but my camera doesn’t seem to be triggering at all?

_edit_ After posting this I noticed something very odd.

If I tab out of my packaged android project using the same set-up you have, and tab back into the app, for less than a second (only sometimes), the camera works and then defaults back to the basic cube material. Unplugging my usb cable and plugging it back in also flickers the camera activation momentarily for some reason.

Any ideas?  
note: I’ve chosen to use sdk 21. Is this wise for my HTC One M8?  
[/QUOTE]

that sound weird, you are not turn it off and on? for some reason?, give me some log, otherwise is difficult know what is happen

---

<div class="post-metadata">

**Author:** ![ZkarmaKun](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zkarmakun/32/1194545_2.png) [@ZkarmaKun](https://forums.unrealengine.com/u/ZkarmaKun)\
**Post date:** [January 5, 2017, 12:09am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/28 "2017-01-05T00:09:45Z")

</div>

> [@xmak;645970](#):
>
> Great work it will be very usefull!
> 
> The sample projects that are shipped with the plugin don’t have a material chosen in CreateDynamicMaterialInstance node od the CameraCUBE blueprint. So in order for this sample projects to work you have to select Cube\_mat as SourceMaterial for CreateDynamicMaterialInstance node.
> 
> Also, in UE 4.14 it doesn’t work when launched from the Project Launcher in editor, but only when it’s packaged. When trying to launch it with the Project Launcher, it starts te game on the smartphone, but it gets stuck on the splash screen with this in the error log:
> 
> [2017.01.04-16.01.40:840] 0]LogCook:Display: Mobile HDR setting 1  
> [2017.01.04-16.01.40:964] 0]LogCook:Display: Done creating registry. It took 0.11s.  
> [2017.01.04-16.01.42:960] 0]LogCook:Display: Sandbox cleanup took 1.986 seconds  
> [2017.01.04-16.01.42:993] 0]LogCook:Display: Generated asset registry size is 848.62kb  
> [2017.01.04-16.01.43:122] 0]LogFileServer:Warning: Unreal Network File Server starting up…  
> [2017.01.04-16.01.43:141] 0]LogInit: WinSock: I am DESKTOP-2B2O56V (192.168.56.1:0)  
> [2017.01.04-16.01.43:154] 0]LogFileServer:Display: Unreal Network File Server is ready for client connections on 0.0.0.0:41899!  
> [2017.01.04-16.01.43:164] 0]LogCookCommandlet:Display: GC…  
> \<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
> \<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
> \<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
> \<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
> \<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…  
> \<\>c\_\_DisplayClass62\_0.\<RunClientWithServer\>b\_\_0: Waiting for server to start…
> 
> Any clues why it doesn’t work?

Not material in place indeed, to create the instance is choosing the first index material, in this case the unique material attached to the cube, and Let me see that error from the launcher, I never tried before jaja, just for package

---

<div class="post-metadata">

**Author:** ![ZkarmaKun](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zkarmakun/32/1194545_2.png) [@ZkarmaKun](https://forums.unrealengine.com/u/ZkarmaKun)\
**Post date:** [January 5, 2017, 2:24am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/29 "2017-01-05T02:24:18Z")

</div>

@xmak and @ you are right guys, and your problem was the same, for some reason UE RHI system is messing with the color per pixel convertion, that make the texture unhappy, and it was causing the flickering in launch mode, please download the new version and test again, I changed my update method, must be work now

Cheers

---

<div class="post-metadata">

**Author:** ![TroJanVirusLive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TroJanVirusLive](https://forums.unrealengine.com/u/TroJanVirusLive)\
**Post date:** [January 5, 2017, 3:10am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/30 "2017-01-05T03:10:04Z")

</div>

> [@ZkarmaKun;646268](#):
>
> @xmak and @ you are right guys, and your problem was the same, for some reason UE RHI system is messing with the color per pixel convertion, that make the texture unhappy, and it was causing the flickering in launch mode, please download the new version and test again, I changed my update method, must be work now
> 
> Cheers

Fantastic, I’ll let you know if the updated 4.14.1 fix indeed fixes things. I too noticed the missing source material input on the node in your example and on the project. I tried entering the cube material and tried without it so I knew it was getting the correct stuff regardless.  
Guess it must just have been he “pixel conversion” you’ve mentioned.

Update soon!

---

<div class="post-metadata">

**Author:** ![xmak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xmak](https://forums.unrealengine.com/u/xmak)\
**Post date:** [January 5, 2017, 4:03am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/31 "2017-01-05T04:03:38Z")

</div>

I have tried it (in UE 4.14.2) and it doesn’t solve the problem, the deployment still gets stuck on “Waiting for server to start…” ☹

---

<div class="post-metadata">

**Author:** ![TroJanVirusLive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TroJanVirusLive](https://forums.unrealengine.com/u/TroJanVirusLive)\
**Post date:** [January 5, 2017, 4:54am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/32 "2017-01-05T04:54:12Z")

</div>

> [@xmak;646294](#):
>
> I have tried it (in UE 4.14.2) and it doesn’t solve the problem, the deployment still gets stuck on “Waiting for server to start…” ☹

Do you have Android SDK installed?

---

<div class="post-metadata">

**Author:** ![TroJanVirusLive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TroJanVirusLive](https://forums.unrealengine.com/u/TroJanVirusLive)\
**Post date:** [January 5, 2017, 8:26am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/33 "2017-01-05T08:26:41Z")

</div>

All is working now! 🙂  
I was also able to edit the android.h file and up the resolution scale and set the fps to 60. Looks great now!  
I have implemented this into VR cardboard and now I have a android camera background with a floating UMG UI that says the time and sways in-reaction to the cameras gyroscope. Augmented V-reality! Fun stuff 😛

---

<div class="post-metadata">

**Author:** ![xmak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xmak](https://forums.unrealengine.com/u/xmak)\
**Post date:** [January 5, 2017, 1:45pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/34 "2017-01-05T13:45:57Z")

</div>

;646304]  
Do you have Android SDK installed?  
[/QUOTE]

Yes I do and I don’t think this is an issue. Everything works fine when I package the project (File-\>Package-Android…) but the described problem occurs when I try to launch the game from the Project Launcher (Window-\> Project Launcher).

---

<div class="post-metadata">

**Author:** ![ZkarmaKun](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zkarmakun/32/1194545_2.png) [@ZkarmaKun](https://forums.unrealengine.com/u/ZkarmaKun)\
**Post date:** [January 5, 2017, 2:56pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/35 "2017-01-05T14:56:59Z")

</div>

hi xmak  
When you are lauching the game is just for debug the current open map in the editor, that might be the cause of your problem, or you are doing something else in you project, your log is talking about server connection, which is diferent topic from the plugin,

either way try to run my simple alone and see if is work

---

<div class="post-metadata">

**Author:** ![xmak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xmak](https://forums.unrealengine.com/u/xmak)\
**Post date:** [January 5, 2017, 5:01pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/36 "2017-01-05T17:01:38Z")

</div>

I found the solution to my problem, it was not related to this plugin, but the problem was in my antivirus firewall which was blocking the port on which Unreal File Server was running.

I have disabled the firewall and now everything works.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4965ef0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4965ef0](https://forums.unrealengine.com/u/anonymous_user_d4965ef0)\
**Post date:** [January 26, 2017, 8:07pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/37 "2017-01-26T20:07:27Z")

</div>

hi karmakun,  
this plugin is working great for me in 4.14.2, thanks again for you hard work. my camera texture looks really blurry, i tried to find androidcamera.h as you recommend but it just has a couple of lines about startup and shutdown. is it possible you changed the location of these variables when you released the latest version? i even searched for some variables like height and width but could not find setting them except in AndroidCamera\_APL.xml. Do I just change it in there every time it says 320, 240 in that xml file?

also, does the resolution of the bitmap in the material that is assigned to the geometry also limit the available resolution of the output? I’d think it would, just checking.

cheers,  
o

---

<div class="post-metadata">

**Author:** ![user\_5e23941dc51dd99e40051e4ee987785bba4c310bfe21c97c6b6e3d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@user\_5e23941dc51dd99e40051e4ee987785bba4c310bfe21c97c6b6e3d](https://forums.unrealengine.com/u/user_5e23941dc51dd99e40051e4ee987785bba4c310bfe21c97c6b6e3d)\
**Post date:** [January 30, 2017, 10:44am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/38 "2017-01-30T10:44:59Z")

</div>

Hi ZkarmaKun,

Thank you so much! Btw I would like to know a license of your plugin, because I would like to commit your plugin into my github repository to add iOS camera support. So I would like to distribute this plugin through github to anyone who wants to support a camera in their games.

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6b33c376](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6b33c376](https://forums.unrealengine.com/u/anonymous_user_6b33c376)\
**Post date:** [February 28, 2017, 3:37pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/40 "2017-02-28T15:37:54Z")

</div>

Hello! I build your project and everything is working fine. But despite the 30fps int the .h file the real fps is something about 10. My devise is samsung s6 edge. Oh, also i tested in VR mode. What could be the reason of such a small fps?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6b33c376](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6b33c376](https://forums.unrealengine.com/u/anonymous_user_6b33c376)\
**Post date:** [March 1, 2017, 11:58am UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/41 "2017-03-01T11:58:29Z")

</div>

Hello! I build your project and everything is working fine. But despite the 30fps int the .h file the real fps is something about 10. My devise is samsung s6 edge. Oh, also i tested in VR mode. What could be the reason of such a small fps?

---

<div class="post-metadata">

**Author:** ![ZkarmaKun](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zkarmakun/32/1194545_2.png) [@ZkarmaKun](https://forums.unrealengine.com/u/ZkarmaKun)\
**Post date:** [March 1, 2017, 2:16pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/42 "2017-03-01T14:16:12Z")

</div>

Hi @WoojooGames yes you can!!!, for develop or shipping, I will glad to have an IOS camera support, I have my own, but for legal reasons with a former job I can’t publish it, but if you can publish yours that will be fine!

hi @anonymous_user_61df53a0 are you doing something else in your app? I have a s6 edge either, perhaps is the VR mode, I never tested that, the 30fps is just a clamp for camera refresh rate

---

<div class="post-metadata">

**Author:** ![SOADawe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SOADawe](https://forums.unrealengine.com/u/SOADawe)\
**Post date:** [March 3, 2017, 6:07pm UTC](https://forums.unrealengine.com/t/plugin-android-camera/69320/43 "2017-03-03T18:07:47Z")

</div>

Hi I don´t know why but it´s not working. Everything is set like in your project but still not working. My phone without problems open app but no camera just default view like in editor. Could it be becouse of the UE 4.15? Or could it be couse of my phone I am using HTC oneX tegra 3. Btw when the app running and i try turn on camera outside app Phone doesn´t have access to it… So I think the app actually using the camera, but not showing the image for some reason. Do you have some advice?

[Previous page](https://forums.unrealengine.com/t/plugin-android-camera/69320.md?page=1)

[Next page](https://forums.unrealengine.com/t/plugin-android-camera/69320.md?page=3)
