Mobile App Development Practice Questions | Generated by AI
Question: Provide 30 multiple-choice questions (with 4 options each) based on the Guangdong Higher Education Self-Examination course “Mobile Application Development Technology (Practical Assessment)” (Course Code: 14568), covering the topics in the syllabus and similar in style and difficulty to the sample exam paper. Do not reveal the correct answers.
Answer:
Here are 30 multiple-choice questions for practice or exam preparation:
-
When creating a new Android project in Android Studio, which template is typically chosen for a basic empty app?
A) Empty Activity
B) Basic Activity
C) Navigation Drawer Activity
D) Blank Fragment -
In which folder should drawable resources like images be placed?
A) res/values
B) res/layout
C) res/drawable
D) res/menu -
How do you define a color resource named “primary_color” in colors.xml?
A)#FF5722
B)#FF5722
C)- #FF5722
D)#FF5722 -
To change the application name displayed on the device, which string resource in strings.xml should be modified?
A) app_title
B) app_name
C) application_label
D) title_text -
Which file must declare all Activities used in the project?
A) build.gradle
B) AndroidManifest.xml
C) activity_main.xml
D) styles.xml -
Which layout arranges its children in a single horizontal or vertical row?
A) RelativeLayout
B) ConstraintLayout
C) LinearLayout
D) FrameLayout -
To allow only numeric input in an EditText for height, which attribute should be set?
A) android:inputType=”text”
B) android:inputType=”number”
C) android:inputType=”phone”
D) android:inputType=”decimal” -
Which control is best suited for single selection between “Male” and “Female”?
A) CheckBox
B) Spinner
C) RadioGroup with RadioButtons
D) ToggleButton -
How do you apply a custom style to a TextView in XML?
A) android:style=”@style/CustomTitleFontStyle”
B) android:theme=”@style/CustomTitleFontStyle”
C) android:layout_style=”@style/CustomTitleFontStyle”
D) android:textStyle=”@style/CustomTitleFontStyle” -
Which component is recommended for displaying a scrollable list of items in modern Android apps?
A) ListView
B) GridView
C) RecyclerView
D) ScrollView -
To set an onClick listener for a Button in code, which method is commonly used?
A) button.setOnClickListener()
B) button.addClickListener()
C) button.onClick()
D) button.setClickEvent() -
Which Intent method is used to start another Activity?
A) startService()
B) sendBroadcast()
C) startActivity()
D) bindService() -
To pass a String value “height” with value 170 to another Activity, which method is used?
A) intent.putExtra(“height”, 170)
B) intent.addExtra(“height”, 170)
C) intent.setData(“height”, 170)
D) intent.putData(“height”, 170) -
In the receiving Activity, how do you retrieve an int extra named “weight”?
A) getIntent().getIntExtra(“weight”, 0)
B) getExtras().getInteger(“weight”)
C) intent.getData(“weight”)
D) bundle.getInt(“weight”) -
Which class is used for simple key-value persistent storage in Android?
A) SQLiteDatabase
B) FileOutputStream
C) SharedPreferences
D) ContentValues -
To get a SharedPreferences instance named “mydata” in MODE_PRIVATE, which method is used?
A) getSharedPreferences(“mydata”, Context.MODE_PRIVATE)
B) getPreferences(“mydata”, Context.MODE_WORLD_READABLE)
C) openSharedPreferences(“mydata”)
D) getDefaultSharedPreferences(“mydata”) -
How do you save a String value to SharedPreferences?
A) editor.putString(“key”, value); editor.commit();
B) editor.saveString(“key”, value);
C) preferences.write(“key”, value);
D) editor.add(“key”, value); editor.apply(); -
Which class is used to perform database operations like create, insert, update, delete in SQLite?
A) SQLiteOpenHelper
B) Cursor
C) ContentResolver
D) DatabaseUtils -
To execute raw SQL in SQLite, which method of SQLiteDatabase is used?
A) execSQL()
B) rawQuery()
C) runSQL()
D) querySQL() -
Which class is commonly used for custom drawing in a View?
A) Paint
B) Bitmap
C) Canvas
D) All of the above -
To decode an image file into a Bitmap, which class is typically used?
A) BitmapFactory
B) ImageDecoder
C) DrawableFactory
D) AssetManager -
Which class is best for playing short sound effects efficiently?
A) MediaPlayer
B) SoundPool
C) AudioTrack
D) ExoPlayer -
To play a video in a simple way, which control is commonly used?
A) ImageView
B) SurfaceView
C) VideoView
D) TextureView -
To start a Service that runs in the background without binding, which method is used?
A) bindService()
B) startService()
C) createService()
D) runService() -
Which component is used to respond to system or custom broadcasts?
A) Service
B) BroadcastReceiver
C) ContentProvider
D) Activity -
To send a custom broadcast, which method of Context is used?
A) sendBroadcast(Intent)
B) broadcastIntent(Intent)
C) dispatchBroadcast(Intent)
D) publishBroadcast(Intent) -
In AndroidManifest.xml, how are permissions like WRITE_EXTERNAL_STORAGE added?
A)
B)
C)
D) -
Which attribute in AndroidManifest.xml sets the launcher Activity?
A)with ACTION_MAIN and CATEGORY_LAUNCHER B) C) D) -
To set the background color of an Activity’s root layout from a color resource, which attribute is used?
A) android:background=”@color/skyblue”
B) android:colorBackground=”@color/skyblue”
C) android:layout_color=”@color/skyblue”
D) android:fillColor=”@color/skyblue” -
When exporting a SharedPreferences file for submission, it is typically located in which directory on the device/emulator?
A) /data/data//shared_prefs/ B) /res/values/ C) /assets/ D) /drawable/