kamera
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| kamera [2013/04/14 22:51] – angelegt admin | kamera [2026/08/05 20:09] (aktuell) – admin | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ==== Zugriff auf die Kamera ==== | + | ====== Kamera |
| - | kamera/AndroidManifest.xml | + | https://www.youtube.com/ |
| - | < | ||
| - | android: | ||
| - | android: | ||
| - | <code xml AndroidManifest.xml> | ||
| - | <?xml version=" | ||
| - | < | ||
| - | package=" | ||
| - | android: | ||
| - | android: | ||
| - | |||
| - | < | ||
| - | android: | ||
| - | android: | ||
| - | | ||
| - | |||
| - | < | ||
| - | android: | ||
| - | android: | ||
| - | android: | ||
| - | android: | ||
| - | android: | ||
| - | | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | | ||
| - | < | ||
| - | android: | ||
| - | android: | ||
| - | android: | ||
| - | android: | ||
| - | < | ||
| - | android: | ||
| - | android: | ||
| - | android: | ||
| - | < | ||
| - | <action android: | ||
| - | |||
| - | < | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | </ | ||
| - | </ | ||
| - | |||
| - | kamera/ | ||
| - | |||
| - | <code java MainActivity.java> | ||
| - | package com.example.erstephonegapapp; | ||
| - | |||
| - | import android.os.Bundle; | ||
| - | import android.view.Menu; | ||
| - | import org.apache.cordova.*; | ||
| - | |||
| - | public class MainActivity extends DroidGap { | ||
| - | |||
| - | @Override | ||
| - | public void onCreate(Bundle savedInstanceState) { | ||
| - | super.onCreate(savedInstanceState); | ||
| - | super.loadUrl(" | ||
| - | } | ||
| - | |||
| - | |||
| - | @Override | ||
| - | public boolean onCreateOptionsMenu(Menu menu) { | ||
| - | // Inflate the menu; this adds items to the action bar if it is present. | ||
| - | getMenuInflater().inflate(R.menu.main, | ||
| - | return true; | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | kamera/ | ||
| - | |||
| - | <code css meinecss.css> | ||
| - | #meldung{ | ||
| - | display: | ||
| - | background: | ||
| - | color: | ||
| - | height: | ||
| - | font-size: 16px; | ||
| - | padding: | ||
| - | margin: | ||
| - | text-align: | ||
| - | } | ||
| - | #bild{ | ||
| - | // | ||
| - | margin-left: | ||
| - | margin-right: | ||
| - | width: | ||
| - | } | ||
| - | #btn{ | ||
| - | text-align: | ||
| - | margin-left: | ||
| - | margin-right: | ||
| - | margin-bottom: | ||
| - | } | ||
| - | h4{ | ||
| - | text-align: | ||
| - | font-size: | ||
| - | } | ||
| - | button{ | ||
| - | margin: | ||
| - | width: 200px; | ||
| - | font-size: | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | kamera/ | ||
| - | |||
| - | <code html index.html> | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | <meta http-equiv=" | ||
| - | <meta name=" | ||
| - | |||
| - | <link rel=" | ||
| - | <script type=" | ||
| - | <script type=" | ||
| - | </ | ||
| - | < | ||
| - | < | ||
| - | <div id=" | ||
| - | <button id=" | ||
| - | Foto aufnehmen | ||
| - | </ | ||
| - | <br/> | ||
| - | <button id=" | ||
| - | Foto l& | ||
| - | </ | ||
| - | <br/> | ||
| - | <button id=" | ||
| - | Foto speichern | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | <div id=" | ||
| - | <img id=" | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | kamera/ | ||
| - | |||
| - | <code javascript meineskripte.js> | ||
| - | var destinationType; | ||
| - | |||
| - | window.onload = function() { | ||
| - | document.getElementById(" | ||
| - | |||
| - | navigator.camera.getPicture(onSuccess1, | ||
| - | quality : 50, | ||
| - | destinationType : destinationType.DATA_URL | ||
| - | }); | ||
| - | }); | ||
| - | document.getElementById(" | ||
| - | |||
| - | document.getElementById(' | ||
| - | |||
| - | document.getElementById(" | ||
| - | }); | ||
| - | |||
| - | document.getElementById(" | ||
| - | navigator.camera.getPicture(onSuccess2, | ||
| - | quality : 50, | ||
| - | destinationType : destinationType.FILE_URI, | ||
| - | saveToPhotoAlbum : true, | ||
| - | encodingType : navigator.camera.EncodingType.PNG | ||
| - | }); | ||
| - | }); | ||
| - | |||
| - | document.addEventListener(' | ||
| - | destinationType = navigator.camera.DestinationType; | ||
| - | }, false); | ||
| - | |||
| - | }; | ||
| - | function onSuccess1(imageData) { | ||
| - | |||
| - | document.getElementById(' | ||
| - | document.getElementById(' | ||
| - | |||
| - | document.getElementById(" | ||
| - | } | ||
| - | |||
| - | function onSuccess2(imageData) { | ||
| - | |||
| - | document.getElementById(" | ||
| - | } | ||
| - | |||
| - | function onFail(message) { | ||
| - | document.getElementById(" | ||
| - | document.getElementById(' | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | In kamera/ | ||
| - | |||
| - | In kamera/ | ||
kamera.1365972697.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
