Computer Knowledge

GUI and Web Frameworks

1,711 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

Multiple choice
  1. All the resources should be placed directly under the root directory.

  2. All the resources should be placed directly under the res/ directory.

  3. You should place each type of resource in a specific directory of your project's res/ directory.

  4. You can define your own user defined directories and place all the resources over there.

  5. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Android requires resources to be organized in specific subdirectories under res/ (like res/layout for XML layouts, res/drawable for images, res/values for strings/colors). Placing all resources directly under res/ or in custom user-defined directories will not work - the build system expects specific subdirectory names.

Multiple choice
  1. withText

  2. ifRoom

  3. ifNotRoom

  4. withRoom

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

It is recommended that the android:showAsAction attributes to ifRoom, which will display the menu item as an action item only if there is enough room on the display. On a small size screen, the actions will  collapse into the overflow menu.

Multiple choice
  1. This will collapse the action view into just an action item.

  2. This will completely collapse the action view.

  3. This will completely collapse the action item.

  4. The search widget would consume space on the action bar even when it is not in use.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The given code will collapse the action view into just an action item. Otherwise, the search widget would consume space on the action bar even when it is not in use.

Multiple choice
  1. Only A

  2. Only B

  3. Both A and B

  4. Neither A nor B

Reveal answer Fill a bubble to check yourself
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.

Multiple choice
  1. 
    <activity> 
    android:name=”.SampleActivity” android:uiOptions=”splitActionBar”> 
    </activity>
    
  2. 
    <activity> android:name=”.SampleActivity” android:uiOptions=”splitActionBarWhenNarrow”> </activity>
    
  3. 
    <activity> android:name=”.SampleActivity” android:uiOptions=”splitActionBarNarrow”> </activity>
    
  4. <activity> android:name=”.SampleActivity” android:Options=”splitActionBarWhenNarrow”> </activity>
    
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To enable a split action bar on an activity, the code is:


android:name=”.SampleActivity” android:uiOptions=”splitActionBarWhenNarrow”> 

Multiple choice
  1.      Tab t1=bar.newTab();
          t1.setText("Tab Text&");
    
  2.     Tab t1=bar.newTab();
        t1.setTabListener(this);
    
  3.             Tab t1=bar.newTab();
                t1.setText("Tab Text");
                t1.setTabListener(this);
    
  4.            Tab t1=bar.newTab();
                t1.setText("Tab Text");
                t1.setTabListener(this);
                bar.addTab(bar.newTab());
    
Reveal answer Fill a bubble to check yourself
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());
Multiple choice
  1. Android:actionProviderClass=”android.widget.ShareActionProvider”
    
  2. Public void onCreate(Bundle bun1) {
     Super.onCreate(bun1);
     final ActionBar bar = getActionBar();
     bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    }
    
  3. Public void onCreate(Bundle bun1) {
     Super.onCreate(bun1);
     final ActionBar bar = getActionBar();
     bar.setNavigationMode(ActionBar.NAVIGATION_TABS);
    }
    
  4. Public void onCreate(Bundle bun1) {
     Super.onCreate(bun1);
     final ActionBar = getActionBar();
     bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    }
    
Reveal answer Fill a bubble to check yourself
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);
}