1. Which of the following are UI elements that you can use in a window in an Android application?
Answers:
Answers:
Answers:
a) All applications must be signed.
b) No certificate authority is needed.
c) When releasing application special debug key that is created by the Android SDK build tools can be used.
Answers:
SensorManager mgr = (SensorManager) getSystemService(SENSOR_SERVICE);
List<Sensor> sensors = mgr.getSensorList(Sensor.TYPE_ALL);
for (Sensor sensor : sensors) {
System.out.println(“”+sensor.getName());
}
Answers:
try {
String token = GoogleAuthUtil.getToken(this, email, “https://www.googleapis.com/auth/devstorage.read_only”);
System.out.println(token);
} catch (IOException e) {
System.out.println(“IOException”);
} catch (UserRecoverableAuthException e) {
System.out.println(“UserRecoverableAuthException”);
} catch (GoogleAuthException e) {
System.out.println(“GoogleAuthException”);
}
Answers:
Answers:
Answers:
a) create
b) read
c) update
d) delete
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
A) com.google.android.c2dm.permission.RECEIVE
B) android.permission.INTERNET
C) android.permission.GET_ACCOUNTS
D) android.permission.WAKE_LOCK
E) applicationPackage + “.permission.C2D_MESSAGE”
F) A receiver for com.google.android.c2dm.intent.RECEIVE, with the category set as applicationPackage. The receiver should require the com.google.android.c2dm.SEND permission
Answers:
a) INTERNET
b) ACCESS_NETWORK_STATE
Answers:
@Override
protected void onStop
{
Super.onStop();
SharedPreferences setting = getSharedPreferences(“MyPrefs”, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean(“MyBool”, true);
<some more code here>
}
Which of the following should be used <some more code here>?
Answers:
It provides query(), insert(), update(), and delete() methods for accessing data from a content provider and invokes identically-named methods on an instance of a concrete content provider.
Answers:
Answers:
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
Answers:
A) Running sync adapter in response to a user request.
B) Running sync adapter periodically by setting a period of time to wait between runs, or by running it at certain times of the day, or both.
Answers:
A) call getToken() on the UI thread
B) call getToken() on AsyncTask
Answers:
A) HTTP
B) XMPP
C) SOAP
D) RMI
Answers:
ApplicationInfo, SyncInfo, ActivityInfo, PackageInfo
Answers:
Answers:
Answers:
<MyElement xmlns:”http://schemas.androd.com/apk/res/android”
android:layout_width = “fill_parent”
android:layout_height = “fill_parent”
android:text = “Some Text”>
</MyElement>
Which of the following are true about the XML fragment above?
Answers:
Answers:
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(PATH_TO_FILE);
<Some code here>
mp.start();
Which of the following should be placed at <Some code here>?
Answers:
public class MyReceiver extends PhoneStateIntentReceiver
{
@Override
public void onReceiveIntent(Context context, Intent intent)
{
if (intent.action == Intent.CALL_ACTION)
{
}
}
}
Assuming that notifyPhoneCallState has been called to enable MyReceiver to receive notifications about the phone call states, in which of the following cases will the code in get executed?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(PATH_TO_FILE);
<Some code here>
mp.start();
Which of the following should be placed at <Some code here>?
Answers:
Answers:
Answers:
Answers:
Answers:
A) A content provider allows applications to access data.
B) A content provider must be declared in the AndroidManifest.xml file.
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
<MyElement xmlns:”http://schemas.androd.com/apk/res/android”
android:layout_width = “fill_parent”
android:layout_height = “fill_parent”
android:text = “Some Text”>
</MyElement>
Which of the following are true about the XML fragment above?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
<font size =2>
@Override
protected void onStop
{
Super.onStop();
SharedPreferences setting = getSharedPreferences(“MyPrefs”, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean(“MyBool”, true);
<some more code here>
}
Which of the following should be used <some more code here>?
</font
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Once an app is published, the ________ cannot be changed. It should be unique for each APK.
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
- TextBox
- TextView
- TextField
- TextElement
- EditText
- RichText
Answers:
- request permission for ACCESS_COARSE_LOCATION
- request permission for ACCESS_FINE_LOCATION
- request permission for INSTALL_LOCATION_PROVIDER
- None of the above
Answers:
- Contacts
- Contacts
- Shared Preferences
- MediaStore
- Bookmarks
- Settings
a) All applications must be signed.
b) No certificate authority is needed.
c) When releasing application special debug key that is created by the Android SDK build tools can be used.
Answers:
- a) and b) are true
- a) and c) are true
- b) and c) are true
- all statements are true
SensorManager mgr = (SensorManager) getSystemService(SENSOR_SERVICE);
List<Sensor> sensors = mgr.getSensorList(Sensor.TYPE_ALL);
for (Sensor sensor : sensors) {
System.out.println(“”+sensor.getName());
}
Answers:
- prints names of all available sensors in device
- prints names of all available sensor types in device
- prints names of all sensors which are not available
- none of above
try {
String token = GoogleAuthUtil.getToken(this, email, “https://www.googleapis.com/auth/devstorage.read_only”);
System.out.println(token);
} catch (IOException e) {
System.out.println(“IOException”);
} catch (UserRecoverableAuthException e) {
System.out.println(“UserRecoverableAuthException”);
} catch (GoogleAuthException e) {
System.out.println(“GoogleAuthException”);
}
Answers:
- prints token
- prints IOException
- prints UserRecoverableAuthException
- prints GoogleAuthException
Answers:
- AsyncTask
- IntentService
- Sync adapters
- All of these
Answers:
- Create a view to display a list of items from a data source.
- List all the activities currently running on the Android device.
- List all the activites that are installed on the Android device.
- List the activities whose IntentFilters match with a particular Intent type.
a) create
b) read
c) update
d) delete
Answers:
- a, b and c
- b, c and d
- all of these
- none of these
Answers:
- ImageView
- ImageButton
- both of above
- none of these
Answers:
- Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivity(takePictureIntent);
- Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, 1); }
- Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(takePictureIntent, 1);
- Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, -1); }
Answers:
- <uses-feature android:name=”android.hardware.camera”/>
- <uses-feature android:name=”android.hardware.camera” android:required=”true” />
- <uses-feature android:name=”android.hardware.camera.front” android:required=”true” />
- <uses-permission android:name=”android.permission.CAMERA”/>
Answers:
- linear acceleration sensor
- gravity sensor
- rotation vector sensor
- accelerometer sensor
Answers:
- MP4
- MPEG
- AVI
- MIDI
A) com.google.android.c2dm.permission.RECEIVE
B) android.permission.INTERNET
C) android.permission.GET_ACCOUNTS
D) android.permission.WAKE_LOCK
E) applicationPackage + “.permission.C2D_MESSAGE”
F) A receiver for com.google.android.c2dm.intent.RECEIVE, with the category set as applicationPackage. The receiver should require the com.google.android.c2dm.SEND permission
Answers:
- A, B, C and D
- C, D, E and F
- A, B, E and F
- all of these
a) INTERNET
b) ACCESS_NETWORK_STATE
Answers:
- a
- b
- both
- none
@Override
protected void onStop
{
Super.onStop();
SharedPreferences setting = getSharedPreferences(“MyPrefs”, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean(“MyBool”, true);
<some more code here>
}
Which of the following should be used <some more code here>?
Answers:
- editor.save(); editor.close();
- editor.save(); editor.finish();
- editor.commit();
- editor.save();
- editor.close();
- editor.finish();
It provides query(), insert(), update(), and delete() methods for accessing data from a content provider and invokes identically-named methods on an instance of a concrete content provider.
Answers:
- CursorLoader
- ContentResolver
- ContentProvider
- Loader
Answers:
- a bit easier to work with
- the possibility easily update progress bar
- no comparison, because it implements completely different functionality
- less work with the configuration of applicationM
public boolean isOnline() {
ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
return (networkInfo != null && networkInfo.isConnected());
}
Answers:
- checking Network connection.
- checking only WIFI network connectivity.
- checking only Bluetooth data connection.
- checking only Ethernet data connection
A) Running sync adapter in response to a user request.
B) Running sync adapter periodically by setting a period of time to wait between runs, or by running it at certain times of the day, or both.
Answers:
- Statement A is true, while Statement B is false.
- Statement B is true, while Statement A is false.
- Both statements are true.
- Both statements are false.
A) call getToken() on the UI thread
B) call getToken() on AsyncTask
Answers:
- Statement A is true, while Statement B is false.
- Statement B is true, while Statement A is false.
- Both statements are true.
- Both statements are false.
A) HTTP
B) XMPP
C) SOAP
D) RMI
Answers:
- A and B
- A, B, C
- C, D
- all of these
ApplicationInfo, SyncInfo, ActivityInfo, PackageInfo
Answers:
- ApplicationInfo
- SyncInfo
- ActivityInfo
- PackageInfo
Answers:
- Using the “adb install /path/to/apk” command from the command prompt/terminal, when USB Debugging Mode is enabled in the device.
- Exporting and signing the package, then browsing it to install.
- Launching the application from an IDE, when USB Debugging Mode is enabled in the device.
- All of these.
Answers:
- SQLiteOpenHelper
- SQLiteDatabase
- ContentProvider
- DatabaseHelper
<MyElement xmlns:”http://schemas.androd.com/apk/res/android”
android:layout_width = “fill_parent”
android:layout_height = “fill_parent”
android:text = “Some Text”>
</MyElement>
Which of the following are true about the XML fragment above?
Answers:
- It is taken from the manifest XML file of the Android project.
- It is taken from an XML file used to define a view.
- It is taken from the package file (.apk) of the Android project.
- The xmlns: attribute is a compulsory attribute.
- If this is not the outer most tag in the XML file then it need not contain the xmlns: attribute.
- MyElement should be the name of a class derived, directly or indirectly, from the View class.
Answers:
- StrictMode detects improper layouts
- StrictMode detects operation which blocks UI
- StrictMode detects the speed of the connection
- All of the above
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(PATH_TO_FILE);
<Some code here>
mp.start();
Which of the following should be placed at <Some code here>?
Answers:
- mp.prepare();
- mp.prepareAsync();
- mp.loadMedia();
- mp.loadSource();
- mp.loadSource(); mp.prepare();
- No code is required at <Some code here> to start playback.
public class MyReceiver extends PhoneStateIntentReceiver
{
@Override
public void onReceiveIntent(Context context, Intent intent)
{
if (intent.action == Intent.CALL_ACTION)
{
}
}
}
Assuming that notifyPhoneCallState has been called to enable MyReceiver to receive notifications about the phone call states, in which of the following cases will the code in get executed?
Answers:
- When the device receives an incoming phone call.
- When an outgoing phone call is initiated on the device.
- When the user presses the CALL button on the device.
- The code in will never get executed.
Answers:
- onCreateOptionsMenu can be used to enable/disable some menu items in an Android application.
- onPrepareOptionsMenu can be used to enable/disable some menu items in an Android application.
- onShowOptionsMenu can be used to enable/disable some menu items in an Android application.
- The menu items in an Android application cannot be disabled.
Answers:
- Activity.onStop()
- Activity.onPause()
- Activity.onDestroy()
- Activity.onShutdown()
- Activity.onFreeze()
Answers:
- The android:versionCode attribute in the manifest file must be incremented and the APK file must be signed with the same private key.
- The android:versionCode attribute in the manifest file must be same and the APK file must be signed with the same private key.
- The android:versionCode attribute in the manifest file must be incremented and the APK file must be signed with the new private key.
- The android:versionCode attribute in the manifest file must be same and the APK file must be signed with the new private key.
Answers:
- import android.content;
- import android.widget;
- import android.database;
- import android.database.sqlite;
- import android.util;
Answers:
- Activity.onFreeze()
- Activity.onPause()
- Activity.onStop()
- Activity.onDestroy()
Answers:
- MIDLet
- AndroidApp
- Activity
- AppLet
- Application
Answers:
- SimpleCursor
- SimpleCursorAdapter
- SimpleAdapter
- SQLiteCursor
- SQLLiteAdapter
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(PATH_TO_FILE);
<Some code here>
mp.start();
Which of the following should be placed at <Some code here>?
Answers:
- mp.prepare();
- mp.prepareAsync();
- mp.loadMedia();
- mp.loadSource();
- mp.loadSource(); mp.prepare();
- No code is required at <Some code here> to start playback.
Answers:
- android.hardware
- android.bluetooth
- android.bluez
- org.bluez
Answers:
- Save a phone number to the contacts in the phone device.
- Retrieve a phone number from the contacts in the phone device.
- Delete a phone number from the contacts in the phone device.
- Format an international telephone number.
- Setting and retrieving the call forwarding phone number on the phone device.
Answers:
- Adding this line to the Android manifest file: <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” />
- Adding these two lines to the Android manifest file: <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” /> <uses-permission android:name=”android.permission.ACCESS_COARSE_LOCATION” />
- Adding this line to the Android manifest file: <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” />
- Adding this line to the Android manifest file: <uses-permission android:name=”android.permission.CONTROL_LOCATION_UPDATES” />
Answers:
- notifyPhoneCallState has to be called if your application wishes to receive a notification about an incoming phone call.
- notifyPhoneCallState is a call back function that is called when the call state changes.
- notifyPhoneCallState is called to initiate a call from the device.
- notifyPhoneCallState is used to send notifications about call states.
- notifyPhoneCallState gets called when the device receives an incoming phone call.
A) A content provider allows applications to access data.
B) A content provider must be declared in the AndroidManifest.xml file.
Answers:
- Statement A is true, while Statement B is false.
- Statement B is true, while Statement A is false.
- Both statements are true.
- Both statements are false.
Answers:
- List<ProviderInfo> returnList = new ArrayList<ProvderInfo>(); for (PackageInfo pack : getPackageManager().getInstalledPackages(PackageManager.GET_PROVIDERS)) { ProviderInfo[] providers = pack.providers; if (providers != null) { returnList.addAll(Arrays.asList(providers)); } } return returnList;
- return getContext().getPackageManager().queryContentProviders(“com.google”, Process.myUid(), 0);
- List<ActivityInfo> returnList = new ArrayList<ActivityInfo>(); for (PackageInfo pack : getPackageManager().getInstalledPackages(PackageManager.GET_RECEIVERS)) { ActivityInfo[] providers = pack.receivers; if (providers != null) { returnList.addAll(Arrays.asList(providers)); } } return returnList;
- None of these.
Answers:
- To play rich media content files.
- To create and publish rich media files.
- To share data between Android applications.
- To access the global information about an application environment.
- To maintain global application state.
Answers:
- Both startActivity and startSubActivity start an activity synchronously.
- Both startActivity and startActivityForResults start an activity asynchronously.
- startActivity is an asynchronous call, but startSubActivity is synchronous.
- startActivity is a synchronous call, but startSubActivity is asynchronous.
Answers:
- Application
- ApplicationContext
- Context
- Component
- Object
Answers:
- Adapte
- Manage
- Matche
- BluetoothAdapte
Answers:
- one
- two
- three
- four
Answers:
- Debug mode
- Release mode
- Production mode
- Development mode
Answers:
- A command line tool to create Android project files.
- A framework to create unit tests for Android projects.
- A resource editor to create user interface for Android applications.
- A tool to generate Android byte code from .class files.
- An emulator to execute and debug Android projects.
<MyElement xmlns:”http://schemas.androd.com/apk/res/android”
android:layout_width = “fill_parent”
android:layout_height = “fill_parent”
android:text = “Some Text”>
</MyElement>
Which of the following are true about the XML fragment above?
Answers:
- It is taken from the manifest xml file of the Android project.
- It is taken from an XML file used to define a view.
- It is taken from the package file (.apk) of the Android project.
- The xmlns: attribute is a compulsory attribute.
- If this is not the outer most tag in the XML file then it need not contain the xmlns: attribute.
- MyElement should be the name of a class derived, directly or indirectly, from the View class.
Answers:
- tag
- what
- arg1
- arg2
- userData
Answers:
- Screen2 has to be a part of MyAndroid.
- Screen2 can exist in any other Android application installed on the device.
- Screen2 will always be launched asynchronously.
- Screen2 can be launched synchronously.
- Screen2 can return a result code to Screen1 if launched with startActivity.
- Screen2 can return a result code to Screen1 if launched with startActivityForResult.
Answers:
- bindService
- startService
- runService
- startActivity
Answers:
- Android IDE
- Eclipse
- Visual Studio 2005
- Visual Studio 2008
Answers:
- WebBrowser
- BrowserView
- WebView
- Browser
- HtmlView
<font size =2>
@Override
protected void onStop
{
Super.onStop();
SharedPreferences setting = getSharedPreferences(“MyPrefs”, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean(“MyBool”, true);
<some more code here>
}
Which of the following should be used <some more code here>?
</font
Answers:
- editor.save(); editor.close();
- editor.save(); editor.finish();
- editor.commit();
- editor.save();
- editor.close();
- editor.finish();
Answers:
- A command line tool to create Android project files.
- A framework to create unit tests for Android projects.
- A resource editor to create user interface for Android applications.
- A tool to generate Android byte code from .class files.
- An emulator to execute and debug Android projects.
Answers:
- Activity.onCreate
- Activity.onCreateOptionsMenu
- Constructor of the Activity class.
- Activity.onCreateMenu
- Activity.onStart
- Activity.onPrepareOptionsMenu
Answers:
- onCreate
- onInit
- onCompleteThaw
- onRestart
Answers:
- Manipulate text that can span across multiple pages.
- Manipulate text that can span across multiple TextView windows.
- This is the interface for text to which markup objects can be attached and detached.
- String parsing.
Answers:
- It does server to device communication.
- It does device to server communication.
- It does device to server communication and vice versa.
- It does device to device communication.
Answers:
- Looking for the package attribute’s value of the <manifest> element in the manifest file.
- Executing the command, “pm list packages -f”, in the ADB shell.
- Programmatically, using PackageManager in an installed Android app.
- Using the AAPT platform tool, “aapt dump badging apkName.apk”.
Answers:
- 50MB
- 2GB
- 30MB
- unlimited
Answers:
- A new programming language that can be used to develop applications for mobile devices.
- A new IDE that can be used to develop applications for mobile devices.
- A software stack for mobile devices that includes an operating system, middleware and key applications.
- A new mobile device developed by Google.
Answers:
- Binde
- Flow
- Navigate
- Intent
- ApplicationContext
Answers:
- FEATURE_NO_TITLE
- FEATURE_NO_ICON
- FEATURE_RIGHT_ICON
- FEATURE_NO_MENU
- FEATURE_TRANSPARENT_WINDOW
Answers:
- startActivity and startActivityForResult can both be used to start a new activity from your activity class.
- Only startActivityForResult can be used to launch a new activity from your activity class.
- startActivity(myIntent); and startActivityForResult(myIntent, -1); have the same result.
- startActivity(myIntent); and startActivityForResult(myIntent, 0); have the same result.
- When startActivity is used to launch a new activity from your activity class then your activity class gets notified when the new activity is completed.
- When startActivityForResult is used to launch a new activity from your activity class then your activity class gets notified when the new activity is completed.
Answers:
- ProgressBa
- ProgressDialog
- ProgressItem
Answers:
- commandAction
- onMenuItem
- onMenuItemSelected
- onMenuItemClicked
- onOptionsItemSelected
Once an app is published, the ________ cannot be changed. It should be unique for each APK.
Answers:
- private key
- package name
- main activity
- APK file name
Answers:
- android:versionCode
- android:versionName
- android:targetSdkVersion
- android:maxSdkVersion
Answers:
- Both of them are used to dial a phone number on the device.
- Intent.action == Intent.CALL_ACTION is true when a phone call is received on the device.
- Intent.action = Intent.CALL_ACTION is used when a phone number is to be dialled without showing a UI on the device.
- Intent.action = Intent.DIAL_ACTION is used when a phone number is to be dialled without showing a UI on the device.
- Intent.action = Intent.CALL_ACTION is used when a phone number is to be dialled without the user having to explicitly initiate the call.
- Intent.action = Intent.DIAL_ACTION is used when a phone number is to be dialled without the user having to explicitly initiate the call.
Answers:
- Call setCurrentView(mView) in the startApp() of the main application class.
- Call setContentView(mView) in the startApp() of the main application class.
- Call setContentView(mView) in the onStart() of the main application class.
- Call setContentView(mView) in the onCreate() of the main application class.
Answers:
- Java
- C# with .NET Compact Framework for mobile devices.
- C programming language.
- Android programming language.
Answers:
- import android.drivers;
- import android.hardware.camera;
- import android.camera;
- import android.util;
- import android.hardware;
Answers:
- A command line tool to create Android project files.
- A framework to create unit tests for Android projects.
- A resource editor to create user interface for Android applications.
- A tool to generate Android byte code from .class files.
- An emulator to execute and debug Android projects.
Answers:
- 50MB
- 2GB
- 30MB
- unlimited
No comments:
Post a Comment