Jump to content

microtronx

Members
  • Content Count

    136
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by microtronx


  1. 2 hours ago, Cristian Peța said:

    Have you tried to delete all Tfdconnection and Tsqlconnection? Still does not start?

    Do you open Tfdconnection at runtime after the service start-up? Or it's set active at design time?

     

    Toooooo many questions....

    Hi Cristian,

     

    I configure and connect the connection at runtime after the service starts up. It is not connected at designtime.

     

    1. if i remove the unit from implementation uses where tDatamodule with tsqlconnection / tfdconnection is, than the app and service starts.

    2. If i let the unit in implementation uses and delete the tfdconnection/tsqlconnection from datamodule but let the interface-uses:   Data.DbxSqlite, Data.FMTBcd, Data.DB, Data.SqlExpr; than it hangs!
    3. if i do the 2. but remote the units "  Data.DbxSqlite, Data.FMTBcd, Data.DB, Data.SqlExpr;" from interface-uses than it hangs

    4. if i create the tsqlconnection and a tsqltable directly within the tServiceModule at runtime and add the needed units (see 2.) to interface-uses than it hangs

     

    5. if i change the project file and remove the units for tDatamodule than i can create components at runtime within tServiceModule and it works !!

     

    Seems that the problem is connected with tDatamodule? Dont know really... crazy,

     


  2. 8 minutes ago, Dalija Prasnikar said:

    This is design error in built in Delphi JSON library. Instead of working with properties it works with fields. 

     

    https://quality.embarcadero.com/browse/RSP-26262

     

    AFAIK there are some options to add custom converters , but I never used it... take a look at REST.JsonReflect and Data.DBXJSONReflect

    Thanks for link to rsp.

    I have read a lot regarding DBXJSONReflect but there is no good documentation so i don't know how to create a custom converter for my object, so that datasnap uses the registered converters for Marshal and UnMarshal.

     


  3. As in different old topics written, it is still not possible to have a android service with a tfdconnection or a tsqlconnection on it. The service is not starting any more, you use this. 

     

    Here's a link: https://forums.embarcadero.com/thread.jspa?threadID=229761

     

    But what can we do? Is there a known solution? I'm not able to find one. Have tried to create all components in service's code but still, i don't even get a log entry that means the service still can't be created and the app hangs on trying to start the service.

     

    Anone out there who can give some tips?


  4. Hi, i'm searching now for days how to setup datasnap / json to automatically Marshall and UnMarshall following Object;

     

    	__Constants = record
    	public
    		vname:string;
    		vwert:variant;
    	end;
    	tmyObject = class(tObject)
    	private
    		[JSONMarshalled(False)]
    		fData:tDictionary<string, __Constants>;
    
    		fJsonValue:string;
    		fname:string;
    
    		function getJsonValue():string;
    		procedure setJsonValue(vValue:string);
    		function fData_get(vindex:int64):_Constants;
    	public
    		constructor Create;
    		destructor Destroy; override;
    
    		property  cName:string read fname write fname;
    		property  cData[index:int64]:__Constants read fData_get;
    
    		[JSONMarshalled(true)]
    		property JsonValue:string read getJsonValue write setJsonValue;
    	end;

     

    I hoped that the marshaller get's the value of property JsonValue so the getJsonValue() is called and converts the fData to Json but it does not. The Marshaller directly read the fJsonValue which is empty.

    Also i can't find any good documentation about the attributes like [JSONMarshalled(false|true)]

     

    Any help is appreciated.


  5. If i open the demo, select the service as active project and add a new clientmodule to a datasnap-server, save it and change the code in locationchangehandler to this:

     

    procedure TServiceModule.LocationChangeHandler(Sender: TObject; const ALocation: TLocationCoord2D; const ASource: TLocationSource);
    var
      LStatus: Integer;
    begin
      // This is where to use the location data to update a server, or to a database when not connected to the internet and the data is to be sent later
      LStatus := 0;
      // Service in foreground means app is inactive
      if IsForeground then
    	LStatus := 1;
      if FBackgroundMonitor.IsDozed then
    	LStatus := 2;
    //  FUpdater.SendLocation(ALocation, LStatus);
    
    
    	try
    		if locationClientModule.ServerMethodsClient.savelocation('hardwareidxx', aLocation.Latitude, aLocation.Longitude, lStatus, now())=true then begin
    			toslog.d('savelocation REST OK');
    		end;
    	except
    		on e:Exception do begin
    			toslog.d('savelocation REST Error:'+e.message);
    		end;
    	end;
    end;

    plus add the locationclientmodule's unit to implementation/uses the module does not start any more, this is from logcat:

     

    01-22 12:40:55.046  1491  1510 W ActivityManager: Timeout executing service: ServiceRecord{8ba5020 u0 org.xxxx.xxxx/com.embarcadero.services.xxxxLocationService}
    01-22 12:40:57.623  1491  1510 E ActivityManager: Reason: executing service org.xxxx.xxxx/com.embarcadero.services.xxxxLocationService

     

    I have also tried to add only a tfdConnection and a tfdQuery onto service-module and same problem, the service can't be started. the device i'm testing this is a Huawei P30-Lite with Android 9 on it. Possible that the problem is connected with this?


  6. Guys, have heard about htscripter from Delphihtlmcomponents?

     

    We are using it as runtime interpreter and it is working very good and stable plus it registers classes with only few lines of code (rtti) and the most important thing is: it is still developed and optimized by the developer.

     

    We have switched over from jvInterpreter! and it was a very good decision!

     

     

    • Like 1

  7. Hi Folks,

     

    i'm new to Android Services world but have successful created my first app with a background-service (used demo of Kastrifree / CrossPlatformLocation) as base. It works good, but as soon i add a tfdconnection for a local sqlite table or a TDSRestConnection for connecting to a remote-server in the service-module it does not start.

     

    My question is: What are the limits of a android-service-module created with Delphi Rio? What is blocking the service from starting if we add one of those components?

     


  8. 9 hours ago, Dave Nottage said:

    I can help particularly with this part if you're interested.

     

    Hi Dave,

    give me a while so i can check the projects in limelect's suggestion. If i can start with something from there i will need only the service programmed by someone. So yes i'm interested.

    But i have not too much time so if someone is willing to create everything on his side i can invest my time for serverside so the beta in january is not impossible 😉


  9. Hi programmers,

     

    i'm a Delphi programmer now for 20+ years since Delphi 3, having subscription and now on Delphi Rio 10.3.3. Because of not having enough experiences with Android i need a template for starting projects with android:

    I need at least following functionality:

     

    * Login Screen with Register new user screen (all data can be saved / received later from a restserver)

    * List of Functions Screen like the settings screen on android 9 with a search-area on top + in same area my details with login/registrationdata and below a list of different functions with icon+caption + small description (smaller font)

    * Function details screen where we have different options details etc (can be made later by us)

    * An android service in backgroud which can i.e. collect gps positions each x minutes into a table for later use within the app

     

    For now this is all. I'm searching for a programmer which has enough experiences with android to create this template / app for us so we can use it as "starting template" with latest Delphi Rio.

    Offers welcome.

     

    Yusuf Zorlu / MicrotronX


  10. 4 minutes ago, Lars Fosdal said:

    That is unfortunately correct.  

    As mentioned above - if you avoid creating Json that embed container data outside your control, you will avoid such issues.

     

    New projects are not using things like "tstringlist" as a result ... Yep, we will change all "old" projects. Thx.

    • Like 1

  11. 40 minutes ago, Lars Fosdal said:

    That was a very weird difference. It looks like the types of Fencoding and FDefaultEncoding has changed. 

    Can it be that the type you intend to use is being "replaced" by type with the same name, due to a scope issue?

     

    image.thumb.png.fb712d4e980cd1d063ae752573bb8882.png

     

    I do nothing special, i open the project compile it with Tokyo and it works, i open the same project without changing anything with Rio 10.3.3 and it does not work. 

     

    In Rio and in Tokyo it shows System.Classes.xxx when i move the mouse over tStrings and tStringList


  12. 38 minutes ago, Lars Fosdal said:

    Can you describe in what way the Json encoding differs?  Json examples would be good!

    Even better would be small self-contained compilable example that demonstrates the difference between 10.3.2 and 10.3.3.

    Here's a example. 

     

    1. Servers method:

    function tmyServerMethods.Load_Scanning_Functions(vuserid:longint):tstrings;
    var
    	i:integer;    
    begin
        result:=tstringlist.create;
    		// data is a query ...
    		for i:=1 to vdata.recordcount do begin
    			result.add(inttostr(vdata.fieldbyname('statusid').asinteger)+'|'+vdata.fieldbyname('statusname').asstring);
    		end;
    		vdata.next;
        end;
    end;

    2. Answer compiled with Tokyo:

    {"result":[{"type":"System.Classes.TStringList","id":1,"fields":{"FList":[["10|Einlagern",null],["30|Umlagern",null],["400|Kundenbarcode",null],["100|St\u00FCckgutverladung",null],["400|NVE zu Kundenbarcode",null],["",null],["",null],["",null]],"FCount":5,"FCapacity":8,"FSorted":false,"FDuplicates":"dupIgnore","FCaseSensitive":false,"FOwnsObject":false,"FEncoding":null,"FDefaultEncoding":{"type":"System.SysUtils.TMBCSEncoding","id":2,"fields":{"FCodePage":1252,"FMBToWCharFlags":0,"FWCharToMBFlags":0,"FIsSingleByte":true,"FMaxCharSize":1}},"FLineBreak":"\r\n","FUpdateCount":0,"FDelimiter":",","FQuoteChar":"\"","FNameValueSeparator":"="}}]}

    3. Answer compiled with Rio:

    {"result":[{"type":"System.Classes.TStringList","id":1,"fields":{"FList":[["10|Einlagern",null],["30|Umlagern",null],["400|Kundenbarcode",null],["100|St\u00FCckgutverladung",null],["400|NVE zu Kundenbarcode",null],["",null],["",null],["",null]],"FCount":5,"FCapacity":8,"FSorted":false,"FDuplicates":"dupIgnore","FCaseSensitive":false,"FOwnsObject":false,"FCompareStringsOverriden":false,"FEncoding":"","FDefaultEncoding":"1252","FLineBreak":"\r\n","FUpdateCount":0,"FDelimiter":",","FQuoteChar":"\"","FNameValueSeparator":"="}}]}

    4. In the client app (compiled with Tokyo) cannot work with the result. We're no able to update the client apps at the moment.


  13. 30 minutes ago, Lars Fosdal said:

    Can you describe in what way the Json encoding differs?  Json examples would be good!

    Even better would be small self-contained compilable example that demonstrates the difference between 10.3.2 and 10.3.3.

    The Rest-Application's difference is between Tokyo and Rio. I'll try to isolate that at a later time ...


  14. Good / Great news: Some problems with Regular Expressions in 10.3.2 are not appearing in 10.3.3 so this is a good bugfix update! 

     

    Bad news: A Datasnap Rest Application Server compiled with 10.2 Tokyo is working very good for months without restart, compiled with 10.3.3 it answers with different REST / JSON encoding so client apps don't work any more !


  15. 1 minute ago, Angus Robertson said:

    I've used SvCom from Aldyn Software for 15 years.  It is commercial software, still being updated for new Delphi versions, comes with source code. 

     

    The major benefit is it allows applications to be created as dual purpose GUI and service applications, which means you can develop and test under the Delphi debugger with a minimal GUI window usually just a log window and start/stop buttons.  Some of my applications can be optionally installed as a service, but have a full GUI as well, and include their own code to install as a service.

     

    Angus

     

     

    That means it is still supported? I have send two request to their mails but have not received any answers so i thinked that they not "online" anymore ...


  16.  Here's my Outlook 2019 in 64bit, can someone test this with new Outlook in 32bit so we can compare:

     

    TDropFileSource,Execute,>>>
    TDropFileSource,OnGetDragImage,
    TDropFileSource,OnGetData,Shell IDList Array
    TDropFileSource,OnGetData,IsShowingText
    TDropFileSource,OnGetData,UsingDefaultDragImage
    TDropFileSource,OnGetData,DragSourceHelperFlags
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnGetData,DragContext
    TDropFileSource,OnGetData,Shell IDList Array
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,Shell IDList Array
    TDropFileSource,OnGetData,IsShowingText
    TDropFileSource,OnGetData,UsingDefaultDragImage
    TDropFileSource,OnGetData,DragSourceHelperFlags
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnGetData,DragContext
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,UntrustedDragDrop
    TDropFileSource,OnGetData,Shell IDList Array
    TDropFileSource,OnGetData,Shell IDList Array
    TDropFileSource,OnGetData,Preferred DropEffect
    TDropFileSource,OnGetData,Shell IDList Array
    TDropFileSource,OnGetData,DropEffectFolderList
    TDropFileSource,OnGetData,Preferred DropEffect
    TDropFileSource,OnGetData,Shell IDList Array
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,UntrustedDragDrop
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,UntrustedDragDrop
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,UntrustedDragDrop
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,UntrustedDragDrop
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,UntrustedDragDrop
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,UntrustedDragDrop
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,
    TDropFileSource,OnGetData,UntrustedDragDrop
    TDropFileSource,OnGetData,DisableDragText
    TDropFileSource,OnGetData,IsComputingImage
    TDropFileSource,OnGetData,DropDescription
    TDropFileSource,OnFeedback,19
    TDropFileSource,OnDrop,
    TDropFileSource,OnGetData,Object Descriptor
    TDropFileSource,OnGetData,FileName
    TDropFileSource,OnGetData,CF_HDROP
    TDropFileSource,OnAfterDrop,
    TDropFileSource,Execute,<<<
    

     

×