You have submitted an updated version of an application you have published to th
e Android market. However, you are getting reports that when people try to insta ll the update it is installed as a new application instead of as an update. Based on the scenario above, what is the cause of this problem? Choice 1 You did not include the ALLOW_UPDATE permission in AndroidManifest.xml file. Choice 2 A different certificate was used to sign the update .apk file. Choice 3 A different version of keytool was used to sign the .apk file. Choice 4 The name of the application has been changed from what it originally was. Choice 5 You did not run zipalign on the APK before publishing. Android 4.0 Development, Question 1 of 40 You have a long-run process that you do not want impacting your UI thread. You d ecide that spawning a new thread to do this work is appropriate, but you do not want to write all the boilerplate code to deal with the threads. Based on the scenario above, which class will provide the functionality you need? Choice 1 Runnable Choice 2 UIThread Choice 3 UIWorker Choice 4 BackgroundTask Choice 5 AsyncTask Scenario You are working on an application with a main activity. You have a requirement t o show another activity started from the main one but have it NOT be full-screen . Based on the scenario above, how do you achieve this requirement? Choice 1 Ensure the second activity's Activity class has a public boolean field AS_DIALOG set to true. Choice 2 Pass a boolean true as the third argument to the Intent constructor. Choice 3 Call startActivityAsDialog() to launch the second activity. Choice 4 TACNO!!!!!! Set the second activity to use android:theme="@android:style/Theme.Dialog". Choice 5 Set the ACTION_LAUNCH_DIALOG flag on the intent used to launch the second activi ty. According to Android guidelines, if you want to create a custom permission for y our application and you want the permission to be automatically granted for all your other applications, you use: Choice 1 safe permission. Choice 2 signature permission. Choice 3 noCheck permission. Choice 4 selfSigned permission. Choice 5 system permission. Scenario You need to retrieve a list of private data files associated with your applicati on. You only need a list of filenames, not File handles to the actual files them selves. Based on the scenario above, which method do you use to accomplish this goal? Choice 1 InputStream.listFiles() Choice 2 AssetManager.listPrivateFiles() Choice 3 Context.fileList() tacan!!!!!!!!!!!!!!! Choice 4 File.getFiles() Choice 5 Context.getFileNames() Sample Code logcat radio Based on the sample code above, which change do you make to be able to l og radio activity? Choice 1 Add -s before radio. Choice 2 Change radio to cell. Choice 3 Add -v after radio. Choice 4 Add -b before radio. tacno!!!!!!!!! Choice 5 Enclose radio in quotation marks. The subclass of BroadcastReceiver that you use to aid in implementing a provider for an application widget is: Choice 1 BroadcastProvider. mislim da je ovo tacno!!!!!!!! Choice 2 AppListenerBase. Choice 3 AppWidgetProvider. Choice 4 BroadcastProviderBase. Choice 5 AppWidgetBroadcastReceiver. Sample Code Based on the sample code above, which method name replaces XXXX on line five to properly terminate the loop after the last record has been read? Choice 1 cursorExhausted() Choice 2 lastRecord() Choice 3 isAtEnd() Choice 4 isAfterLast() tacno!!!!!!!! Choice 5 isEnd() Based on the sample code above, which constant replaces XXXXXXXXXX to la unch the activity this code is a part of when an NDEF payload is discovered in a received NFC tag? Choice 1 ACTION_PAYLOAD_FOUND Choice 2 EXTRA_NDEF_MESSAGES Choice 3 ACTION_TAG_DISCOVERED Choice 4 ACTION_NFC_NDEF Choice 5 ACTION_NDEF_DISCOVERED You need to access a remote system to retrieve data. The remote system p rovides a REST-based web service interface. You do not want to include any addit ional libraries in your application other than what Android provides. Based on the scenario above, which package included with the Android SDK contains classes that will enable you to accomplish your goals? Choice 1 java.net.rest Choice 2 javax.ws.rs Choice 3 org.apache.http Choice 4 org.apache.cxf Choice 5 javax.ws.rest Which debugging tool do you use to capture screenshots of your applicati on running on a device? Choice 1 Monkey Choice 2 scrcap Choice 3 adb Choice 4 tacan odgovor!! proverio DDMS Choice 5 Dev Tools Sample Code Based on the sample code above, you ensure that the accuracy of the loca tion is less than 100 meters by: Choice 1 calling getHighAccuracyLocation() instead of getLastKnownLocation(). Choice 2 calling enhancedAccuracy(true) on the Location object. Choice 3 using ACCURACY_FINE instead of ACCURACY_LOW. valjda je ovo Choice 4 passing Context.LOCATION_SERVICE_ACCURATE to getSystemService(). Choice 5 passing true to the Criteria constructor. Which of the following is an example of an attribute value in AndroidManifest.xm l that references a string in a theme? Choice 1 ?drawable/heading Choice 2 /string/heading Choice 3 :string?heading Choice 4 ?string/heading Choice 5 @drawable/headingPic Sample Code Based on the sample code above, you initiate the configured transition a nd execute it over one second within the code of a View class with: Choice 1 ((TransitionDrawable)this.getTransition()).start(1); Choice 2 ((TransitionDrawable)this.getBackground()).initiateTransition(1); Choice 3 ((TransitionDrawable)this.getBackground()).startTransition(1000); Choice 4 ((TransitionDrawable)this.getBackground()).executeTransition(1000); ovo je tacno valjda Choice 5 ((TransitionDrawable)this.getTransition()).run(1000); Scenario You want to provide cloud-based backup of your application's data. You look at s everal options and decide that the Android Backup Service fits your needs. Based on the scenario above, to use the Android Backup Service your appl ication needs to: Choice 1 be modified by Google to include the proper backup interface code. Choice 2 get a private key from the user and register it with the service via a web servi ce. Choice 3 have the android.BACKUP_SERVICE permission and provide a Backup Service Router ( BSR). Choice 4 be registered with the service and provide a backup agent component. Choice 5 include a certificate obtained from Google in resources and provide a BackupMana ger. You have an application that is causing an Application Not Responding (ANR) dial og box. This application consists of a single screen with some text fields, a bu tton to save the entries to a text file, and a broadcast receiver that triggers when a user taps the save button. You are able to enter data and save it without any problem during your hundreds of test executions, but the ANR dialog is stil l occurring randomly. Based on the scenario above, what is the cause of the ANR dialog box? Choice 1 The main application thread is heap dumping as the user navigates the screen. Choice 2 Too many child threads are being spawned by UI interactions. Choice 3 The broadcast receiver is randomly taking more than 10 seconds to execute. Choice 4 There is no response to an input event on the text fields within three seconds. Choice 5 The save operation is a blocking I/O call. To test if every string resource needed for your application is present for a de fault language by using the emulator, you: Choice 1 run your application and look for any ResourceUndefined exceptions in the logcat output. Choice 2 set the emulator to the unsupported language and run the application ensuring yo u do not get a force close. Choice 3 use the Dev Tools application to validate the application once you have transfer red it to the emulator using adb. Choice 4 run DDMS against your application and note any "Missing String Resource" errors in the logcat window. Choice 5 run the resourceValidation tool on your application's APK file and ensure the er rors.txt file is empty. Which class do you use to send an SMS message? Choice 1 dalvik.system.SmsGenerator Choice 2 android.net.SmsSender Choice 3 java.net.SmsComm Choice 4 android.telephony.SmsManager TACAN ODGOVOR NASAO Choice 5 android.os.MessageManager Based on the sample code above, why is the output NOT correct? Choice 1 The namespace specified is incorrect. Choice 2 <application> can only appear once. Choice 3 You cannot use hardcoded strings in AndroidManifest.xml for label values. Choice 4 Two main activities are not allowed to exist in the same package. Choice 5 The value of minSdkVersion is not a valid value. You want to have a single activity defined in AndroidManifest.xml be accessible by two names with two separate sets of intent filters. Referring to the scenario above, which attribute do you use? Choice 1 <alternate-alias> Choice 2 <copy-activity> Choice 3 <activity-alias> valjda ovo Choice 4 <secondary-name> Choice 5 <alternate-name> You are trying to troubleshoot your application using log messages, but the outp ut of logcat has too much data in it to be useful. Therefore you want to limit t he output to only show output from ActivityManager at a priority of Info or abov e, as well as anything from your application (using the tag CustomerProcessor) a t Debug level or above. Based on the scenario above, which filter expression do you use with log cat to get the output you want? Choice 1 ActivityManager:I CustomerProcessor:D *:S Choice 2 ActivityManager:I CustomerProcessor:D Choice 3 ActivityManager=I CustomerProcessor=D Choice 4 --ActivityManager=info --CustomerProcessor=debug --All=silent Choice 5 ActivityManager(I) CustomerProcessor(D) *(S) WebView by default handles different screen densities by scaling webpage s, so that all devices display them at the same relative size as a: Choice 1 extra-high-density screen. Choice 2 medium-density screen. ovo je tacno Choice 3 AMOLED screen. Choice 4 high-density screen. Choice 5 low-density screen. When a call to a method implemented in an IBinder originates from anothe r process, the method: Choice 1 is executed in a thread chosen from a pool in the same process as the caller. Choice 2 call fails with a SecurityViolationException thrown back to the caller. Choice 3 is executed in the caller's thread. Choice 4 call spawns a new thread within the main UI servicing thread. Choice 5 is executed in a thread chosen from a pool in the same process as the IBinder. Which class asynchronously connects to and monitors data sources and del ivers them to the client? Choice 1 Fragment Choice 2 RemoteCursor Choice 3 Loader ovo je tacno Choice 4 DataBridge Choice 5 DataProvider jedno sam preskocio ono za muziku Based on the sample code above, to ensure that a user must explicitly gr ant this permission when requested you: Choice 1 change the label and description values to reference standard Android permission string constants. Choice 2 change the protectionLevel to dangerous. Choice 3 change the permissionGroup to android.permission-group.REQUEST. Choice 4 add android:forceGrant="true" to the <permission> tag. Choice 5 add a child element <explicitGrant>true</explicitGrant> to the <permission> tag. Methods in bound services written using AIDL must: Choice 1 not alter persistent data. Choice 2 be written using AIDL. Choice 3 not use third-party classes. Choice 4 be thread-safe. Choice 5 return within two seconds. Google provides Android development extensions for which IDE? Choice 1 IntelliJ IDEA Choice 2 Eclipse Choice 3 Netbeans mozda Choice 4 JDeveloper Choice 5 JBuilder Based on the sample code above, which line of code must be added to atta ch the Bundle to the Intent so it can be passed to the next activity? Choice 1 i.addExtra(b); Choice 2 i.passBundle(b); Choice 3 i.putBundle(b); Choice 4 i.putExtras(b); Choice 5 i.addData(b); You want to show data from a content provider in a ListView. Based on the scenario above, which column needs to be returned as part o f the records provided by the content provider? Choice 1 uniqueID Choice 2 key Choice 3 _ID valjda ovo Choice 4 _COUNT Choice 5 _Index You have an activity that needs to do some long-running background work. The cod e spawns a worker thread to do this. However, most of the time, Android is killi ng the thread to regain system resources before the work completes. Based on the scenario above, you keep the background process from being killed by: Choice 1 ensuring the thread only posts messages back to UI components. Choice 2 implementing it as a service instead of a worker thread. Choice 3 starting the worker thread with the runOnUiThread() method. Choice 4 setting the android:doNotKill to true in the manifest for the application. Choice 5 setting the classification of the thread to daemon and setting its priority to l ow. Which of these standard broadcast actions are NOT protected for system use only and therefore can be broadcast by your application? Choice 1 ACTION_UID_REMOVED Choice 2 ACTION_POWER_DISCONNECTED Choice 3 ACTION_TIMEZONE_CHANGED Choice 4 ACTION_TIME_CHANGED tacno sigurno 100% Choice 5 ACTION_TIME_TICK If your application does not specifically require a camera using a manifest decl aration, how do you check to see if a camera is available at runtime? Choice 1 boolean hasCamera = context.getPackageManager().hasSystemFeature(PackageManager. FEATURE_CAMERA) ? true : false; Choice 2 boolean hasCamera = getPackageManager().hasSystemFeature(PackageManager.HARDWARE _CAMERA) ? true : false; Choice 3 boolean hasCamera = context.getPackageManager().hasSystemFeature(PackageManager. HARDWARE_CAMERA) ? true : false; Choice 4 boolean hasCamera = system.getPackageManager().hasSystemFeature(PackageManager.F EATURE_CAMERA) ? true : false; Choice 5 boolean hasCamera = context.getPackageManager().hasHardware(PackageManagerFeatur e.CAMERA) ? true : false; You have an application that was written to target an API level of Andro id prior to 13. While versions of Android above 3.2 must use screen compatibilit y mode to stretch your application to fit the screen, this results in pixelation and generally doesn't look as attractive as the application does on smaller scr eens. The application functions as expected in all cases though, and you do not have resources to significantly modify the application. Based on the scenario above, the way you ensure the application looks go od at all resolutions is to: Choice 1 rewrite the application from the ground up to target the new screen sizes. Choice 2 add the android:compatibleWidthLimitDp to your <application> element with a valu e of 320 or higher. Choice 3 use the android:maxSdkVersion to stop your application from running on non-suppo rted devices. Choice 4 provide alternative layouts for different screen sizes. Choice 5 include a <supports-screens> element in your manifest. String lc = context.getResources().getConfiguration().locale.getLanguage (); In order for the sample code above to provide the ISO language code, you change: Choice 1 getConfiguration() to getISOConfiguration(). Choice 2 getResources() to getISO3Resources(). Choice 3 getLanguage() to getISOLanguage(). Choice 4 locale to iso3Locale. Choice 5 getLanguage() to getISO3Language(). ovo je tacno Given activity A that launches activity B that then launches activity C, which I ntent flag do you use to launch activity B to ensure that activity A is shown in stead of activity B when the user presses the back button from activity C? Choice 1 FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS Choice 2 FLAG_ACTIVITY_NO_BACK Choice 3 FLAG_ACTIVITY_IGNORE Choice 4 FLAG_ACTIVITY_SKIP Choice 5 FLAG_ACTIVITY_NO_HISTORY ovo je Based on the sample code above, which line of code copies the URI to the clipboa rd? Choice 1 Object o = (ClipData)ClipData.getURI(myURI); Choice 2 Clip c = Clip.newUri(getContentResolver(), "URI", myURI); Choice 3 ClipData c = ClipData.newUri(getContentResolver(), "URI", myURI); Choice 4 ClipData c = new ClipData(getContentResolver(), "URI", myURI); Choice 5 Object o = (ClipData)ClipData.newUri(new ContentResolver(), myURI); Which snippet of code do you use to determine if the package com.company .app is allowed to initiate a phone call without going through the Dialog interf ace? Choice 1 Context.checkPermission("com.company.app", "android.permission.CALL_PHONE"); Choice 2 context.getPackageManager().checkPermission("com.company.app", "android.permissi on.MODIFY_PHONE_STATE"); Choice 3 context.getPackageManager().checkPermission("android.permission.CALL_PHONE", "co m.company.app"); Choice 4 PackageManager.get("com.company.app").validatePermission("android.permission.CAL L_PHONE"); Choice 5 context.getPackageManager().checkPermission("android.permission.MODIFY_PHONE_STA TE", "com.company.app"); http://alttest.123assess.com/do/bb1 If users are complaining that your application, which stores data on a r emote server, is draining their batteries, you must ensure that the application is not: Choice 1 requesting a low-speed connection from the system when a high-speed one is avail able. Choice 2 spawning multiple content providers, since each one needs a network connection. Choice 3 using fragments to render its UI due to their reliance on sockets. Choice 4 constantly retrying failed network operations. Choice 5 trying to access a site mirror that is too far away from the device's current lo cation.
Python Advanced Programming: The Guide to Learn Python Programming. Reference with Exercises and Samples About Dynamical Programming, Multithreading, Multiprocessing, Debugging, Testing and More