Jump to content

petermm

Members
  • Content Count

    44
  • Joined

  • Last visited

  1. petermm

    CSS class name vs StyleClass property

    What I've found now is, that the <link rel="stylesheet" type="text/css" href="res/app.css"/> was missing in index.html. Maybe that was because the project includes a "Custom Template" that loads another CSS for some DHTMLX components used. I've added link rel="stylesheet" type="text/css" href="res/app.css" to the Custom Template now and the problem seems to be gone 😊
  2. petermm

    CSS class name vs StyleClass property

    The problem is, that methode #1 (use custom theme and add css) does not work for me. As mentioned before, all changes to my Custom CSS are ignored at runtime. I guess it has to do with the project history (It is one that was build with SMS 2.x some years ago). Maybe the app.css file is located at a wrong place (...\www\res at the moment) or the initialization sequence is not correct for some reason... Don't know where to look next at the moment.
  3. petermm

    CSS class name vs StyleClass property

    Not sure about that. My changes to the Custom CSS are reflected to "...www\.res\app.css", but ignored at runtime.
  4. petermm

    CSS class name vs StyleClass property

    Finaly I've found the following: All exrension to my Custom CSS are ignored. I had to create my own TW3StyleSheet in FormCreate, following a suggestion in an other post in this forum, and add my extensions there. Still confused a little bit...
  5. petermm

    CSS class name vs StyleClass property

    OK, that makes sense. But I've TW3Panel set sets (at design time) StyleClass to a special style that seems to be ignored. The css style itself seems to be OK - at leats it worked with SMS 2.x
  6. petermm

    CSS class name vs StyleClass property

    From: https://jonlennartaasenden.wordpress.com/2017/10/09/smart-mobile-studio-and-css-part-1/ I've learned, that SMS uses the classname to find the matching CSS style. On the other hand the TW3xxx components do have a property named StyleClass. I'm confused: What is to use when?
  7. petermm

    PhoneGap / Cordova: How to use PlugIns?

    > However, I can send you a file for Cordova though.. Very kind. You can reach my by: pmm (at) sycon dot de With asynchrounus load (as you suggested) the android version (created with PhongGap-Builder) no works fine. However I had to add: <plugin name="cordova-plugin-blob-constructor-polyfill" /> to my config.xml to make asm aBlob = new Blob(["some text"], {type: "text/plain"}); end; work.
  8. petermm

    PhoneGap / Cordova: How to use PlugIns?

    Txs for your suggestions and for your patients Christian. I hope someone else will benefit from that as well. I’ll look if my nodes/cordova is up to date later on, but since I’ve done a fresh install (following your suggestions) yesterday, I think it is. If removed cordova.js/phonegap.js from my project and the {$R cordova.js} line as well. (BTW: what do yo mean by “What needs to remain however is the link to the file…” Where should that link be?) I was able to run your code “load Cordova library asynchronous” in the SMS internal browser / chrome browser with activated developer tools. Result: Console output shows “Serving file [pathtofile\www\cordova.js] a pop up message window showing “gap_init:2” – click OK leads to: Serving file [….] messages for lots of cordova plugin files a pop up messages: gap:[null,"CoreAndroid","messageChannel","CoreAndroid1795065768"] gap:[null,"CoreAndroid","show","CoreAndroid1795065769"] gap:[null,"File","requestAllPaths","File1795065770"] and then a loop of: Error in line #1081 cordova.js that is: console.log("processMessage failed: invalid message: " + JSON.stringify(message)); with an empty message that crashes the browser.. Do you have minimalistic running example so I can compare what I’ve got to what it should look like? Edited: Finally found SO Thread: http://stackoverflow.com/questions/29678317/getting-gap-init-on-new-apache-cordova-install-when-viewing-android-app-in-brows What I did'nt know was, that the cordova.js is streamlined for the target platform and since mine was coming from the PhoneGapBuilder android APK was an android only one. Tried the one coming from the PGB windows XAP package and the strange messages mentioned above are gone
  9. petermm

    PhoneGap / Cordova: How to use PlugIns?

    OK, tried to do so: cordova platfrom add android gives the following error: Microsoft (R) Windows Script Host, Version 5.8 Copyright (C) Microsoft Corporation 1996-2001. Alle Rechte vorbehalten. E:\DLSExtensions\DBExtensions\3Tier\WEB\TEST_FilePlugIn\www\cordova.js(1974, 1) Laufzeitfehler in Microsoft JScript: 'window' ist undefiniert Questions: by " root directory of your project:" you mean the folder where the index.html is located or the .sproj one? Isn't what you descripe above that what the PhoneGap build service already has done? Inside my APK I can see the folder: ....\www\plugins\cordova-plugin-file\www\ with all the *.js files I would expect.
  10. petermm

    FileWriter

    Txs Christian. I wasn't aware of the difference between open and serve in this context. I'll try to follow your advice on how to link the cordova library and come back on this at the deployment topic.
  11. I was able to succesfully build an andoid APK from a simple SMS project, that doesn't use PhoneGap/Cordova plugins Now I have an application that is using file access (see http://forums.smartmobilestudio.com/index.php?/topic/4106-filewriter/) that I also want to deploy using phonegap/cordova. Cordova has an matching plugin called "cordova-plugin-file". My config.xml file is: <?xml version="1.0" encoding="UTF-8" ?> <widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" xmlns:android = "http://schemas.android.com/apk/res/android" id = "de.sycon.MyPGTest" versionCode = "10" version = "0.0.1" > <!-- versionCode is optional and Android only --> <name>MyPGTest</name> <description> TEST PhoneGapAPI - File. </description> <author email="pmm@sycon.de"> Peter MM </author> <content src="index.html" /> <plugin name="cordova-plugin-file" /> <feature name="http://api.phonegap.com/1.0/device" /> </widget> I’ve include the line: {$R 'file:phonegap.js'} to my project. PhoneGap build service accepts my project and builds an android APK successfully. However, if I try to install/run the app on an android device, the app crashes without further notice Whats to do? Are there any example available showing how to use PhpneGap/Cordova PlugIn?
  12. petermm

    FileWriter

    Sorry but what do you mean by "...As opposed to this if you only open the html file in the browser directly (without serving the file) "? What ist the difference between "opening" and "serving" the file? But that is only out of curiosity for my goal is to run it using phonegap/cordova. Didn't expected that to be such a big issue... Isn't it possible tor run the result packed by PhoneGap inside my local browser for debugging? The resulting APK is a ZIP file and includes the "www" folder with all plugins needed. Isn't there any example available, that shows how to make a SMS project "phonegap/cordova aware"? Created a new task http://forums.smartmobilestudio.com/index.php?/topic/4107-phonegap-cordova-how-to-use-plugins/ under "deployment" for to discuss the PhoneGap/Cordova issue.
  13. petermm

    FileWriter

    Finally I found, that all the things above works without using phonegap/cordova. Still don’t know why it runs form inside SMS but not from the chrome browser (even when startet with “--allow-file-access-from-files”) but that seems to be the reasons while it doesn’t work with other browsers/android. Do make use of phonegap/cordova I guess I have to add something like: {$R 'file:cordova.js'} {$R 'file:cordova_plugins.js'} to my project, but doing so leads to crashes everywhere I’ve tried running it so far. L Because the FileWriter issue itself seems to be solved, I’ll start another thread under “deployment” to find a solution for the phonegap/cordova issue. Is that OK to do so?
  14. petermm

    FileWriter

    Txs Christian but I think we are drifting away to mutch from my original topic "PhoneGap / FileWriter". What I have so far is a working example using PG/filewriter (BTW: If you want, I can give that back to the community) By "working" I mean it is working from the internal SMS browser, as well as from the browser launched by SMS clicking "open in browser" (that is chrome 50.0.2661.102 here). Unfortunately it doesn’t work in the following situations : - Open the same index.html in Chrome started outside SMS - strange - Using IE or Safari browser - OK maybe not supported - Packed with PhoneGap to an APK and started on an android device (it seems to crash and disappears without a note) The later one is what is worse for me, because that is what I hopped for… Any suggestions? Link to the example projekt: https://www.dropbox.com/s/mk2orrajui4kvnx/TEST_FilePlugIn.zip?dl=0
  15. petermm

    FileWriter

    OK I'm learning so every hind is welcome BTW: The THandle / Blob thing was coming form the RTL unit system.io But if there is a type save way to do it 'Lll prefer that, for sure. I've tried your suggestion var DataBlob := new JBlob(['some text'], class &type = 'text/plain' end); but that doesn't compile as well: Syntax Error: There is no overloaded version of "Create" that can be called with these arguments [line: 165, column: 28, file: form1] The TByteArray comes in by the following Code: Function HexStrToBin(Const aHexStr: AnsiString):TByteArray; Const Convert: array[48..102] {'0'..'f'} of Byte = ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,10,11,12,13,14,15); var aB: Byte; I, aMax: Integer; Begin aMax := Length(aHexStr); I := 1; While I < aMax do Begin aB := Convert[Ord(aHexStr[I])] shl 4 + Convert[Ord(aHexStr[I+1])]; Result.Add(aB); I := I + 2; end; end; Somewhat "delphish" I think. What would be the "smart" way to do it? My approach is something like that: var UInt8Array := JUint8Array.Create(Length(aHexStr) DIV 2); I := 1; While I < aMax do Begin aB := Convert[Ord(aHexStr[I])] shl 4 + Convert[Ord(aHexStr[I+1])]; UInt8Array.Items[I DIV 2] := aB; I := I + 2; end;
×