mvn archetype:generate -DarchetypeGroupId=net.alchim31.maven -DarchetypeArtifactId=scala-archetype-simple
Install Oracle JDK 16 on Linux
Version specific installation guides are available here:
-
Install Oracle JDK 8 on Linux
- Install Oracle JDK 11 on Linux
- Install Oracle JDK 16 on Linux
-
Install Oracle JDK 17 on Linux
(The latest version)
-
Install the latest Oracle JDK on Linux
(Permanent link to install the latest version)
sudo dpkg -i jdk-$java_version$java_update_no_linux-x64_bin.deb
If your Linux distribution is using RPM package format like Cent
OS, you can download and install the
jdk-$java_version$java_update_no_linux-x64_bin.rpm file using the
following command:sudo rpm -ivh jdk-$java_version$java_update_no_linux-x64_bin.rpm
However, this article explains the manual installation method which is applicable for all Linux distributions out there. Personally, I prefer the manual installation because I have more control over the changes made in the system.
Download Files in Android - Kotlin & Java
Unless you are writing a Download Manager, downloading files in an Android
application is never going to be the main business logic to solve but based on
the requirement, you may need to download metafiles, media files, or documents
over the Internet within your Android application. However, a reliable
solution to download files in an Android application poses its own challenges
including but not limited to the following list:
1. Thread Management
IO operations must be executed in a separate thread. Though there are plenty
of options to achieve this such as now deprecated AsyncTask, Kotlin coroutines, or RxJava, still complex for a novice developer to properly handle
the concurrency problems. Sending signals to the downloading thread to cancel
or pause the download may introduce additional synchronization issues.
2. Error Handling
What if the Internet connection dropped while downloading the file? What if
the application is closed while downloading/saving the file? How to handle all
HTTP errors? the list goes on. Addressing all these scenarios is tedious and
most of the time not possible.
3. Updating the UI
While downloading the file in a separate thread, updating a progress bar in the main thread is a challenge unless the concurrency framework you use provides an easy way. The same goes to update the UI after the file is downloaded.