An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map.
Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.
An application usually consists of multiple activities that are loosely bound to each other. Typically, one activity in an application is specified as the "main" activity, which is presented to the user when launching the application for the first time. Each activity can then start another activity in order to perform different actions.
Each time a new activity starts, the previous activity is stopped, but the system preserves the activity in a stack .
When a new activity starts, it is pushed onto the back stack and takes user focus.
An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map.
Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.
An application usually consists of multiple activities that are loosely bound to each other. Typically, one activity in an application is specified as the "main" activity, which is presented to the user when launching the application for the first time. Each activity can then start another activity in order to perform different actions.
Each time a new activity starts, the previous activity is stopped, but the system preserves the activity in a stack .
When a new activity starts, it is pushed onto the back stack and takes user focus.
This is a basic crash course for android development covers:
Android Studio,Hello World Application,Application Components,Application Resources,User Interface,Good UI,Play Store
1. Understanding Android Events
2. Event Listeners and Callback Methods
2.1 onClick()
2.2 onLongClick()
2.3 onFocusChange()
2.4 onKey()
2.5 onTouch()
2.6 Using a separate Listener class
2.7 Using a Named Inner Class for Event Handling
2.8 Handling Events by Having Main Activity Implement Listener Interface
2.9 Handling Events by Specifying the Event Handler Method in main.xml
2.10 Handling Events by Specifying the Event Handler Method in main.xml(cont.)
3. Exercise 5
An introduction to Intents in Android. First, the presentation introduces the concept of Intents as messages between application components. Then, the difference between implicit and explicit intents is clearly stated, along with a description of the Intent resolution mechanism. The presentation concludes with a step-by-step tutorial on how to cast and intercept Intents from Activities.
This set of slides introduces the reader to the concepts of Android Activities and Views. After presenting these two concepts in general terms, it continues with a detailed description of the activity lifecycle. It follows a discussion on how to structure the user interface in terms of View and ViewGroup objects. Finally, the presentation shows how to frame Android application development within the dictates of the Model-View-Controller (MVC) pattern.
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAhsanul Karim
These slides are for self-learners and trainees of my BASIS and DIIT Android course.
I have used information, content and images from various sources. As these materials are for non-commercial use, I think they won’t infringe any copyright issue.
This is a basic crash course for android development covers:
Android Studio,Hello World Application,Application Components,Application Resources,User Interface,Good UI,Play Store
1. Understanding Android Events
2. Event Listeners and Callback Methods
2.1 onClick()
2.2 onLongClick()
2.3 onFocusChange()
2.4 onKey()
2.5 onTouch()
2.6 Using a separate Listener class
2.7 Using a Named Inner Class for Event Handling
2.8 Handling Events by Having Main Activity Implement Listener Interface
2.9 Handling Events by Specifying the Event Handler Method in main.xml
2.10 Handling Events by Specifying the Event Handler Method in main.xml(cont.)
3. Exercise 5
An introduction to Intents in Android. First, the presentation introduces the concept of Intents as messages between application components. Then, the difference between implicit and explicit intents is clearly stated, along with a description of the Intent resolution mechanism. The presentation concludes with a step-by-step tutorial on how to cast and intercept Intents from Activities.
This set of slides introduces the reader to the concepts of Android Activities and Views. After presenting these two concepts in general terms, it continues with a detailed description of the activity lifecycle. It follows a discussion on how to structure the user interface in terms of View and ViewGroup objects. Finally, the presentation shows how to frame Android application development within the dictates of the Model-View-Controller (MVC) pattern.
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAhsanul Karim
These slides are for self-learners and trainees of my BASIS and DIIT Android course.
I have used information, content and images from various sources. As these materials are for non-commercial use, I think they won’t infringe any copyright issue.
The action bar is a window feature that identifies the application and user location, and provides user actions and navigation modes. 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, it first appears as an icon in the notification area. In this unit we will discuss about the action bar and notification usage in Android.
Android - How To Create Push Notifications With Custom View?
Today, most Android applications are integrated with the option to send push notifications. Developers and app publishers consider this capability as one of the most important actions in maintaining the relationship with their users and the ability to motivate them into performing certain actions within the app. However, in most applications the display of push notification message is quite basic - a miniature version of the app icon, a title (most of the time it will be the app name), with a short description below it.
Push notification message can be much more interesting! One of the better examples for it, is the way in which Groupon send their push messages - big and seductive picture, with important details such as price and the amount of discount. They also display action buttons!
In this tutorial we will learn how to create a rich push notification message.
Integrating Push Notifications in your app
If your app doesn’t yet support in basic push notification, please refer to PushApps short tutorial:
https://wiki.pushapps.mobi/display/PUSHAPPS/Android+Getting+Started
This tutorial assumes you have completed the basic push notifications integration, and you are able to receive notifications to your device. We will take you step by step from this phase and show you how to code and design the notification.
Push Notification received event
After you register the device to PushApps with your private keys, we would like to “take control” over the push notification received event. We would like to perform certain actions and display our custom view. With PushApps it’s easy:
1. In you Application class (if you don’t have one, please create it) register to PushApps with your Google API Project Number and PushApps Token.
@Override
public void onCreate() {
super.onCreate();
// first we initialize the push manager, you can also initialize the
// PushManager in your main activity.
PushManager.init(getBaseContext(), GOOGLE_API_PROJECT_NUMBER, PUSHAPPS_APP_TOKEN);
PushManager.getInstance(getApplicationContext())
.setShouldStartIntentAsNewTask(false);
// these methods are both optional and used for the notification
// customization
PushManager.getInstance(getApplicationContext()).setShouldStackNotifications(true);
}
2. We want PushApps to notify us when a new push notification received to the device. For that, we need to implement the PushAppsMessageInterface.
@Override
public void onCreate() {
super.onCreate();
// first we initialize the push manager, you can also initialize the
// PushManager in your main activity.
PushManager.init(getBaseContext(), GOOGLE_API_PROJECT_NUMBER, PUSHAPPS_APP_TOKEN);
PushManager.getInstance(getApplicationContext()).setShouldStartIntentAsNewTask(false);
// these methods are both optional and us
Presentation/demo held at Google Developer Group Oslo DevFest 2014
Abstract:
This talk will show you how to build an Android Wear app. Thomas will start out with a plain notification and show you how to add features until you have a full-fledged card UI. We will discuss the role of the phone and the watch and how to communicate between them. As a case study he will use a prototype for a news alert app he's working on - there will be plenty of code examples and demos.
Thomas Oldervoll has worked 5 years for Google in Mountain View and 9 years for Zenior in Oslo. He likes building things, in particular machine learning, scalable backend systems and Android apps.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Azure Interview Questions and Answers PDF By ScholarHat
Notification android
1. Notification :
A service, running in the background, needs a way to let users know something of
interest has occurred, such as when email has been received.
We used toast to show details for some actions but they are not persistent to show for longer time. And
another activity which is going on background.
For important messages to be given to the user, it is required to have more persistent method. A
notification is a message you can display as an icon at the top of the device which we call notification bar or
status bar.
To see the details of the notification, you will have to select the icon from the android phone, tablet
or other devices which will display notification drawer having detail about the notification.
we have to set Two type of notification view.
1. Normal View
2. Big View
2. Normal View :
While working with emulator with virtual device, you will have to click and drag down the status
bar to expand it which will give you detail as follows. This will be just 64 dp tall and called normal view.
Big View :
Big View which will have additional detail about the notification. You can add up to six additional lines in the
notification. The following screenshot shows such notification.
3. Creating a Notification in android :
For making or create a notification in android we have to do following steps :
1. Create Notification Builder
2. Setting Notification Properties
3. Attach Actions
4. Issue the notification
Create Notification Builder :
The first step is to create a notification builder using NotificationCompat.Builder.build(). You will use
Notification Builder to set various Notification properties like its small and large icons, title, priority etc.
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
4. Setting Notification Properties :
Once you have Builder object, you can set its Notification properties using Builder object as per your
requirement. But this is mandatory to set at least following:
A small icon, set by setSmallIcon()
A title, set by setContentTitle()
Detail text, set by setContentText()
mBuilder.setSmallIcon(R.drawable.notification_icon);
mBuilder.setContentTitle("Notification Alert, Click Me!");
mBuilder.setContentText("Hi, This is Android Notification Detail!");
Attach Actions :
This is an optional part and required if you want to attach an action with the notification. An action allows
users to go directly from the notification to an Activity in your application, where they can look at one or
more events or do further work.
The action is defined by a PendingIntent containing an Intent that starts an Activity in your application. To
associate the PendingIntent with a gesture, call the appropriate method of NotificationCompat.Builder. For
example, if you want to start Activity when the user clicks the notification text in the notification drawer, you
add the PendingIntent by calling setContentIntent().
5. A PendingIntent object helps you to perform an action on your application’s behalf, often at a later
time, without caring of whether or not your application is running.
Example :
Intent resultIntent = new Intent(this, ResultActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
stackBuilder.addParentStack(ResultActivity.class);
// Adds the Intent that starts the Activity to the top of the stack
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
6. Issue the notification :
Finally, you pass the Notification object to the system by calling NotificationManager.notify() to send your
notification. Make sure you call NotificationCompat.Builder.build() method on builder object before notifying
it. This method combines all of the options that have been set and return a new Notification object.
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// notificationID allows you to update the notification later on.
mNotificationManager.notify(notificationID, mBuilder.build());
The NotificationCompat.Builder class allows easier control over all the flags, as well as help
constructing the typical notification layouts. Following are few important and most frequently used
methods available as a part of NotificationCompat.Builder class :
7. Notification build() :
Combine all of the options that have been set and return a new Notification object.
NotificationCompat.Builder setAutoCancel (boolean autoCancel) :
Setting this flag will make it so the notification is automatically canceled when the user clicks it in the panel.
NotificationCompat.Builder setContent (RemoteViews views) :
Supply a custom RemoteViews to use instead of the standard one.
NotificationCompat.Builder setContentInfo (CharSequence info) :
Set the large text at the right-hand side of the notification.
NotificationCompat.Builder setContentIntent (PendingIntentintent) :
Supply a PendingIntent to send when the notification is clicked.
NotificationCompat.Builder setContentText (CharSequence text) :
Set the text (second row) of the notification, in a standard notification.
NotificationCompat.Builder setContentTitle (CharSequence title) :
Set the text (first row) of the notification, in a standard notification.
8. NotificationCompat.Builder setDefaults (int defaults) :
Set the default notification options that will be used.
NotificationCompat.Builder setLargeIcon (Bitmap icon) :
Set the large icon that is shown in the ticker and notification.
NotificationCompat.Builder setNumber (int number) :
Set the large number at the right-hand side of the notification.
NotificationCompat.Builder setOngoing (boolean ongoing) :
Set whether this is an ongoing notification.
NotificationCompat.Builder setSmallIcon (int icon) :
Set the small icon to use in the notification layouts.
NotificationCompat.Builder setStyle (NotificationCompat.Stylestyle) :
Add a rich notification style to be applied at build time.
NotificationCompat.Builder setTicker (CharSequence tickerText) :
Set the text that is displayed in the status bar when the notification first arrives.
9. NotificationCompat.Builder setVibrate (long[] pattern) :
Set the vibration pattern to use.
NotificationCompat.Builder setWhen (long when) :
Set the time that the event occurred. Notifications in the panel are sorted by this time.
10. Push Notification :
Push Notification is used to create your own notifications in android very easily.
Android provides NotificationManager class for this purpose.
In order to use this class, you need to instantiate an object of this class by requesting the android system
through getSystemService() method. Its syntax is given below:
NotificationManager NM;
NM=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
After that you will create Notification through Notification class and specify its attributes such as
icon, title and time etc. Its syntax is given below:
Notification notify=new
Notification(android.R.drawable.stat_notify_more,title,System.currentTimeMillis());
The next thing you need to do is to create a PendingIntent by passing context and intent as a parameter.
parameter. By giving a PendingIntent to another application, you are granting it the right to perform the
operation you have specified as if the other application was yourself.
PendingIntent pending=PendingIntent.getActivity(getApplicationContext(), 0, new Intent(),0);
11. The last thing you need to do is to call setLatestEventInfo method of the Notification class and pass the
pending intent along with notification subject and body details. Its syntax is given below. And then finally
call the notify method of the NotificationManager class.
notify.setLatestEventInfo(getApplicationContext(), subject, body,pending);
NM.notify(0, notify);
Apart from the notify method, there are other methods available in the NotificationManager class. They
are listed below:
cancel(int id) :
This method cancels a previously shown notification.
cancel(String tag, int id) :
This method also cancels a previously shown notification.
cancelAll() :
This method cancels all previously shown notifications.
12. notify(int id, Notification notification) :
This method posts a notification to be shown in the status bar.
notify(String tag, int id, Notification notification) :
This method also Post a notification to be shown in the status bar.