What's new

Help Patulong po sa android studio

12coco

Eternal Poster
Joined
Oct 15, 2022
Posts
478
Reaction
930
Points
314
Pano po maglagay ng question sa application
 
You can put a question into your application by using a prompt. A prompt is a message that appears on your screen that encourages the user to answer a question or perform a task. You can use a prompt to ask a question, and then store the user's response in a variable. This can then be used elsewhere in your application.
Code:
Code for putting prompt to application

// Prompt code
var userInput = prompt("Please enter your name:");

// Code to use prompt
if (userInput) {
    console.log("Hello, " + userInput + "!");
} else {
    console.log("Hello!");
}
 
You can use a combination of TextViews, RadioGroups, RadioButtons, and CheckBoxes to create multiple questions in an Android app. Here is an example of how to create a simple multiple choice question: 1. Create a layout with a TextView for the question, a RadioGroup for the choices, and four RadioButtons for the answer choices.

Code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >
 
    <TextView
        android:id="@+id/question_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="What is the capital of France?" />
 
    <RadioGroup
        android:id="@+id/answer_choices"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
 
        <RadioButton
 
Thanks po

Pano po gumana lahat ng question kase po hanggang 4th question lang tas bumabalik sa home.
 
Last edited:
Gawa ka ng object array ng question, answer, and ung right answer. Bukod dun kailangan mo ng variable para sa current index. Show mo first index ng object array tapos compare moy ung piniling sagot sa tamang sagot. Kapag tama, increment mo lang yung current index na array. Kapag mas mataas na yung current index mo, pop mo lang yung page para lumabas yung home.
 
Gawa ka ng object array ng question, answer, and ung right answer. Bukod dun kailangan mo ng variable para sa current index. Show mo first index ng object array tapos compare moy ung piniling sagot sa tamang sagot. Kapag tama, increment mo lang yung current index na array. Kapag mas mataas na yung current index mo, pop mo lang yung page para lumabas yung home.
Thanks po
 

Similar threads

Back
Top