Q61
Q61 How do you set a click listener for a Button in Android?
button.setOnClickListener(this);
button.addClickListener();
button.onClick(this);
button.clickListener(this);
Q62
Q62 How do you update the text in a TextView in Java code?
textView.updateText("New Text");
textView.setText("New Text");
textView.changeText("New Text");
textView.modifyText("New Text");
Q63
Q63 How do you retrieve the selected value from a Spinner in Android?
spinner.getSelectedItem();
spinner.getSelected();
spinner.retrieveSelection();
spinner.selectedItem();
Q64
Q64 How do you handle multiple checkbox selections programmatically in Android?
By using checkbox.onSelectListener();
By looping through checkboxes and checking their isChecked() status
By using checkbox.onMultipleSelect();
By using checkboxGroup();
Q65
Q65 A Button in your app is not responding to clicks. What is the most likely issue?
The Button is invisible
The Button has no click listener
The Button is disabled
The Button has no ID
Q66
Q66 A ListView displays no data even though the adapter is properly set. What could be the issue?
The ListView is not in the layout file
The adapter is empty
The ListView has no click listener
The ListView is not visible
Q67
Q67 An app crashes when trying to update a ProgressBar. What is a likely cause?
The ProgressBar is set to wrap_content
The ProgressBar is not in the main layout
The app tries to update UI from a background thread
The ProgressBar has no ID
Q68
Q68 What is the main purpose of Shared Preferences in Android?
To store files
To store key-value pairs of primitive data
To store large databases
To store images
Q69
Q69 What is SQLite used for in Android?
Storing structured data in tables
Storing images
Storing network data
Storing UI layouts
Q70
Q70 What is the maximum size of data that can be stored in Shared Preferences?
1MB
5MB
10MB
No strict limit
Q71
Q71 How do you delete a value from Shared Preferences?
preferences.clearValue("key");
preferences.edit().remove("key").apply();
preferences.delete("key");
preferences.edit().delete("key");
Q72
Q72 What is the main advantage of using SQLite over Shared Preferences for data storage?
Faster read and write operations
Ability to store large datasets and complex queries
Requires no permissions
Stores UI elements
Q73
Q73 How do you save a string in Shared Preferences in Android?
editor.put("key", value).apply();
editor.putString("key", value).apply();
preferences.add("key", value).apply();
editor.save("key", value);
Q74
Q74 How do you create or open a SQLite database in Android?
SQLiteDatabase.openOrCreateDatabase();
SQLiteDatabase.createDatabase();
SQLite.open();
SQLiteDatabase.getInstance();
Q75
Q75 How do you insert a new row into an SQLite database in Android?
db.insertRow();
db.insert("table", nullColumnHack, contentValues);
db.addRow();
db.save("table", contentValues);
Q76
Q76 How do you query data from an SQLite database using raw SQL?
db.query("SELECT * FROM table");
db.rawQuery("SELECT * FROM table", null);
db.runQuery("table");
db.executeQuery("table");
Q77
Q77 An app fails to retrieve a value from Shared Preferences. What could be the most likely issue?
The key does not exist
The key is stored incorrectly
The app has no internet access
The preferences file is corrupted
Q78
Q78 An SQLite database query in Android is returning no data. What is the most probable cause?
The database is not open
The query is malformed
The app has no permissions
The database connection is lost
Q79
Q79 An app crashes when trying to update the SQLite database. What could be a likely cause?
The database is locked
The app has no permissions
The table is missing
The query is incorrect
Q80
Q80 What is the primary purpose of using networking in Android apps?
To display images
To manage background services
To interact with web servers and APIs
To store local data
Q81
Q81 Which class is commonly used in Android to manage HTTP connections?
HttpURLConnection
SQLiteConnection
ServerSocket
HttpSocket
Q82
Q82 What does REST stand for in the context of web services?
Remote Event Service Tracking
Representational State Transfer
Remote Element State Transfer
Resource Event Service
Q83
Q83 What is the purpose of using Retrofit in Android?
To manage UI layouts
To make network requests easier
To handle database operations
To manage notifications
Q84
Q84 What is the advantage of using OkHttp over HttpURLConnection?
OkHttp supports caching and connection pooling
OkHttp requires less code
OkHttp has faster request time
OkHttp is built-in
Q85
Q85 How do you execute a GET request using HttpURLConnection?
connection.setRequestMethod("POST");
connection.getRequestMethod("GET");
connection.setRequestMethod("GET");
connection.execute("GET");
Q86
Q86 How do you handle a JSON response from a web server in Android?
Use JSONParser
Use XMLParser
Use JSONObject and JSONArray classes
Use HttpResponseHandler
Q87
Q87 How do you send data to a web server using a POST request in Retrofit?
@GET
@POST
@PUT
@DELETE
Q88
Q88 How do you make an asynchronous network call using Retrofit in Android?
Call
Response
Call
api.getData();
Q89
Q89 A network request in your Android app is timing out. What is the most likely cause?
The server is down
The URL is incorrect
The network is slow
The timeout duration is too short
Q90
Q90 An API response in your Android app returns 404. What does this status code indicate?
The request was successful
The server could not find the resource
There was a server error
The client is unauthorized