Mobile Game development using Android OS Test Upwork

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

a.Log.d

b.Log.v

c.Logcat

d.Tag.Log

e.Log.e

Which of the following layouts is not there in Android SDK?

a.Circle Layout

b.Linear Layout

c.Relative Layout

d.List view

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

a.True

b.False

Which of the following classes handles sound media in an Android game?

a.Soundpool

b.MediaPlayer

c.Both a and b

d.None of the above

OpenGL is a/an ________ .

a.type of computer-aided design (CAD)

b.Application programming Interface

c.Graphical Processing Unit

d.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?

a.setARGB(0, 255, 255, 0);

b.setRGB(0, 255, 255, 0);

c.setColor(0, 255, 255, 0);

d.setRGB(0, 255);

e.setARGB(0, 255, 255);

In Eclipse, the layout folder of an Android application are located in which of the following folders by default?

a.bin

b.assets

c.values

d.res

State whether the following statement is true or false.

In Eclipse, on saving the .java files, the code is automatically compiled each time.

a.True

b.False

While we are developing an application on eclipse, an .apk file is automatically generated. In which of the folders is this file generated?

a.src

b.bin

c.res

d.libs

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

a. .dx

b. .dex

d. .exe

e. None of the above

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 objects is/are used for building user interface elements in Android?

I) View

II) ViewGroup

III) Layout

a.I

b.II

c.III

d.I & II Only

e.II & III Only

f.All of the above

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?

a.import Android.microedition.khronos.egl.EGLConfig;

b.import javax.microedition.khronos.egl.EGLConfig;

c.import Android.microedition.EGLConfig;

d.import javax.microedition.EGLConfig;

View the section of Android code given below:

public void draw(Canvas canvas) {

Rect destRect = new Rect(getX(), getY(), getX() + spriteWidth, getY() + spriteHeight);

canvas.drawBitmap(bitmap, sourceRect, destRect, null);

canvas.drawBitmap(bitmap, 20, 150, null);

Paint Paint = new Paint();

paint.setARGB(50, 0, 255, 0);

canvas.drawRect(20 + (currentFrame * destRect.width()), 150, 20 + (currentFrame *destRect.width()) +destRect.width(), 150 + destRect.height(), paint);

The code is executed using eclipse. What does the above code do?

a.It draws an image at two positions. One image is drawn at the coordinates (20, 150) and second at the coordinates (50, 255).

b.It displays a frame at the coordinates (20, 150) and creates a new paint object so we can paint over the current frame on the original image.l

c.It displays a frame at the coordinates (50, 255) and creates a new paint object so we can paint over the current frame on the original image.

d.It displays an image at the coordinates (50, 255) using the Paint method.

e.It draws a rectangle at the coordinates (50, 255) using the Paint method.

Examine the code given below:

public boolean onCreateOptionsMenu(Menu menu) {

// Inflate the menu; this adds items to the action bar if it is present.

getMenuInflater().inflate(R.menu.activity_main, menu);

return true;

}

Which of the following classes need(s) to be imported in order for this function to work properly?

a.Android.app.Activity

b.Android.app.admin

c.Android.view.Menu

d.Android.os.Bundle

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

a.<dimension name="abcDim">250px</dimension>

b.<size name="abcDim">250</size>

c.<dimension abcDim= 250px></Dimension>

d.<dimen name="abcDim">250px</dimen>

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

a.R.java

b.Runmain.java

c.MainActivity.java

d.AndroidManifest.xm

Suppose you want to include a robot.png image in your Android game. Which is the recommended folder where you should copy this image?

a.Drawable.hdpi

b.Drawable.mdpi

c.Drawable.ldpi

d.Drawable.xhdpi

e.Any of the above

f.None of the above

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



a. private void loadResources(){

this.glyphs = new Glyphs(BitmapFactory.decodeResource(R.drawable.glyphs_white));

Log.d(TAG, "Glyphs loaded");

}



b. private void loadResources() {

this.glyphs = new Glyphs(BitmapFactory.decodeResource(getResources().glyphs));

Log.d(TAG, "Glyphs loaded");

}



c. private void loadResources() {

this.glyphs = new Glyphs(BitmapFactory.decodeResource(getResources(), R.glyphs));

Log.d(TAG, "Glyphs loaded");

}



d. private void loadResources() {

this.glyphs = new Glyphs(BitmapFactory.decodeResource(getResources(),R.drawabl e.glyphs_white));

Log.d(TAG, "Glyphs loaded");

}



e.private void loadResources() {

this.glyphs = new Glyphs(BitFontFactory.decodeResource(getGlphsImages(),R.drawabl e.glyphs_color));

Log.d(TAG, "Glyphs loaded");

}

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

a.Emacs

b.Eclipse

c.Notepad++

d.IntelliJ IDEA

e.None of the above

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

a.import Android.content.Resources;

b.import Android.content.res.Resources;

c.import content.res.Resources;

d.import Android.System.res.Resources;

e.import Android.String.res.Resources;

Which of the following are the features of the AndroidManifest.xml file?

I) Intent Filters

II) Permission

III) Project text

IV) Instrumentation

V) AppTheme

a.I, III

b.II, III, V

c.I, II, IV

d.III, V

e.II, III, IV, V

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

a.Dalvik Debug Monitor Server (DDMS)

b.Android Debug Bridge(ADB)

c.Java Debugger

d.None of the above

Suppose you are creating an Android application. If you want to print out a message that says "Game Begins" and use this for debugging purpose, then which of following statements should you use?

a.Log.d(TAG, "Game Begins");

b.LogCat(TAG, "Game Begins");

c.TAG.Log("Game Begins");

d.Log.Tag("Game Begins");

e.Log.debug(TAG, "Game Begins");

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

Which of the following is the correct syntax to do so?



a.boolean CheckOrientation = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;

int frameBufferHeight = CheckOrientation ? 1000: 600;

int frameBufferWidth = CheckOrientation ? 600: 1000;



b.getOrientation().getConfiguration().ORIENTATION_PORTRAIT;

if(true)

{

int frameBufferHeight = 1000px ;

int frameBufferWidth = 600px ;

}

else

{

int frameBufferHeight = 1000px ;

int frameBufferWidth = 600px ;

}



c.boolean CheckOrientation(). getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;

if(true)

{

int frameBufferHeight = 1000px ;

int frameBufferWidth = 600px ;

}

else

{

int frameBufferHeight = 1000px ;

int frameBufferWidth = 600px ;

}



d.getOrientation().getConfiguration().ORIENTATION_PORTRAIT;

int frameBufferHeight = CheckOrientation ? 600: 1000;

int frameBufferWidth = CheckOrientation ? 1000: 600;



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?

a.When the game is paused, its music stops, and when the user resumes it, the game starts again without the music.

b.When the game is paused, its music stops and when the user resumes it and the game regains focus, the background music starts again.

c.When the game is paused, its music does not stop and when the user resumes it, the game starts again with the music.

d.Nothing happen

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?

a.Copy and paste the Warrior.ap.exe file onto the device and install the application.

b.Copy and paste the buildConfig.java file onto the device and install the application.

c.Copy and paste the Warrior.java file onto the device and install the application.

d.Copy and paste the Warrior.apk file onto the device and install the application.

e.Copy and paste the Warrior.exe file onto the device and install the application

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

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

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); } } }

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

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);

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);

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

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

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

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

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();

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.drawimage(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 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

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

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

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);

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

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

Mobile Game development using Android OS Test Upwork 2019

