This document discusses background processes in Android, including threads, services, and notifications. It explains that threads are used to perform long-running tasks without blocking the main UI thread. Services are intended for long-running background tasks rather than threads, and can be started and stopped from an activity. Notifications allow services to display status information in the status bar and notify the user of events even when the app is not visible.
Presentation to the MIT IAP HTML5 Game Development Class on Debugging and Optimizing Javascript, Local storage, Offline Storage and Server side Javascript with Node.js
Introduction to reactive programming & ReactiveCocoaFlorent Pillet
A short introduction to the concepts of functional reactive programming, and their implementation in ReactiveCocoa, a framework for iOS and OS X developers.
This speech was given at CocoaHeads Paris, October 9th 2014
A new compact XML algorithm without any dependencies. Its implemented as a rubygem to provide Non-native XML parser for particular usages. RubyGem at http://rubygems.org/gems/xml-motor and https://github.com/abhishekkr/rubygem_xml_motor
Sharding and Load Balancing in Scala - Twitter's FinagleGeoff Ballinger
My presentation at Mostly Functional (http://mostlyfunctional.com), part of this year's Turing Festival Fringe (http://turingfestival.com) in Edinburgh. The example source code is up on Github at https://github.com/geoffballinger/simple-sharder
Presentation to the MIT IAP HTML5 Game Development Class on Debugging and Optimizing Javascript, Local storage, Offline Storage and Server side Javascript with Node.js
Introduction to reactive programming & ReactiveCocoaFlorent Pillet
A short introduction to the concepts of functional reactive programming, and their implementation in ReactiveCocoa, a framework for iOS and OS X developers.
This speech was given at CocoaHeads Paris, October 9th 2014
A new compact XML algorithm without any dependencies. Its implemented as a rubygem to provide Non-native XML parser for particular usages. RubyGem at http://rubygems.org/gems/xml-motor and https://github.com/abhishekkr/rubygem_xml_motor
Sharding and Load Balancing in Scala - Twitter's FinagleGeoff Ballinger
My presentation at Mostly Functional (http://mostlyfunctional.com), part of this year's Turing Festival Fringe (http://turingfestival.com) in Edinburgh. The example source code is up on Github at https://github.com/geoffballinger/simple-sharder
Some thoughts on asynchrony in a modern world, inspired by Reactive Extensions and await in C#, for the Obj-C audience at CocoaHeads Stockholm June 2012.
Please read the notes on each slide to make sense of them, the slides are not understandable by themselves.
Let'Swift 2019 컨퍼런스에서 RxSwift to Combine 이라고 발표한 자료입니다. 자료 내에 언급되는 코드 링크는 다음과 같습니다.
[BringMyOwnBeer]
• RxSwift/RxCocoa: https://github.com/fimuxd/BringMyOwnBeer-
• Combine/SwiftUI: https://github.com/fimuxd/BringMyOwnBeer-Combine
Intro to some diagram auto-generation tools. For more info and sample files, head over to http://www.mbarsinai.com/blog/2014/01/12/draw-more-work-less/.
Let'Swift 2019 컨퍼런스에서 RxSwift to Combine 이라고 발표한 자료입니다. 자료 내에 언급되는 코드 링크는 다음과 같습니다.
[BringMyOwnBeer]
• RxSwift/RxCocoa: https://github.com/fimuxd/BringMyOwnBeer-
• Combine/SwiftUI: https://github.com/fimuxd/BringMyOwnBeer-Combine
Business Dashboards using Bonobo ETL, Grafana and Apache AirflowRomain Dorgueil
Zero-to-one hands-on introduction to building a business dashboard using Bonobo ETL, Apache Airflow, and a bit of Grafana (because graphs are cool). The talk is based on the early version of our tools to visualize apercite.fr website. Plan, Implementation, Visualization, Monitoring and Iterate from there.
Lecture on Reactive programming on Android, mDevCamp 2016.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Understanding reactive programming with microsoft reactive extensionsOleksandr Zhevzhyk
We all want our applications to be responsible, reliable and testable. But event-driven paradigm sometimes could lead us to obscured or, even worse, messy code. Let’s look into the world, where generated data, background tasks and events are stuck together as asynchronous data streams to achieve a better result.
"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)AvitoTech
После внедрения Swift в проект значительно увеличилось время сборки, что стало для нас существенным препятствием. В своём докладе я расскажу о том, как мы решили эту проблему, сократив время компиляции более чем в два раза.
From object oriented to functional domain modelingCodemotion
"From object oriented to functional domain modeling" by Mario Fusco
Malgrado l'introduzione delle lambda, la gran parte degli sviluppatori Java non è ancora abituata agli idiomi della programmazione funzionale e quindi non è pronta a sfruttare a pieno le potenzialità di Java 8. In particolare non è ancora comune vedere dati e funzioni usate insieme quando si modella un dominio di business. Lo scopo del talk è mostrare come alcuni principi di programmazione funzionale quali l'impiego di oggetti e strutture dati immutabili, l'uso di funzioni senza side-effect e il loro reuso mediante composizione, possono anche essere validi strumenti di domain modelling.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Presented at Droidcon Greece 2016.
The fundamentals and advance application of Node will be covered. We will explore the design choices that make Node.js unique, how this changes the way applications are built and how systems of applications work most effectively in this model. You will learn how to create modular code that’s robust, expressive and clear. Understand when to use callbacks, event emitters and streams.
Some thoughts on asynchrony in a modern world, inspired by Reactive Extensions and await in C#, for the Obj-C audience at CocoaHeads Stockholm June 2012.
Please read the notes on each slide to make sense of them, the slides are not understandable by themselves.
Let'Swift 2019 컨퍼런스에서 RxSwift to Combine 이라고 발표한 자료입니다. 자료 내에 언급되는 코드 링크는 다음과 같습니다.
[BringMyOwnBeer]
• RxSwift/RxCocoa: https://github.com/fimuxd/BringMyOwnBeer-
• Combine/SwiftUI: https://github.com/fimuxd/BringMyOwnBeer-Combine
Intro to some diagram auto-generation tools. For more info and sample files, head over to http://www.mbarsinai.com/blog/2014/01/12/draw-more-work-less/.
Let'Swift 2019 컨퍼런스에서 RxSwift to Combine 이라고 발표한 자료입니다. 자료 내에 언급되는 코드 링크는 다음과 같습니다.
[BringMyOwnBeer]
• RxSwift/RxCocoa: https://github.com/fimuxd/BringMyOwnBeer-
• Combine/SwiftUI: https://github.com/fimuxd/BringMyOwnBeer-Combine
Business Dashboards using Bonobo ETL, Grafana and Apache AirflowRomain Dorgueil
Zero-to-one hands-on introduction to building a business dashboard using Bonobo ETL, Apache Airflow, and a bit of Grafana (because graphs are cool). The talk is based on the early version of our tools to visualize apercite.fr website. Plan, Implementation, Visualization, Monitoring and Iterate from there.
Lecture on Reactive programming on Android, mDevCamp 2016.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Understanding reactive programming with microsoft reactive extensionsOleksandr Zhevzhyk
We all want our applications to be responsible, reliable and testable. But event-driven paradigm sometimes could lead us to obscured or, even worse, messy code. Let’s look into the world, where generated data, background tasks and events are stuck together as asynchronous data streams to achieve a better result.
"Ускорение сборки большого проекта на Objective-C + Swift" Иван Бондарь (Avito)AvitoTech
После внедрения Swift в проект значительно увеличилось время сборки, что стало для нас существенным препятствием. В своём докладе я расскажу о том, как мы решили эту проблему, сократив время компиляции более чем в два раза.
From object oriented to functional domain modelingCodemotion
"From object oriented to functional domain modeling" by Mario Fusco
Malgrado l'introduzione delle lambda, la gran parte degli sviluppatori Java non è ancora abituata agli idiomi della programmazione funzionale e quindi non è pronta a sfruttare a pieno le potenzialità di Java 8. In particolare non è ancora comune vedere dati e funzioni usate insieme quando si modella un dominio di business. Lo scopo del talk è mostrare come alcuni principi di programmazione funzionale quali l'impiego di oggetti e strutture dati immutabili, l'uso di funzioni senza side-effect e il loro reuso mediante composizione, possono anche essere validi strumenti di domain modelling.
A practical guide to using RxJava on Android. Tips for improving your app architecture with reactive programming. What are the advantages and disadvantages of using RxJava over standard architecture? And how to connect with other popular Android libraries?
Presented at Droidcon Greece 2016.
The fundamentals and advance application of Node will be covered. We will explore the design choices that make Node.js unique, how this changes the way applications are built and how systems of applications work most effectively in this model. You will learn how to create modular code that’s robust, expressive and clear. Understand when to use callbacks, event emitters and streams.
The .NET garbage collector can be your best friend or your worst enemy; and it’s not friendly with a lot of people. The GC left more than a few production systems burning in smoke after developers failed to anticipate the effects of real production loads on the memory subsystem. In this talk, we will methodically measure and improve the .NET garbage collector’s performance. We will begin with a quick refresher on dynamic performance tools that can identify GC issues: CLR performance counters, ETW GC events, and ETW object allocation events; as well as static analysis tools, such as the Roslyn-based heap allocations analyzer. Then, we will inspect multiple issues at the source code level: excessive boxing, unintended effects of lambdas closing over local variables, await-generated state machines, intermediate objects in LINQ queries, and many others. We will also discuss higher-level memory problems: how to get rid of large object allocations, how to avoid finalization, and how to convert heap-based designs to local objects. Some of these ideas are now being applied at the language and framework level in C# 7 and .NET Core. At the end of the talk, you will be equipped to reduce memory traffic and GC overhead in your own applications, often by a factor of 10 or more!
MongoDB + Java - Everything you need to know Norberto Leite
Learn everything you need to know to get started building a MongoDB-based app in Java. We'll explore the relationship between MongoDB and various languages on the Java Virtual Machine such as Java, Scala, and Clojure. From there, we'll examine the popular frameworks and integration points between MongoDB and the JVM including Spring Data and object-document mappers like Morphia.
Learn everything you need to know to get started building a MongoDB-based app in Java. We'll explore the relationship between MongoDB and various languages on the Java Virtual Machine such as Java, Scala, and Clojure. From there, we'll examine the popular frameworks and integration points between MongoDB and the JVM including Spring Data and object-document mappers like Morphia.
Aplicações Assíncronas no Android com Coroutines e JetpackNelson Glauber Leal
Para usufruir dos múltiplos núcleos existentes nos processadores dos smartphones atuais, podemos realizar chamadas assíncronas de modo a paralelizar o fluxo de execução da aplicação. Normalmente isso é feito por meio de threads e callbacks que acabam por adicionar uma complexidade ao código que pode comprometer sua leitura e manutenção. Nessa apresentação, veremos como utilizar a API de Coroutines do Kotlin em conjunto com diversas bibliotecas do Jetpack do Android de modo a implementar programação assíncrona forma simples e eficiente.
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...Fons Sonnemans
Tijdens deze sessie zal met behulp van demo's en voorbeeld code getoond worden van wat de nieuwe mogelijkheden zijn van ASP.NET MVC6 en Entity Framework Core 1.0. Hoe genereer je de model classes, de controllers en de views. Wat kan en dien je daarna nog aan te passen. Wat zijn de mogelijkheden voor validatie en weergaves. Hoe kan je de nieuwe TagHelpers slim toepassen en zelf ook maken. Hoe gebruik je async controllers en views om de schaalbaarheid en soms ook de performance te verbeteren.
Sounds daunting right? But there is always a case where your organisation has either a custom, or third party system that you could leverage generating secrets for, or maybe an IAM system that doesn't quite fit on the ones included in Vault. Well, a couple of months ago I went from "no go" to writing my first plugin from Vault, and I'd like to tell you how I did it. This talk doesn't require you to know go, but it does require a minimal level of understanding of object oriented programming.
Slides for the 1st lecture on mobile development (dedicated to iOS) at the Faculty of Mathematics and Physics at the Charles University in Prague.
Course page: http://www.inmite.eu/en/talks/mff-2012
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developersJSFestUA
Say hello to the Angular CLI from new perspective. Get to know what schematics are and how you can use them for your purpose. Make use of ng add, ng update, ng new command and much more. Learn how to create read update and delete files automatically in your project, and how to execute npm tasks such as installing dependencies.
Introduction to interactive data visualisation using R Shinyanamarisaguedes
Shiny is an R library for building interactive webapps. Shiny allows rapid prototyping and quick production of dashboards and interactive data visualisations. This is especially important in situations where putting a real data-driven prototype in the hands of the end user allows for better refining of requirements before passing off to a web development team. This allows to speed up the delivery process and reducing the dependencies on other teams.
Code and solution to exercises available on github: https://github.com/amguedes/ShinySeminar
This is Application development life cycle of Anjdroid. How to create Activity and How it'll run. Its clear the basics from Activity creation to destroy an activity. For more description please go through the www.trainingguide.in
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
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.
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.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
3. l
l
l
Threads
Recall that Android ensures responsive apps by enforcing a
5 second limit on Activities
Sometimes we need to do things that take longer than 5
seconds, or that can be done while the user does something
else
5. •
•
•
•
•
•
•
private void methodInAndroidClass() {
Threads
Thread thread = new Thread(null, doSomething, “Background”);
Thread.start();
}
private Runnable doSomething = new Runnable() {
public void run() { /* do the something here */ }
};
l
• private void methodInAndroidClass() {
• new Thread(){
•
public void run() {/* do the something here */ }
• }.start();
•}
6. • @Override
•
public void onCreate(Bundle savedInstanceState) {
•
super.onCreate(savedInstanceState);
•
setContentView(R.layout.main);
•
new Thread() {
•
public void run() {
• Get data from web in background
•
String maps = null;
•
try {
•
URL updateURL = new URL("http://simexusa.com/cm/mapdata.txt");
•
URLConnection conn = updateURL.openConnection();
•
int contentLength = conn.getContentLength();
•
InputStream is = conn.getInputStream();
•
BufferedInputStream bis = new BufferedInputStream(is,1024);
•
ByteArrayBuffer baf = new ByteArrayBuffer(contentLength);
•
int current = 0;
•
while((current = bis.read()) != -1){
•
baf.append((byte)current);
}
•
maps = new String(baf.toByteArray()); //Convert the Bytes read to a String.
•
} catch (Exception e) {}
•
}
• Now we want to display data on screen
•
}.start();
• }
7. • public void onCreate(Bundle savedInstanceState) {
•
super.onCreate(savedInstanceState);
•
setContentView(R.layout.main);
•
TextView hello = (TextView)this.findViewById(R.id.hellotv);
•
hello.setText("testing");
•
new Thread() {
•
public void run() {
•
String maps = null;
•
try {
•
URL updateURL = new URL("http://simexusa.com/cm/mapdata.txt");
•
URLConnection conn = updateURL.openConnection();
•
int contentLength = conn.getContentLength();
•
InputStream is = conn.getInputStream();
•
BufferedInputStream bis = new BufferedInputStream(is,1024);
•
ByteArrayBuffer baf = new ByteArrayBuffer(contentLength);
•
int current = 0;
•
while((current = bis.read()) != -1){
•
baf.append((byte)current);
•
}
•
maps = new String(baf.toByteArray()); //Convert the Bytes read to a String.
•
} catch (Exception e) {}
•
TextView hello = (TextView)findViewById(R.id.hellotv);
•
• CalledFromWrongThreadException: Only the original
hello.setText(maps);
•
}}.start(); • thread that created a view hierarchy can touch its views.
8. l
l
l
Android Thread Constraints
Child threads cannot access UI elements (views); these must
be accessed through the main thread
What to do?
l Give results to main thread and let it use results
l In Campus Maps I set a flag in the thread, then I added the
menu item dynamically in Activity.onPrepareOptionsMenu
9. •
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final TextView hello = (TextView)this.findViewById(R.id.hellotv);
hello.setText("testing");
new Thread() {
public void run() {
String maps = null;
try {
URL updateURL = new URL("http://simexusa.com/cm/mapdata.txt");
URLConnection conn = updateURL.openConnection();
int contentLength = conn.getContentLength();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is,1024);
ByteArrayBuffer baf = new ByteArrayBuffer(contentLength);
int current = 0;
while((current = bis.read()) != -1){
baf.append((byte)current);
}
maps = new String(baf.toByteArray()); //Convert the Bytes read to a String.
} catch (Exception e) {}
hello.setText(maps);
}}.start();
10. l
l
Post to GUI Thread
Handler allows you to post Messages and Runnable objects
to threads
l These can be scheduled to run at some point in the future,
or enqueued for another thread
l We will use the latter
11. • public class BackgroundDemos extends Activity {
•
private Handler handler = new Handler();
•
private String maps = null;
•
TextView hello;
•
@Override
•
public void onCreate(Bundle savedInstanceState) {
•
super.onCreate(savedInstanceState);
•
setContentView(R.layout.main);
•
hello = (TextView)this.findViewById(R.id.hellotv);
•
hello.setText("testing");
•
new Thread() {
•
public void run() {
•
try {
•
URL updateURL = new URL("http://simexusa.com/cm/mapdata.txt");
•
//code omitted here
•
maps = new String(baf.toByteArray()); //Convert the Bytes read to a String.
•
handler.post(doUpdateMaps);
•
} catch (Exception e) {} } }.start();
•
}
•
private Runnable doUpdateMaps = new Runnable() {
•
public void run() {
•
hello.setText(maps);
•
}
•
};}
12. l
l
l
Services are like Activities, but without a UI
Services are not intended as background threads
l
l
l
Services
Think of a media player where the song keeps playing
while the user looks for more songs to play or uses other
apps
Don’t think of a cron job (e.g. run every day at 3am), use
Alarms to do this
Several changes in 2.0 related to Services
l
See http://androiddevelopers.blogspot.com/2010/02/service-api-changesstarting-with.html
13. l
Add to AndroidManifest.xml
l
Create the Service class
• <service android:enabled=“true” android:name=“.NewMapService”></service>
• public class NewMapService extends Service {
•
@Override
•
public void onCreate() {
•
}
•
@Override
•
public void onStart(Intent intent, int startId) {
•
//do something
•
}
•
@Override
•
public IBinder onBind(Intent intent) {
•
return null;
•
}
• }
14. l
l
Start/Stop the Service
Other alternatives in text
• public class MyActivity extends Activity {
•
@Override
•
public void onCreate() {
•
…
•
startService(new Intent(this, NewMapService.class);
•
}
•
@Override
•
public void onStop() {
•
…
•
stopService(new Intent(this, NewMapService.class));
• }
• }
15. l
•
•
•
•
•
•
•
•
•
•
•
•
Status Bar Notifications
NotificationManager nm = (NotificationManager)getSystemService(
Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.icon,
"NewMaps",System.currentTimeMillis());
String expandedTitle = "New Map Service";
String expandedText = "New Map Service is running";
Intent i = new Intent(this, NewMapService.class);
PendingIntent launchIntent = PendingIntent.getActivity(
getApplicationContext(), 0, i, 0);
notification.setLatestEventInfo(getApplicationContext(), expandedTitle,
expandedText, launchIntent);
nm.notify(1,notification);
• nm.cancel(1); //cancel a notification (id/parameters must match)