Skip to content

Commit 7afefbc

Browse files
authored
Update ndc.md
1 parent 65519fc commit 7afefbc

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

docs/development/ndc.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,35 @@ ENDCLASS.
109109
```
110110

111111
#### Camera
112-
For camera capabilities, refer to the addon section under [js-libraries.](/addons/ext_js)
112+
For camera capabilities, refer to the sample `z2ui5_cl_sample_app_306`:
113+
```abap
114+
CLASS z2ui5_cl_demo_app_306 DEFINITION PUBLIC FINAL CREATE PUBLIC .
115+
116+
PUBLIC SECTION.
117+
INTERFACES z2ui5_if_app.
118+
DATA mv_picture_base TYPE string.
119+
120+
ENDCLASS.
121+
122+
CLASS z2ui5_cl_demo_app_306 IMPLEMENTATION.
123+
METHOD z2ui5_if_app~main.
113124
125+
IF client->check_on_init( ).
126+
DATA(page) = z2ui5_cl_xml_view=>factory( )->shell( )->page( 'abap2UI5 - Device Camera Picture'
127+
)->_z2ui5( )->camera_picture(
128+
value = client->_bind_edit( mv_picture_base )
129+
onphoto = client->_event( 'CAPTURE' ) ).
130+
client->view_display( page->stringify( ) ).
131+
ENDIF.
132+
133+
IF client->get( )-event = `CAPTURE`.
134+
"handle mv_picture_base
135+
"...
136+
ENDIF.
137+
138+
ENDMETHOD.
139+
ENDCLASS.
140+
```
114141

115142
::: tip **Browser Restrictions**
116143
Depending on browser permissions and configuration settings, access to or use of native device capabilities (NDC) may be restricted. Watch out for any warning messages directly from your browser during testing.

0 commit comments

Comments
 (0)