# Using the camera

**URL:** <https://techcommunity.softwareag.com/t/using-the-camera/174956>\
**Category:** Forum\
**Tags:** mobile\
**Created:** [March 10, 2014, 2:02pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956 "2014-03-10T14:02:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ken\_Peersman1](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@Ken\_Peersman1](https://techcommunity.softwareag.com/u/Ken_Peersman1)\
**Post date:** [March 10, 2014, 2:02pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/1 "2014-03-10T14:02:30Z")

</div>

Hi all,

I’m new to this community and to programming in software AG.  
There for, the solution to my question can be easy but i realy don’t find it.

In my app, i need to take a picture with the camera.  
But i have no idea how to open the camera view, and make the picture…

Is there a good example code anywhere…?

Thnx in advance.

Ken

---

<div class="post-metadata">

**Author:** ![Tong\_Wang](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/tong_wang/32/410_2.png) [@Tong\_Wang](https://techcommunity.softwareag.com/u/Tong_Wang)\
**Post date:** [March 10, 2014, 7:38pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/2 "2014-03-10T19:38:09Z")

</div>

check the Java API at:  
com.softwareag.mobile.runtime.media.CameraHandler

getCameraSnapshot method etc.  
the document is under:  
\_documentation\webMethods\Mobile\_Designer\9-0-SP1\_Mobile\_Designer\_Java\_API\_Reference

---

<div class="post-metadata">

**Author:** ![Ken\_Peersman1](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@Ken\_Peersman1](https://techcommunity.softwareag.com/u/Ken_Peersman1)\
**Post date:** [March 11, 2014, 10:16am UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/3 "2014-03-11T10:16:22Z")

</div>

Correct me if im wrong.  
But as far as i understand the API,

- First i need te make a new object of the class “CameraHandler”
- Then i need te connect te handler to my canvas.
- Then i use the function “createCamera()” to set my camera

And then i shoud see the videostream of the camera on the screen…?

Because all i get is al black screen from the code below

```auto

public class CameraView extends nUIViewDisplay{
	public CameraView (MyCanvas controller, ExpenseItem current_expense)
	{
		super (Constants.NUIID_SETTINGS_VIEW);
		this.controller = controller;
		
		if(current_expense!=null)
			setHeadertext ("Photo: "+current_expense.getName());
		else
			setHeadertext ("Photo: New expense");
		
		CameraHandler camera = new CameraHandler();
		camera.initCamera(controller);
		camera.createCamera();
		camera.getCameraSnapshot("PNG", 100, 100);
		
		// Button to go back
		add(new nUINavbuttonElement(Constants.NUIID_BACK_PHOTO_VIEW, Util.getString(Parameters.TEXTID_BUTTON_BACK), nUINavbuttonElement.TYPE_BACK, null));
	}

	protected MyCanvas controller = null;
}
```

Or is this normal because i run this on my computer…

---

<div class="post-metadata">

**Author:** ![Tong\_Wang](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/tong_wang/32/410_2.png) [@Tong\_Wang](https://techcommunity.softwareag.com/u/Tong_Wang)\
**Post date:** [March 11, 2014, 3:46pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/4 "2014-03-11T15:46:33Z")

</div>

I can’t see anything wrong with your code. pls try to run it on a phone. I’m not sure if your simulator on computer will take control of its camera, most likely not.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [August 15, 2014, 11:37am UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/5 "2014-08-15T11:37:53Z")

</div>

Hello, Tong. I am also new here to do intership in Software AG. Are u still in here? I am chinese also. Now i do some Mobiel Development works, but I have some problems with the database and server connection. Can we exchange the contact way? Thank u a lot

---

<div class="post-metadata">

**Author:** ![Tong\_Wang](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/tong_wang/32/410_2.png) [@Tong\_Wang](https://techcommunity.softwareag.com/u/Tong_Wang)\
**Post date:** [August 15, 2014, 8:36pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/6 "2014-08-15T20:36:58Z")

</div>

Pigeon,  
If you have questions/issues, post it to the forum.  
I’m sure someone will help you.  
Tong

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [August 15, 2014, 9:03pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/7 "2014-08-15T21:03:49Z")

</div>

Hey, hello,  
I met a question. I know codes using cookbook. I used the HttpConnection.openHttpConnectionByteArrayData(String url, int encoding\_format, byte data\_to\_send, String request\_properties) this method to try a connect to server using Intergration Server. (localhost : 5555). So my questions are:

1. I wanna know about the JDBC, Server, Client and Database the connection structure, because my cookbook author has already configured the structure, I do not need to do that any more, but I write the same codes like the cook book, and I run the cookbook original source programm, it runs, but my did not work, and It has also not problem about the logic.  
I want to know, how I can know, wether I already connect to the Server?  
Best Regards  
Pigeon

 ![Untitled.png](https://global.discourse-cdn.com/techcommunity/original/2X/e/e642bba3e8ca5d23670f1de2c6b8c7d4d1e4e9a4.png)

---

<div class="post-metadata">

**Author:** ![Tong\_Wang](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/tong_wang/32/410_2.png) [@Tong\_Wang](https://techcommunity.softwareag.com/u/Tong_Wang)\
**Post date:** [August 15, 2014, 9:40pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/8 "2014-08-15T21:40:59Z")

</div>

If you are connecting to a Integration Server, check the sessions on IS side, so you will know if your connection is working.

Also, try to do something with your opened connect, so you will know if it works.  
HTH,

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [August 26, 2014, 12:42pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/9 "2014-08-26T12:42:52Z")

</div>

> [@Tong Wang](#):
>
> If you are connecting to a Integration Server, check the sessions on IS side, so you will know if your connection is working.
> 
> Also, try to do something with your opened connect, so you will know if it works.  
> HTH,

Hey, Wang Tong. How are you, thank you for ur replay. I have tried ur eay and i have solve the Problem I met befor about the server conncetion. I met some questions more unfortunetly, I have wrote it in the forum with some pictures, maybe it will be better to be understood. And I personally has a questoin, that is has Mobile Designer some WYSIWYG tool to design the UI for Applications, like “Droid-Draw” or “Xamarin” ?

Thank you Tong Wang and Thanks for everyone who maybe some tipps!  
HU, Tiange

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:30pm UTC](https://techcommunity.softwareag.com/t/using-the-camera/174956/10 "2021-04-02T15:30:31Z")

</div>


