Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Oh, I’m sorry. I didn’t realize you already looked at those. Those should go into a Window Size file. You can call it whatever, I called mine WindowSize and WindowUtil. These files should be written once and used on all your apps. So design them with that in mind. You can call them in your main Activity file or anywhere else you need it. Here is a good example of using the code in the documentation inside a news info App. This is their main activity file [theirs is written in kotlin, but can be translated into Java] https://github.com/android/compose-samples/blob/main/JetNews/app/src/main/java/com/example/jetnews/ui/MainActivity.kt And here is their window size class files -- https://github.com/android/compose-samples/blob/main/JetNews/app/src/main/java/com/example/jetnews/utils/WindowSize.kt https://github.com/android/compose-samples/blob/main/Jetcaster/app/src/main/java/com/example/jetcaster/util/WindowInfoUtil.kt You should also go into your manifest file and put - android:resizeableActivity="true" or false [depends on what you want resized] In the application or activity section depending on isolation of activity or not.. And here is a YT video with good points - always code for device unknown. That way it wouldn’t matter the screen size, resolution, hardware config. Ext. -- It doesn't give much on syntax usage, but good insight info. Build apps for foldable, multi-display, and large-screen devices (Google I/O'19) https://youtu.be/8uQEzv3upy8 Considering you are just starting out and getting the hang of things. I would look at all their files in the App source code above and see how the classes and functions are being used. Download the source files and tear it apart. The best way of learning any coding language is looking at code and playing with it then going back to the documentation to further understand it. I hope this helps. Good luck.