The document discusses how to use AlarmManager in Android to schedule intents and broadcast receivers to be triggered at specific times in the future. It provides code examples of how to set an alarm to trigger an intent in 10 seconds, how to register a broadcast receiver in the manifest to receive alarm intents, and how to use setRepeating() to have an alarm trigger every 30 seconds. It also demonstrates how to cancel an alarm using its pending intent. The key points are that AlarmManager allows scheduling intents and broadcast receivers to be launched even if the app is closed, and is intended for triggering actions at specific times rather than just pausing a thread for a period.
Working effectively with ViewModels and TDD - UA Mobile 2019UA Mobile
The introduction of Android Architecture Components made a lot of things easier for Android developers. Despite this, the documentation is still not complete and confusing. Here and their developers arise questions like: “How should I handle communication between ViewModels?”, “How to send one time events properly?”, “How to fill pleasure from Android development again?”. I will cover these topics and guide you through this dark forest and show that the light of TDD.
In this talk, I will cover the most popular pitfalls when using ViewModels and show how one can easily follow the TDD approach while implementing MVVM on Android.
http://uamobile.org/uk/topics/working-effectively-viewmodels-and-tdd
A Series of Fortunate Events - Symfony Camp Sweden 2014Matthias Noback
What is an event really? How can you best describe an event in your code? What types of events are there, and how do you decide whether or not to implement something as an event?
In this talk we start with a straightforward command-only piece of code. We extract events from it and start moving the event handling code out, trying different design patterns on the way. First we try Observer. Then we introduce event data, event handlers and a Mediator between our code and the event handlers. Finally we pick a well-known event dispatcher implementation (the Symfony EventDispatcher) and see how it uses the Chain of Responsibility design pattern to control the entire flow of a web application request.
In the end I will answer some burning questions like: is it safe to use events all over the place and rely on event handlers to do some really important stuff? How do I overcome the indirection in my event-driven code? And how can I quickly find out what happens where?
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014Matthias Noback
Events are the new hooks. But what is an event really? How can you best describe an event in your code? What types of events are there, and how do you decide whether or not to implement something as an event?
In this talk we take a look at how events are essential to processing a Request and producing a Response. We take a look at the Symfony EventDispatcher and related classes that you need when you want to hook into this process. When you know all about the event system and how you can implement your own events, we discuss some situations which may or may not be good use cases for events. You will learn to decide if using events is the right solution for your problem.
Working effectively with ViewModels and TDD - UA Mobile 2019UA Mobile
The introduction of Android Architecture Components made a lot of things easier for Android developers. Despite this, the documentation is still not complete and confusing. Here and their developers arise questions like: “How should I handle communication between ViewModels?”, “How to send one time events properly?”, “How to fill pleasure from Android development again?”. I will cover these topics and guide you through this dark forest and show that the light of TDD.
In this talk, I will cover the most popular pitfalls when using ViewModels and show how one can easily follow the TDD approach while implementing MVVM on Android.
http://uamobile.org/uk/topics/working-effectively-viewmodels-and-tdd
A Series of Fortunate Events - Symfony Camp Sweden 2014Matthias Noback
What is an event really? How can you best describe an event in your code? What types of events are there, and how do you decide whether or not to implement something as an event?
In this talk we start with a straightforward command-only piece of code. We extract events from it and start moving the event handling code out, trying different design patterns on the way. First we try Observer. Then we introduce event data, event handlers and a Mediator between our code and the event handlers. Finally we pick a well-known event dispatcher implementation (the Symfony EventDispatcher) and see how it uses the Chain of Responsibility design pattern to control the entire flow of a web application request.
In the end I will answer some burning questions like: is it safe to use events all over the place and rely on event handlers to do some really important stuff? How do I overcome the indirection in my event-driven code? And how can I quickly find out what happens where?
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014Matthias Noback
Events are the new hooks. But what is an event really? How can you best describe an event in your code? What types of events are there, and how do you decide whether or not to implement something as an event?
In this talk we take a look at how events are essential to processing a Request and producing a Response. We take a look at the Symfony EventDispatcher and related classes that you need when you want to hook into this process. When you know all about the event system and how you can implement your own events, we discuss some situations which may or may not be good use cases for events. You will learn to decide if using events is the right solution for your problem.
Treze ferramentas/frameworks para desenvolvimento androidRicardo Longa
Palestra sobre treze ferramentas/frameworks para desenvolvimento em Android, realizada no dia 18/09/14, no Senai CTAI em Florianópolis (evento do Grupo de usuários Java de SC - http://www.gujavasc.org).
K19 k41 Desenvolvimento Mobile com AndroidAline Diniz
A K19 é uma empresa especializada na capacitação de desenvolvedores de software. Sua equipe
é composta por profissionais formados em Ciência da Computação pela Universidade de São Paulo
(USP) e que possuem vasta experiência em treinamento de profissionais para área de TI.
O principal objetivo da K19 é oferecer treinamentos de máxima qualidade que relacionados às
principais tecnologias utilizadas pelas empresas. Através desses treinamentos, seus alunos se tornam
capacitados para atuar no mercado de trabalho.
Visando a máxima qualidade, a K19 mantém as suas apostilas em constante renovação e melhoria,
oferece instalações físicas apropriadas para o ensino e seus instrutores estão sempre atualizados
didática e tecnicamente. Uma das vantagens de desenvolver para o Android é que as ferramentas e programas necessários
são todos gratuitos e disponíveis para todos os sistemas operacionais (OS X,Windows™e Linux).
Para começar a programar para o Android é necessário conhecer (ou aprender) a linguagem Java,
pois foi a linguagem escolhida pela Google.
Minicurso sobre AndroidAnnotations, GreenDAO, EventBus e CroutonRicardo Longa
Minicurso sobre Android Annotations, GreenDAO, EventBus e Crouton ocorrido em 22 de outubro no TechNight 2014, na Universidade do Sul de Santa Catarina.
Treze ferramentas/frameworks para desenvolvimento androidRicardo Longa
Palestra sobre treze ferramentas/frameworks para desenvolvimento em Android, realizada no dia 18/09/14, no Senai CTAI em Florianópolis (evento do Grupo de usuários Java de SC - http://www.gujavasc.org).
K19 k41 Desenvolvimento Mobile com AndroidAline Diniz
A K19 é uma empresa especializada na capacitação de desenvolvedores de software. Sua equipe
é composta por profissionais formados em Ciência da Computação pela Universidade de São Paulo
(USP) e que possuem vasta experiência em treinamento de profissionais para área de TI.
O principal objetivo da K19 é oferecer treinamentos de máxima qualidade que relacionados às
principais tecnologias utilizadas pelas empresas. Através desses treinamentos, seus alunos se tornam
capacitados para atuar no mercado de trabalho.
Visando a máxima qualidade, a K19 mantém as suas apostilas em constante renovação e melhoria,
oferece instalações físicas apropriadas para o ensino e seus instrutores estão sempre atualizados
didática e tecnicamente. Uma das vantagens de desenvolver para o Android é que as ferramentas e programas necessários
são todos gratuitos e disponíveis para todos os sistemas operacionais (OS X,Windows™e Linux).
Para começar a programar para o Android é necessário conhecer (ou aprender) a linguagem Java,
pois foi a linguagem escolhida pela Google.
Minicurso sobre AndroidAnnotations, GreenDAO, EventBus e CroutonRicardo Longa
Minicurso sobre Android Annotations, GreenDAO, EventBus e Crouton ocorrido em 22 de outubro no TechNight 2014, na Universidade do Sul de Santa Catarina.
This Presentation will give u information about Android :
1. Creating an Activity Declaring the activity in the manifest
2. Starting an Activity Starting an activity for a result Shutting
3. Down an Activity Managing the Activity Lifecycle Implementing the lifecycle callbacks Saving
4. activity state Handling configuration changes
How to recognise that the user has just uninstalled your android appPrzemek Jakubczyk
A presentation done spontaneously during Droidcon.de 2015.
Shows the trick Opera did - open a web page after uninstalling the binary. Raw meat, C code, included.
Android Lab Test : Using the sensor gyroscope (english)Bruno Delb
Android Lab Test : Using the sensor gyroscope (english)
Video of tutorial on : https://www.youtube.com/playlist?list=PLL2Z3bzdO25yHwIV3XdMzKs61At0Ldh6L
Visit http://www.AndroidLabTest.com
Big Data como Serviço: da captura à visualização de dados com alto desempenhoRicardo Longa
A Neoway fornece serviços de análise de dados e Big Data por assinatura, trabalhando com mais de 10 terabytes de dados indexados de centenas de fontes, em duas verticais: prospecção de clientes e prevenção de fraudes bancárias. Nesta palestra vamos mostrar como organizamos o fluxo de processamento e análise de dados, desde a captura dos dados de mais de 200 fontes públicas, até a disponibilização para clientes.
Apresentaremos como é gerenciado e monitorado nosso ecossistema para garantir alto desempenho e resiliência da plataforma, que consiste de 30 microsserviços e um cluster de ElasticSearch com mais de dez nós. Também serão mostradas as ferramentas utilizadas para implementar Continuous Integration/Delivery/Deployment, e o que nos motivou a refatorar grande parte dos serviços para a linguagem Go e a substituição de RabbitMQ para NSQ.io, assim como os ganhos obtidos e desafios enfrentados com essas mudanças.
Um dos nossos principais desafios tem sido minimizar o tempo desde a captura de grandes volumes de dados até a disponibilização para clientes. Mostraremos como foi acelerado este processo de nove dias para quase realtime através de uma Stream API.
JSR 339 - Java API for RESTful Web ServicesRicardo Longa
Esta palestra é fruto da iniciativa de adoção da JSR 339 pelo Grupo de Usuários Java de SC. Foi apresentada no The Developers Conference 2014 (Florianópolis). Trata das novidades da JAX-RS 2 em relação a especificação anterior.
Da introdução à prática com Drools Expert e Drools FlowRicardo Longa
As suas regras de negócio mudam constantemente? Que tal gerenciar suas regras sem a necessidade de um re-deploy? Nesta palestra serão apresentadas as introduções aos projetos JBoss Drools Expert e JBoss Drools Flow (atualmente jBPM 5). Indicada as pessoas com nenhum ou mínimo conhecimento sobre a plataforma Drools pois serão desenvolvidos exemplos de regras e fluxos básicos para uma melhor compreensão.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
10. O alarme só será cancelado por nós
ou caso o device seja reiniciado.
11.
12. public class ExemploAlarme extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
agendarPara10Segundos();
}
}
13. public class ExemploAlarme extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
agendarPara10Segundos();
}
private void agendarPara10Segundos() {
}
}
14. public class ExemploAlarme extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
agendarPara10Segundos();
}
private void agendarPara10Segundos() {
Intent intencao = new Intent("ALARME_TESTE");
}
}
15. public class ExemploAlarme extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
agendarPara10Segundos();
}
private void agendarPara10Segundos() {
Intent intencao = new Intent("ALARME_TESTE");
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intencao, 0);
}
}
16. public class ExemploAlarme extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
agendarPara10Segundos();
}
private void agendarPara10Segundos() {
Intent intencao = new Intent("ALARME_TESTE");
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intencao, 0);
Calendar calendario = Calendar.getInstance();
calendario.setTimeInMillis(System.currentTimeMillis());
}
}
17. public class ExemploAlarme extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
agendarPara10Segundos();
}
private void agendarPara10Segundos() {
Intent intencao = new Intent("ALARME_TESTE");
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intencao, 0);
Calendar calendario = Calendar.getInstance();
calendario.setTimeInMillis(System.currentTimeMillis());
calendario.add(Calendar.SECOND, 10);
long agendamentoEmMilis = calendario.getTimeInMillis();
}
}
18. public class ExemploAlarme extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
agendarPara10Segundos();
}
private void agendarPara10Segundos() {
Intent intencao = new Intent("ALARME_TESTE");
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intencao, 0);
Calendar calendario = Calendar.getInstance();
calendario.setTimeInMillis(System.currentTimeMillis());
calendario.add(Calendar.SECOND, 10);
long agendamentoEmMilis = calendario.getTimeInMillis();
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
}
}
19. public class ExemploAlarme extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
agendarPara10Segundos();
}
private void agendarPara10Segundos() {
Intent intencao = new Intent("ALARME_TESTE");
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intencao, 0);
Calendar calendario = Calendar.getInstance();
calendario.setTimeInMillis(System.currentTimeMillis());
calendario.add(Calendar.SECOND, 10);
long agendamentoEmMilis = calendario.getTimeInMillis();
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, agendamentoEmMilis, pendingIntent);
}
}
20. O AlarmManager irá disparar a Intent
“ALARME_TESTE” após 10 segundos.
Neste período nosso aplicativo pode
ter sido finalizado. Justamente por
isso, precisaremos de um
BroadcastReceiver...
21. public class ReceberAlarme extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Alarme recebido!", Toast.LENGTH_LONG).show();
}
}
22. public class ReceberAlarme extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Alarme recebido!", Toast.LENGTH_LONG).show();
}
}
23. public class ReceberAlarme extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "Alarme recebido!", Toast.LENGTH_LONG).show();
}
}