ANDROID  LAYOUTS  Eduardo Lagares
TextViewREFERÊNCIAShttp://developer.android.com/reference/android/widget/TextView.htmlLAYOUT<TextView android:id="@+id/tex...
ButtonREFERÊNCIAShttp://developer.android.com/reference/android/widget/Button.htmlLAYOUT<Button android:id="@+id/my_button...
EditTextREFERÊNCIAShttp://developer.android.com/reference/android/widget/EditText.htmlLAYOUT<EditText            android:i...
Recuperando elementoREFERÊNCIAShttp://developer.android.com/guide/topics/ui/declaring-layout.htmlCÓDIGO(TipoDoObjeto) obj ...
SpinnerREFERÊNCIAShttp://developer.android.com/reference/android/widget/Spinner.htmlhttp://developer.android.com/reference...
ActionBarREFERÊNCIAShttp://developer.android.com/guide/topics/ui/actionbar.htmlExemploManifest<manifest ... >  <uses-sdk a...
Intents e FiltersUm Intent é uma descrição abstrata de uma operação a ser executada.Você pode utilizar um intent-filter di...
Intents e FiltersActions:ACTION_CALL : activityInicia um chamada.ACTION_EDIT : activityMostra dados para o usuário editarA...
Upcoming SlideShare
Loading in …5
×

Curso Básico Android

727 views

Published on

Curso básico de Android

Veja nosso canal no youtube
http://www.youtube.com/user/KiwiOfficeHour

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
727
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Curso Básico Android

  1. 1. ANDROID LAYOUTS Eduardo Lagares
  2. 2. TextViewREFERÊNCIAShttp://developer.android.com/reference/android/widget/TextView.htmlLAYOUT<TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello, I am a TextView" />
  3. 3. ButtonREFERÊNCIAShttp://developer.android.com/reference/android/widget/Button.htmlLAYOUT<Button android:id="@+id/my_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/my_button_text"/>
  4. 4. EditTextREFERÊNCIAShttp://developer.android.com/reference/android/widget/EditText.htmlLAYOUT<EditText android:id="@+id/idDoCampo" android:layout_height="45dp" android:hint="Texto HINT" android:inputType="text" android:maxLength="15" android:maxLines="1" android:scrollHorizontally="false" android:singleLine="true" />
  5. 5. Recuperando elementoREFERÊNCIAShttp://developer.android.com/guide/topics/ui/declaring-layout.htmlCÓDIGO(TipoDoObjeto) obj = (TipoDoObjeto) findViewById(R.id.idDoCampo);EXEMPLOS(EditText) campo = (EditText) findViewById(R.id.campo1);(Spinner) combobox = (Spinner) findViewById(R.id.combobox1);(Button) botao1 = (Button) findViewById(R.id.botao1);
  6. 6. SpinnerREFERÊNCIAShttp://developer.android.com/reference/android/widget/Spinner.htmlhttp://developer.android.com/reference/android/widget/CheckedTextView.htmlhttp://developer.android.com/reference/android/widget/ArrayAdapter.htmlCÓDIGOArrayAdapter mAdapter = new ArrayAdapter<Model>(this,R.layout.kw_spinner_item,mItens);LAYOUT<?xml version="1.0" encoding="utf-8"?><CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" style="?android:attr/spinnerDropDownItemStyle" android:layout_width="fill_parent" android:textSize="14dp" android:textColor="#666666" android:layout_height="?android:attr/listPreferredItemHeight" android:checkMark="@android:color/transparent" android:singleLine="true" />
  7. 7. ActionBarREFERÊNCIAShttp://developer.android.com/guide/topics/ui/actionbar.htmlExemploManifest<manifest ... > <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" /> ...</manifest>
  8. 8. Intents e FiltersUm Intent é uma descrição abstrata de uma operação a ser executada.Você pode utilizar um intent-filter disponível ou criar um intent para usopúblico.Referências:http://developer.android.com/guide/components/intents-filters.htmlhttp://developer.android.com/reference/android/content/Intent.htmlExemplos:ACTION_VIEW content://contacts/people/1ACTION_DIAL content://contacts/people/1ACTION_VIEW tel:123ACTION_DIAL tel:123ACTION_EDIT content://contacts/people/1ACTION_VIEW content://contacts/people/ACTION_VIEW content://contacts/N
  9. 9. Intents e FiltersActions:ACTION_CALL : activityInicia um chamada.ACTION_EDIT : activityMostra dados para o usuário editarACTION_MAIN : activityChama a activity inicial de um aplicativoACTION_BATTERY_LOW : broadcast receiverInicia um broadcast para viso de bateria fraca.ACTION_HEADSET_PLUG : broadcast receiverUsado em broadcast para avisar se o headset foi plugado ou retirado.ACTION_SCREEN_ON : broadcast receiverUsado em broadcasts para avisar quando a tela é ligada.

×