Java Virtual Keyboard Using Robot, Toolkit and JToggleButton ClassesAbdul Rahman Sherzad
A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
Java Virtual Keyboard Using Robot, Toolkit and JToggleButton ClassesAbdul Rahman Sherzad
A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
La conférence « ProTips » de Mathias Seguy (Android2EE).
Cette conférence a eu lieu lors du BarCamp de la DroidCon Paris, Lundi 17 Juin 2013.
Si vous êtes un JUG ou un AUG et que cette conférence vous interesse, n'hésitez pas à me contacter.
Si vous souhaitez apprendre la technologie Android, contacter moi: mathias.seguy@android2ee.com, je suis formateur Android et les formations Android que je dispense sont exceptionnelles.
Speaker:Mathias est le fondateur de la société Android2ee spécialisée dans la technologie Android.
Il est :
• formateur Android,
• expert logiciel Android,
• speaker Android sur de grandes conférences Java : AndroidCon, Devoxx France, Eclipse Day Toulouse, JCertif Africa, Toulouse JUG, CocoAhead,…
• Rédacteur Android sur Developpez.com ;
• Programmateur Android : MyLight, MyTorch, MySensors, JCertifMobile disponibles sur GooglePlay ;
• Docteur en Mathématiques Fondamentales et Ingénieur de l’ENSEEIHT ;
• Expert technique de l’agence nationale de la recherche française ;
Il présentera au cours de cette conférence sa vision sur la mise en place d’une architecture d’une application Android pertinente et partagera les meilleurs pro-tips (astuces de pro) de sa connaissance. A ne pas manquez.
Mathias Séguy
mathias.seguy@android2ee.com
Fondateur Android2EE
Formation – Expertise – Consulting Android.
Ebooks pour apprendre la programmation sous Android.
By Eduardo Lima.
GNOME, the free desktop environment, has embraced Javascript. Starting from version 3.0, Javascript is at the core of the user experience delivered to tens of thousands of GNOME users out there. We call it the gnome-shell, but the real beauty lies within.
This presentation will give you a brief tour around the great technology behind the shell, a technology that GNOME hackers use to have automatic reflection of their core libraries into Javascript. Yes, you read well, automatic! It is called gobject-introspection and gives you the super-powers of Javascript-ing most of the hardcore C libraries that powers GNOME, from multimedia, web browsing, accelerated 2D and 3D graphics, communications, UX, hardware interaction, and many more.
During the talk, a couple of examples will be discussed, some demos dropped, and we might hack the shell on-the-fly as well!
Vous subissez les régressions à chaque livraison ? Vous ne voyez pas l’intérêt des tests unitaires car ils ne servent qu’à tester des additions ? Les tests ne sont pas applicables à votre projet car il est trop complexe ? Si c’est le cas, suivez David dans la quête du Test Driven Development. Vous rencontrerez pléthore d’ennemies contre lesquels vous aurez à combattre : bugs, complexité, code statique, couplage fort. Ils essaieront de vous barrer la route, mais heureusement, vous pourrez compter sur vos alliés jUnit, Mockito, refactoring et injection/dépendance.
David finira la soirée par une démonstration pratique sur un exercice de refactoring.
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - WebReb...Luciano Mammino
Learn how you can use some JavaScript/Node.js black magic to crack JWT tokens and impersonate other users or escalate privileges. Just add a pinch of ZeroMQ, a dose of parallel computing, a 4 leaf clover, mix everything applying some brute force and you'll get a powerful JWT cracking potion!
RxJava и Android. Плюсы, минусы, подводные камниStfalcon Meetups
Ярослав Герьятович
Android Engineer в компании Attendify . Спикер на UA Mobile'14 . Идеолог функционального и реактивного подхода в проектировании Android приложений.
All you ever wanted to know about Android Loaders and never dared to ask.
Important: I no longer recommend to use a Loader for "one-shot" actions because it's complicated and has a few side-effects. So I recommend to still use AsyncTasks in that case. You can create an AsyncTask inside a Fragment with setRetainInstance(true) to keep the same AsyncTask instance accross configuration changes, but beware not to update the view or interact with the Activity if the result arrives while the fragment is stopped. If you don't need the result, a static AsyncTask will do the job.
Improving android experience for both users and developersPavel Lahoda
Android UI and User Experience has changed dramatically in the recent version(s) and while users generally enjoy the new features, there are still several areas that are left to application-level-DIY-patterns. For developers, this is double challenge, they want to provide users with the bleeding edge UI patterns and at the same time, they have to deal with evolving API, that sometimes changes dramatically.
Presentation covers the gotchas developer might face dealing with ever-moving Android API, and how to utilize Java language and the tools it have to make the experience for developer more pleasant. Typical trends in the API will get analyzed and divided into several areas or "patterns", discussing typical scenarios how these components are designed and implemented.
This talk will propose several such UI patterns, that will compete to become "de facto" standards and details on the implementation, including possible impact on existing API as we have both end users and developers in mind.
The list of patterns/areas discussed in the talk include following :
ActionBar
ListView
TimePicker
KineticGestureComponent
La conférence « ProTips » de Mathias Seguy (Android2EE).
Cette conférence a eu lieu lors du BarCamp de la DroidCon Paris, Lundi 17 Juin 2013.
Si vous êtes un JUG ou un AUG et que cette conférence vous interesse, n'hésitez pas à me contacter.
Si vous souhaitez apprendre la technologie Android, contacter moi: mathias.seguy@android2ee.com, je suis formateur Android et les formations Android que je dispense sont exceptionnelles.
Speaker:Mathias est le fondateur de la société Android2ee spécialisée dans la technologie Android.
Il est :
• formateur Android,
• expert logiciel Android,
• speaker Android sur de grandes conférences Java : AndroidCon, Devoxx France, Eclipse Day Toulouse, JCertif Africa, Toulouse JUG, CocoAhead,…
• Rédacteur Android sur Developpez.com ;
• Programmateur Android : MyLight, MyTorch, MySensors, JCertifMobile disponibles sur GooglePlay ;
• Docteur en Mathématiques Fondamentales et Ingénieur de l’ENSEEIHT ;
• Expert technique de l’agence nationale de la recherche française ;
Il présentera au cours de cette conférence sa vision sur la mise en place d’une architecture d’une application Android pertinente et partagera les meilleurs pro-tips (astuces de pro) de sa connaissance. A ne pas manquez.
Mathias Séguy
mathias.seguy@android2ee.com
Fondateur Android2EE
Formation – Expertise – Consulting Android.
Ebooks pour apprendre la programmation sous Android.
By Eduardo Lima.
GNOME, the free desktop environment, has embraced Javascript. Starting from version 3.0, Javascript is at the core of the user experience delivered to tens of thousands of GNOME users out there. We call it the gnome-shell, but the real beauty lies within.
This presentation will give you a brief tour around the great technology behind the shell, a technology that GNOME hackers use to have automatic reflection of their core libraries into Javascript. Yes, you read well, automatic! It is called gobject-introspection and gives you the super-powers of Javascript-ing most of the hardcore C libraries that powers GNOME, from multimedia, web browsing, accelerated 2D and 3D graphics, communications, UX, hardware interaction, and many more.
During the talk, a couple of examples will be discussed, some demos dropped, and we might hack the shell on-the-fly as well!
Vous subissez les régressions à chaque livraison ? Vous ne voyez pas l’intérêt des tests unitaires car ils ne servent qu’à tester des additions ? Les tests ne sont pas applicables à votre projet car il est trop complexe ? Si c’est le cas, suivez David dans la quête du Test Driven Development. Vous rencontrerez pléthore d’ennemies contre lesquels vous aurez à combattre : bugs, complexité, code statique, couplage fort. Ils essaieront de vous barrer la route, mais heureusement, vous pourrez compter sur vos alliés jUnit, Mockito, refactoring et injection/dépendance.
David finira la soirée par une démonstration pratique sur un exercice de refactoring.
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - WebReb...Luciano Mammino
Learn how you can use some JavaScript/Node.js black magic to crack JWT tokens and impersonate other users or escalate privileges. Just add a pinch of ZeroMQ, a dose of parallel computing, a 4 leaf clover, mix everything applying some brute force and you'll get a powerful JWT cracking potion!
RxJava и Android. Плюсы, минусы, подводные камниStfalcon Meetups
Ярослав Герьятович
Android Engineer в компании Attendify . Спикер на UA Mobile'14 . Идеолог функционального и реактивного подхода в проектировании Android приложений.
All you ever wanted to know about Android Loaders and never dared to ask.
Important: I no longer recommend to use a Loader for "one-shot" actions because it's complicated and has a few side-effects. So I recommend to still use AsyncTasks in that case. You can create an AsyncTask inside a Fragment with setRetainInstance(true) to keep the same AsyncTask instance accross configuration changes, but beware not to update the view or interact with the Activity if the result arrives while the fragment is stopped. If you don't need the result, a static AsyncTask will do the job.
Improving android experience for both users and developersPavel Lahoda
Android UI and User Experience has changed dramatically in the recent version(s) and while users generally enjoy the new features, there are still several areas that are left to application-level-DIY-patterns. For developers, this is double challenge, they want to provide users with the bleeding edge UI patterns and at the same time, they have to deal with evolving API, that sometimes changes dramatically.
Presentation covers the gotchas developer might face dealing with ever-moving Android API, and how to utilize Java language and the tools it have to make the experience for developer more pleasant. Typical trends in the API will get analyzed and divided into several areas or "patterns", discussing typical scenarios how these components are designed and implemented.
This talk will propose several such UI patterns, that will compete to become "de facto" standards and details on the implementation, including possible impact on existing API as we have both end users and developers in mind.
The list of patterns/areas discussed in the talk include following :
ActionBar
ListView
TimePicker
KineticGestureComponent
TDD on android. Why and How? (Coding Serbia 2019)Danny Preussler
We all heard about TDD: test-driven development. The one side says: It produces better code and fewer bugs, other's see a waste of time. How much time does TDD cost? Does it even work on Android? Is it possible to develop an android app fully test driven? Should we do it? And if: should we only test Java classes? Should we use or avoid Robolectric? How do I even start?
We have all heard about TDD: Test Driven Development. It produces better code and leads to fewer bugs. But, in our daily Android lives, why aren’t we doing it? Is it possible to develop an Android app that is fully test driven? Where do you start? Should you only test Java classes? Should you use or avoid Robolectric?
Junit5: the next gen of testing, don't stay behindDanny Preussler
Junit 5 is a big step for the world of unit testing. A new very flexible testing framework, based on learning from many years of Junit 4.
At sporttotal we use this for our Android unit tests and it changed the way we write tests. Hard for us to imagine living without features like @Nested. Other features we ignored as those are more leaning towards Java and are solved already by Kotlin or other Kotlin libraries. And some features are even breaking changes. How do you test on Android in a world without TestRunner and TestRules?
Android testing team was always very slowly in adopting to new Junit versions, so how far can we bypass this?
Let's do a deep dive into Junit5, how it works and how we can use it on Android
Demystifying dependency Injection: Dagger and ToothpickDanny Preussler
Dependency Injection, that's the thing that Dagger2 does, right? For most of us, it's black magic. Let's look deeper how DI works. And then we better understand the frameworks that are out there. This session introduce Toothpick that was created this year and is already used by millions of users as driven a lot by engineers at Groupon.
What was their need? What's wrong with Dagger?
Toothpick was designed to bring goodies from Guice to modern mobile world. It focuses on scopes and unit testing without loosing performance as Roboguice did.
Unit testing without Robolectric, Droidcon Berlin 2016Danny Preussler
Are you bound to flaky, slow Robolectric Tests? Do you want to know a way out of it? This session shows ideas and concepts to replace Robolectric from your test code base
All around the world, localization and internationalization on Android (Droid...Danny Preussler
Android apps are global, they get downloaded all around the world. And this means not only supporting multiple languages via xml files. Its about plurals, date formats, currencies up to things like right-to-left
This topic tries to give an introduction into this large topic for new developers.
(Android) Developer Survival in Multiscreen World, MobCon Sofia 2016Danny Preussler
A modern Android app looks good on phones various sizes, often also a tablet version is required. But good tablet version is more than just a bigger screen, it might have completely different flows.
Now Android TV starts, another entry into the same app code. How does this affect an app? What is with Android Wear?
What code can and should be reused? How can an app be prepared for another screen? Whats a good architecture for this? Which patterns work, which patterns we know are outdated for the new multi screen world of Android?
Bye Bye Charles, Welcome Odo, Android Meetup Berlin May 2014Danny Preussler
Introducing the next generation testing proxy we use at Groupon to the public:
Odo an http proxy with a RESTful API for mocking or partial rewriting of responses and requests
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, BerlinDanny Preussler
Mobile Apps leben nicht in einer isolierten Welt, sie interagieren mit anderen Apps, mit Services sowie internen und externen Datenquellen. Auch der Nutzer hat hier Einfluss: er wechselt in Realität schnell zwischen Apps, er nimmt Anrufe entgegen während die App läuft. Wenn es zum Testen kommt, stellt uns dies vor Herausforderungen, denn hier brauchen wir isolierte Zustände. Nur so können die Tests reproduzierbare Ergebnisse liefern. Und doch wollen wir die App realitätsnah testen. Wie testet man aber eine App mit Webservices? Wie entkoppelt man diesen, wie testet man Fehlerzuständige die in der Kommunikation passieren können? Wie simuliert man GPS u.ä.? Diese Session versucht Best Practices hierzu zu vermitteln. Es werden sowohl SDK Bordmittel als auch externe Tools vorgestellt, die uns das Testen von Apps in diesen komplexen Fällen erleichtern.
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!
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...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.
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.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
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.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
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.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
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.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
3. ● Danny Preussler:
● Lead Engineer Android
ebay Kleinanzeigen, Germany
● Path to the green side:
C++ -> Java SE -> JME -> BlackBerry -> Android
● My current Droids:
Galaxy Nexus, Nexus 7, Logitech Revue, I'm watch
● My 1st Droid was a:
Motorola Droid/Milestone
● Johannes Orgis:
● Software Development Manager
Cortado Mobile Clients
Cortado AG, Germany
● Path to the green side:
Java EE -> Java SE -> BlackBerry -> Android
● My current Droids:
Galaxy Nexus, Nexus 7
● My 1st Droid was a:
HTC Magic
4. ● We show code snippets that does something or maybe not
● Look out for hidden pitfalls
● All Puzzles are run with Android 4.1 Jelly Beans
There should be no platform depended puzzles
● Test yourself!
● Raise your hands when we ask you!
● Guess if you're unsure!
● Learn something if you were wrong!
● Have fun! :D
5. public class DroidConPuzzle extends Activity {
@Override
protected void onCreate(Bundle saved) {
FragmentTransaction trans = getFragmentManager().beginTransaction();
trans.add(android.R.id.content, new Fragment() {
@Override
public View onCreateView(LayoutInflater inf,
ViewGroup view, Bundle saved)
{
View v = inf.inflate(R.layout.fragment_default, null);
return null;
}
});
trans.commit();
super.onCreate(saved);
}
}
For your eyes only...
a) NullPointerException in Inflater.inflate()
b) NullPointerException after onCreateView()
c) llegalStateException in super.onCreate()
d) llegalStateException in Transaction.commit()
e) shows an empty screen
6. public class DroidConPuzzle extends Activity {
@Override
protected void onCreate(Bundle saved) {
FragmentTransaction trans = getFragmentManager().beginTransaction();
trans.add(android.R.id.content, new Fragment() {
@Override
public View onCreateView(LayoutInflater inf,
ViewGroup view, Bundle saved)
{
View v = inf.inflate(R.layout.fragment_default, null);
return null;
}
});
trans.commit();
super.onCreate(saved);
}
}
For your eyes only...
a) NullPointerException in Inflater.inflate()
b) NullPointerException after onCreateView()
c) llegalStateException in super.onCreate()
d) llegalStateException in Transaction.commit()
e) shows an empty screen
7. public class DroidConPuzzle extends Activity {
@Override
protected void onCreate(Bundle saved) {
FragmentTransaction trans = getFragmentManager().beginTransaction();
trans.add(android.R.id.content, new Fragment() {
@Override
public View onCreateView(LayoutInflater inf,
ViewGroup view, Bundle saved)
{
View v = inf.inflate(R.layout.fragment_default, null);
return null;
}
});
trans.commit();
super.onCreate(saved);
}
}
For your eyes only...
e) shows an empty screen BUT after rotation it will crash:
8. ● Fragments need to be public:
not possible as inner or anonymous class
● Fragments must have a public empty
constructor
● RTFW: read the fucking warnings:
●
9. <Button ... android:onClick="clicked" />
public class OnClickToastFragment extends Fragment {...
public void clicked(View v)
{
Toast.makeText(getActivity(),getClass().getName(),Toast.LENGTH_SHORT).show();
}
}
public class OnClickToastFragmentActivity extends FragmentActivity{
public void clicked(View v)
{
Toast.makeText(this,getClass().getName(),Toast.LENGTH_SHORT).show();
}
}
public class MyMainActivity extends Activity{
public void clicked(View v)
{
Toast.makeText(this,getClass().getName(),Toast.LENGTH_SHORT).show();
}
}
Licence to click
What happens when I click the Button?
a) Toast : MyMainActivity
b) Toast : OnClickToastFragmentActivity
c) Toast : OnClickToastFragment
d) Nothing
e) IllegalStateException - Could not find a method ...
10. <Button ... android:onClick="clicked" />
public class OnClickToastFragment extends Fragment {...
public void clicked(View v)
{
Toast.makeText(getActivity(),getClass().getName(),Toast.LENGTH_SHORT).show();
}
}
public class OnClickToastFragmentActivity extends FragmentActivity{
public void clicked(View v)
{
Toast.makeText(this,getClass().getName(),Toast.LENGTH_SHORT).show();
}
}
public class MyMainActivity extends Activity{
public void clicked(View v)
{
Toast.makeText(this,getClass().getName(),Toast.LENGTH_SHORT).show();
}
}
Licence to click
What happens when I click the Button?
a) Toast : MyMainActivity
b) Toast : OnClickToastFragmentActivity
c) Toast : OnClickToastFragment
d) Nothing
e) IllegalStateException - Could not find a method ...
11. android:onClick is an easy way to trigger "click" events in xml
but remember: the calling Activity MUST implement the xxx(Viev v) method otherwise a
IllegalStateException will be thrown at runtime
be careful if you are using Fragments in multiple Activities
12. Every 2.2. Device has the "unique" ANDROID_ID
9774d56d682e549c ?
Be aware of platform dependent puzzles....
or did you know that?
13. public class GetViewFragment extends Fragment {
public View onCreateView(LayoutInflater inf, ViewGroup view, Bundle saved) {
super.onCreateView(inf, view, saved);
return inf.inflate(R.layout.fragment_get_view, view);
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getView().setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(getActivity(),
"My name is droid, android",
Toast.LENGTH_SHORT);}});
}
}
A View to (a) Kill
a) shows a Toast "my name is droid, android"
b) does nothing but showing a view
c) Exception in Inflater.inflate()
d) Exception in GetViewFragment.onCreate()
e) Exception in Fragment.onCreateView()
14. public class GetViewFragment extends Fragment {
public View onCreateView(LayoutInflater inf, ViewGroup view, Bundle saved) {
super.onCreateView(inf, view, saved);
return inf.inflate(R.layout.fragment_get_view, view);
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getView().setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(getActivity(),
"My name is droid, android",
Toast.LENGTH_SHORT);}});
}
}
A View to (a) Kill
a) shows a Toast "my name is droid, android"
b) does nothing but showing a view
c) Exception in Inflater.inflate()
d) Exception in GetViewFragment.onCreate()
e) Exception in Fragment.onCreateView()
15. public class GetViewFragment extends Fragment {
public View onCreateView(LayoutInflater inf, ViewGroup view, Bundle saved) {
super.onCreateView(inf, view, saved);
return inf.inflate(R.layout.fragment_get_view, view);
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getView().setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Toast.makeText(getActivity(),
"My name is droid, android",
Toast.LENGTH_SHORT);}});
}
}
A View to (a) Kill
a) shows a Toast "my name is droid, android"
b) does nothing but showing a view
c) Exception in Inflater.inflate() (2nd winner)
d) Exception in GetViewFragment.onCreateView()
e) Exception in Fragment.onCreateView()
16. ● Know about the life cycle of Activities,
Fragments, Services!
● Example: methods as
getView() or getActivity() can return null in
certain points of their life cycle!
17. public class ToastFragment extends Fragment {
...
public void onDestroy() {
super.onDestroy();
new ToastingAsyncTask().execute(null,null,null);
}
class ToastingAsyncTask extends AsyncTask<String, Integer, Long>{
protected void onPostExecute(Long result) {
if (getActivity() == null){
System.out.println(getString(R.string.no_activity));
}else{
System.out.println(getString(R.string.activity_leak));
}
}
protected Long doInBackground(String... params) {
try {Thread.sleep(500);} catch (InterruptedException e) {}
return null;}
...
Live and let die ...
what happens when I change the orientation of my Galaxy Nexus?
a) Sysout: no_activity
b) Sysout: activity_leak
c) Sysout: null
d) Exception in getActivity
e) Exception in getString
18. public class ToastFragment extends Fragment {
...
public void onDestroy() {
super.onDestroy();
new ToastingAsyncTask().execute(null,null,null);
}
class ToastingAsyncTask extends AsyncTask<String, Integer, Long>{
protected void onPostExecute(Long result) {
if (getActivity() == null){
System.out.println(getString(R.string.no_activity));
}else{
System.out.println(getString(R.string.activity_leak));
}
}
protected Long doInBackground(String... params) {
try {Thread.sleep(500);} catch (InterruptedException e) {}
return null;}
...
Live and let die ...
what happens when I change the orientation of my Galaxy Nexus?
a) Sysout: no_activity
b) Sysout: activity_leak
c) Sysout: null
d) Exception in getActivity
e) Exception in getString
20. Until Android 4 (possible 3.x) android.app.DownloadManager only supports http
connections:
if (scheme == null || !scheme.equals("http")) {
throw new IllegalArgumentException("Can only download HTTP URIs: " + uri);
}
Because of that the stock browser (and Chrome)
could not handle https downloads.
Be aware of platform dependent puzzles....
or did you know that?
21. public class MyListActivity extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFromServer(getApplicationContext());
}
void getFromServer(Context context) {
final ProgressDialog dlg = new ProgressDialog(context);
dlg.show();
new AsyncTask<Context, Void, ArrayAdapter>() {
protected ArrayAdapter doInBackground(Context... params) {
return new ArrayAdapter<String>(params[0],
android.R.layout.simple_list_item_1,
Arrays.asList(new String[] { "0", "0", "7" }));
}
protected void onPostExecute(ArrayAdapter result) {
setListAdapter(result);
dlg.dismiss();
}
}.execute(context);
}...
a) shows list with entries 0,0,7
b) shows list with entries 0,7
c) Exception in getFromServer
d) Exception in doInBackground
e) Exception in onPostExecute
Tomorrow never dies...
22. public class MyListActivity extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFromServer(getApplicationContext());
}
void getFromServer(Context context) {
final ProgressDialog dlg = new ProgressDialog(context);
dlg.show();
new AsyncTask<Context, Void, ArrayAdapter>() {
protected ArrayAdapter doInBackground(Context... params) {
return new ArrayAdapter<String>(params[0],
android.R.layout.simple_list_item_1,
Arrays.asList(new String[] { "0", "0", "7" }));
}
protected void onPostExecute(ArrayAdapter result) {
setListAdapter(result);
dlg.dismiss();
}
}.execute(context);
}...
a) shows list with entries 0,0,7
b) shows list with entries 0,7
c) Exception in getFromServer
d) Exception in doInBackground
e) Exception in onPostExecute
Tomorrow never dies...
23. ● Know your Context!
● Never use Application Context for UI!
Prefer Application Context for Non-UI!
● Be aware of Context Leaks!
24. public class ActionbarFragment extends Fragment {
...
public View onCreateView(LayoutInflater inf, ViewGroup view, Bundle saved) {
setHasOptionsMenu(true);
return inf.inflate(R.layout.fragment_get_view, null);
}
public boolean onOptionsItemSelected(MenuItem item) {
Toast.makeText(getActivity(), "from Fragment", Toast.LENGTH_SHORT).show();
return true;
}
}
public class ActionbarActivity extends Activity {
...
public boolean onOptionsItemSelected(MenuItem item) {
Toast.makeText(this, "from Activity", Toast.LENGTH_SHORT).show();
return true;
}
}
From Fragment with Love...
When clicking an item from actionbar:
a) shows toast: "from Activity"
b) shows toast: "from Fragment"
c) shows both toasts
d) shows toast depending on who the creator of the menu item
25. public class ActionbarFragment extends Fragment {
...
public View onCreateView(LayoutInflater inf, ViewGroup view, Bundle saved) {
setHasOptionsMenu(true);
return inf.inflate(R.layout.fragment_get_view, null);
}
public boolean onOptionsItemSelected(MenuItem item) {
Toast.makeText(getActivity(), "from Fragment", Toast.LENGTH_SHORT).show();
return true;
}
}
public class ActionbarActivity extends Activity {
...
public boolean onOptionsItemSelected(MenuItem item) {
Toast.makeText(this, "from Activity", Toast.LENGTH_SHORT).show();
return true;
}
}
From Fragment with Love...
When clicking an item from actionbar:
a) shows toast: "from Activity"
b) shows toast: "from Fragment"
c) shows both toasts
d) shows toast depending on who the creator of the menu item
26. "If you added the menu item from a fragment, then the
respective onOptionsItemSelected() method is called for that
fragment.
However the activity gets a chance to handle it first, so the
system calls onOptionsItemSelected() on the activity before
calling the fragment."
● RTFJD: read the fucking java doc:
27. On pre 2.3.6 Android's HttpUrlConnection is broken
as soon as the server supports more than Basic authentication ?
You'll get IndexOutOfBoundsException
Be aware of platform dependent puzzles....
or did you know that?
int realm = challenge.indexOf("realm="") + 7;
WWW-Authenticate: Basic realm="RealmName"
WWW-Authenticate: NTLM
28. protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String[] longList = new String[1000000];
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra("droidcon", longList);
startActivityForResult(intent, 100);
}
protected void onActivityResult(int request, int result, Intent data) {
super.onActivityResult(request, result, data);
Log.e("droidcon", "result" + request + " " + result);
}
a) OutOfMemoryException in onCreate()
b) IllegalArgumentException in onCreate()
c) Nothing happens, direct invocation of onActivityResult (with cancel code)
d) Nothing happens, no invocation of onActivityResult
e) System-Intent-Picker for "sent" action will be shown normally
The world is not enough ...
29. protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String[] longList = new String[1000000];
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra("droidcon", longList);
startActivityForResult(intent, 100);
}
protected void onActivityResult(int request, int result, Intent data) {
super.onActivityResult(request, result, data);
Log.e("droidcon", "result" + request + " " + result);
}
a) OutOfMemoryException in onCreate()
b) IllegalArgumentException in onCreate()
c) Nothing happens, direct invocation of onActivityResult (with cancel code)
d) Nothing happens, no invocation of onActivityResult
e) System-Intent-Picker for "sent" action will be shown normally
The world is not enough ...
30. Logcat shows:
11-12 16:25:53.391: E/JavaBinder(6247): !!! FAILED BINDER TRANSACTION !!!
Some devices show TransactionTooLargeException:
The Binder transaction failed because it was too large.
During a remote procedure call, the arguments and the return value of the call are transferred as
Parcel objects stored in the Binder transaction buffer. If the arguments or the return value are too
large to fit in the transaction buffer, then the call will fail and TransactionTooLargeException will be
thrown.
The Binder transaction buffer has a limited fixed size, currently 1Mb, which is shared by all
transactions in progress for the process. Consequently this exception can be thrown when there are
many transactions in progress even when most of the individual transactions are of moderate size.
31. Be aware of platform dependent puzzles....
or did you know that?
Starting with 2.3 HTTPUrlConnection handles and sets gzip as Content-Encoding.
This leads to errors if you get a response where there is no content but a Content-
Length (=0) or a Content-Encoding(=gzip).
getResponceCode leads to EOFException
32. public class AsyncTaskActivity extends Activity{
...
protected void onResume() {
super.onResume();
TextView testV = (TextView) findViewById(R.id.async_text_1);
new WritingAsyncTask(testV,2000).execute(" Bob");
new WritingAsyncTask(testV,100).execute("Alice");
new WritingAsyncTask(testV,500).execute("loves");
}
...
public class WritingAsyncTask extends AsyncTask<String, Void, String>{...
private final TextView view;//set in Constructor
private final int timeout;//set in Constructor
protected String doInBackground(String... params) {
try {Thread.sleep(timeout);} catch (InterruptedException e) {}
return params[0];
}
protected void onPostExecute(String result) {
view.setText(view.getText()+" "+result);}
Casino Royal
What is shown in the TextView when I start the Activity on my Galaxy Nexus:
a) Alice loves Bob
b) Bob Alice loves
c) Bob loves Alice
d) There is not enough information to decide
33. public class AsyncTaskActivity extends Activity{
...
protected void onResume() {
super.onResume();
TextView testV = (TextView) findViewById(R.id.async_text_1);
new WritingAsyncTask(testV,2000).execute(" Bob");
new WritingAsyncTask(testV,100).execute("Alice");
new WritingAsyncTask(testV,500).execute("loves");
}
...
public class WritingAsyncTask extends AsyncTask<String, Void, String>{...
private final TextView view;//set in Constructor
private final int timeout;//set in Constructor
protected String doInBackground(String... params) {
try {Thread.sleep(timeout);} catch (InterruptedException e) {}
return params[0];
}
protected void onPostExecute(String result) {
view.setText(view.getText()+" "+result);}
Casino Royal
What is shown in the TextView when I start the Activity on my Galaxy Nexus:
a) Alice loves Bob
b) Bob Alice loves
c) Bob loves Alice
d) There is not enough information to decide
34. public class AsyncTaskActivity extends Activity{
...
protected void onResume() {
super.onResume();
TextView testV = (TextView) findViewById(R.id.async_text_1);
new WritingAsyncTask(testV,2000).execute(" Bob");
new WritingAsyncTask(testV,100).execute("Alice");
new WritingAsyncTask(testV,500).execute("loves");
}
...
public class WritingAsyncTask extends AsyncTask<String, Void, String>{...
private final TextView view;//set in Constructor
private final int timeout;//set in Constructor
protected String doInBackground(String... params) {
try {Thread.sleep(timeout);} catch (InterruptedException e) {}
return params[0];
}
protected void onPostExecute(String result) {
view.setText(view.getText()+" "+result);}
Casino Royal
What is shown in the TextView when I start the Activity on my Galaxy Nexus:
a) Alice loves Bob
b) Bob Alice loves .... usually
c) Bob loves Alice
d) There is not enough information to decide
35. public class AsyncTaskActivity extends Activity{
...
protected void onResume() {
super.onResume();
TextView testV = (TextView) findViewById(R.id.async_text_1);
new WritingAsyncTask(testV,2000).execute(" Bob");
new WritingAsyncTask(testV,100).execute("Alice");
new WritingAsyncTask(testV,500).execute("loves");
}
...
public class WritingAsyncTask extends AsyncTask<String, Void, String>{...
private final TextView view;//set in Constructor
private final int timeout;//set in Constructor
protected String doInBackground(String... params) {
try {Thread.sleep(timeout);} catch (InterruptedException e) {}
return params[0];
}
protected void onPostExecute(String result) {
view.setText(view.getText()+" "+result);}
Casino Royal
What is shown in the TextView when I start the Activity on my Galaxy Nexus:
a) Alice loves Bob
b) Bob Alice loves
c) Bob loves Alice
d) There is not enough information to decide
36. You need to know the android:targetSdkVersion (and the Device Version of the Target Device)
android:targetSdkVersion < 13:
AsyncTask is executed parallel
android:targetSdkVersion >= 13 && Device OS >= 14:
AsyncTask is executed serial
from AsyncTask.Java:
...
public static final Executor SERIAL_EXECUTOR = new SerialExecutor();
private static volatile Executor sDefaultExecutor = SERIAL_EXECUTOR;
...
You can enforce parallel execution in SDK >= 11
executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,...);
37. public class ManyAsyncTasksActivity extends Activity{
...
protected void onResume() {
super.onResume();
TextView testV = (TextView) findViewById(R.id.async_text_1);
for (int i = 0; i < 200; i++) {
new WritingAsyncTask(testV,100).execute(i+",");
}
}
...
public class WritingAsyncTask extends AsyncTask<String, Void, String>{...
private final TextView view;//set in Constructor
private final int timeout;//set in Constructor
protected String doInBackground(String... params) {
try {Thread.sleep(timeout);} catch (InterruptedException e) {}
return params[0];
}
protected void onPostExecute(String result) {
view.setText(view.getText()+" "+result);}
Moonraker
What is shown when I start the Activity on my G. Nexus (target SDK is 11, A: 4.1.2) :
a) Numbers from 0 to 199 in random order
b) Application Error (App has stopped)
c) Numbers from 0 to 199 in serial order
d) Numbers from 0 to 127 in random order
e) Numbers from 0 to 137 in random order
38. public class ManyAsyncTasksActivity extends Activity{
...
protected void onResume() {
super.onResume();
TextView testV = (TextView) findViewById(R.id.async_text_1);
for (int i = 0; i < 200; i++) {
new WritingAsyncTask(testV,100).execute(i+",");
}
}
...
public class WritingAsyncTask extends AsyncTask<String, Void, String>{...
private final TextView view;//set in Constructor
private final int timeout;//set in Constructor
protected String doInBackground(String... params) {
try {Thread.sleep(timeout);} catch (InterruptedException e) {}
return params[0];
}
protected void onPostExecute(String result) {
view.setText(view.getText()+" "+result);}
Moonraker
What is shown when I start the Activity on my G. Nexus (target SDK is 11, A: 4.1.2) :
a) Numbers from 0 to 199 in random order
b) Application Error (App has stopped)
c) Numbers from 0 to 199 in serial order
d) Numbers from 0 to 127 in random order
e) Numbers from 0 to 137 in random order
39. LogCat shows:
java.lang.RuntimeException: Unable to resume activity {...}: java.util.concurrent.
RejectedExecutionException: Task android.os.AsyncTask ... rejected from java.util.concurrent.
ThreadPoolExecutor ... [Running, pool size = 128, active threads = 128, queued tasks = 10,
completed tasks = 0]
ThreadPoolExecutor currently only accepts a given number of Tasks, default value is a pool size of
128.
private static final int MAXIMUM_POOL_SIZE = 128;
...
private static final BlockingQueue<Runnable> sPoolWorkQueue =
new LinkedBlockingQueue<Runnable>(10);