Mobile Game development using Android OS Upwork Test

0
140

We don’t guarantee that all provided answers are correct.

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

  • queue
  • stack
  • register
  • All of the above
  • None of the above

In an Android game, if you want to set the color of a particular screen as yellow, which of the following is the correct method to do so?
Answer

  • setARGB(0, 255, 255, 0);
  • setRGB(0, 255, 255, 0);
  • setColor(0, 255, 255, 0);
  • setRGB(0, 255);
  • setARGB(0, 255, 255);

If you want to set the size of your textView control to 250 pixel, then which of the following xml queries can be used?
Answer

  • <dimension name=”abcDim”>250px</dimension>
  • <size name=”abcDim”>250</size>
  • <dimension abcDim= 250px></Dimension>
  • <dimen name=”abcDim”>250px</dimen>

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

  • Context context=New Context(this);
  • Context context=getApplicationContext();
  • Context context=getContext(this);
  • Context context=New Applicationcontext();

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

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

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

  • private SensorManager sensor_M;
    Sensor_M= (SensorManager) getSystemService(SENSOR_SERVICE);
  • private Sensor sensor_M;
    sensor_M= getSystemService(SENSOR_SERVICE);
  • private SytemSensorManager sensor_M;
    sensor_M= (SensorManager) getService(SENSOR_SERVICE
  • private Manager sensor_M;
    Sensor_M= (Sensor) getSystemService(SENSOR.SERVICE);

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?

Answer

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

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

  • BuildConfig.java
  • R.java
  • AndroidManifest.xml
  • MainActivity.java

OpenGL is a/an ________ .
Answer

  • type of computer-aided design (CAD)
  • Application programming Interface
  • Graphical Processing Unit
  • 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?
Answer

  • MainActivity.java
  • AndroidManifest.xml
  • BuildConfig.java
  • both b and c

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)?
Answer

  • Vibrator vibrator = getSystemService
    (Activity.VIBRATOR_SERVICE);
    model.setVibrator(vibrator);
  • Vibrator vibrator = (Vibrator) getService
    (Activity.VIBRATOR_SERVICE);
    setVibrator(vibrator);
  • Vibrator vibrator = (Vibrator)getSystemService
    (Activity.VIBRATOR_SERVICE);
    model.setVibrator(vibrator);
  • None of the above

________ file in the Android project is an auto generated file and is stored in the package gen.
Answer

  • R.java
  • Runmain.java
  • MainActivity.java
  • AndroidManifest.xm

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

  • Mac
  • Linux
  • Solaris
  • All of the above

The base class for Android Activity class is ________.
Answer

  • Android.app.Activity
  • java.lang.Object
  • Android.app.admin
  • None of the above

Which of the following debugging tools is used in Android game development?
Answer

  • Dalvik Debug Monitor Server (DDMS)
  • Android Debug Bridge(ADB)
  • Java Debugger
  • None of the above

Which of the following classes contains Android system string resources Cut, Copy, and Paste?
Answer

  • import Android.content.Resources;
  • import Android.content.res.Resources;
  • import content.res.Resources;
  • import Android.System.res.Resources;
  • import Android.String.res.Resources;

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?
Answer

  • context.setVolumeControlStream
    (AudioManager.STREAM_MUSIC);
  • setVolumeControlStream
    (context.AudioManager.STREAM_MUSIC);
  • context.setVolumeControlStream
    (SoundManager.STREAM_MUSIC);
  • setVolumeControlStream
    (context.SoundManager.STREAM_MUSIC);

State whether the following statement is true or false.
In Eclipse, on saving the .java files, the code is automatically compiled each time.
Answer

  • True
  • False

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?
Answer

  • String getYes= Resource.getString().getSystem()
    .(Android.R.string.Yes);
  • String getYes= Resources.getSystem().getString(Yes);
  • String getYes= Resources.getSystem().
    getString(Android.R.string.Yes);
  • String getYes= Resources.getString.
    getSystem(Android.R.string.Yes);

In Android game development, which of the following is the correct method to load the images using Eclipse?
Answer

  • private void loadResources(){
    this.glyphs = new Glyphs(BitmapFactory.decodeResource
    (R.drawable.glyphs_white));
    Log.d(TAG, “Glyphs loaded”);
    }
  • private void loadResources() {
    this.glyphs = new Glyphs(BitmapFactory.decodeResource
    (getResources().glyphs));
    Log.d(TAG, “Glyphs loaded”);
    }
  • private void loadResources() {
    this.glyphs = new Glyphs(BitmapFactory.decodeResource
    (getResources(), R.glyphs));
    Log.d(TAG, “Glyphs loaded”);
    }
  • private void loadResources() {
    this.glyphs = new Glyphs(BitmapFactory.decodeResource
    (getResources(),R.drawable.glyphs_white));
    Log.d(TAG, “Glyphs loaded”);
    }
  • private void loadResources() {
    this.glyphs = new Glyphs(BitFontFactory.decodeResource
    (getGlphsImages(),R.drawable.glyphs_color));
    Log.d(TAG, “Glyphs loaded”);
    }

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?
Answer

  • <uses-permission Android:name=”permission.VIBRATE”></uses-permission>
  • <uses-permission Android:name=”Android.permission.VIBRATE”></uses-permission>
  • <uses-permission Android:name=”Android.VIBRATE”></uses-permission>
  • <uses-permission Android =”Android.permission.VIBRATE”/>
  • It is not required to be added

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

  • /res/values/string.xml
  • /res/values/styles.xml
  • /layout/values/string.xml
  • /layout/values/styles.xml

Suppose you are developing a game for an Android mobile phone using Eclipse. In the game, you want to set the height and width of the game frame as 1000 and 600 respectively if held normally and vice versa, that is height 600 and width 1000 if the orientation of screen is changee.
Which of the following is the correct syntax to do so?

