Android Activity lifecycle
is onStart or onCreate first will be triggered in android activity?
In the Android Activity lifecycle, onCreate() is triggered before onStart(). Here’s a brief overview of the sequence of method calls when an Activity is created:
onCreate(): This method is called when the activity is first created. It is where you typically perform one-time initialization such as setting up the user interface, binding data to lists, or initializing variables.
onStart(): This method is called after onCreate() ...
OkHttp cookie handling on android webview supported
Here how i implement cookie handling for android lollipop - tiramisu and also jvm and non-persistent connection.
requires:
[versions]
webkit = "1.10.0"
okhttp = "4.12.0"
[libraries]
webkit = { module = "androidx.webkit:webkit", version.ref = "webkit" }
okhttp = { module = "com.squareup.okhttp3:okhttp-bom", version.ref = "okhttp" }
okhttp-lib = { module = "com.squareup.okhttp3:okhttp" }
implementa ...
Turn git log history into markdown
#!/bin/bash
echo "writing github commit history"
git log --pretty=format:"%ad%n%h %s%n%b" --date=format:"%Y-%m-%d %H:%M:%S" | while IFS= read -r line; do
trimmed_line="${line#"${line%%[![:space:]]*}"}"
trimmed_line="${trimmed_line%"${trimmed_line##*[![:space:]]}"}"
if [ -n "$trimmed_line" ]; then
if [[ "$trimmed_line" =~ ^[0-9]{4}-[0-9]{2&# ...
Android SDK API List
API 10 (Gingerbread) - 0.3%
API 15 (Ice Cream Sandwich) - 0.3%
API 16 (Jellybean) - 1.2%
API 17 (Jellybean) - 1.5%
API 18 (Jellybean) - 0.5%
API 19 (KitKat) - 6.9%
API 21 (Lollipop) - 3.0%
API 22 (Lollipop) - 11.5%
API 23 (Marshmallow) - 16.9%
API 24 (Nougat) - 11.4%
API 25 (Nougat) - 7.8%
API 26 (Oreo) - 12.9%
API 27 (Oreo) - 15.4%
API 28 (Pie) - 10.4%
List of Android SDK versions along with their corresponding API levels and dessert code names:
Android 1.0 (API level 1): No codename
Androi ...
enable automatic memory heap resizing of android studio
To limit Android Studio’s memory usage, you can modify the studio.vmoptions file. This file contains configuration settings for Android Studio, including memory-related settings. Follow these steps:
Locate the studio.vmoptions file:
On Windows, it is usually located in the bin directory of the Android Studio installation directory. For example, C:\Program Files\Android\Android Studio\bin\studio64.exe.vmoptions.
On macOS, it is often found in the Contents/bin directory within the application b ...
is defining screen density on gradle.build can reduce build time ?
Setting screen density in an Android project’s “build.gradle” file usually has no direct impact on build time.
Screen density refers to the resources used in your Android app and affects how your app runs on different devices with different screen densities.
This is not configured at build time.
To clarify, when you set screen density in the ‘build.gradle’ file, you typically specify different versions of the drawable resource for different screen densities.
For example:
gradle
android {
...
setup vmoption intellij idea for 8GB RAM processor intel i3
When configuring IntelliJ IDEA’s VM options, we recommend that you consider the available memory on your computer, in this case 8GB of RAM.
With this in mind, you need to configure your Java Virtual Machine (JVM) settings so that IntelliJ IDEA runs properly within the available resources.
Here are some suggestions for setting VM options in IntelliJ IDEA with an 8GB RAM machine and an Intel i3 processor:
Heap Memory (Xmx and Xms):
Set the maximum heap size (-Xmx) to a value that is suitable ...
How to use kotlin-bom?
In Kotlin, a bill of materials is a more centralized way to manage dependencies. This allows you to specify a set of dependencies and their versions in one place, making it easier to manage and update dependencies across your projects.
To use Kotlin BOM, you typically follow these steps:
Add the BOM Dependency to Your Build File:
You need to add the BOM dependency to your build file. If you’re using Gradle, you can add it like this:
implementation platform("org.jetbrains.kotlin:kotlin-bom:1 ...
Hexo Cannot GET /
Check config yaml
check your _config.yml
url: https://www.webmanajemen.com/
root: /
# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
path: '/'
per_page: 10
order_by: -updated # updated | date | -date | -updated
pagination_dir: page
Check the URL and Paths:
Ensure that you are accessing the correct ...
Detect NodeJS if called using import or directly
CommonJS
CommonJS modules can use the require.main object to determine whether the module is executed directly or imported. The require.main object is the main module that started your Node.js application.
// CommonJS
// main.js
if (require.main === module) {
// This script is being run directly
console.log('This script is the main module.');
} else {
// This script is being imported as a module
console.log('This script is being imported as a module.' ...