Computer Knowledge
GUI and Web Frameworks
1,915 Questions
Graphical user interface and web frameworks involve layout management, directives, and application design across platforms like Android and Angular. These concepts are tested in computer science and IT officer competitive exams. Review these questions to understand UI components and coding standards.
Android layout attributesAngular structural directivesVB.Net web methodsJava Swing componentsSiebel application framework
GUI and Web Frameworks Questions
-
Tab navigation mode
-
Viewpager
-
List navigation mode
-
Tabwidget
C
Correct answer
Explanation
List navigation mode is a good choice when the number of possible navigation options are too large to make tabs practical.
-
Only A
-
Only B
-
Both A and B
-
Neither A nor B
C
Correct answer
Explanation
ActionProvider is a new class available in Android 4.0. The action bar is a way to quickly add functionality to your application, while maintaining a native platform look and feel. Hence, both statements are correct.
-
ActionBar
-
ActionBarListener
-
ActionProvider
-
TabListener
D
Correct answer
Explanation
TabListener is used to implement the methods onTabSelected, onTabUnselected and onTabReselected.
-
ActionBar
-
TabWidget
-
ViewPager
-
Tab
B
Correct answer
Explanation
If you need to add tabs to a sub-view of your app, you can create a tab-style interface by using a TabWidget.
-
<activity>
android:name=”.SampleActivity” android:uiOptions=”splitActionBar”>
</activity>
-
<activity> android:name=”.SampleActivity” android:uiOptions=”splitActionBarWhenNarrow”> </activity>
-
<activity> android:name=”.SampleActivity” android:uiOptions=”splitActionBarNarrow”> </activity>
-
<activity> android:name=”.SampleActivity” android:Options=”splitActionBarWhenNarrow”> </activity>
B
Correct answer
Explanation
To enable a split action bar on an activity, the code is:
android:name=”.SampleActivity” android:uiOptions=”splitActionBarWhenNarrow”>
-
TabHost
-
TabWidget
-
ViewPager
-
ActionBar
-
Tab t1=bar.newTab();
t1.setText("Tab Text&");
-
Tab t1=bar.newTab();
t1.setTabListener(this);
-
Tab t1=bar.newTab();
t1.setText("Tab Text");
t1.setTabListener(this);
-
Tab t1=bar.newTab();
t1.setText("Tab Text");
t1.setTabListener(this);
bar.addTab(bar.newTab());
D
Correct answer
Explanation
The code to add the tabs and their listeners to the action bar is as follows:
t1.setText("Tab Text");
t1.setTabListener(this);
bar.addTab(bar.newTab());
C
Correct answer
Explanation
The correct sequence to create a tab-style interface is:
1.TabHost
2. LinearLayout
3. TabWidget
-
Android:actionProviderClass=”android.widget.ShareActionProvider”
-
Public void onCreate(Bundle bun1) {
Super.onCreate(bun1);
final ActionBar bar = getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
-
Public void onCreate(Bundle bun1) {
Super.onCreate(bun1);
final ActionBar bar = getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_TABS);
}
-
Public void onCreate(Bundle bun1) {
Super.onCreate(bun1);
final ActionBar = getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
D
Correct answer
Explanation
To create a tabbed interface, you have to set the navigation mode for the action bar in the onCreate method of your activity. The code is:
Public void onCreate(Bundle bun1) {
Super.onCreate(bun1);
final ActionBar bar = getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
-
For background task
-
To provide a text window
-
To provide a simple popup
-
None of these
C
Correct answer
Explanation
A toast provides a simple popup.
-
Layout
-
Values
-
Drawable
-
Assest
C
Correct answer
Explanation
Images to be used in android projects should be stored in drawable folder of res directory.
-
To modify the application permissions
-
To add media files(images)
-
To change layout or graphical view
-
To provide pointers to drawable, layout and values directory
A
Correct answer
Explanation
AndroidManifest.xml present in res folder is used to modify the application permissions, activities and intent fillters.
-
Values
-
Layout
-
Drawable
-
Assests
D
Correct answer
Explanation
The res directory has subfolders - values, layout and drawable.
-
android.widget.ImageView
-
android.widget.Image
-
android.widget.ShowImage
-
None of these
A
Correct answer
Explanation
The android.widget.ImageView package has to be imported for displaying images.
-
Only uses-permission
-
Only uses-feature
-
Both uses-permission and uses-feature
-
None of these
C
Correct answer
Explanation
Manifest.xml file should contain the following code:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.CAMERA" />