Saturday, November 22, 2025

Axioo Hype 5 X6 Ryzen 6600h, blank screen but laptop running

 Symptoms;

  1. laptop on, fan on, indicator on
  2. no any image nor characters appear on screen, backlight on
  3. ctl-alt-del is working
  4. can not enter bios 

Steps to diagnostic

How to remove static voltage

  1. open back cover you need screw driver + small
  2. remove all rams
  3. remove all nvme
  4. remove / unplug battery 
  5. Press and hold power button at least 15 seconds
  6. reconnect/plug battery 

Check ram

  1. clean ram connector with eraser 
  2. put in a ram in slot 1
  3. turn on laptop, and see what screen show, usually it will enter uefi/bios settings
  4. if not ram not detected, blank screen or not appear in uefi, turn of laptop and put ram into another slot. repeat until no more slot to try. if it still does not detected, ram fail/damage.
  5. If ram detected in another, it may something wrong with previous slot, check connector and clean if necessary. if still can detect, slot failure.
  6. repeat step 2 with another ram.

Check nvme (or sata)

  1. clean vnme connector with eraser 
  2. put nvme in the slot
  3. turn in laptop
  4. if it does not go to os or uefi, turn off and move vnme to another slot if available.
  5. if no more slot can detect nvme and start uefi/os, nvme is failure/demage 

Wednesday, November 19, 2025

Protokol pengisian daya cepat Dan mereka.yang menggunakannya

Protocol charging usb mobile phone

  1. transsion tecno, Infinix
  2. Power Delivery (pd) apple Samsung google  xiaomi Redmi pocco baru
  3. Quick Charge (qc) Qualcomm snapdragon 
  4. Super Vooc oppo realme vivo oneplus
  5. Programmable Power Supply (pps) Samsung xiaomi Redmi pocco baru
  6. super charge protocol (scP) huawei honor

Beberapa xiaomi Redmi pocco menggunakan qc, khususnya yang menggunakan snapdragon 

Kpatibilitas berdasarkan lama charging handphone infinix note 12, Infinix hot 40 pro, tecno spark 20 pro.

no nama harga kompatibilitas
1 Acome 18 watt n/a sesuai
2 Xiomi 33 watt Rp.30.000 tidak, charging infinix note 12, Infinix hot 40 pro, tecno spark 20 pro lebih Dari 4 jam
3 Veger VR33 33 watt Rp.89.000 tidak, charging infinix note 12, Infinix hot 40 pro, tecno spark 20 pro lebih Dari 4 jam

Belilah merek yang baik atau ditoko resmi, pastikan charger mendukung protol charging yang benar.

Tuesday, November 11, 2025

Android java: using DataLive for orientation change

I test it in Android 10 xiaomi mia2

What will happen when orientation change e.g. screen change or language change?

the object in activity will be destroyed. here is the sequence:

  • after orientation change
    V  onPause
    V  onStop
    V  onDestrouy
  • after flusing all data
    V  onCreate
    V  onCreate myClass :null
    V  MyClass constructor
    V  onCreateView myClass.getRandom
    V  onStart
    V  onResume 

At xiomi mia2, override public void onConfigurationChanged(Configuration newConfig) method did not called at all during screen orientation change, not appearred in logcat. except, you put android:configChanges in your layout.

Base on the android behave, these are the solution can be used to keep the object during configuration change:

  1. Local persistence to handle process death for complex or large data. Persistent local storage includes databases or DataStore.
  2. Retained objects such as ViewModel instances to handle UI-related state in memory while the user is actively using the app.
  3. Saved instance state to handle system-initiated process death and keep transient state that depends on user input or navigation. 

ViewModel is recommended used for today an future, These are some options:

  1. ViewModel    Holds UI data & logic    Core architecture component
  2. ComputableLiveData (Deprecated)
  3. MediatorLiveData    Combines multiple LiveData sources    Merging streams
  4. MutableLiveData    Observable, mutable data    UI updates
  5. SavingStateLiveData    LiveData with saved-state persistence    Restore after process death 

Comparison between AndroidViewModel vss ViewModel

AndroidViewModel require Context for DB, prefs, etc. gemini: Avoid if possible. Only use when you absolutely need Context. violates a core principle of good architecture: separation of concerns and testability.
ViewModel UI logic without needing Context Network requirement may use this, it does not need context

NOTE: Don’t store Activity or Fragment in VieModel nor AndroidViewModel! 

These are the java code for education, first text using direct access to object in activity, and second text using live data and AndroidViewModel. this code used AndroidViewModel, because I need application's context to access sqlite.

-- MyClass.java

package com.dedetok.testdataorientation;

import android.content.Context;
import android.util.Log;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;

import java.util.Random;

public class MyClass {
    // dummy
    Context context;

    boolean isCreated = false;
    int randomNumber=-1;

    public MyClass(Context context) {
        this.context = context;
        Log.v("deddetok", "MyClass constructor"); // debug

    }

    public String getRandom() {
        if (!isCreated) {
            Random random = new Random();
            randomNumber = random.nextInt(100);
            isCreated = true;
        }
        return String.valueOf(randomNumber);
    }

