You are on page 1of 6

UNIVERSIDAD NACIONAL DE SAN AGUSTÍN

ESCUELA PROFESIONAL DE TECNOLOGIA DE LA INFORMACION

LABORATORIO DE DESARROLLO AVANZADO NUEVAS PLATAFORMAS


Profesor: Mg. Ernesto Suarez Fecha: 04/04/2018

LAB #01:
Requerimientos de Información

 Tiempo estimado para completar este laboratorio: 90 minutos

COMPETENCIA
Conocer nuevas plataformas de desarrollo que permitan afrontar la implementación de software para
tecnologías recientes.

PREREQUISITOS
 Ninguno

FUNDAMENTAL CONCEPTS

1. Android Studio
By default, Android Studio displays your project files in the Android project view, as shown in figure 1.
This view is organized by modules to provide quick access to your project's key source files.
Figure 1. The project files in Android view
Figure 2. The Android Studio main window

1. The toolbar lets you carry out a wide range of actions, including running your app and
launching Android tools.
2. The navigation bar helps you navigate through your project and open files for editing.
It provides a more compact view of the structure visible in the Project window.
3. The editor window is where you create and modify code. Depending on the current
file type, the editor can change. For example, when viewing a layout file, the editor
displays the Layout Editor.
4. The tool window bar runs around the outside of the IDE window and contains the
buttons that allow you to expand or collapse individual tool windows.
5. The tool windows give you access to specific tasks like project management, search,
version control, and more. You can expand them and collapse them.
6. The status bar displays the status of your project and the IDE itself, as well as any
warnings or messages.

2. Android Back button


3. Activity lifecycle

onCreate
Called when your activity is first created. This is the place you normally create your
views, open any persistent datafiles your activity needs to use, and in general initialize
your activity. When calling onCreate, the Android framework is passed a Bundle object
that contains any activity state saved from when the activity ran before.

onStart
Called just before your activity becomes visible on the screen. Once onStart completes,
if your activity can become the foreground activity on the screen, control will transfer
to onResume. If the activity cannot become the foreground activity for some reason,
control transfers to the onStop method.

onResume
Called right after onStart if your activity is the foreground activity on the screen. At this
point your activity is running and interacting with the user. You are receiving keyboard
and touch inputs, and the screen is displaying your user interface. onResume is also
called if your activity loses the foreground to another activity, and that activity
eventually exits, popping your activity back to the foreground. This is where your
activity would start (or resume) doing things that are needed to update the user interface
(receiving location updates or running an animation, for example).

onPause
Called when Android is just about to resume a different activity, giving that activity the
foreground. At this point your activity will no longer have access to the screen, so you
should stop doing things that consume battery and CPU cycles unnecessarily. If you are
running an animation, no one is going to be able to see it, so you might as well suspend
it until you get the screen back. Your activity needs to take advantage of this method to
store any state that you will need in case your activity gains the foreground again—and
it is not guaranteed that your activity will resume. If the mobile device you are running
on runs out of memory, there is no virtual memory on disk to use for expansion, so your
activity may have to make way for a system process that needs memory. Once you exit
this method, Android may kill your activity at any time without returning control to
you.

onStop
Called when your activity is no longer visible, either because another activity has taken
the foreground or because your activity is being destroyed.
onDestroy
The last chance for your activity to do any processing before it is destroyed. Normally
you’d get to this point because the activity is done and the framework called its finish
method. But as mentioned earlier, the method might be called because Android has
decided it needs the resources your activity is consuming.

ACTIVITIES
1. Create a new project on Android Studio called “Lab01”. Inside the project, you must
create to activities, the first one should be called “MainActivity” and the second one
called “InfoActivity”. Both activities first and second must implement all “Activity
status/events”.
2. Add a button (“Open Info”) on the MainActivity, which must call an event
OnclickListener for open the InfoActivity. You should use “startActivity” method to start
the InfoActivity.
3. The application should look like the following images.

Figure 3. MainActivity
Figure 4 InfoActivity

4. Fill the following table:

Instruction MainActivity InfoActivity


Open application onCreate, onStart, onStop
onResume(La actividad se (La actividad no es visible)
crea e interactua con el
Usuario)
Press button (“Open Info”) onPause, onStop(La onCreate, onStart,
actividad de ser visible y onResume (La actividad se
pasa hasta el estado crea y llega a ser visible)
onStop)
Press back (InfoActivity) onStart, onResume(La onPause, onStop (La
actividad vuelve a ser actividad deja de ser
visible para interactuar con visible y esta en el estado
el usuario) onStop )
Press back (MainActivity) On Pause, onStop, onDestroy (Al presionar
onDestroy (Al presionar “back” la actividad se
“back” la actividad se destruye)
destruye)

You might also like