Jump to content

Rollo62

Members
  • Content Count

    1671
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by Rollo62

  1. If so many people urgently (mis)use it that way, this should be a sign that there is a strong need 🙂
  2. Hi folks, I'm trying to use TWebBrowser (embedded in the app) to show a special page in my mobile apps. These page is able to download images and other stuff from that page. When I use normal web browser such documents land in the downloads folder. Of coarse mobile apps life in a sandbox, and it seems that downloads don't land in public downloads folder. iOS seems to open the image in a separate page, which Android seems to do nothing. From the behaviour so far I can say that the embedded browsers behaves different than the default browser of the system. My questions are howto handle downloads via embedded TWebBrowser in Android and iOS ? Are downloads blocked completely on mobile ? Are downloads stored somewhere in the sandbox ? Can I configure somewhat in TWebBrowser (below surface), to finetune behaviour and where documents will land ? Can I hook into the click/ajax events of the TWebBrowser page (if I have no control over the page itself) ? Maybe a concept of control would be to use a local HTML5 wrapper page with frames around the target site, so to be able to get control about the inner events of the target site ? I would prefer to use the internal TWebBrowser, if possible, but also 3rd party solutions would be welcome Hope somebody of the mobile experts have found more insights and a good solution already. I cannot change the HTML5 page, by the way, to add something like a JS-bridge to Delphi directly, so I hope to find some hooks and tweaks around. Rollo
  3. Thanks, I still checking some stuff to get around this at all, with Indy and THttpClient, so far I prefer the new THttpClient. This may work for 90% of the needs, but may fail to work with a life-video stream via Ajax events, thats why I try to use TWebBrowser in the first place., since this will work in the native environment with full performance. But thats another story. I will check such JS "injections" on Android first, then iOS later, but indeed I had hope to find a general solution to all platforms. This seems to be a lot of handcafted work, each on Delphi as well as on HTML side. Maybe there is the simple possibility to send events somehow, like TMessage to be received via TMessageManager) from JS to Delphi ?
  4. Rollo62

    Units design

    Maybe Uwe's MMX-Explorer might be a helpful tool clearing your units up. (be aware, I'm not sure if its already 100% Rio-ready yet, better check before)
  5. Dear Eli, thank you very much for sharing and finding such nice solution. I will check later, but that looks good, seems be able to inject something into the browser.
  6. Rollo62

    Pointers are dangerous

    So you're looking for a pointer as alias 🙂 Maybe this will be the next language extension
  7. Rollo62

    TListView collapse stuff under a header

    Maybe be toggling the Visible flag for all entries from below the "Clicked" Header item to next Header item ? Certainly not nice, I know, but I think there is no grouping function included in FMX.ListView AFAIK. Not sure howto force Headers to fire events.
  8. Rollo62

    TListView collapse stuff under a header

    Do you mean like that ? https://community.embarcadero.com/blogs/entry/adding-headers-to-tlistview-programmatically This is done via TListItemPurpose.
  9. Rollo62

    10.3 Rio: No iOS target

    Can you resolve this by building an empty test-app with XCode ? Usually XCode fixes (or at least warns) all issues, like missing/wrong provisionging files. After empty XCode app is running, you could try another empty app via Fmx.
  10. Rollo62

    IDE Fix pack for Rio

    As far as i understood EMBT, the IdeFixPack should be partly Integrated. Is there still tve need for the rest ?
  11. Rollo62

    10.3 Rio: No iOS target

    Did you define a connection profile ?
  12. I personally use ifdef as modularization option of common behaviours, for different customers or versions, e.g. in a common configuration file (*.inc normally). What I mean here is for example the support of special custom hardware modules (e.g. for connection to special hardware which is supported). To make the whole process more readable, I personally use a special signature for my ifdefs very often, which makes the whole status and situation very readable and clear for the status of switching ON and OFF., {$DEFINE _X_USE_MODULE_A} {$DEFINE _X_USE_MODULE_B} {$DEFINE ___USE_MODULE_C} {$DEFINE _X_USE_MODULE_D} {$DEFINE ___USE_MODULE_E} ... {$IFDEF _X_USE_MODULE_A} ... {$ENDIF _X_USE_MODULE_A} I know that mostly the notation of {.DEFINE Module_A} is used for switching off conditionals, but I very much dislike this for poor readability, especialy if you have switches for many similar options, like in above sample. This is just a possible, different way to to defines (which I have never seen anywhere else before, but this I don't care). Maybe somebody likes such "talking" defines too.
  13. I've installed Rio right now, and testing ... So I had some time to check for your issue, not sure if this is what you want to achieve. When I use this settings And disable these files in the deployment manager My project APK results in missing those splash images under /res Still possible to compile, debug and launch with RadStudio
  14. Rollo62

    Android 8.0 Permissions errors using Delphi Rio 10.3

    I think it should be good practice to request permission short before desired access, Not to request this generally in FormCreate or FormShow. If you do so rhe request will popup directly after app launched, maybe not even fully prepared, and users (like me) will see this quite suspicious.
  15. Rollo62

    TImagelist dynamic.

    I used something like this for testing purposes // Adds a new Bitmapitem to the ImageList acc. to InsertPos // iInsertPos = -1 = Append; iInsertPos = Insert(iPos, ... insert before // ASrcRect defines the CropRect of the SourceBmp, which is used in Destination // Return the just added ImgList ID function ImgList_Bitmap_Add( iInsertPos : Integer; const ADestImgList : TImageList; const ADestRect : TRectF; const ASrcBmp : TBitmap ) : Integer; var isi: TSourceItem; idi: TDestinationItem; lay: TLayer; sSrcName: string; bmi: TBitmapItem; ms: TMemoryStream; begin Result := -1; if not Assigned(ADestImgList) or not Assigned(ASrcBmp) then Exit; if (ASrcBmp.Width = 0) or (ASrcBmp.Height = 0) then Exit; try // Create new Source entry if iInsertPos < 0 then isi := ADestImgList.Source.Add as TSourceItem // Append else isi := ADestImgList.Source.Insert(iInsertPos) as TSourceItem; // Insert before if not Assigned(isi) then begin Exit; // Somethings wrong end; // Create MultiResBitmap w/ LAyer if isi.MultiResBitmap.Count = 0 then begin bmi := isi.MultiResBitmap.Add as TBitmapItem; if not Assigned(bmi) then begin Exit; // Somethings wrong end; // Add the Bitmap via Stream, to allow Format settings ms := TMemoryStream.Create; // Copy Bmp via Stream, so that PNG-Format is possible try ASrcBmp.SaveToStream( ms ); ms.Position := 0; bmi.Bitmap.CreateFromStream( ms ); finally ms.Free; end; end; // Get the unique SourceItem Name sSrcName := isi.Name; // Create new Destination entry if iInsertPos < 0 then idi := ADestImgList.Destination.Add as TDestinationItem // Append else idi := ADestImgList.Destination.Insert(iInsertPos) as TDestinationItem; // Insert before if not Assigned(idi) then begin Exit; // Somethings wrong end; // Add new Dest Layer, for output lay := idi.Layers.Add; if Assigned(lay) and (sSrcName <> '') then begin // Link the Layer with the Source, so that Output Bitmap is linked lay.Name := sSrcName; // Setup the link the the Source Bitmap here lay.SourceRect.Rect := ADestRect; // Region which crops within the soure-Rect // Finally new Bitmap is in list, return the destination ID Result := idi.Index; end; finally end; end;
  16. Not sure if that is a good idea. https://cyrilmottier.com/2013/01/23/android-app-launching-made-gorgeous/ Maybe simplest way is to provide a black PNG image.
  17. Rollo62

    Display the title

    +1 But on desktop there is the title line at the bottom too (not sure on mobile), but still scroling is necessary.
  18. Rollo62

    MMX for Delphi 10.3 Rio

    Thanks for the great tool, I will check a little later. Good decision in general, to make projects futureproof, instead of trying to re-invent the past 👍
  19. Rollo62

    Advice on starting to work with databases

    Exactly,I would think the same way. But since Arnauld is recommending mORMOT, does this help to allow Multi User ?
  20. Rollo62

    Issue with guided access

    Thanks, good to know. I use AutoLock to avoid fastly Off After 20sec, but Thanks Good I have very likely user interactions within 20min.
  21. Have you installed all hotfixes, etc., and have you tried with a "blank" app, e.g. just a button ?
  22. Yes, I mostly had problems with iOS and Samsung devices. But currently (since 10.2.3) all is fine.
  23. Rollo62

    An elegant open-source calculator for Android

    Another good expression parser is the one from LiveBindings, explained by Daniele Teti. Not sure if that old XE2 sample still works, but it should give the basic idea. I use the expression engine of LiveBindings for calculations in my projects, usable in runtime. This is how I use it: uses System.Rtti , System.Bindings.EvalSys , System.Bindings.EvalProtocol , System.Bindings.Evaluator , System.Bindings.Methods ; function TTestCalculator.Evaluate(const AExpr: string) : Double; var LScope: IScope; LCompiledExpr: ICompiledBinding; LResult: TValue; begin Result := 0.0; try LScope := TNestedScope.Create(BasicOperators, BasicConstants); //add the registered methods LScope := TNestedScope.Create(LScope, TBindingMethodsFactory.GetMethodScope); LCompiledExpr := Compile(AExpr, LScope); LResult := LCompiledExpr.Evaluate(LScope, nil, nil).GetValue; if not LResult.IsEmpty then Result := LResult.AsExtended; finally LCompiledExpr := nil; LScope := nil; end; end;
  24. Rollo62

    Where do I store my own images on Android?

    You could consider to use System.IOUtils.TPath.Combine(path1, path2); to get rid of the TPath.DirectorySeparatorChar
×