Уведомление пользователя ANDROID CLUB 2015. Сегодня  Toast  Диалог  Уведомление.

Slides:



Advertisements
Similar presentations
Copyright© Jeffrey Jongko, Ateneo de Manila University Dialogs, Custom Dialogs, Toasts.
Advertisements

Android 12: Dialogs and Notifications Kirk Scott 1.
User Interface Classes.  Design Principles  Views & Layouts  Event Handling  Menus  Dialogs.
Notifications & Alarms.  Notifications  Alarms.
Cosc 4730 Android Dialogs and notifications. Notifications There are a couple of ways to notify users without interrupting what they are doing The first.
Building Windows phone, iOS and Android apps with C# Jaime Rodriguez Principal Evangelist, Microsoft.
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
@2011 Mihail L. Sichitiu1 Android Introduction Hello Views Part 1.
Android Tutorial Team 3 Jerry Yu Mayank Mandava Mu Du Will Wangles.
Broadcast Receiver Android Club Agenda Broadcast Receiver Widget.
CSS216 MOBILE PROGRAMMING Android, Chapter 5 Book: “Professional Android™ 2 Application Development” by Reto Meier, 2010 by: Andrey Bogdanchikov (
로봇 전화번호부 4/4 UNIT 12 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 뷰 홀더 패턴을 사용할 수 있다. 토스트를 사용할 수 있다. 클릭 이벤트를 처리할 수 있다. 2.
Mobile Computing Lecture#11 Adapters and Dialogs.
Android Dialog Boxes AlertDialog - Toast
Threads and Services. Background Processes One of the key differences between Android and iPhone is the ability to run things in the background on Android.
Cosc 5/4730 Dialogs and below 3.0 and above (fragment)
User notification Android Club Agenda Toast Custom Toast Notification Dialog.
Notifications. A notification is a message you can display to the user outside of your application's normal UI. When you tell the system to issue a notification,
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
User Interface Android Club Agenda Button OnClickListener OnLongClickListener ToggleButton Checkbox RatingBar AutoCompleteTextView.
Activity Android Club Agenda Hello Android application Application components Activity StartActivity.
HTTP ANDROID CLUB 2015.
Service ANDROID CLUB Сегодня  Service Service - служба  Работает в фоновом режиме  Не имеет пользовательского интерфейса.
Styles, Dialog Boxes, and Menus. Styles Allow creation of a common format – placed in res/values/styles.xml – file name is incidental Can be applied.
Mobile Programming Lecture 7 Dialogs, Menus, and SharedPreferences.
Activities and Intents Richard S. Stansbury 2015.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Android Drawing Units and The.
Activity ANDROID CLUB Сегодня  Основные компоненты Android  Activity  Layout для Activity  Создание Activity  Launcher Activity  Activity.
User Interface Layout Interaction. EventsEvent Handlers/Listeners Interacting with a user.
Android Alert Dialog. Alert Dialog Place Button to open the dialog. public class MainActivity extends ActionBarActivity { private static Button button_sbm;
CHAP 7. 메뉴와 대화상자. © 2012 생능출판사 All rights reserved 메뉴의 종류 옵션 메뉴 : 사용자가 MENU 키를 누를 때 나타난다. 컨텍스트 메뉴 : 컨텍스트 메뉴는 사용자가 화면을 일정 시간 이상으로 길게 누르면 나타나는 메뉴이다.
Contents Searches related to Android RatingBar Basics Android ratingbar example Android custom ratingbar.
More App Customizations. Overview  Application/ Activity Customizations: Themes  Menu Customizations  Custom Dialogs  Custom Toasts  Custom Buttons.
Java for android Development Nasrullah Khan. Using instanceof in Android Development the classes such as Button, TextView, and CheckBox, which represent.
The Flag Quiz app tests your ability to correctly identify 10 flags from various countries and territories.
ANDROID DIALOGS. Slide 2 Dialogs (Introduction) The Dialog class is the base class for all dialogs A dialog is a small window that prompts the user to.
Android Programming - Features
CS499 – Mobile Application Development
GUI Programming Fundamentals
Further android gui programming
Android 13: Dialogs and Notifications
Android – Event Handling
Android Location Based Services
Android Widgets 1 7 August 2018
CS499 – Mobile Application Development
Android Introduction Hello Views Part 1.
android architecture components with mvvm
Android Dialog Boxes AlertDialog - Toast
Android Introduction Camera.
Picasso Revisted.
Mobile Computing With Android ACST 4550 Alerts
CIS 470 Mobile App Development
Chapter 3: Coding the GUI Programmatically, Layout Managers
Android Programming Lecture 4
Android Notifications (Part 1)
Lesson 9 Dialog Boxes & Toast Widgets Victor Matos
CA16R405 - Mobile Application Development (Theory)
Many thanks to Jun Bum Lim for his help with this tutorial.
CMPE419 Mobile Application Development
Android Timer Example.
Android Developer Fundamentals V2
Android Topics Threads and the MessageQueue
Android Developer Fundamentals V2 Lesson 4
Android Developer Fundamentals V2
Android Notifications
Notifying from the Background
Implication of Orientation Changes
External Services CSE 5236: Mobile Application Development
CA16R405 - Mobile Application Development (Theory)
External Services CSE 5236: Mobile Application Development
Presentation transcript:

Уведомление пользователя ANDROID CLUB 2015

Сегодня  Toast  Диалог  Уведомление

Toast – всплывающие сообщение Toast.makeText(getApplicationContext(), "Hello Android!", Toast. LENGTH_LONG ).show();

Toast: практика  Показывайте вашу имя в всплывающим сообщении

Toast: пример 2 Toast toast = Toast.makeText(getApplicationContext(), "Hello Android!", Toast. LENGTH_LONG ); toast.setGravity(Gravity. CENTER, 0, 0); toast.show();

Toast: практика 2  Показывайте вашу имя в всплывающим сообщении наверху экрана

Toast: пример 3 Toast toast = Toast.makeText(getApplicationContext(), "Hello Android!", Toast. LENGTH_LONG ); toast.setGravity(Gravity. CENTER, 0, 0); ImageView image = new ImageView(getApplicationContext()); image.setImageResource(R.drawable. a ndroid ); LinearLayout toastLayout = (LinearLayout) toast.getView(); toastLayout.addView(image, 0); toast.show();

Toast: практика 3  Показывайте вашу имя и фото в всплывающим сообщении наверху экрана

Toast: пример 4 Toast toast = new Toast(getApplicationContext()); toast.setDuration(Toast. LENGTH_LONG ); View view = getLayoutInflater().inflate(R.layout. toast_layou t, null ); toast.setView(view); toast.show();

Toast: практика 4  В сплывающим сообщении показывайте ваше фото и имя. Имя – зеленном светом

Диалог  AlertDialog  ProgressDialog  DatePickerDialog  TimePickerDialog

AlertDialog: пример Button bAlert = (Button) findViewById(R.id. bAlert ); bAlert.setOnClickListener( new View.OnClickListener() public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity. this ); builder.setTitle( "Выход" ); builder.setMessage( "Вы хотите выйти из программы?" ); builder.setCancelable( false ); builder.setPositiveButton( "Да", new DialogInterface.OnClickListener() public void onClick(DialogInterface dialog, int which) { finish(); } }); builder.setNegativeButton( "Нет", new DialogInterface.OnClickListener() public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog dialog = builder.create(); dialog.show(); } });

AlertDialog: практика

ProgressDialog: пример ProgressDialog dialog = ProgressDialog.show(MainActivity. this, "Загрузка", "Под ождите пожалуйста" ); dialog.setCancelable( true ); dialog.show(); Handler handler = new Handler(); handler.postDelayed( new Runnable() { public void run() { dialog.dismiss(); } }, 3000);

ProgressDialog: практика

Уведомление: пример Uri alarm = RingtoneManager.getDefaultUri(RingtoneManager. TYPE_NOTIFICATION ); Uri ringtone = Uri.parse( "android.resource://uz.androidclub.notificationpreparation/" + R.raw. ringtone ); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(MainActivity. this ).setTicker( "Текст1" ).setSmallIcon(R.drawable. facebook ).setSound(ringtone).setVibrate( new long []{0, 100, 50, 200, 50, 300, 50, 400}).setContentTitle( "Текст2" ).setContentText( "Текст3" ); Intent resultIntent = new Intent(MainActivity. this, SecondActivity. class ); PendingIntent pending = PendingIntent.getActivity(getApplicationContext(), 0, resultIntent, 0); mBuilder.setContentIntent(pending); NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context. NOTIFICATION_SERVICE ); mNotificationManager.notify(1, mBuilder.build());

Уведомление: практика  Показывайте уведомление  Заголовок: Привет  Текст: Привет Android!  Поставьте рингтон