Deck 14: Making an Android Widget
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
العب
ملء الشاشة (f)
Deck 14: Making an Android Widget
1
App widgets, also known as widgets, are small apps that are embedded in other apps, called app widget hosts.
True
2
The Home screen and the ____________ screen are examples of app widget hosts.
Lock
3
It is possible to style a widget with colors.
True
4
What method of the RemoteViews class is the equivalent of the setText method of the TextView class?
A) setText
B) setViewText
C) setTextViewText
D) setTextView
A) setText
B) setViewText
C) setTextViewText
D) setTextView
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
The minimum time between automatic updates for a widget is 30 minutes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
6
What static method of the PendingIntent class can we use to create a PendingIntent?
A) createIntent
B) createPendingIntent
C) makePendingIntent
D) getBroadcast
A) createIntent
B) createPendingIntent
C) makePendingIntent
D) getBroadcast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
7
A JSON string can include two data structures: an object and a(n) ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
It is possible to let the user customize a widget based on some user input.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
9
What is another name for the Lock screen?
A) Key
B) Guard
C) Keyguard
D) GuardKey
A) Key
B) Guard
C) Keyguard
D) GuardKey
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
10
The AppWidgetProviderInfo includes two constants that correspond to the Home screen and Lock screen widget categories.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
11
To create a widget, we need to extend the ____________ class or the BroadcastReceiver class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
12
What is the name of the class that describes the metadata in a widget provider, such as icon and minimum width and height?
A) WidgetInfo
B) AppWidgetInfo
C) AppWidgetProviderInfo
D) ProviderInfo
A) WidgetInfo
B) AppWidgetInfo
C) AppWidgetProviderInfo
D) ProviderInfo
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
13
To create a widget, we define an AppWidgetProviderInfo object in an XML ____________ located in the res/xml directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
14
The URL class encapsulates a URL.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
15
The openConnection method of the URL class returns a(n) ____________ reference.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
16
The getInputStream method from the URLConnection class returns an InputStream.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
17
The AsyncTask class, from the android.os package, allows us to perform a task in the ____________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
18
What package contains classes that enable us to create and manage widgets?
A) android.widgets
B) android.appwidget
C) widget.android
D) widget.app
A) android.widgets
B) android.appwidget
C) widget.android
D) widget.app
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
19
What method of the AppWidgetProvider class is called when the last widget of a type of widget is deleted from the host screen?
A) onDone
B) onDisabled
C) onUninstalled
D) onDestroyed
A) onDone
B) onDisabled
C) onUninstalled
D) onDestroyed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
20
What method of the RemoteViews class is the equivalent of the setTextColor method of the TextView class?
A) setColor
B) setTextColor
C) setTextViewTextColor
D) setTextViewColor
A) setColor
B) setTextColor
C) setTextViewTextColor
D) setTextViewColor
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which one of these strings is the only valid JSON string?
A) { "cities": ("New York", "Palo Alto", "Boston") }
B) { "cities": {"New York", "Palo Alto", "Boston"} }
C) [ "cities": {"New York", "Palo Alto", "Boston"} ]
D) { "cities": ["New York", "Palo Alto", "Boston"] }
A) { "cities": ("New York", "Palo Alto", "Boston") }
B) { "cities": {"New York", "Palo Alto", "Boston"} }
C) [ "cities": {"New York", "Palo Alto", "Boston"} ]
D) { "cities": ["New York", "Palo Alto", "Boston"] }
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
22
What method of the AsyncTask class is automatically called after doInBackground finishes?
A) run
B) execute
C) onPostExecute
D) finish
A) run
B) execute
C) onPostExecute
D) finish
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
23
What attribute, included in the XML file defining the AppWidgetProviderInfo for the widget, specifies the frequency of updates of the widget?
A) android:updatePeriodMillis
B) android:millis
C) android:update
D) android:periodic
A) android:updatePeriodMillis
B) android:millis
C) android:update
D) android:periodic
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
24
What attribute, included in the XML file defining the AppWidgetProviderInfo for the widget, specifies the XML layout resource of the widget?
A) android:layout
B) android:view
C) android:initialLayout
D) android:xml
A) android:layout
B) android:view
C) android:initialLayout
D) android:xml
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
25
What method of the AppWidgetProvider class is called when the widget first runs and when the widget is updated?
A) onRun
B) onStart
C) onUpdate
D) onRestart
A) onRun
B) onStart
C) onUpdate
D) onRestart
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
26
The getJSONObject method of the JSONObject class has this API:
JSONObject getJSONObject( String name )
What does it return?
A) The JSONObject calling that method
B) The JSONObject mapped to name if there is one
C) The string name
D) null
JSONObject getJSONObject( String name )
What does it return?
A) The JSONObject calling that method
B) The JSONObject mapped to name if there is one
C) The string name
D) null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
27
Widgets can receive periodic updates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
28
If we allow the user to configure the widget, we need to add to the app-provider element an android:configure attribute in the widget configuration XML file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
29
There are no restrictions regarding the use of Views and layout managers inside a widget.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
30
A RemoteViews reference can be obtained by inflating an XML resource.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
31
It is possible to test a widget inside the emulator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
32
The execute method of the AsyncTask class accepts a variable number of arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
33
The __________________ method of the AppWidgetManager sets the RemoteViews for a widget based on its id.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
34
The JSONObject class, part of the org.json package, includes methods to parse a __________________ string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
35
The AsyncTask class uses three generic types that we must specify when extending it. The class header of a subclass is as follows:
AccessModifier ClassName extends AsyncTask< Params, Progress, Result>
where Params, Progress, and Result are placeholders for actual __________________ names.
AccessModifier ClassName extends AsyncTask< Params, Progress, Result>
where Params, Progress, and Result are placeholders for actual __________________ names.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck