Search the Community
Showing results for tags 'solved'.
Found 9 results
-
problem integrating AAR from manufacturer startup-runtime maybe not working (?)
NecoArc posted a topic in FMX
I have an FMX self-service application designed to run on kiosks/tablets with printers and scanners. The application already works on various device models by integrating with their respective AAR/JAR libraries provided by the manufacturers (extracting the .jar files and generating the JNI interface using java2op). This past month, I have been working on integrating two devices sent by a new manufacturer: the Mini Kiosk Model and the Plus Kiosk Model. According to the manufacturer, the same AAR and method calls are used for both devices. On the Mini Kiosk, I was able to make everything work without any issues. However, on the Plus Kiosk, which should work the same way, Delphi returns the following error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.HashMap android.hardware.usb.UsbManager.getDeviceList()' on a null object reference. So i created a test project in Java that worked fine on both devices, the issue is not with the AAR itself. After talking to the manufacturer’s support, I was advised that the Plus Kiosk requires the startup-runtime-1.1.0 library (Startup Runtime initializes objects and components automatically when the application starts). I checked the manifest.xml inside the AAR and found the following declaration: <application> <provider android:name="androidx.startup.InitializationProvider" android:authorities="${applicationId}.androidx-startup" android:exported="false" tools:node="merge" > <meta-data android:name="com.e1.Comunicacao.ConUSB" android:value="androidx.startup" /> <meta-data android:name="com.e1.Pagamento.Brigde.ConfigFileInitializer" android:value="androidx.startup" /> </provider> </application> This explains the "null object reference" error, as the UsbManager class is not being initialized properly. However, as far as I understand, Delphi already includes this library internally. So I am looking for suggestions on how I can try to solve this issue: Is there a way to check if startup-runtime is correctly interacting with the manufacturer's libraries? Do I need to regenerate the JNI interface, adding startup-runtime to it? (I’m going to try this now, but I don’t see much sense in doing so.) Can someone please help me? I've already spent several days trying to understand and fix this error. -
Good Day, Night ..... ItemNoCol := Ord(ComboBox2.Text[1]) - Ord('A') + 1; QtyCol := Ord(ComboBox3.Text[1]) - Ord('A') + 1; DataStart := StrToInt(ComboBox4.Text); // Which column does data start in for Row := DataStart to ExcelRowsCount do begin ItemNo :=Trim(Sheet.Cells[Row, ItemNoCol]); if (ItemNo <>'') then if (Sheet.Cells [Row, QtyCol] <> '0') or (Sheet.Cells [Row, QtyCol] <> '') then // HERE i get invalid variant operation err.msg begin .... end; What am i doing wrong ? Thank You
-
I have a simple function where i call a json file from memory and then parse it on a FMX project procedure TPrincipal.Button3Click(Sender: TObject); var jsonstr:string; json :TJsonObject ; begin jsonstr:=TFile.ReadAllText(ExtractFilePath(paramstr(0))+'\jsonTeste.json', TEncoding.UTF8); json :=TJSONObject.ParseJSONValue(jsonstr) as TJSONObject; freeandNil(json); end; the json is a 449kb file so it's n ot a big one but when i execute the TJSONObject.ParseJSONValue(jsonstr) as TJSONObject command the memory of my aplication goes up in 20mb then when i execute freeandNil(json) the memory do not goes down those 20mb continues to weigh throughout the execution of the application when i close it, it present memory leaks on jsonObjects, jsonStrings, unicodeString etc. but like why????? i don't understand what is wrong and this seems to happend only with this json thanks for any help, the json file is attached. jsonTeste.json
-
I have always been unable to find an answer to the following: The vertical line I point to in the image: Does it have a name? Can its horizontal position (width or column) be changed? Is it correct for what I think it is? When using Format Code (Ctrl-D), it makes all the code stay inside the limit of that column. Thanks in advance.
-
Is there any way I can run the script without the main thread hanging? I can run the code in a stream, but I don't understand how it works to the end, because I can execute the code in PyCharm and everything works fine. For example, I initialize the stream directly inside the python script, put the code into it, but the Library telethon that performs the task throws the error "There is no current event loop" или "There is no current event loop in thread 'Thread-1 (main)'." или "There is no current event loop in thread 'Dummy-1'." In pycharm that work as def CreateConnect(path: str, proxy, api_hash, api_id, device=None, system=None, loop=None): TC = TelegramClient( api_hash=api_hash, api_id=api_id, session=path, timeout=60, device_model=device, system_version=system, proxy=proxy, loop=loop ) try: TC.connect() if TC.is_connected(): return TC else: return False except Exception as e: print(f'error {path}: {e}') return False def main(loop): asyncio.set_event_loop(loop) #... tg = CreateConnect(path=f'{accPath}\\{account}\\telethon.session', proxy=proxy, api_hash=settings['telethon']['api_hash'], api_id=settings['telethon']['api_id'], device=settings['telethon']['device_model'], system=settings['telethon']['system_version'], loop=loop ) if __name__ == '__main__': loop = asyncio.new_event_loop() p = threading.Thread(target=main, args=(loop,)) p.start() but in delphi, the Thread is initialized on top of the module, as I understood it
-
Good Day Delphi10, FB-3, SQLDataset, DataSetProvider, CDS, DataSource MasterTable TNAME Field.Value = 'A.Cap-' // There is - at the end When I insert a new record into the DetailTable my code is like below DetailTable.FieldByName('TNAME').asString := MasterTable.FieldByName('TNAME').asString; After Post & ApplyUpdate when i check releated record in the Database i see TNAME value in DetailTable is 'A.Cap' // No - at the end, There should have been 'A.Cap-' but in Database, MasterTable TNAME value = 'A.Cap-' // there is - at the end which is correct What is wrong ? Thank You
-
Hi, An hour ago I've tried out CnPack's "Bug reporter" IDE enhancement. It did not go well, after I've clicked "send Email". (Lot's of AV errors, ca 100 / sec while tried to close Delphi 7.) Since than: If I click the green |> arrow or [F9] to start debugging >> it compiles the EXE fine, than starts the EXE normally! (without attaching the debugger process.) Tried to: - restart PC - disable some CnPack modules But nothing helps 😞 - Where is the Delphi "error LOG file"?
-
Hi. I just created a Amazon Linux 2 virtual machine for development and testing. I'm able to connect via SSH, i installed PAServer and it's running normal. However, it's not possible for Delphi to connect to PAServer, even with all the information entered correct. Any clues ?
- 3 replies
-
- alexandria
- linux
-
(and 1 more)
Tagged with:
-
I think i've just found a bug in Delphi 11.1.... In this piece of code i'm getting the error "E2010 Incompatible types: 'TShape' and 'Integer'" but if we take a closer look both types are Integer: