Stop press! Accessing parameters not being passed is … possible
A method or function can have optional parameters. Sometimes the function is called with two parameters, and other times with three parameters. We’ve all dreamed of accessing the parameters without counting the parameters, checking if the parameter has been passed, or simply not having to check if the variable associated with the parameter has been initialized. This could make the code much simpler, and much more readable, without all the “If” or “Count parameters” lines.
Well, dream no more, and switch to 4D v19 R3! Managing method and function parameters has never been easier.
4D for Mobile: What’s new in v19 R3
We are pleased to announce that a new version of 4D is available with new features for 4D for iOS and 4D for Android.
WHAT’s in it?
For both 4D for iOS and 4D for Android:
- A new feature of 4D allows you to add computed attributes to an entity. These new attributes can also be used in the list and detail forms of your mobile application.
For 4D for iOS only:
- You can create action input controls of type choice list. The choice list can be a predefined list in a JSON or a dynamic list filled using a data source.
- In your actions and input controls, you can use computed attributes to simplify your code.
For 4D for Android only:
- The N to one relation is available, so you can display relative data in a list, and decide which field(s) from the related table to publish in your app
- You can test and debug the generated application on your device.
Several blog posts detailing the different features are listed in this post.
Secure your app’s resources with a new algorithm
When generating .4dz files, 4D uses a standard zip format by default. If you are a software publisher, you’ll be happy to know that 4D v19 R2 added a feature that allows preventing users of your application from seeing the content of the 4DZ, and therefore from being able to modify it.
How to take advantage of GitHub actions with 4D
Your project is now on a source control system. This means that managing several versions of your software, monitoring changes, and integrating corrections or new features is much simpler now.
Why not also take advantage of continuous integration?
Starting with 4D v19, you can launch the compilation of your project with a command. As a result, you now have all the building blocks needed to automate your integration chain.
This blog post will give you an example of automation with the GitHub manager and GitHub Actions.
How to automate the compilation
Since 4D v19, you can start the compilation of a project with a simple command. You might be wondering what you can use this for!
Your team may consist of several developers, so why not automate the compilation at each code push on your source control server? It is always easier to identify an error when it is quickly detected.
Another case is when your project consists of several components. You can write a method that compiles, builds, and then copies the component to the host database.
This blog will discuss the different technical points that are very useful to create your own automation tools, along with an example application.
Toggle Dark & Light Mode on macOS in one click
As of 4D v19, you have the possibility to create applications that support the Dark and Light mode on macOS. To do this, you have to modify and check many small details: icons, widgets, texts, background colors, etc.
As a result, you need change the appearance of your mac dozens of times per hour. OK, you might be thinking, “What? All it takes is three clicks. Open the preferences panel, click the general icon, then the light or dark control, that’s it!“. But honestly, if you are a developer or a tester, repeating these actions over and over again becomes very tedious.
Show online documentation directly from the code editor
In the latest versions of 4D, several improvements have been made to simplify the writing of code with classes:
- function and attribute suggestions according to type
- display of the prototype with a short description
With 4D v19 R2, you can open the online documentation of a function with a single action.
Go Mobile with 4D: Generate Android and iOS apps from a Single Project
We are pleased to announce that 4D for Android is available with 4D v19 R2.
Many features are already available, and with each new release, we’ll enrich the possibilities so that 4D for Android’s features match those of 4D for iOS.
What’s best is that the same mobile project can generate both native iOS and native Android apps. We made sure to provide very similar user experiences on both platforms while still respecting their standards.
how to extend your application and go mobile
The mobile project editor is fully integrated into 4D. You can design and build native iOS and Android apps quickly and easily without programming. If you want to go further, you can open the generated application with Android Studio or Xcode and customize it with Kotlin or Swift.
The other big advantage of a native application is that you can access the data even when you’re offline.
CSS Media query for a dark or light UI
Dark mode has been gaining a lot of ground recently. That’s why we’ve added support for it in 4D v19, and mentioned a few ways you can adjust it to your needs in the related announcement.
In this blog post, we’ll focus on CSS and explain in detail how to set CSS styles for light and dark modes using CSS media queries.
Launch a compilation by programming
In continuous integration systems, every time code is submitted, or on an hourly basis, a compilation of the source code is automatically launched. This approach allows you to check merges on the code management server.
Starting from 4D v19, a new command allows you to launch code compilation, so you can set up this type of system.
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy