Your SlideShare is downloading. ×
Curso Básico Android
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Curso Básico Android

494
views

Published on

Curso básico de Android …

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
494
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ANDROID LAYOUTS Eduardo Lagares
  • 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. 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. 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. 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. 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. ActionBarREFERÊNCIAShttp://developer.android.com/guide/topics/ui/actionbar.htmlExemploManifest<manifest ... > <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" /> ...</manifest>
  • 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. 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.

×