• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/25

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

25 Cards in this Set

  • Front
  • Back
In Android screen measurements, what is a dp?
an abstract unit of measurement, which is completely based on the density of the
Device’s screen. There is 1 DP as a pixel in a 160 dpi screen.
Density Independent Pixel
How does the singleTop launch mode change how and when an activity is started?
If the activity is already present, singleTop would send an intent instead of recreating/relaunching another copy of the activity
Why would we want to save the activity state even if we don’t plan to exit the activity?
Keep track of the state of activites (landscape/portrait, values, ect)
Suppose we have something (like a clock) I want to update every second. How can we use a handler to accomplish this?
on every tick, set handler to accomplish an event’s task
onTick();
How can we use the AsyncTask class to do background items?
onPreExecute()
doInBackground(Params...),
retrieve and send out progress reports as the tasks finish
onProgressUpdate(Progress...)
onPostExecute(Result)
What is the difference between an Activity and a Service?
Activites are more UI oriented while services usually handle background tasks
How do we set up an app so the user can work in either English or French?
Multiple folders for language, -EN –FR, ect, selects which is most appropriate

res/values-fr/strings.xml – French
How can we update the state of a progress bar?
Use the progress bar widget to update the position of the progress bar (set progress method)
What is necessary to add an XML menu to an activity?
Use MenuInflater to add XML menu
MenuInflater(Context context)
What do we have to add to the manifest file to add search to the app?
Action added to manifest in order to search

android:resource="@xml/searchable"/> XML file name
</activity>
List three of the Touch motion events.
onTouch, onMove, onPointerUp, Pointer down, secondary pointer down, pointer up, secondary pointer up
List three of the image formats that Android can display.
PNG,JPEG,GIF,BITMAP
How do we display a video using the VideoView class?
Create video view, put on screen, put on layout, video.start()
Create the appropriate android code to load the Media Player and have it start playing the file /mnt/sdcard/music/ex.mp3
Uri myUri =/mnt/sdcard/music/ex.mp3; // initialize Uri here
MediaPlayer mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setDataSource(getApplicationContext(), myUri);
mediaPlayer.prepare();
mediaPlayer.start();
How can we detect if the user has pressed a key?
boolean value of Key_Down/Key_Up() events
List three steps we can take to help our Android apps be compatible with future versions of Android.
Do not use internal or unsupported APIs.
Do not go overboard with the layouts.
Do not make bad hardware assumptions.
What is an Android Intent?
An intent is an abstract description of an operation to be performed.
Request to the OS to start an activity or service.
In Eclipse, what steps do we have to take to add a new Activity to an application?
To create an activity, you must create a subclass of Activity (or an existing subclass of it). In your subclass, you need to implement callback methods that the system calls when the activity transitions between various states of its lifecycle, such as when the activity is being created, stopped, resumed, or destroyed.
What is the difference between /res/drawable-hdpi, /res/drawable-mdpi/, and /res/drawable-ldpi/, and what would be put in each of them?
hd high density md medium density ld low density
What is the difference between an options menu and a context menu?
Options menu comes from the actual options button, context is from a held longClick() event and is based on the location context on where the click is being held
Context is like Right Clicking
What is an App Widget?
An autonomys small widget that periodically receives updates, usually (but not a must) is on the homescreen
What steps do we need to take if we want three items on the screen, each taking an equal part of the screen space?
set the weight of all three items to the same value (1 for example) inside the .xml of the layout of the activity
set them all to 1. 1+1+1=3
if one was set to 2. it would take up half. 2+1+1=4
List two things we can do to help our Android app be more popular.
advertising, user quality, following comment recommendation
What do I have to add to the manifest file to tell Android we want permission to record audio?
add the permission android.permission.record_audio
When would we use a Broadcast Receiver?
When we need a message sent out to all activities in a app (broadcasted to “everyone” who cares.)