Sapient Company Programming

Which of the following statements about the content provider component of Android systems is/are correct?

A. Intents can be used to start a content provider.
B. Intents cannot start a content provider.
C. Content provider supports shared preferences.

1) Statement C is incorrect
2) Both the statements B and C are incorrect
3) Statement B is correct
4) All the statements are wrong

Read Solution (Total 1)

Sapient Other Question

The following code snippet will create a new alarm in Android. In order to invoke the ACTION_SET_ALARM intent, your app must have the SET_ALARM permission. Which of the followinig options correctly sets the SET_ALARM permission?

public void createAlarm(String message, int hour, int minutes){
Intent intent = new Intent(AlarmClock.ACTION_SET_ALARM)
.putExtra(AlarmClock.EXTRA_MESSAGE, message)
.putExtra(AlarmClock.EXTRA_HOUR, hour)
.putExtra(AlarmClock.EXTRA_MINUTES, minutes);

if(intent.resolveActivity(getPackageManager()) != null){
startActivity(intent);
}
}

1)
2)
3)
Bob, and Android programmer, wants to set trigger to Alarm of his Android phone after three days.
What would Bob do to achieve this?

1) Bob would use AlarmManager and call set() method to set after three days. Even if the phone switches off in between the alarm would ring.
2) Bob would use AlarmManager and call set() method to set after three days. Before switching the phone off Bob would maintain all the alarm details in the database and recreate it after switching it on.
3) Bob has to do nothing as Android takes care of automatic Alarm Triggering events
4) Since all alarm details will get killed after phone gets switched off. what Bob is trying to achieve is not possible.