From 0943823a8123c0a11381a679d8f1afa84e3584ea Mon Sep 17 00:00:00 2001 From: Mathias Westerdahl Date: Wed, 16 May 2018 21:40:50 +0200 Subject: [PATCH] Added Android camera support to example app --- AndroidManifest.xml | 141 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 + game.project | 3 +- main/main.script | 2 +- 4 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 AndroidManifest.xml diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 0000000..2eaf505 --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + +{{#android.push_field_title}} + +{{/android.push_field_title}} +{{#android.push_field_text}} + +{{/android.push_field_text}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 4ac656b..245e393 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ It relies on [buffers](https://www.defold.com/ref/buffer/). For the supported set of QRCodes to decode, see the documentation for [Quirc decoded](https://github.com/dlbeer/quirc) The encoder supports the traditional QR code type. +The QRCode extension itself should be supported on all platforms. However, the example app relies on getting images from the camera +and that extension is currently only supports OSX, iOS and Android (and the Android support is very work-in-progress) + # Example app Push the Scan button to start scanning for qrcodes. The camera starts running and the the app scans the diff --git a/game.project b/game.project index 8170f29..af533c5 100644 --- a/game.project +++ b/game.project @@ -1,7 +1,7 @@ [project] title = QRCode version = 0.1 -dependencies = https://github.com/defold/extension-camera/archive/master.zip,https://github.com/andsve/dirtylarry/archive/master.zip +dependencies = https://github.com/defold/extension-camera/archive/dev-android.zip,https://github.com/andsve/dirtylarry/archive/master.zip custom_resources = main/images/defold.png [bootstrap] @@ -38,6 +38,7 @@ app_icon_180x180 = /icons/Icon-180.png [android] package = com.defold.qrcode +manifest = /AndroidManifest.xml [osx] bundle_identifier = com.defold.qrcode diff --git a/main/main.script b/main/main.script index c511ec3..671efdf 100644 --- a/main/main.script +++ b/main/main.script @@ -7,7 +7,7 @@ local function start_scan(self) local quality = camera.CAPTURE_QUALITY_HIGH local type = camera.CAMERA_TYPE_FRONT self.flip = 0 - if sysinfo.system_name == 'iPhone OS' then + if sysinfo.system_name == 'iPhone OS' or sysinfo.system_name == 'Android' then type = camera.CAMERA_TYPE_BACK quality = camera.CAPTURE_QUALITY_MEDIUM self.flip = 1