

Rollo62
Members-
Content Count
1971 -
Joined
-
Last visited
-
Days Won
26
Everything posted by Rollo62
-
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;
-
Unable to deploy after unchecking 'include splash image'
Rollo62 replied to Yaron's topic in Delphi IDE and APIs
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. -
+1 But on desktop there is the title line at the bottom too (not sure on mobile), but still scroling is necessary.
-
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 👍
-
+1
-
Exactly,I would think the same way. But since Arnauld is recommending mORMOT, does this help to allow Multi User ?
-
Thanks, good to know. I use AutoLock to avoid fastly Off After 20sec, but Thanks Good I have very likely user interactions within 20min.
-
How do you test your Delphi applications for Android?
Rollo62 replied to Yaron's topic in Software Testing and Quality Assurance
Have you installed all hotfixes, etc., and have you tried with a "blank" app, e.g. just a button ? -
How do you test your Delphi applications for Android?
Rollo62 replied to Yaron's topic in Software Testing and Quality Assurance
Yes, I mostly had problems with iOS and Samsung devices. But currently (since 10.2.3) all is fine. -
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;
-
Where do I store my own images on Android?
Rollo62 replied to John Kouraklis's topic in Cross-platform
You could consider to use System.IOUtils.TPath.Combine(path1, path2); to get rid of the TPath.DirectorySeparatorChar -
How do you test your Delphi applications for Android?
Rollo62 replied to Yaron's topic in Software Testing and Quality Assurance
Yes, I use RadStudio under Win10 (1803), in VmWare Fusion (still V11), on a Mac for iOS and Android development. -
How do you test your Delphi applications for Android?
Rollo62 replied to Yaron's topic in Software Testing and Quality Assurance
I have about 6-7 different devices, including Android & iOS, for direct testing. But I mean that I'm lucky to have also several Beta-Tester, with more devices, so usually I can test about 20 different devices before upload to the stores. -
Clean Code and Fast Code Slides at EKON 22
Rollo62 replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
Ok, sorry. I misunderstood your question. Now I got your point. -
Clean Code and Fast Code Slides at EKON 22
Rollo62 replied to Arnaud Bouchez's topic in Tips / Blogs / Tutorials / Videos
What happens if you put this in a local procedure, and call it instead ? procedure Main_Function; var meters: TDistanceMeters; miles: TDistanceMiles; begin miles := 100; // No syntax error, no warning, no hint meters := ConvertMetersToMiles(miles); // No syntax error, no warning, no hint end; -
How do you test your Delphi applications for Android?
Rollo62 replied to Yaron's topic in Software Testing and Quality Assurance
I try to test the most common devices in the market, the rare devices I do ignore (not much complaints yet from customers). From Asia I have got more issues, that apps don'T start, but usually they have strange versions of Android running. -
Some isues I had with Samsung devices for debugging in the past, since they seem to had problems with permissions to debug. There were issues with accelleration sensor too, not returning any data. But with the current versions this works again, and debugging is quite smooth (but somewhat slow). Of coarse my oldest, main phone for testing is Samsung S7 Edge, also with older Android 7.0, so I don't check with older devices or OS really.
-
I cannot complain much. Works well from a VM und er Macos, able to debug iOS and android. Usually iOS was more trickier to get running för me, Android was always quite calm. Only since Google changed permissions it got problematic. Rollo
-
Hello everybody, I'm just testing some effects of the required Android permission system, and would like to check with you what would be the best practices. I have used and checked the wonderful KastriFree project from Dave, it all worked well to get things solved. There are the two (actually 3) levels "Normal permissions" and "Dangerous permissions": with "Dangerous permissions" its clear: you need to ask the user for interaction via PermissionRequester But how to handle "Normal permissions", lets take WakeLock as an example ? I can check WakeLock in the "uses permissions" list in the IDE, and don't need a PermissionRequester at all. Would it be better to use the same permission requester process also for WakeLock, although its not needed ? What I found so far is, that it will work with the requester, but simply always grant the permission. I personally would tend to use same procedures now, no matter if "Normal" or "Dangerous", just to be consistent, as well as to be ready for future permission changes. Or is there any reason why I should NOT use "Normal" permissions in same way ? Rollo
-
[Fmx, Android] Normal & Dangerous permissions handling
Rollo62 replied to Rollo62's topic in Cross-platform
Yes, but maybe its good practice to do it always with the same procedure - to have same procedure, no matter if dangerous or not, will avoid hard to find setting errors - to ensure that, if Google considered this or that topic as dangerous in the future, my app is already well prepped Maybe for other good reasons too. Is there anything that speaks against such "overuseage" ? Rollo -
Using configuration records and operators to reduce number of overloaded methods
Rollo62 replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
Dear Primoz, thanks for the nice article. For me personally (this is not that I want to convince everybody), I like and use another pattern quite often in such cases: conn.SetupBridge_FromRelative(url : String); conn.SetupBridge_FromAbsolute(url : String); conn.SetupBridge_FromXxxx( ....); This makes it a lot easier for me to choose the right version, and I got clear parameter lists, on the cost of longer function names, of coarse. Since I'm a friend of long and "speaking" names, this is not a big problem to me, but I can confess this can get nasty in some situations too. Rollo- 7 replies
-
- language
- configuration
-
(and 2 more)
Tagged with:
-
Your right, but unfortunately ApplyStyleLookup seems not always be consistent, (ApplyStyle in some cases), depending on the component. So I would love to find a common "best practice", which could be used for all controls. Until this may be available, I mostly use rather primitive controls, and I got used to that already well. Some of these simple controls run even well under the "Defaut" platform style, so no need to define "Win", "OSX" styles, etc. separately. But I'm talking here about TRectangle or the like. I understand that the platforms are the reason to have different styles in the first place, but I also would like to have a common set of controls, which could be easily custom-styled and live in the "Default" style. Maybe tít would be possible to define some own control sets, which would be able to handle such styles in a more general way, hopefully one day I will have more time to make such experiments.
-
I almost forgot XE2 already, beside the name, and only that I was very exited about the possibilites of FMX 🙂 More problematic than the 'rect' I find the FindStyleResource, which not always gives a valid result. So you should take care when and where you ask for FindStyleResource, because sometimes you will get nil. I changed all my settings usually from FormCreate to FormShow, which has other issues then, but its not that easy as in XE2 (or better VCL) any more, your right.
-
Right, I use a separate form for the Styles editing, and preparing a StyleBook component. With that Stylebook, you can copy and paste by the way, you can use them in other Frames etc. too. The nice thing is that the StyleName property is visible project-wide, and can be used everywhere. Once you have a knd of "common stylebook", its possible to reuse this. Unfortunately the Style system is far from easy to use, but thankfully EMBT offered the export as .style in text. If this option would not be there, I would not touch styles either.
-
This is all right, I use it only on more primitive controls. But the style concept of FMX is so much more than only changing PNG images. Its possible to add components, animations, etc. You're right, the existing style elements are sometimes hard to configure, but EMBT has added e.g. the TStyleColor Object to ease at least re.coloring. But for own styles you can do a lot more. Rollo