Answer

  • boolean CheckOrientation = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
    int frameBufferHeight = CheckOrientation ? 1000: 600;
    int frameBufferWidth = CheckOrientation ? 600: 1000;
  • getOrientation().getConfiguration().
    ORIENTATION_PORTRAIT;
    if(true)
    {
    int frameBufferHeight = 1000px ;
    int frameBufferWidth = 600px ;
    }
    else
    {
    int frameBufferHeight = 1000px ;
    int frameBufferWidth = 600px ;
    }
  • boolean CheckOrientation(). getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
    if(true)
    {
    int frameBufferHeight = 1000px ;
    int frameBufferWidth = 600px ;
    }
    else
    {
    int frameBufferHeight = 1000px ;
    int frameBufferWidth = 600px ;
    }
  • getOrientation().getConfiguration().
    ORIENTATION_PORTRAIT;
    int frameBufferHeight = CheckOrientation ? 600: 1000;
    int frameBufferWidth = CheckOrientation ? 1000: 600;

Suppose you have developed a game named “Warrior” using Eclipse. In order to run this game on an Android phone what is needed to be done?
Answer

  • Copy and paste the Warrior.ap.exe file onto the device and install the application
  • Copy and paste the buildConfig.java file onto the device and install the application
  • Copy and paste the Warrior.java file onto the device and install the application
  • Copy and paste the Warrior.apk file onto the device and install the application
  • Copy and paste the Warrior.exe file onto the device and install the application

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?
Answer

  • protected void Draw(Canvas canvas) {
    canvas.drawimage
    (BitmapFactory.Resource(getResources(),
    R.drawable.roboimage), 20, 20);
  • protected void Canvas() {
    canvas.drawimage
    (BitmapFactory.decodeResource(getResources(),
    R.drawable.roboimage), 20, 20, null);
  • protected void onDraw(Canvas canvas) {
    canvas.drawimage
    (BitmapFactory.decodeResource(getResources(),
    R.drawable.roboimage), 20, 20, null);
  • protected void Canvas() {
    drawimage(BitmapFactory.decodeResource
    (getResources(),
    R.drawable.roboimage), 20, 20);
  • None of the above

How can you view the LogCat in your Eclipse editor?
Answer

  • Window–>Open perspectives–>Android–>LogCat
  • Window–>Others–>General–>LogCat
  • Window–>Show View–>Java–>General–>LogCat
  • Window–>Show View–>Other–>Android–>LogCat

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.
Answer

  • True
  • False

In Android, which of the following header files is needed to be imported in the class that implements OpenGL Renderer given that the game is being developed using Eclipse?
Answer

  • import Android.microedition.khronos.egl.EGLConfig;
  • import javax.microedition.khronos.egl.EGLConfig;
  • import Android.microedition.EGLConfig;
  • import javax.microedition.EGLConfig;

If you want to print or log everything that happens in your application, which of the following tags should you use?
Answer

  • Log.d
  • Log.v
  • Logcat
  • Tag.Log
  • Log.e

Consider the following logic in an Android game:
On receiving onPause() event, pause the music and set onFocusChanged() as false and after receiving onResume(), wait for onFocusChanged(true) message before resuming the background music.
What does the above logic do in the game?
Answer

  • When the game is paused, its music stops, and when the user resumes it, the game starts again without the music
  • When the game is paused, its music stops and when the user resumes it and the game regains focus, the background music starts again.
  • When the game is paused, its music does not stop and when the user resumes it, the game starts again with the music
  • Nothing happen

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?
Answer

  • MainActivity.java
  • BuildConfig.java
  • AndroidManifest.xml
  • Style.xml
  • None of the above

Which of the following objects is/are used for building user interface elements in Android?
I) View
II) ViewGroup
III) Layout

Answer

  • I
  • II
  • III
  • I & II Only
  • II & III Only
  • All of the above

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

  • File–>New–>Android Application Project–>Fill in the required Details and click Finish
  • File–Android –>New Project–>Fill in the required Details and click Finish
  • File–>java–>Android–> Application Project–>Fill in the required Details and click Finish
  • File–>projects–>New Game Project–>Fill in the required Details and click Finish

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

  • Right Click on the project to which you want to add the new XML file–>New–>Class–> Enter Name “colorDim.XML”–>Finish
  • Right Click on the folder–>New–>Untitled xml file–>–> Enter Name”colorDim.XML”–>Finish
  • Right Click on the project to which you want to add the new XML file –>New–>Android XMLFile–> Enter Name “colorDim.XML”–>Finish
  • Right Click on the folder–>New–>Class–>Enter Name “colorDim.XML” –>Finish

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?
Answer

  • 1
  • 2
  • 3
  • 4
  • 5

Which of the following are the features of the AndroidManifest.xml file?
I)Intent Filters
II)Permission
III)Project text
IV)Instrumentation
V)AppTheme
Answer

  • I, III
  • II, III, V
  • I, II, IV
  • III, V
  • II, III, IV, V

This question is based upon the figure shown below
In Eclipse, which of the following is the icon of Android SDK Manager?
Answer

  • I
  • II
  • III
  • IV
  • V
  • VI

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

  • .dx
  • .dex
  • .exe
  • None of the above

The Integrated Development Environment for Android game development is/are ________.
Answer

  • Emacs
  • Eclipse
  • Notepad++
  • IntelliJ IDEA
  • None of the above

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 develope
Which of the following icons provide an option to display only the Style/Theme element of the project?
Answer

  • I
  • II
  • III
  • IV
  • None of the above

LEAVE A REPLY

Please enter your comment!
Please enter your name here