    public LiveData<String> getRandomLive() {
        if (!isCreated) {
            Random random = new Random();
            randomNumber = random.nextInt(100);
            isCreated = true;
        }
        MutableLiveData<String> returnValue = new MutableLiveData<>();
        returnValue.setValue(String.valueOf(randomNumber));

        return returnValue;
    }
}

-- MyAndroidViewModel

package com.dedetok.testdataorientation;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

public class MyAndroidViewModel extends AndroidViewModel {
    MyClass myClass;

    public MyAndroidViewModel(@NonNull Application application) {
        super(application);
        myClass = new MyClass(application);
    }

    public LiveData<String> getData() {
        return myClass.getRandomLive();
    }
}

-- MainActivity.java

package com.dedetok.testdataorientation;

import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.lifecycle.ViewModelProvider;

public class MainActivity extends AppCompatActivity {

    MyClass myClass = null;

    AppCompatTextView myTextView1, myTextView2;

    MyAndroidViewModel myAndroidViewModel;

    /* to preserve myclass
     * 1. Local persistence to handle process death for complex or large data. Persistent local storage includes databases or DataStore.
     * 2. Retained objects such as ViewModel instances to handle UI-related state in memory while the user is actively using the app.
     * 3. Saved instance state to handle system-initiated process death and keep transient state that depends on user input or navigation.
     */

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        Log.v("dedetok", "onCreate"); // debug


        myTextView1 = findViewById(R.id.textView1);
        myTextView2 = findViewById(R.id.textView2);

        Log.v("dedetok", "onCreate myClass :"+myClass); //
        // myTextView1
        if (myClass==null) {
            myClass = new MyClass(this);
        }
        myTextView1.setText(myClass.getRandom()); // work, created in memory

        // ✅ Get ViewModel (it survives rotation)
        // myTextView2
        myAndroidViewModel = new ViewModelProvider(this).get(MyAndroidViewModel.class);
        myAndroidViewModel.getData().observe(this, value -> {
            // 'value' is a plain String here
            myTextView2.setText(value);
        }); //

    }

    @Nullable
    @Override
    public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
        Log.v("dedetok", "onCreateView"); // debug
        //Log.v("dedetok", "onCreateView myClass.getRandom"); // debug
        //myTextView.setText(myClass.getRandom()); // crash textview not ready
        return super.onCreateView(parent, name, context, attrs);
    }

    /*
     * ## activity life cycle 2 ##
     */
    @Override
    protected void onStart() {
        super.onStart();
        Log.v("dedetok", "onCreateView myClass.getRandom"); // debug
        //myTextView1.setText(myClass.getRandom()); // work, view has been created
        myAndroidViewModel.getData().observe(this, value -> {
            // 'value' is a plain String here
            myTextView2.setText(value);
        }); // this is fine place

        Log.v("dedetok", "onStart"); // debug

    }

    /*
     * ## activity life cycle 3 ##
     */
    @Override
    protected void onResume() {
        super.onResume();

        Log.v("dedetok", "onResume"); // debug


    }

    /*
     * ## activity life cycle 4 ##
     */
    @Override
    protected void onPause() {
        Log.v("dedetok", "onPause"); // debug
        super.onPause();

    }

    /*
     * ## activity life cycle 5 ##
     */
    @Override
    protected void onStop() {
        Log.v("dedetok", "onStop"); // debug
        super.onStop();

    }

    /*
     * ## activity life cycle 6 ##
     */
    @Override
    protected void onDestroy() {
        Log.v("dedetok", "onDestrouy"); // debug

        super.onDestroy();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        Log.v("dedetok", "onConfigurationChanged"); // debug
    }
}

-- activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView"
        android:minHeight="50dp"
        android:textSize="24sp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        />
    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView2"
        android:minHeight="50dp"
        android:textSize="24sp"
        app:layout_constraintTop_toBottomOf="@+id/textView1"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        />
</androidx.constraintlayout.widget.ConstraintLayout>

Some of parts of this content generated by ChatGPT and Gemini with some modification.

Wednesday, November 5, 2025

Android Studio: using Logcat and filter

 

LevelPriorityUse Case
Log.v()Verbose (V)Everything. Detailed tracing of functions, variable values, lifecycle events.
Log.d()Debug (D)General debugging messages useful for development.
Log.i()Info (I)Important business logic messages, typical user actions, system state changes.
Log.w()Warn (W)Use of deprecated APIs, non-critical errors that can be recovered.
Log.e()Error (E)Critical errors that cause a failure or stop a feature from working.
Log.wtf()Assert (A)What a Terrible Failure. Reserved for conditions that should never happen.

Option to filter in Andorid Studio Logcat

  1. tag: Filters messages by a specific log tag.
    Example: tag:MyActivity
  2. level: Filters messages at the specified log level or higher. Levels include VERBOSE (V), DEBUG (D), INFO (I), WARN (W), ERROR (E), and ASSERT (A).
    Example: level:ERROR (shows ERROR and ASSERT logs)
  3. process: Filters messages by the process name or process ID (PID).
    Example: process:1234 or process:com.example.app
  4. age: Filters messages by how recent they are. The value is a number followed by a unit of time: s (seconds), m (minutes), h (hours), or d (days).
    Example: age:5m (shows messages from the last 5 minutes)
  5. is: Can be used with crash to filter only crash logs.
    Example: is:crash
  6. package: A convenient shortcut to filter logs only from the currently running application's package. 

