#2 Topics related with App Builder » Feature request: Define environment in BatchFiles for Android » 2016-02-04 15:24:26

pfisterhamj
Replies: 7

Hello,

my Android environment is splitted. This means that I have a seperate HD or partition where I have Java, Ant and the AndroidSDK installed. Due to the fact that I develop in Java too the JAVA_HOME environment variable is not set systemwide.

I've tested that the following entries in the Batchfiles would work awesome:

REM Created by App Builder v2016.59
REM More information at [url]http://www.davidesperalta.com/[/url]

@ECHO OFF

SET JAVA_HOME=c:\Program Files\Java\jdk1.8.0_71\
SET ANT_HOME=c:\Program Files\apache-ant-1.9.6\
SET ANDROID_HOME=d:\android-sdk
SET PATH=%PATH%;%ANT_HOME%\bin;%JAVA_HOME%\bin;%ANDROID_HOME%\platform-tools

CLS

REM Add the Android platform for our app
CALL cordova platform add android

REM Add the Whitelist plugin for our app
CALL cordova plugin add cordova-plugin-whitelist

REM Add the "cordova-plugin-flashlight" plugin by the "Flashlight" plugin
CALL cordova plugin add cordova-plugin-flashlight

REM Build our app for the Android platform
CALL cordova build android

REM Pause the script execution, so we can view the script results
PAUSE

It would be nice if I can input such initialization code in AppBuilder and the stuff is written at first (after the @echo off) out to the batch files.

Thanks

Best regards
Jürgen

#4 Topics related with App Builder » Editing JSFunction arguments » 2015-09-06 15:22:55

pfisterhamj
Replies: 3

Hello,

I have a JSFunction with a defined parameter. I tried to edit the description of the parameter. I always get the error message: <parameter> already exists. I cannot change the description or the parameter name.

Please help


Best regards
Jürgen

#5 Re: Topics related with App Builder » Problem with setting variables from JavaScript Callback » 2015-08-29 00:05:16

Hello David,

setting the barcode (that was scanned with camera) is only filled in a control if I touch onto the view. Then the value is updated.

Do I have to execute something after returning from camera?

Thanks for you patience

Best regards
Jürgen

#6 Re: Topics related with App Builder » Problem with setting variables from JavaScript Callback » 2015-08-28 22:38:37

Hello David,

the solution with:

window.App.Scope.BarcodeReaded(result.text);

is really cool. Works really great.


Thanks for helping me.


Best regards
Jürgen

#7 Re: Topics related with App Builder » Problem with setting variables from JavaScript Callback » 2015-08-28 21:40:59

Hello David,

thanks for the quick reply.

if(App.Cordova) {
  alert('This function only works in Android, Windows Phone and iOS.');
  return;
}

var scanresult = function(result)
{
     alert('We got a barcode\n' +
                'Result: ' + result.text + '\n' +
                'Format: ' + result.format + '\n' +
                'Cancelled: ' + result.cancelled);


          window.App.RootScope.Barcode = result.text;
}

var scanerror = function(result)
{
     alert('Scanning failed: ' + error);
}

cordova.plugins.barcodeScanner.scan(scanresult,scanerror);

I have a simple code for the button:

ScanBarcode
AlertBox "[Barcode]" "primary"

But the Variable [Barcode] remains undefined in the alert.

Best regards

#8 Topics related with App Builder » Problem with setting variables from JavaScript Callback » 2015-08-28 20:52:21

pfisterhamj
Replies: 10

Hello,

I'm trying to get the barcode from a javascript function (cordova plugin). Reading the barcode works. But I'm not able to set a global variable to get it into appbuilder.

if(App.Cordova) {
  alert('This function only works in Android, Windows Phone and iOS.');
  return;
}

var barcode = 'HELLO';

var scanresult = function(result)
{
     alert('We got a barcode\n' +
                'Result: ' + result.text + '\n' +
                'Format: ' + result.format + '\n' +
                'Cancelled: ' + result.cancelled);

     barcode = result.text;
}

var scanerror = function(result)
{
     alert('Scanning failed: ' + error);
}

cordova.plugins.barcodeScanner.scan(scanresult,scanerror);

window.App.RootScope.Barcode = barcode;

I get the results from barcode scanning. But my Variable [Barcode] in appbuilder has the value 'HELLO'.

I'm not really a javascript guy. But I think I should exist a workaround.

Hope someone can help me.


Thanks

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.