diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock b/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock index 6054754..c077435 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock and b/platforms/android/.gradle/2.2.1/taskArtifacts/cache.properties.lock differ diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin b/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin index af708df..2178279 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin and b/platforms/android/.gradle/2.2.1/taskArtifacts/fileHashes.bin differ diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin b/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin index 597d5b6..44a7b3e 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin and b/platforms/android/.gradle/2.2.1/taskArtifacts/fileSnapshots.bin differ diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/outputFileStates.bin b/platforms/android/.gradle/2.2.1/taskArtifacts/outputFileStates.bin index d52e0e6..6e6e790 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/outputFileStates.bin and b/platforms/android/.gradle/2.2.1/taskArtifacts/outputFileStates.bin differ diff --git a/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin b/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin index 03c50e8..3385fcb 100644 Binary files a/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin and b/platforms/android/.gradle/2.2.1/taskArtifacts/taskArtifacts.bin differ diff --git a/platforms/android/.idea/misc.xml b/platforms/android/.idea/misc.xml index a509b72..56a3c17 100644 --- a/platforms/android/.idea/misc.xml +++ b/platforms/android/.idea/misc.xml @@ -1,29 +1,5 @@ - - - - diff --git a/platforms/android/.idea/workspace.xml b/platforms/android/.idea/workspace.xml index 9a12413..fa1bbbf 100644 --- a/platforms/android/.idea/workspace.xml +++ b/platforms/android/.idea/workspace.xml @@ -1,12 +1,7 @@ - - - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1004,7 +959,7 @@ - - - @@ -1546,58 +1487,47 @@ - - - - - 1452811340653 + + 1453414443230 - + - + - + - - + - - + + - + - + + - - - - @@ -1606,15 +1536,7 @@ - - - - - - - - - + @@ -1622,73 +1544,10 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/platforms/android/CordovaLib/build/intermediates/classes/test/debug/org/apache/cordova/test/BuildConfig.class b/platforms/android/CordovaLib/build/intermediates/classes/test/debug/org/apache/cordova/test/BuildConfig.class new file mode 100644 index 0000000..4e79327 Binary files /dev/null and b/platforms/android/CordovaLib/build/intermediates/classes/test/debug/org/apache/cordova/test/BuildConfig.class differ diff --git a/platforms/android/android-release.apk b/platforms/android/android-release.apk index 40fbd9a..33c26e1 100644 Binary files a/platforms/android/android-release.apk and b/platforms/android/android-release.apk differ diff --git a/platforms/android/assets/www/js/controllers.js b/platforms/android/assets/www/js/controllers.js index 6f403f5..18fe355 100644 --- a/platforms/android/assets/www/js/controllers.js +++ b/platforms/android/assets/www/js/controllers.js @@ -1,6 +1,6 @@ angular.module('starter.controllers', []) -.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope) { +.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope, $cordovaFileTransfer) { $scope.preis=""; $scope.name=""; @@ -74,6 +74,45 @@ angular.module('starter.controllers', []) } alert("SUCCESS: \r\n"+strResult ); */ + var link = 'http://api.raataar.de/rosen/kauf.php'; + + $http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis}).then(function (res){ + $scope.filetodownload = res.data; + + // File for download + var url = "http://api.raataar.de/rosen/" + $scope.filetodownload; + + alert(url); + // File name only + var filename = url.split("/").pop(); + + alert(filename); + // Save location + //var targetPath = cordova.file.externalRootDirectory + filename; + var targetPath = cordova.file.applicationStorageDirectory + filename; + + alert(targetPath); + $scope.targetPath=''; + $scope.targetPath=targetPath; + $cordovaFileTransfer.download(url, targetPath, {}, true).then(function (result) { + + $scope.item={name: $scope.name, bild: $scope.targetPath}; + $scope.items.push($scope.item); + + alert ($scope.targetPath); + $database.setBuys($scope.name,$scope.targetPath); + + }, function (error) { + console.log('Error'); + }, function (progress) { + // PROGRESS HANDLING GOES HERE + }); + + return false; + }); + + + } function errorBuyHandler (error) { diff --git a/platforms/android/assets/www/templates/tab-buys.html b/platforms/android/assets/www/templates/tab-buys.html index 5d14bca..e938f08 100644 --- a/platforms/android/assets/www/templates/tab-buys.html +++ b/platforms/android/assets/www/templates/tab-buys.html @@ -7,7 +7,7 @@
Hier können Sie Ihre gekauften Rosen ansehen oder nochmals versenden!
- + diff --git a/platforms/android/build/intermediates/assets/debug/www/js/controllers.js b/platforms/android/build/intermediates/assets/debug/www/js/controllers.js index 6f403f5..18fe355 100644 --- a/platforms/android/build/intermediates/assets/debug/www/js/controllers.js +++ b/platforms/android/build/intermediates/assets/debug/www/js/controllers.js @@ -1,6 +1,6 @@ angular.module('starter.controllers', []) -.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope) { +.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope, $cordovaFileTransfer) { $scope.preis=""; $scope.name=""; @@ -74,6 +74,45 @@ angular.module('starter.controllers', []) } alert("SUCCESS: \r\n"+strResult ); */ + var link = 'http://api.raataar.de/rosen/kauf.php'; + + $http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis}).then(function (res){ + $scope.filetodownload = res.data; + + // File for download + var url = "http://api.raataar.de/rosen/" + $scope.filetodownload; + + alert(url); + // File name only + var filename = url.split("/").pop(); + + alert(filename); + // Save location + //var targetPath = cordova.file.externalRootDirectory + filename; + var targetPath = cordova.file.applicationStorageDirectory + filename; + + alert(targetPath); + $scope.targetPath=''; + $scope.targetPath=targetPath; + $cordovaFileTransfer.download(url, targetPath, {}, true).then(function (result) { + + $scope.item={name: $scope.name, bild: $scope.targetPath}; + $scope.items.push($scope.item); + + alert ($scope.targetPath); + $database.setBuys($scope.name,$scope.targetPath); + + }, function (error) { + console.log('Error'); + }, function (progress) { + // PROGRESS HANDLING GOES HERE + }); + + return false; + }); + + + } function errorBuyHandler (error) { diff --git a/platforms/android/build/intermediates/assets/debug/www/templates/tab-buys.html b/platforms/android/build/intermediates/assets/debug/www/templates/tab-buys.html index 5d14bca..e938f08 100644 --- a/platforms/android/build/intermediates/assets/debug/www/templates/tab-buys.html +++ b/platforms/android/build/intermediates/assets/debug/www/templates/tab-buys.html @@ -7,7 +7,7 @@
Hier können Sie Ihre gekauften Rosen ansehen oder nochmals versenden!
- + diff --git a/platforms/android/build/intermediates/assets/release/www/js/app.js b/platforms/android/build/intermediates/assets/release/www/js/app.js index 2610341..32ae3bc 100644 --- a/platforms/android/build/intermediates/assets/release/www/js/app.js +++ b/platforms/android/build/intermediates/assets/release/www/js/app.js @@ -14,6 +14,10 @@ angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) + + + $rootScope.storeinit=99; + $ionicPlatform.registerBackButtonAction(function(event) { // Handle Android back button to avoid the application exits accidentaly @@ -56,6 +60,7 @@ angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter function successHandler (result) { + /* var strResult = ""; if(typeof result === 'object') { strResult = JSON.stringify(result); @@ -63,10 +68,13 @@ angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter strResult = result; } alert("SUCCESS: \r\n"+strResult ); + */ + $rootScope.storeinit=1; } function errorHandler (error) { - alert("ERROR: \r\n"+error ); + //alert("ERROR: \r\n"+error ); + $rootScope.storeinit=0; } diff --git a/platforms/android/build/intermediates/assets/release/www/js/controllers.js b/platforms/android/build/intermediates/assets/release/www/js/controllers.js index 9e2c165..18fe355 100644 --- a/platforms/android/build/intermediates/assets/release/www/js/controllers.js +++ b/platforms/android/build/intermediates/assets/release/www/js/controllers.js @@ -1,6 +1,6 @@ angular.module('starter.controllers', []) -.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout) { +.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope, $cordovaFileTransfer) { $scope.preis=""; $scope.name=""; @@ -25,6 +25,7 @@ angular.module('starter.controllers', []) }; + $scope.loaddata = function() { $scope.items=[]; $database.getAllBuys().then(function (result) { @@ -51,6 +52,7 @@ angular.module('starter.controllers', []) }; function successBuyHandler (result) { + /* var strResult = ""; if(typeof result === 'object') { strResult = JSON.stringify(result); @@ -58,10 +60,12 @@ angular.module('starter.controllers', []) strResult = result; } alert("SUCCESS: \r\n"+strResult ); - $timeout(buysuccessHandler, 1000); + */ + $timeout(consumesuccessHandler, 1000); } function successConsumeHandler (result) { + /* var strResult = ""; if(typeof result === 'object') { strResult = JSON.stringify(result); @@ -69,26 +73,73 @@ angular.module('starter.controllers', []) strResult = result; } alert("SUCCESS: \r\n"+strResult ); + */ + var link = 'http://api.raataar.de/rosen/kauf.php'; + + $http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis}).then(function (res){ + $scope.filetodownload = res.data; + + // File for download + var url = "http://api.raataar.de/rosen/" + $scope.filetodownload; + + alert(url); + // File name only + var filename = url.split("/").pop(); + + alert(filename); + // Save location + //var targetPath = cordova.file.externalRootDirectory + filename; + var targetPath = cordova.file.applicationStorageDirectory + filename; + + alert(targetPath); + $scope.targetPath=''; + $scope.targetPath=targetPath; + $cordovaFileTransfer.download(url, targetPath, {}, true).then(function (result) { + + $scope.item={name: $scope.name, bild: $scope.targetPath}; + $scope.items.push($scope.item); + + alert ($scope.targetPath); + $database.setBuys($scope.name,$scope.targetPath); + + }, function (error) { + console.log('Error'); + }, function (progress) { + // PROGRESS HANDLING GOES HERE + }); + + return false; + }); + + + } function errorBuyHandler (error) { - alert("ERROR: \r\n"+error ); + var alertPopup = $ionicPopup.alert({ + title: 'Oh Nein', + template: 'Der Kauf konnte nicht durchgeführt werden.' + }); + + alertPopup.then(function(res) { + console.log('Der Kauf konnte nicht durchgeführt werden'); + }); } function errorConsumeHandler (error) { - alert("ERROR: \r\n"+error ); + var alertPopup = $ionicPopup.alert({ + title: 'Oh Nein', + template: 'Der Kauf wurde durchgeführt, aber deine Rosen konnten freigeschaltet werden.' + }); + + alertPopup.then(function(res) { + console.log('Der Kauf wurde durchgeführt, aber deine Rosen konnten freigeschaltet werden'); + }); } - function buysuccessHandler (result) { + function consumesuccessHandler (result) { inappbilling.consumePurchase(successConsumeHandler, errorConsumeHandler, $scope.preis); - var strResult = ""; - if(typeof result === 'object') { - strResult = JSON.stringify(result); - } else { - strResult = result; - } - alert("SUCCESS: \r\n"+strResult ); } $scope.buyRose = function() { @@ -96,7 +147,22 @@ angular.module('starter.controllers', []) //alert($scope.preis); if((window.device && device.platform == "Android") && typeof inappbilling !== "undefined") { - inappbilling.buy(successBuyHandler, errorBuyHandler, $scope.preis); + + if ($rootScope.storeinit==1){ + inappbilling.buy(successBuyHandler, errorBuyHandler, $scope.preis); + } + else{ + var alertPopup = $ionicPopup.alert({ + title: 'Achtung', + template: 'Der Google-Store konnte nicht initialisiert werden.' + }); + + alertPopup.then(function(res) { + console.log('Store steht nicht zur Verfuegung'); + }); + } + + } } diff --git a/platforms/android/build/intermediates/assets/release/www/templates/tab-buys.html b/platforms/android/build/intermediates/assets/release/www/templates/tab-buys.html index 5d14bca..e938f08 100644 --- a/platforms/android/build/intermediates/assets/release/www/templates/tab-buys.html +++ b/platforms/android/build/intermediates/assets/release/www/templates/tab-buys.html @@ -7,7 +7,7 @@
Hier können Sie Ihre gekauften Rosen ansehen oder nochmals versenden!
- + diff --git a/platforms/android/build/intermediates/classes/test/debug/com/raataar/wolle_rosen_kaufen/test/BuildConfig.class b/platforms/android/build/intermediates/classes/test/debug/com/raataar/wolle_rosen_kaufen/test/BuildConfig.class new file mode 100644 index 0000000..b8ced7c Binary files /dev/null and b/platforms/android/build/intermediates/classes/test/debug/com/raataar/wolle_rosen_kaufen/test/BuildConfig.class differ diff --git a/platforms/android/build/intermediates/gradle_project_sync_data.bin b/platforms/android/build/intermediates/gradle_project_sync_data.bin index c1ec57a..bd8029b 100644 Binary files a/platforms/android/build/intermediates/gradle_project_sync_data.bin and b/platforms/android/build/intermediates/gradle_project_sync_data.bin differ diff --git a/platforms/android/build/intermediates/res/resources-debug.ap_ b/platforms/android/build/intermediates/res/resources-debug.ap_ index 11b4225..d02bae3 100644 Binary files a/platforms/android/build/intermediates/res/resources-debug.ap_ and b/platforms/android/build/intermediates/res/resources-debug.ap_ differ diff --git a/platforms/android/build/intermediates/res/resources-release.ap_ b/platforms/android/build/intermediates/res/resources-release.ap_ index 71b2962..6f86323 100644 Binary files a/platforms/android/build/intermediates/res/resources-release.ap_ and b/platforms/android/build/intermediates/res/resources-release.ap_ differ diff --git a/platforms/android/build/outputs/apk/android-debug-unaligned.apk b/platforms/android/build/outputs/apk/android-debug-unaligned.apk index 1cd3bc1..38e8a69 100644 Binary files a/platforms/android/build/outputs/apk/android-debug-unaligned.apk and b/platforms/android/build/outputs/apk/android-debug-unaligned.apk differ diff --git a/platforms/android/build/outputs/apk/android-debug.apk b/platforms/android/build/outputs/apk/android-debug.apk index b25bd66..06b12ab 100644 Binary files a/platforms/android/build/outputs/apk/android-debug.apk and b/platforms/android/build/outputs/apk/android-debug.apk differ diff --git a/platforms/android/build/outputs/apk/android-release-unaligned.apk b/platforms/android/build/outputs/apk/android-release-unaligned.apk index 540945c..fc89ff5 100644 Binary files a/platforms/android/build/outputs/apk/android-release-unaligned.apk and b/platforms/android/build/outputs/apk/android-release-unaligned.apk differ diff --git a/platforms/android/build/outputs/lint-results-release-fatal.html b/platforms/android/build/outputs/lint-results-release-fatal.html index a72f494..9bef3c6 100644 --- a/platforms/android/build/outputs/lint-results-release-fatal.html +++ b/platforms/android/build/outputs/lint-results-release-fatal.html @@ -18,7 +18,7 @@ document.getElementById(id+'Link').style.display = 'none';

Lint Report

-Check performed at Thu Jan 21 22:01:40 CET 2016.
+Check performed at Fri Jan 22 00:13:17 CET 2016.
0 errors and 0 warnings found:

Congratulations! diff --git a/platforms/android/local.properties b/platforms/android/local.properties index 96b146c..9e70eeb 100644 --- a/platforms/android/local.properties +++ b/platforms/android/local.properties @@ -7,5 +7,5 @@ # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. -#Thu Jan 21 22:00:45 CET 2016 +#Fri Jan 22 00:12:54 CET 2016 sdk.dir=C\:\\Program Files (x86)\\Android\\android-sdk diff --git a/www/js/controllers.js b/www/js/controllers.js index 6f403f5..18fe355 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -1,6 +1,6 @@ angular.module('starter.controllers', []) -.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope) { +.controller('DashCtrl', function($scope,$ionicPopup,$http, $database, $timeout,$rootScope, $cordovaFileTransfer) { $scope.preis=""; $scope.name=""; @@ -74,6 +74,45 @@ angular.module('starter.controllers', []) } alert("SUCCESS: \r\n"+strResult ); */ + var link = 'http://api.raataar.de/rosen/kauf.php'; + + $http.post(link, {name : $scope.name, freitext: $scope.freitext, rosen: $scope.preis}).then(function (res){ + $scope.filetodownload = res.data; + + // File for download + var url = "http://api.raataar.de/rosen/" + $scope.filetodownload; + + alert(url); + // File name only + var filename = url.split("/").pop(); + + alert(filename); + // Save location + //var targetPath = cordova.file.externalRootDirectory + filename; + var targetPath = cordova.file.applicationStorageDirectory + filename; + + alert(targetPath); + $scope.targetPath=''; + $scope.targetPath=targetPath; + $cordovaFileTransfer.download(url, targetPath, {}, true).then(function (result) { + + $scope.item={name: $scope.name, bild: $scope.targetPath}; + $scope.items.push($scope.item); + + alert ($scope.targetPath); + $database.setBuys($scope.name,$scope.targetPath); + + }, function (error) { + console.log('Error'); + }, function (progress) { + // PROGRESS HANDLING GOES HERE + }); + + return false; + }); + + + } function errorBuyHandler (error) { diff --git a/www/templates/tab-buys.html b/www/templates/tab-buys.html index 5d14bca..e938f08 100644 --- a/www/templates/tab-buys.html +++ b/www/templates/tab-buys.html @@ -7,7 +7,7 @@
Hier können Sie Ihre gekauften Rosen ansehen oder nochmals versenden!
- +