

Rollo62
Members-
Content Count
1945 -
Joined
-
Last visited
-
Days Won
24
Everything posted by Rollo62
-
[Fmx, iOS] Vibration, which Framework for which devices ?
Rollo62 replied to Rollo62's topic in Cross-platform
Yes I used this one. So you know any reasons why this might work on some iPhones and some not ? These were comments from users, i dont have such iPhones in hand. Its working fine on all my test devices. -
Hi there, I was trying to package the notifications in a more easy to handle function, to be set at runtime. What I noticed was that the NotificationCenter doesn'T seem to work with this method (at least I checked iOS only): FNotificationCenter := TNotificationCenter.Create( nil ); FNotificationCenter.OnReceiveLocalNotification := EvOnReceiveLocalNotification; The internal methid shows a class constructor: class constructor TCustomNotificationCenter.Create; begin {$IF defined(IOS) or defined(ANDROID)} // We need to create the NotificationCenter to register the external notification messages from the system in the app initialization TBaseNotificationCenter.InternalGetInstance; {$ENDIF} end; But this seems never be called, neither the normal Create of the Notification center constructor. constructor TBaseNotificationCenter.Create; begin inherited; TMessageManager.DefaultManager.SubscribeToMessage(TMessage<TNotification>, DoReceiveLocalNotification); end; Maybe somebody knows how it would be possible to create the notification center via runtime safely ? What works is if I pass the normal IDE component to my class, then it works correctly. It seems to me that there are maybe special requirements on the sequence or timing of the creation, or maybe it needs an Owner to work correctly.
-
Not really, I would say. TNotificationCenter is considered to be used in DesignTime only. EMBT would respond to this issue as "by design" probably
-
What about using a 9-patch images: http://docwiki.embarcadero.com/RADStudio/Rio/de/Verwenden_von_9-Patch-Grafiken_in_Android http://docwiki.embarcadero.com/RADStudio/Rio/de/Anwendungsoptionen https://stackoverflow.com/questions/13487124/android-splash-screen-sizes-for-ldpi-mdpi-hdpi-xhdpi-displays-eg-1024x76 https://github.com/yypbd/yypbd-Delphi-NinePatch https://medium.com/@101/splash-screen-in-android-769d3b0bafd0 But I think the basic problem stays the same, you won't get a pixel-perfect display on all devices (if that is needed). P.S.: I would consider if this is worth the efford for an image visible only once at startup. (but customers are kings ....)
-
I think I found the reason: It has to do with the Loaded function when components are created procedure TNotificationCenterIOS.DidFormsLoad; begin FIsApplicationLoaded := True; NotifyDelayedNotifications; end; procedure TNotificationCenterIOS.DoLoaded; begin inherited; DidFormsLoad; end; procedure TCustomNotificationCenter.DoLoaded; begin if Supported then FPlatformNotificationCenter.DoLoaded; //<-- This is never loaded when created during runtime end; I have to simulate the Loaded function, so below is the workaround that fixes the behaviour: procedure TForm1.Notification_Center_Create( AOwner: TComponent ); begin FNotificationCenter := TNotificationCenter.Create( AOwner ); FNotificationCenter.OnReceiveLocalNotification := EvOnReceiveLocalNotification; FNotificationCenter.Loaded; //<-- this works and simulates the component "loaded" state end; I hope that it might be useful for somebody else too. All this was not nice to find, because the libraries also couldn't be debugged in my setting, for some reason. Usually I can debug all the included libraries. Anyway, I can get back to more productive coding again
-
I just made some more tests. I've tried to create a TNotificationCenter variable, created with Owner, like this: procedure TForm1.FormCreate(Sender: TObject); begin MyNotification_Center_Create( Self ); end; procedure TForm1.Notification_Center_Create( AOwner: TComponent ); begin FNotificationCenter := TNotificationCenter.Create( AOwner ); FNotificationCenter.OnReceiveLocalNotification := EvOnReceiveLocalNotification; end; ! But on the Form I have NOT dropped any TNotificationCenter component. OK: Creation works fine OK: Sending local notification works fine OK: When in background & pressing a notification, the app is shown nOK: When in background & pressing a notification, EvOnReceiveLocalNotification is never fired. With a second test, same app, the only difference is: I drop a TNotificationCenter component on the form Just drop component No further "uses" appear Not touching this component at all: No Event handler, no method call, not changing properties ! Suddenly the same code from above magically works. OK: When in background & pressing a notification, EvOnReceiveLocalNotification is fired as it should (before BecameActive). It seems that somehow dropping the component on the form changes something, maybe creation order or registrations. Perhaps somebody has a clue how I could get rid of the designtime component here ? Edit: Another test It also worked as expected without the owner: FNotificationCenter := TNotificationCenter.Create( nil ); <-- Works also, when somewhere a TNotificationCenter was dropped The only difference is that the component needs to be dropped on the main form, to get the event working.
-
Maybe some vendors may use their own USB-drivers, have you checked this one ? I use Samsung devices here too, long time ago I had to consider to install Samsung ADB driver, since I few years I never got into this issue anymore (eiter I have current Samsung driver, or Samsung switched to Google driver too). I hope that nasty issue keeps "magically" solved by EMBT anf Google for the future
-
@TurboMagic Approved by Google and customers of the many Apps in the PlayStore using it 1:1. I wouldnt bother too much about the why' s. @Dalija Prasnikar +1 Use same strategy here too. I didnt found a reliable way to scale and fit real images in all screensizes. Would like to have that too, but its way too risky to get strange results in one of the 10000 devices out there.
-
I get used to non-modal dialogs via anonymous procs. Use them in mobile as well as desktop. Its the better concept
-
Maybe this may help you https://developer.android.com/guide/practices/screens_support.html#DesigningResources https://support.google.com/googleplay/android-developer/answer/1078870?hl=en&ref_topic=2897459 https://developer.android.com/training/multiscreen/screensizes I use the same image sizes as FMX bin\Artwork\Android provides, because thats approved and should be working.
-
Delphi compiler need to be opensourced
Rollo62 replied to AlekXL's topic in RTL and Delphi Object Pascal
I can only partly agree to this. In new projects I use meanwhile 90% FMX, and simply avoid all the buggy parts, by using the essential components only. Regarding VCL-compatibility, I would love to see this vice versa, maybe make VCL more compatible to FMX. Indeed a few simple changes could make code much more compatible, but the question is if its worth the efford. -
Wow, first time using repeat ... until
Rollo62 replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
then also try out "while .. do" loops, they can replace for and repeat loops both -
Unfortunately 99.99% of the people out there are NO engineers, so that these clear and straight concepts doen't work most of the time. It seems we have to sit on the users chairs sometimes, and have a look from their perspective. This catches me also from time to time, if some customer came up with a brilliant simplification idea. I would propose that all engineers should be forced to work for 2 weeks with their own apps and real data, before launching a product. This is not embracing designers work here (sure they do their own mistakes), but I praise the "sitting one somebody elses chair" method.
-
Thanks Remy. I was always hesitating to use the "Transition" animations, because I never can be 100% sure where it may use Application.ProcessMessages internally. There are a lot of places where this is maybe used, and only by digging deep inside the sources I can check it out, but I'm never sure on what happens in future versions. procedure AnimateControlPositionXWait(AParent: TFmxObject; const NewValue: Integer); var A: TIntAnimation; begin TAnimator.StopPropertyAnimation(AParent, 'Position.X'); A := TIntAnimation.Create(AParent); try A.Parent := AParent; A.AnimationType := DefaultSlidingAnimationType; A.Interpolation := DefaultSlidingInterpoation; A.Duration := DefaultSlidingDuration; A.PropertyName := 'Position.X'; A.StartFromCurrent := True; A.StopValue := NewValue; A.Start; while A.Running do begin Application.ProcessMessages; Sleep(0); end; finally A.DisposeOf; end; end; The SetActiveTabWithTransitionAsync is maybe a good starting point for Async transitions, I will check that more deeply. TabControl1.SetActiveTabWithTransitionAsync( On the other hand I banned all unnecessary transitions from my apps anyway, because users don't feel like "cool" anymore, they often consider the UI as "slow".
-
Is there already a statistic about the new registrations?
Rollo62 replied to sh17's topic in Community Management
Everybody in the Pascal world MUST be active here -
Sorry, TLDR. These lines are a little doubtful to me. ms := TMemoryStream.Create; //<-- This is overwriting the formerly created TMemoryStream. ms := dmplanner.GetDbAsStream; I would expect some kind of CopyStream here.
-
Use Reverse Geocoding - How it really works?
Rollo62 replied to Magno's topic in Network, Cloud and Web
Google APIs have a quite relaxed free tier, but it may add monthly service cost if these limits were touched. You very likely will need an Google maps API key (I never used reverse GeoCode alone, only together with maps). (Sorry, already answered by Remy.) Apple reverse geocode is free (how unlikely is that ?). -
Spring4D and IEqualityComparer<T>
Rollo62 replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
Thinking about Roslyn, it seems the hell had frozen already. -
ANN: Find leaks in Delphi and C++ with Deleaker
Rollo62 replied to Artem Razin's topic in Delphi Third-Party
Thanks for clarification. -
ANN: Find leaks in Delphi and C++ with Deleaker
Rollo62 replied to Artem Razin's topic in Delphi Third-Party
Does this tool also support FMX somehow and other platforms (iOS, Android, MaxOS, Linux) ? -
Please excuse my curiosity, I would like to know who is actually dealing with MacOS client apps.
-
Not that I would recommend such harsh steps, but has anybody tried to reset something in the MacOS ? I'm not a Mac guy at all, so thats why I'm very hesitating to get any deeper into the Mac hardware secrets. Maybe there are other tools or settings which could help. Edit: Maybe it helps to search for differences in CoreBluetooth, which could affect Rx10.3.1 apps. Does anyboy know good MacOS forums for such kind of question ?
-
One option would be to return two different "OK" in ModalResult from different buttons, like mrOK and mrYES. If that is what you mean.
-
Yes I like that idea too, but: This is just another service that reads ALL my texts I ever enter and sends them to their KI servers ... In my naivity I thought that Google and Facebook should make enough headache
-
[Fmx, iOS} App in Release shows only white background with Rio 10.3.1
Rollo62 posted a topic in Cross-platform
Hi there, maybe its too late today, but I don't see the reason why my app behaves different now. I updated to Rio 10.3.1, and made a new .dproj File by the IDE, to make all the necessary changes for iOS and Android. Now it shows the Launch-Screen in Debug mode on the deivice, but when I test via Release in Testflight, I just get a white, blank page. I have doublechecked everything, but I can see no reason. All settings in .dproj were doublechecked twice, against the old, working setting of 10.2.3. Nothing special. I added all icons and scxreenshots (including the new ones with different resolutions) I checked the icons for iPhone and iPad, they all are visible and OK in the IDEs "Application icons designer" In form SystemStatusbar I have black color, always, which is strange, since the launch sceen is white. Maybe this setting is only for the statusbar, but this is white during start too, only after start it went black, as usual. No error messages or warnings, all functions work fine, same in debug and release. I haven't checked the PNG file format yet, but I never got any issues, maybe now some special format is required. Anyhow all PNGs display fine in my graphics tools, as usual. I hope somebody could push me in the right direction, maybe tomorrow I see some light in the tunnel