Thursday, 20 August 2015

Mobile Game development using Android OS

Upwork Test Categories

:: Home > Upwork > Mobile Technologies > Mobile Game development using Android OS

If you are creating a new Android game using Eclipse, which of the following is the correct procedure to do so?

a. File–>New–>Android Application Project–>Fill in the required Details and click Finish.
b. File–Android –>New Project–>Fill in the required Details and click Finish.
c. File–>java–>Android–> Application Project–>Fill in the required Details and click Finish.
d. File–>projects–>New Game Project–>Fill in the required Details and click Finish.

In order to create pop-up windows inside an Android game, a/an ________ class is used.

a. Dialog
b. ActivityWindow
c. PopupActivity
d. PopupWindow

Suppose you are developing an Android game using eclipse. If you want to change the version number of your game, which file should you edit to do so?

a. MainActivity.java
b. BuildConfig.java
c. AndroidManifest.xml
d. Style.xml
e. None of the above

In an Android project which of the files should not be modified?

a. BuildConfig.java
b. R.java
c. AndroidManifest.xml
d. MainActivity.java

In the method given below, which code line sets the class "MainGamePanel" as the handler of the events happening on the actual surface?

1. public class MainGamePanel extends SurfaceView implements
2. SurfaceHolder.Callback {
3. public MainGamePanel(Context context) {
4. super(context);
5. getHolder().addCallback(this);
6. setFocusable(true);
7. }

a. 4
b. 5
c. 6
d. None of the above

Which of the following log(s) is/are supported by Android.Util.Log class?

a. Error
b. Warning
c. Verbose
d. Debug
e. All of the above

The application context for the current process can be retrieved using which of the following methods in Android?

a. Context context=New Context(this);
b. Context context=getApplicationContext();
c. Context context=getContext(this);
d. Context context=New Applicationcontext();

The base class for Android Activity class is_______________.

a. Android.app.Activity
b. java.lang.Object
c. Android.app.admin
d. None of the above

This question is based upon the figure shown below


In Eclipse, which of the following is the icon of Android SDK Manager?

a. I
b. II
c. III
d. IV
e. V
f. VI

Suppose you want to draw an image, roboimage.png to coordinates (20, 20). The image is already present in the respective folder. Which of the following is the correct syntax to do so?

a. protected void Draw(Canvas canvas) {
    canvas.drawimage(BitmapFactory.Resource(getResources(),
    R.drawable.roboimage), 20, 20);
b. protected void Canvas() {
    canvas.drawimage(BitmapFactory.decodeResource(getResources(),
    R.drawable.roboimage), 20, 20, null);
c. protected void onDraw(Canvas canvas) {
    canvas.drawBitmap(BitmapFactory.decodeResource(getResources(),
    R.drawable.roboimage), 20, 20, null);
d. protected void Canvas() {
    drawimage(BitmapFactory.decodeResource(getResources(),
    R.drawable.roboimage), 20, 20);
e. None of the above

Which of the following image formats is/are supported by Android?

I. .jpg
II. .gif
III. .png
IV. .webp

a. I, II, III
b. II, III, IV
c. I, III, IV
d. III, IV
e. All of the above

Which of the following options is valid to create an AVD in Eclipse?

a. Go to Window menu –> select Android virtual device manager –> Android virtual devices tab –> New –> Fill in the details for AVD –> Click Ok.
b. Go to Source– >Select Android Virtual Device –> Android virtual devices tab –> Fill in the details for AVD–>Click Create AVD.
c. Go to Window– >Select New Android Virtual Device–> Android virtual devices tab –> Enter name of AVD–>Click Create AVD.
d. Go to Refractor –> Select Android –> Select Android Virtual Device–> Android virtual devices tab –> Enter name of AVD-Click Create AVD.

While creating an Android Virtual Device (AVD) which of the following hardware options is fixed and cannot be changed by the user?

a. RAM size
b. Battery Support
c. Cache partition size
d. DPad Support
e. None of the above

If a developer wants to modify the fundamental characteristics and components of an Android application developed using Eclipse, then which file he should edit to do so?

a. MainActivity.java
b. AndroidManifest.xml
c. BuildConfig.java
d. both b and c

The architecture used by DVM (Dalvik Virtual machine) is ___________ based.

a. queue
b. stack
c. register
d. All of the above
e. None of the above

Study the method given below and answer the following question:

public Triangle() {
1.ByteBuffer vertexByteBuffer = ByteBuffer.allocateDirect(vertices.length * 4);
2. vertexByteBuffer.order(ByteOrder.nativeOrder());
3. vertexBuffer = vertexByteBuffer.asFloatBuffer();
4. vertexBuffer.put(vertices);
5. vertexBuffer.position(0);
}

Which code line allocates memory from byte buffer?

a. 1
b. 2
c. 3
d. 4
e. 5

In order to retrieve a vibrator for interacting with the vibration hardware, which of the following code is used in Android .java file (in eclipse)?

a. Vibrator vibrator = getSystemService(Activity.VIBRATOR_SERVICE);
    model.setVibrator(vibrator);
b. Vibrator vibrator = (Vibrator) getService(Activity.VIBRATOR_SERVICE);
    setVibrator(vibrator);
c. Vibrator vibrator = (Vibrator)getSystemService(Activity.VIBRATOR_SERVICE);
    model.setVibrator(vibrator);
d. None of the above

Which of the following Android code is used to access the Android device's sensor service?

a. private SensorManager sensor_M;
    Sensor_M= (SensorManager) getSystemService(SENSOR_SERVICE);
b. private Sensor sensor_M;
    sensor_M= getSystemService(SENSOR_SERVICE);
c. private SytemSensorManager sensor_M;
    sensor_M= (SensorManager) getService(SENSOR_SERVICE);
d. private Manager sensor_M;
    Sensor_M= (Sensor) getSystemService(SENSOR.SERVICE);

State whether the following statement is true or false.

For handsets (mobile phone) debugging of Android applications, you cannot use eclipse.

a. True
b. False

How can you view the LogCat in your Eclipse editor?

a. Window–>Open perspectives–>Android–>LogCat
b. Window–>Others–>General–>LogCat
c. Window–>Show View–>Java–>General–>LogCat
d. Window–>Show View–>Other–>Android–>LogCat

For Android games, which of the following font types should we use so that the font size remains consistent on different types of devices with different screen sizes?

a. 3D font
b. Dotted Font
c. Bitmap Font
d. Modern Font

In mobile games, what is the ideal frame rate in frame per second (fps) for no noticeable glitches in the motion of objects?

a. ~20fps
b. ~30fps
c. ~40fps
d. ~50fps
e. ~60fps

In Android, a tool called DX is used to convert java .class files into _________format.

a. .dx
b. .dex
c. .exd
d. .exe
e. None of the above

Which of the following is the suggested location for storing the string resources in an Android application?

a. /res/values/string.xml
b. /res/values/styles.xml
c. /layout/values/string.xml
d. /layout/values/styles.xml

Suppose you are developing an Android game for mobiles. If you want to set the volume button of your phone to handle sounds of the game, which of the following is the correct syntax to do so?

a. context.setVolumeControlStream(AudioManager.STREAM_MUSIC);
b. setVolumeControlStream(context.AudioManager.STREAM_MUSIC);
c. context.setVolumeControlStream(SoundManager.STREAM_MUSIC);
d. setVolumeControlStream(context.SoundManager.STREAM_MUSIC);

Which of the following methods is used to display text on screen in eclipse?

a. public void displayString(String text, int x, int y){
    Canvas canvas;
    for (int i = 0; i < text.length(); i++) {
    Character Ch = text.CharAt(i);
    if (glyphs.get(ch) != null) {
    canvas.drawBitmap(glyphs.get(ch), x + i, (y* width), null); } } }
b. displayString(Canvas canvas, String text) {
    int x;
    int y;
    for (int x = 0; x < text.length(); x++) {
    Character ch
    if (glyphs.get(ch) != null) {
    canvas.drawBitmap(glyphs.x + (i * width.y, null); } } }
c. public void displayString(Canvas canvas, String text, int x, int y){
    for (int i = 0; i < text.length(); i++) {
    Character Ch = text.CharAt(i);
    if (glyphs.get(ch) != null) {
    canvas.drawBitmap(glyphs.get(ch), x + (i * width), y, null); } } }
d. public void displayString(Canvas canvas, String text, int x){
    for (int y = 0; y < text.length(); y++) {
    Character ch
    if (glyphs.get(ch) != null) {
    canvas.drawBitmap(glyphs.get(ch), x * width), null); } } }

Which of the following code lines is needed to be added in Android manifest file (in eclipse),outside of the block, for retrieving a vibrator that interacts with the vibration hardware?

a. <uses-permission Android:name="permission.VIBRATE"></uses-permission>
b. <uses-permission Android:name="Android.permission.VIBRATE"></uses-permission>
c. <uses-permission Android:name="Android.VIBRATE"></uses-permission>
d. <uses-permission Android ="Android.permission.VIBRATE"/>
e. It is not required to be added.

What are application assets in Android?

a. They are used very infrequently to store uncompiled files within the application package file that is installed on the handset.
b. They are used very frequently to store uncompiled files within the application package file that is installed on the handset.
c. They are used very infrequently to store compiled files within the application package file that is installed on the handset.
d. They are used very frequently to store compiled files within the application package file that is installed on the handset.

Study the Android method given below and answer the following question:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

What is the function of the given method?

a. It shows all the menus on the device in a zoomed in view.
b. It sets the application window to full screen mode.
c. Both a and b.
d. None of the above.

Suppose you want to add a new XML file named "colorDim" to your Android project. How can you do so?

a. Right Click on the project to which you want to add the new XML file–>New–>Class–> Enter Name "colorDim.XML"–>Finish
b. Right Click on the folder–>New–>Untitled xml file–>–> Enter Name"colorDim.XML"–>Finish
c. Right Click on the project to which you want to add the new XML file –>New–>Android XMLFile–> Enter Name "colorDim.XML"–>Finish
d. Right Click on the folder–>New–>Class–>Enter Name "colorDim.XML" –>Finish

State whether the given statement is true or false.

OpenGL is used only for writing 3D Graphics that are rendered on GPU (Graphics Processing Unit).

a. True
b. False

Which of the following devices can be used to run an Android application developed using Eclipse?

I) Android Refractor
II) Android Emulator
III) ProGuard
IV) Android device

a. I and IV
b. I, II and III
c. II and IV
d. All of the above
e. II, III and IV

Which of the following data type(s) is/are used by Android?

a. Primitive objects
b. Non persistent objects
c. Both a and b
d. None of the above

Which of the following is the correct way to retrieve a string instance named "hello" from the application resource of Android by using its resource id?

a. String rID= getString(R.string.hello);
b. String rID= getResources(R.string.hello);
c. String rID= getString().getResources(R.string.hello);
d. String rID= getResources().getString(R.string.hello);

Suppose you want to retrieve a system resource string called "Yes" from within an Activity class. Which of the following queries should you use to do so?

a. String getYes= Resource.getString().getSystem().(Android.R.string.Yes);
b. String getYes= Resources.getSystem().getString(Yes);
c. String getYes= Resources.getSystem().getString(Android.R.string.Yes);
d. String getYes= Resources.getString.getSystem(Android.R.string.Yes);

The Android operating system is based upon which of the following Kernel/s?

a. Mac
b. Linux
c. Solaris
d. All of the above

Which of the following adapters exposes data from a Cursor to a ListView widget?

a. BaseAdapter
b. AdapterView
c. BaseExpandableListAdapter
d. CursorAdapter

This question is based upon the figure shown below


In Eclipse, inside an Android project the style.xml file contain styles related to element of project or application being developed. Which of the following icons provide an option to display only the Style/Theme element of the project?

a. I
b. II
c. III
d. IV
e. None of the above

Which of the following code lines describes a map to associate a bitmap to each character?

a. private Map<Bitmap, Character> glyphs = new HashMap<Character, Bitmap>(62);
b. private Map<Bitmap, Character> glyphs = new BitMap<Bitmap, Character>(62);
c. private Map<Character, Bitmap> glyphs = new HashMap<Character, Bitmap>(62);
d. private Map<Character, Bitmap> glyphs = new BitMap<Character, Bitmap>(62);
e. private Map<Character, Bitmap> glyphs = new glyphs<Character, Bitmap>(62);

State whether the following statement is true or false.

While creating a new Android application using eclipse, we need to set the Android version for "Minimum Required SDK" and "Compile With" fields. Android version greater than or equal to Android 4.1 should be selected for both the fields.

a. True
b. False
Disqus Comments