Jump to content

microtronx

Members
  • Content Count

    57
  • Joined

  • Last visited

Everything posted by microtronx

  1. It is a non stop optimizing and refactoring ... Never ending story 😉
  2. Is there a known bug with a Restserver build with RIO for Windows and an Android client calling a normal function like function tServerMethods.testfunction(vparameter1:string; vparameter2:string):string; begin result:=vparameter1+'/'+vparameter2; end; if i call this from an android client with clientmodule.servermethodsclient.testfunction('+abcd','def') the android device shows a error in log: http 404 error ... because the '+abcd' is not encoded. It attaches this to calling url without encoding it so it fails in my case.
  3. It seems, that the rest-client on latest Rio and Android is broken. It has problems with any special chars in parameters like + or /. Seems that it does not encode the parameters in POST request where it add the parameters to the URL ...
  4. Do i need to synchronize here: FMX.Dialogservice.TDialogService.MessageDialog(mxappform._('Bestätigen?'), tmsgdlgtype.mtConfirmation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], tmsgdlgbtn.mbNo, 0, procedure(const AResult: TModalResult) begin if aResult=mrYes then begin tThread.Synchronize(nil, procedure begin // do something on GUI end); end; end);
  5. Hi, i know that Rio does not support below API16 but we have some older apps for industrial devices we need to update them. They were programmed with Tokyo with a lot of problems and i want to test them with Rio. Rio is installed on a new VM so i want to know if someone has get it work to compile apps for api level 16 / android 4.1.1 with Rio.
  6. Hi, new to android and services but thanks to Dave and others i'm on the right way, creating great Apps with Delphi Rio for Android. In my case i lost 2 weeks because of not starting services ... and the reason was the automatic added FireDAC.FMXUI.Wait to my interface-uses. At the moment i make changes to my Datamodule (within Service project), remove the unit with datamodule from my project, go to notepad, open datamaduleunit.pas and remove the "FireDAC.FMXUI.Wait" from uses. Next time i make changes within my datamodule the unit gets automatically added by delphi ... so i again have to remove it from the project and remove the uses by use of notepad. Does someone know how to disable this feature?
  7. microtronx

    How to disable automatic adding of units to interface-uses

    Thanks Dave, that's the trick!
  8. microtronx

    Android Service using local sqlite DB

    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?
  9. microtronx

    Android Service using local sqlite DB

    Again one note for others having also problems with Rio + Android + Service not starting: If you use the unit FMX.Types in your service-units, it will crash also.
  10. microtronx

    How to disable automatic adding of units to interface-uses

    I found a solution: Add a tfdguixWaitCursor component to the datamodule. This component has a "Provider" Property, which can be setup to "Console". It seems this solves the problems.
  11. microtronx

    Android Service using local sqlite DB

    Hi Dave, I use your demo for background-location-updates in a new app and there is one question. will that tLocation use a lot of energy/battery or will it only be active each x minutes as defined in this line: FLocation.TimerTask.Schedule( (cLocationTimerInterval*60*1000) ); I also need a new timer in the service, which i create with tTimerTask.create and set the .schedule(..). Any tips for me for a better battery usage on the device?
  12. microtronx

    Android Service using local sqlite DB

    In my service i don't have that Console define because normally in a FMX Application we need FireDAC.FMXUI.wait ... but in case of android-service we need the FireDAC.ConsoleUI.wait
  13. microtronx

    Android Service using local sqlite DB

    Dave, you're the "Killer". Thanks a lot for this change in your demo. If i compare your project with mine the difference is: yours: FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, FireDAC.ConsoleUI.Wait, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, to mine: FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, FireDAC.FMXUI.Wait, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, Using your used units solved all hangers + i have removed the datamodule-unit and restclient-unit also from project files. Everything is now working for some minutes without problems, very coool Thank you very much,
  14. microtronx

    Android Service using local sqlite DB

    Hi All, thanks for trying to help me out. Now after i was able to debug the android-service by creating a lot of toslog.d entries and viewing them in realtime with help of the DeviceLens Tool we see that the problem is not only the Data.DB! If we use Data.DB (i had defined $ifdef's for this) then we have used also a function as described in And there is also the problem. Each time the service calls that function with a + in a string it gets appended to a server-method-call within the url and the service stops working because of an exception http/404! I was not able to see this because the service is not debuggable from Delphi (afaik). Now after doing a check of strings / url-encoding them it works but this seems to be a bug in latest Rio Restserver / restclient impementations ... But using Data.DB also forces the service to hang, it can't even be started!
  15. See here: https://github.com/DelphiWorlds/DeviceLens Thank you DelphiWorlds! This is helping me more than everything else for debugging my Android-Apps
  16. microtronx

    Android Service using local sqlite DB

    Yes, i think i can but i have deadlines with projects. Will try to create a Demo based on https://github.com/DelphiWorlds/KastriFree/tree/master/Demos/CrossPlatformLocation asap.
  17. microtronx

    Android Service using local sqlite DB

    I have changed the code so the services does nothing, only adding the data.db in uses stops it from starting, removing the data.db everything ok again.
  18. microtronx

    Android Service using local sqlite DB

    Hi Lars, No rights are there. I'm requesting all rights on application start so we have access to filesystem ... as said, it works when i create all db-components in code and i can write / read.
  19. microtronx

    Android Service using local sqlite DB

    I don't think it has to do with that, because I can use the sqlite db with creating components in code and excluding Data.DB from uses.
  20. microtronx

    Android Service using local sqlite DB

    Good morning Dave, it is crazy but possible it has to do with Android 9? In my case everything works if i don't use the Data.DB and that means, i have to create all DB-Components in code. I'm doing this, using tSQLConnection and tSQLQuery for all access to SQLite Database files from app and from service. It works but something is not ok in Delphi. I use latest Rio with all available patches.
  21. microtronx

    Android Service using local sqlite DB

    I have removed all occurences of Data.DB Unit from my project and units and now the Service is working without problems. Seems that Delphi Rio latest Version has problems there ...
  22. microtronx

    Android Service using local sqlite DB

    I was able to track down things, it seems if we use Data.DB in tServiceModule or another unit which is used by the android-service the service is not able to start. Now i create a tFdConnection directly in the tServiceModule by using only these units: FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Comp.Client, and now the Android Service is running fine. Next I will check if same happens, if we remote Data.DB from ClientModuleUnit's from Rest-Client ... Edit: those FireDAC units are not enough, adding others >> service hangs .. i think some of them uses Data.DB ... Ohh Embarcadero...
  23. microtronx

    Android Service using local sqlite DB

    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,
  24. 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.
  25. 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.
×