by Dual Cube.
Dear Dang,
Hope you are doing good. I understand you are a beginner, and there is no end to the number of problems you may have to face in the initial stages of getting acquainted with Moodle. Don’t worry you will get a hang of it in sometime.
Dang, may I know what exactly you mean by "mobile app"?
To get the details of a logged in user, use the global variable $USER. Define global $USER; in the page where you want to get the user details and then view the full user details by print_r($USER);
To get the user id, you may do this,
$userId = $USER->id;
Do let me know if this helps.
All the best! Would love to hear from you again.
Purnendu (developer)
DualCube