Logical operation can be use in Logcat Filter

  1. && (AND): Requires both conditions to be true.
    Example: package:mine && level:WARN
  2. | (OR): Requires at least one condition to be true.
    Example: tag:Tag1 | tag:Tag2
  3. - (NOT/Exclude): Excludes logs matching the condition. Place the hyphen before the key.
    Example: -tag:ExcludedTag

Example usage Logcat filter:

  1. package:mine level:INFO "user data" -tag:network
  2. tag:MyTag && level:DEBUG || is:crash 

Credit: Table conversion to html online http://the-mostly.ru/online_html_table_generator.html

Tuesday, November 4, 2025

Java Netbeans: using opencsv from url

Create a new Project Java with Maven project name e.g. TestOpenCSV

At Project Files, open pom.xml and add

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.dedetok</groupId>
    <artifactId>TestOpenCSV</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>17</maven.compiler.release>
        <exec.mainClass>com.dedetok.testopencsv.TestOpenCSV</exec.mainClass>
    </properties>
    <dependencies>
    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>5.9</version> <!-- or latest -->
    </dependency>
</dependencies>
</project>

You can use beans to map the result, or manually process the csv files. for data size bigger then 1 millions, there is deference about 1 second, it is better to manually process. Here are code to test, before you use it in production. Feel free to change any the code to meet your requirement.

Classs Radio

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.dedetok.testopencsv;

import com.opencsv.bean.CsvBindByName;

/**
 *
 * @author dedetok
 */
public class Radio {
    @CsvBindByName(column = "country")
    private String country;

    @CsvBindByName(column = "city")
    private String city;

    @CsvBindByName(column = "radioname")
    private String radioname;

    @CsvBindByName(column = "url_logo")
    private String url_logo;

    @CsvBindByName(column = "url_stream")
    private String url_stream;

    public String getCountry() { return country; }
    public String getCity() { return city; }
    public String getRadioname() { return radioname; }
    public String getUrl_logo() { return url_logo; }
    public String getUrl_stream() { return url_stream; }
}

Main class

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 */

package com.dedetok.testopencsv;

import com.opencsv.CSVParser;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import com.opencsv.exceptions.CsvValidationException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.opencsv.bean.CsvBindByName;
import com.opencsv.bean.CsvToBean;
import com.opencsv.bean.CsvToBeanBuilder;
import java.util.List;

/**
 *
 * @author dedetok
 */
public class TestOpenCSV {

    static String urlString = "https://raw.githubusercontent.com/dedetok/myradiolist/refs/heads/main/myradio_radiolist.csv";
    
    public static void main(String[] args) throws CsvValidationException {
        System.out.println("Hello World!");
        
        // start function

        try {
            URL url = new URL(urlString);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            // Check response
            int status = connection.getResponseCode();
            if (status == 200) {
                // Configure parser: semicolon separator, double-quote as quote char
                InputStreamReader reader = new InputStreamReader(connection.getInputStream());
                // Start For parsing manual
                CSVParser parser = new CSVParserBuilder()
                        .withSeparator(';')
                        .withQuoteChar('"')
                        .build();
                //CSVReader csvReader = new CSVReader(reader);
                CSVReader csvReader = new CSVReaderBuilder(reader)
                        .withCSVParser(parser)
                        //.withSkipLines(1) // skip header if needed
                        .build();
                String[] nextLine;
                int i=1;
                while ((nextLine = csvReader.readNext()) != null) {
                    for (String cell : nextLine) {
                        System.out.print(cell + " | ");
                    }
                    i++;
                    System.out.println();
                    if (i==5) {
                        break;
                    }
                }
                // End For parsing manual
                // start convert directly to list<Radio> using opencsv beans
                /*
                CsvToBean<Radio> csvToBean = new CsvToBeanBuilder<Radio>(reader)
                    .withType(Radio.class)
                    .withSeparator(';')
                    .withQuoteChar('"')
                    .withIgnoreLeadingWhiteSpace(true)
                    .build();
                List<Radio> radios = csvToBean.parse();
                System.out.println("Loaded " + radios.size() + " radios!");
                
                // debug
                for (int i = 0; i < Math.min(5, radios.size()); i++) {
                    Radio r = radios.get(i);
                    System.out.println(
                        r.getCountry() + " | " +
                        r.getCity() + " | " +
                        r.getRadioname() + " | " +
                        r.getUrl_logo() + " | " +
                        r.getUrl_stream()
                    );
                }
                */
                // end convert directly to list<Radio> using opencsv beans

            }
        } catch (MalformedURLException ex) {
            Logger.getLogger(TestOpenCSV.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(TestOpenCSV.class.getName()).log(Level.SEVERE, null, ex);
        }      
    }
}

 Code is write with collaboration with chatgpt