Peter, our SB god, thanks for this tip, I think it will be really helpful with the next upcoming problems!
Stefan, what version of SB and what Java do you use? I use SB 2.32Beta1 with Java jdk-8u321 on Win 11 Pro 64 for compiling, but I'm actually at "only" 10000 code lines, mostly SB and some JS as solution for missing things. Since my changes of the device-plugin I don't have any problems, and I also include other cordova plugins with own changes for bluetooth (also hardware-near).
DeviceAlwaysOn(*) is also an SB command like DeviceInfo(*), that seems to need the device-plugin.
Instructions for creating an Android app
Re: Instructions for creating an Android app
Ich habe tatsächlich etwas gefunden:
Ich habe Spiderbasic 2.32 beta 1
Allerdings kann ich das nicht in meinem Spider-Code entdecken.
if("undefined"==typeof Spider)var Spider={};spider.system={batteryEventRegistered:0,batteryLevel:-1,defaultBrightness:0.5};function spider_InitSystem(){window.cordova&&cordova.plugins.brightness.getBrightness(function(a){spider.system.defaultBrightness=a;console.log("night: "+a)})}function spider_ElapsedMilliseconds(){return(new Date).getTime()}function spider_CountProgramParameters(){var a=location.search.substring(1);return 0<a.length?spider_CountString(a,"&")+1:0}
function spider_ProgramParameter(a){var d=location.search.substring(1);return 0<=a&&a<spider_CountProgramParameters()?decodeURI(spider_StringField(d,a+1,"&")):""}function spider_BatteryLevel(){window.cordova&&!spider.system.batteryEventRegistered&&(spider.system.batteryEventRegistered=1,window.addEventListener("batterystatus",function(a){spider.system.batteryLevel=a.isPlugged?-2:a.level},!1));return spider.system.batteryLevel}
function spider_DeviceInfo(a){if(window.cordova)switch(a){case 0:return device.model;case 1:return device.platform;case 2:return device.uuid;case 3:return device.version;case 4:return device.manufacturer;case 5:return device.serial}return""}function spider_VibrateDevice(a){window.cordova&&navigator.vibrate(a)}function spider_DeviceBrightness(a){window.cordova&&(-1===a?cordova.plugins.brightness.setBrightness(spider.system.defaultBrightness):cordova.plugins.brightness.setBrightness(a/100))}
function spider_DeviceAlwaysOn(a){window.cordova&&cordova.plugins.brightness.setKeepScreenOn(0!==a)}function spider_LoadScript(a,d,b){"undefined"==typeof b&&(b=0);var c="text";0===b&&(c="script");$.ajax({url:a,dataType:c}).done(function(c,f,e){1==b&&$("<style></style>").appendTo("head").html(c);d(a,1)}).fail(function(b,c,e){d(a,0)})};
Ich habe Spiderbasic 2.32 beta 1
Re: Instructions for creating an Android app
lt. Deinem Schnippsel könnten es folgende Befehle sein: BatteryLevel(), DeviceInfo(), VibrateDevice(), DeviceBrightness(), DeviceAlwaysOn().
Könnten, nicht müssen. Kann auch sein, dass ein anderer Befehl die Cordova-Funktionen einbindet.
Re: Instructions for creating an Android app
I don't use any of that.
Is it possible to issue Cordova with one command?
Is it possible to issue Cordova with one command?
Re: Instructions for creating an Android app
Stefan, sorry but there really must be other SB commands in your code, that trigger the automatic include of the device-plugin.
I‘ve checked my spiderbasic.js file, and there is no cordova in it.
Do you use geolocation or any other things, that are not really „basic“?
If you really have time, you could compile a web app with SB, set up a cordova project manually, copy your web app to the project and compile it manually in cordova to android.
I‘ve checked my spiderbasic.js file, and there is no cordova in it.
Do you use geolocation or any other things, that are not really „basic“?
If you really have time, you could compile a web app with SB, set up a cordova project manually, copy your web app to the project and compile it manually in cordova to android.
Re: Instructions for creating an Android app
Just tested some of the SB examples compiling for Android, because I don't want new problems for my app, and found out:
the Screen.sb example triggers the same plugin error.
Stefan, do you use the Screen/Frame/Buffer/Sprite features in your app? Maybe you can try with the example, what function there is the problem?
the Screen.sb example triggers the same plugin error.
Stefan, do you use the Screen/Frame/Buffer/Sprite features in your app? Maybe you can try with the example, what function there is the problem?
Re: Instructions for creating an Android app
Surprise, surprise, the problem is ElapsedMilliseconds()
Here is the solution:
Here is the solution:
Code: Select all
Procedure.d ElapsedMilliseconds2()
Protected ms.d
! v_ms = (new Date).getTime()
ProcedureReturn ms
EndProcedure
Re: Instructions for creating an Android app
Oh my god, I'm speechless, that such a basic function kills the Android compile.....
Re: Instructions for creating an Android app
In the help under system you will probably find all the commands that can cause trouble:
BatteryLevel()
CountProgramParameters()
DeviceAlwaysOn()
DeviceBrightness()
DeviceInfo()
ElapsedMilliseconds()
LoadScript()
LoadStyle()
ProgramParameter()
VibrateDevice()
BatteryLevel()
CountProgramParameters()
DeviceAlwaysOn()
DeviceBrightness()
DeviceInfo()
ElapsedMilliseconds()
LoadScript()
LoadStyle()
ProgramParameter()
VibrateDevice()