Having problems with Android application compatibility? You're not alone.
From the very beginning of the Android platform, developers always had to cope with a very difficult target: developing on a moving platform, a very fast moving one.
Release after release, features and goodies piled up, but, to a minor extent, so did API differentiation. This talk will step through how platform releases can risk jeopardizing professional development of Android applications, analyzing how to keep consistent UI patterns and implementation, and ending with the biggest release since 1.0: Honeycomb.
Java Course 12: XML & XSL, Web & ServletsAnton Keks
Lecture 12 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
The Internet of Things is rising fast, but how to run it safely and efficiently using standards?
OMA Lightweight M2M is the brand new IoT protocol for managing smart objects. It provides answers to the typical IoT needs: monitoring, configuring, securing and upgrading devices.
It’s bandwidth efficient and fits in constrained embedded environments while providing friendly and discoverable RESTful API.
This tutorial aims at giving you a hands-on experience with Lightweight M2M by showing you the power and simplicity of the Eclipse Leshan library for managing real world IoT application.
Agenda:
- Introduction to CoAP and Lightweight M2M
- Demo and live discovery of a connected smartwatch
- Presentation of Eclipse Leshan, a lightweight M2M implementation for Java
- Code your own Java server, and start managing fleet of smartwatches!
- Presentation of more advanced lightweight M2M topic: firmware upgrade, security, bootstrap, Wakaama and Tinydtls
- Code a smartwatch application using Lightweight M2M
Taking the example of donating SpringSource dm Server to Eclipse.org as the Virgo project, this presentation considers the costs and (significant) benefits of such a donation. Improvements to Eclipse.org are suggested. Project leads should glean ideas to apply to their own projects. This file is licensed under the Eclipse Public License.
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011hugs
Slides from Jason Huggins' talk at Jenkins User Conference, October 2011 in San Francisco. Title: "Extreme Testing with Selenium - In the Cloud and In the Garage."
Java Course 12: XML & XSL, Web & ServletsAnton Keks
Lecture 12 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
The Internet of Things is rising fast, but how to run it safely and efficiently using standards?
OMA Lightweight M2M is the brand new IoT protocol for managing smart objects. It provides answers to the typical IoT needs: monitoring, configuring, securing and upgrading devices.
It’s bandwidth efficient and fits in constrained embedded environments while providing friendly and discoverable RESTful API.
This tutorial aims at giving you a hands-on experience with Lightweight M2M by showing you the power and simplicity of the Eclipse Leshan library for managing real world IoT application.
Agenda:
- Introduction to CoAP and Lightweight M2M
- Demo and live discovery of a connected smartwatch
- Presentation of Eclipse Leshan, a lightweight M2M implementation for Java
- Code your own Java server, and start managing fleet of smartwatches!
- Presentation of more advanced lightweight M2M topic: firmware upgrade, security, bootstrap, Wakaama and Tinydtls
- Code a smartwatch application using Lightweight M2M
Taking the example of donating SpringSource dm Server to Eclipse.org as the Virgo project, this presentation considers the costs and (significant) benefits of such a donation. Improvements to Eclipse.org are suggested. Project leads should glean ideas to apply to their own projects. This file is licensed under the Eclipse Public License.
Extreme Testing with Selenium - @hugs at Jenkins User Conference 2011hugs
Slides from Jason Huggins' talk at Jenkins User Conference, October 2011 in San Francisco. Title: "Extreme Testing with Selenium - In the Cloud and In the Garage."
Level Up Your Integration Testing With TestcontainersVMware Tanzu
Traditional approaches to integration testing—using shared, local, or in-memory databases—fall short for today's modern developer.
Developers today are building cloud native distributed microservices and taking advantage of a rich variety of backing services. This explosion of applications and backing services introduces new challenges in creating the necessary environments for integration testing. To be useful and effective, these environments must be easy to create and they must resemble production as closely as possible. New solutions are needed to make this need a reality.
Enter Testcontainers!
Testcontainers is a Java library that supports JUnit tests and makes it incredibly easy to create lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
In this talk, you will learn when and how to use Testcontainers. We will cover the fundamentals and walk through a step-by-step example using a Spring Boot application that we build from scratch. As a bonus, we'll highlight some new features in Spring Boot 3.0 along the way!
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...Daniel Bryant
When enterprise organizations adopt microservices, containers, and cloud native development, the technologies and architectures may change, but the fact remains that we all still add the occasional bug to our code. The main challenge you now face is how to perform integration or end-to-end testing without spinning up all of your microservices locally and driving your laptop fans into high speed!
Join me for a tour of your microservices testing options using a series of Java-friendly tools.
- Explore challenges with scaling container-based application development (you can only run so many microservices locally before minikube melts your laptop)
- Learn about effective unit testing with mocks, using TestContainers for dependency testing, and using Telepresence to extend your local testing environment into the cloud
- Understand when to use each type of test and tooling based on your use case and requirements for realism, speed, and practicality
- See how Telepresence can "intercept" or reroute traffic from a specified service in a remote K8s cluster to your local dev machine
Presentation of the research paper entitled "Efficient Proxies in Smalltalk" in ESUG International Workshop on Smalltalk Technologies (IWST 2011), Edinburgh, Scotland.
Containers are an amazing technology that are revolutionising how we deploy and create applications. Docker and Kubernetes are helping developers and organisations realise the magical potential that container technology and orchestration offer. Enter MicroShed and the Testcontainers framework enabling local test automation that leverages that magical portability containers offer. In this session we'll explore how Testcontainers can help you run and test with true-to-production environments in development with minimal re-writing of your test code.
JLove - Replicating production on your laptop using the magic of containersGrace Jansen
Containers are an amazing technology that are revolutionising how we deploy and create applications. Docker and Kubernetes are helping developers and organisations realise the magical potential that container technology and orchestration offer. Enter MicroShed and the Testcontainers framework enabling local test automation that leverages that magical portability containers offer. In this session we'll explore how Testcontainers can help you run and test with true-to-production environments in development with minimal re-writing of your test code.
Slide deck for a presentation during a JavaScript meetup in Atlanta, GA.
This is an intro into titanium with a twist being that I focused on explaining some of the power titanium gives developers by allowing them to easily create their own UI versus using native graphics.
State of Puppet - Puppet Camp Barcelona 2013Puppet
Chris Spence delivers the "State of Puppet" at Puppet Camp Barcelona 2013. Learn about upcoming Puppet Camps at http://puppetlabs.com/community/puppet-camp/
Introduction to Material Design, with focus on general principles and patterns for Android and Web.
This will introduce you to principles and patterns of Material Design to elaborate your modern designs for web and mobile.
While the deck is pretty much image heavy, the speaker notes are provided to get a sense of the live speech.
Held at Google Developer Group DevFest 2014 at Politecnico di Bari.
Programming Sideways: Asynchronous Techniques for AndroidEmanuele Di Saverio
Android apps need to respond fast, support highly parallel execution and multi component architecture.
Learn some tricks of the trade for these problems!
as presented at www.mobileconference.it (2013 edition)
More Related Content
Similar to Android 1.5 to 3.0: a compatibility journey
Level Up Your Integration Testing With TestcontainersVMware Tanzu
Traditional approaches to integration testing—using shared, local, or in-memory databases—fall short for today's modern developer.
Developers today are building cloud native distributed microservices and taking advantage of a rich variety of backing services. This explosion of applications and backing services introduces new challenges in creating the necessary environments for integration testing. To be useful and effective, these environments must be easy to create and they must resemble production as closely as possible. New solutions are needed to make this need a reality.
Enter Testcontainers!
Testcontainers is a Java library that supports JUnit tests and makes it incredibly easy to create lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
In this talk, you will learn when and how to use Testcontainers. We will cover the fundamentals and walk through a step-by-step example using a Spring Boot application that we build from scratch. As a bonus, we'll highlight some new features in Spring Boot 3.0 along the way!
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...Daniel Bryant
When enterprise organizations adopt microservices, containers, and cloud native development, the technologies and architectures may change, but the fact remains that we all still add the occasional bug to our code. The main challenge you now face is how to perform integration or end-to-end testing without spinning up all of your microservices locally and driving your laptop fans into high speed!
Join me for a tour of your microservices testing options using a series of Java-friendly tools.
- Explore challenges with scaling container-based application development (you can only run so many microservices locally before minikube melts your laptop)
- Learn about effective unit testing with mocks, using TestContainers for dependency testing, and using Telepresence to extend your local testing environment into the cloud
- Understand when to use each type of test and tooling based on your use case and requirements for realism, speed, and practicality
- See how Telepresence can "intercept" or reroute traffic from a specified service in a remote K8s cluster to your local dev machine
Presentation of the research paper entitled "Efficient Proxies in Smalltalk" in ESUG International Workshop on Smalltalk Technologies (IWST 2011), Edinburgh, Scotland.
Containers are an amazing technology that are revolutionising how we deploy and create applications. Docker and Kubernetes are helping developers and organisations realise the magical potential that container technology and orchestration offer. Enter MicroShed and the Testcontainers framework enabling local test automation that leverages that magical portability containers offer. In this session we'll explore how Testcontainers can help you run and test with true-to-production environments in development with minimal re-writing of your test code.
JLove - Replicating production on your laptop using the magic of containersGrace Jansen
Containers are an amazing technology that are revolutionising how we deploy and create applications. Docker and Kubernetes are helping developers and organisations realise the magical potential that container technology and orchestration offer. Enter MicroShed and the Testcontainers framework enabling local test automation that leverages that magical portability containers offer. In this session we'll explore how Testcontainers can help you run and test with true-to-production environments in development with minimal re-writing of your test code.
Slide deck for a presentation during a JavaScript meetup in Atlanta, GA.
This is an intro into titanium with a twist being that I focused on explaining some of the power titanium gives developers by allowing them to easily create their own UI versus using native graphics.
State of Puppet - Puppet Camp Barcelona 2013Puppet
Chris Spence delivers the "State of Puppet" at Puppet Camp Barcelona 2013. Learn about upcoming Puppet Camps at http://puppetlabs.com/community/puppet-camp/
Introduction to Material Design, with focus on general principles and patterns for Android and Web.
This will introduce you to principles and patterns of Material Design to elaborate your modern designs for web and mobile.
While the deck is pretty much image heavy, the speaker notes are provided to get a sense of the live speech.
Held at Google Developer Group DevFest 2014 at Politecnico di Bari.
Programming Sideways: Asynchronous Techniques for AndroidEmanuele Di Saverio
Android apps need to respond fast, support highly parallel execution and multi component architecture.
Learn some tricks of the trade for these problems!
as presented at www.mobileconference.it (2013 edition)
Presentazione introduttiva alla sviluppo sui piattaforma Android; verranno presentati gli elementi fondamentali e i tool per sviluppare applicazioni in Android.
La presentazione fa riferimento a del codice di esempio reperibile a http://code.google.com/p/dive-tutorials/
E stata composta in occasione di un seminario per Sardegna Ricerche.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
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.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
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.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
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.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
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.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
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
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Essentials of Automations: The Art of Triggers and Actions in FME
Android 1.5 to 3.0: a compatibility journey
1. Android 1.5 to 3.0
a compatibility journey
Emanuele Di Saverio
Senior Technologist
frog
Monday, May 23, 2011
2. Who?
• Emanuele Di Saverio
– Senior Technologist for Android Platform @
– Open Source Committer
Monday, May 23, 2011
3. Objectives
• Code Compatibility
• Screen Compatibility
• User Interface Patterns
• a Real Life Example
Monday, May 23, 2011
4. DISCLAIMER!
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla the following is result of my professional experience and will be
technical and advanced topics, I will give for granted a good level of familiarity with the
platform bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
bla bla bla bla bla bla bla bla
Monday, May 23, 2011
5. 1.5 - Cupcake
• Virtual Keyboard: IME
• AppWidget
• 2 New Widget
Monday, May 23, 2011
6. 1.6 - Donut
• Screen Fragmentation
• Resources Framework
• Search Integration for
App
Monday, May 23, 2011
7. 2.0 - Eclair
• Support for HTML5
• Bluetooth Support
• Sync Services
Monday, May 23, 2011
8. 2.1 - Eclair (again)
• Live Wallpapers
• Enrich WebKit
• lots of bug fixes
Monday, May 23, 2011
9. 2.2 - Froyo
• App on SD
• Cloud 2 Device
Messaging
• Device Manager
• Data backup
Monday, May 23, 2011
10. 2.3 - Gingerbread
• Near Field
Communication
• Gyroscope,
Barometer, various
Sensors
• StrictMode
• SIP
Monday, May 23, 2011
11. 2.3.4 - Gingerbread
(again)
• more NFC Api
• more BT Api
• lots of Bug fixes
• fix for ClientLogin
• Accessory DevKit
Monday, May 23, 2011
13. • Every release brings new classes, new
methods, changes and deprecations
• We Want New Features
• We Want to target ALL devices
• We Don’t Want to constantly rewrite!
Monday, May 23, 2011
16. Android does no
magic here
We compile against
only one JAR:
choose our feature
set!
On device we will
have di erent
classes
Monday, May 23, 2011
17. Code Fragmentation
• 3 Techniques
• Canary
• Switch by Code/Resource
• Reflection
Monday, May 23, 2011
18. Canary
• Canaries are use in cave digging as a
“probes” for venomous gases
• If they don’t come back, you can’t use
that cave
• We want a Code Canary!
Monday, May 23, 2011
19. • We can’t replace or modify Java
Classloader in a Dalvik VM :(
• classes are verified as soon as
somebody new them
• ..so classloaders load classes lazily!
Monday, May 23, 2011
20. If this code is executed on a VM where
ScaleGestureDetector class is not
available, we can “gracefully degrade”
class Canary {
android.view.ScaleGestureDetector delegatto;
static void tryNewClass() {
android.view.ScaleGestureDetector foo = new
android.view.ScaleGestureDetector(null, null);
}
/* use the delegatto */
}
Monday, May 23, 2011
22. Switch by Code
• use info from android.os.Build
• can be used on the fly
• or via Factory pattern if performance is
needed (i.e. operations on UI Thread)
Monday, May 23, 2011
23. ad-hoc
public class RomaSkiFragmentActivity extends
FragmentActivity {
private final boolean isHoneycomb =
android.os.Build.VERSION.SDK_INT > 10;
@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
if (!isHoneycomb) {
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
}
/* cut */
Monday, May 23, 2011
24. factory
public static synchronized LocalDevice getInstance() {
if (instance == null) {
int vInt = LocalDevice.getVersionNumber();
log.i(LocalDevice.class, "Parsed version number is " + vInt);
if (vInt < SDK_NUM_2_0) {
instance = new it.gerdavax.easybluetooth.LocalDevice1Impl();
} else {
instance = new it.gerdavax.easybluetooth.LocalDevice2Impl();
}
}
log.i(LocalDevice.class, "Returning: " + instance);
return instance;
}
private static int getVersionNumber() {
return Integer.parseInt(Build.VERSION.SDK.trim());
}
Monday, May 23, 2011
25. Switch by Resource
• leverage the Resource framework
• the -v su x is for versions
• es. -v4 resource will be selected for Api
level 4 (Donut)
Monday, May 23, 2011
26. Reflection
• Java allows us to:
• instantiate classes starting from their
name in a String
• invoke methods, even private
• inspect fields, even private
• Some problems with final and static
though
• With big power comes big...risks
Monday, May 23, 2011
27. If you miss
something...
private static int R_id_message_handle = -1;
static {
try {
Class clazz = Class.forName("com.android.internal.R$id");
R_id_message_handle = clazz.getField("message").getInt(clazz);
} catch (Throwable e) {
// who cares
e.printStackTrace();
}
}
public static void setRightAlignToMessageField(Dialog d) {
if (R_id_message_handle != -1) {
TextView tv = (TextView) d.findViewById(R_id_message_handle);
if (tv != null) {
tv.setGravity(Gravity.RIGHT);
Monday, May 23, 2011
28. android-bluetooth library
void bindAndListen() {
try {
Method bindMethod = bluetoothSocketClass.getMethod
(METHOD_BIND, new Class[] { String.class });
bindMethod.invoke(bluetoothSocketObject, new Object[]
{ "devicename-tobeignored" });
Method listenMethod = bluetoothSocketClass.getMethod
(METHOD_LISTEN, new Class[] { int.class });
listenMethod.invoke(bluetoothSocketObject, new Object[]
{ this.port });
Method getPortMethod = bluetoothSocketClass.getMethod
(METHOD_GET_PORT, new Class[] {});
Integer getPortMethodReturnValue = (Integer)
getPortMethod.invoke(bluetoothSocketObject,
new Object[] {});
this.port = getPortMethodReturnValue.intValue();
} catch (Throwable t) {
throw new RuntimeException(t);
}
}
Monday, May 23, 2011
29. disclaimer on Reflection
• It’s dangerous: depends on names, avoids
compiler checks, makes your code ugly
without remedy
• It allows to access @hide functionalities,
and break the public API
• Google hates it: for good reasons
• ...and makes you feel quite a hacker :)
Monday, May 23, 2011
30. Screen Fragmentation
• Google tackled aggressively the
fragmentation problem since 1.6
• The approach is based on “buckets”:
this is an -eventually correct- approach
Monday, May 23, 2011
31. small medium large xlarge
ldpi
mdpi
hdpi
xhdpi
Monday, May 23, 2011
32. small medium large xlarge
cheapo,
ldpi highly
portable
midrange,
mdpi
old school
iPhone one
hdpi like (or handed tablet
wannabe) tablet
xhdpi
Monday, May 23, 2011
33. • It’s not a universal solution!
• What happens if I have a extra-large
screen with low density???
Monday, May 23, 2011
35. • But it works for real-life devices
• Pragmatic Balance between
performances and image definition
• That’s why “eventually correct”
Monday, May 23, 2011
36. The Real Reason
• behind screen compat framework is...
• keeping the physical size the same (dpi =
dot per inch)
• has to do with human size factor
...with the size of the thumb actually :)
Monday, May 23, 2011
37. Real Estate
• so I just have to provide image for ldpi
mdpi and hdpi and I am set, right?
• NOPE
• you real estate will change!
Monday, May 23, 2011
38. • 800x480 (240 dpi)= 5/3
but DIPs are scaled
• 480x320 (160 dpi) = 3/2
homogeneously!
• 320x240 (120 dpi) = 4/3
Monday, May 23, 2011
39. Solutions
• Modal Controls:
SlidingDrawer, FlipViews, Alerts,
Notifications
• or simply cut the ancillary content!
Monday, May 23, 2011
42. ...but don’t do Least Common
Denominator :(
Monday, May 23, 2011
43. Design Patterns
• Google doesn’t enforce constraints on
Application UI Design
• No Censorship, No Certification, No
Approval!
• ....but strongly suggests them
Monday, May 23, 2011
45. Twitter App
GoogleIO 2010
Monday, May 23, 2011
46. Twitter App
Home Action Bar
GoogleIO 2010
Dashboard
Live Wallpaper Quick
Actions
Monday, May 23, 2011
47. Resources
• Home, QuickActions, ActionBar:
Cyril Motter’s GreenDroid
https://github.com/cyrilmottier/GreenDroid
• Dashboard:
Roman Nurik’s Layout
https://gist.github.com/882650
• Live Wallpapers:
SDK Samples: CubeLiveWallpaper
http://developer.android.com/resources/articles/live-wallpapers.html
Monday, May 23, 2011
48. Designing Android UIs
for Phones and Tablets
• Pattern consolidated and implemented in
platform
• Direct support for ActionBar and Home
• Extension to tablets
• IO Schedule App is again reference
implementation - Fragment Compat!!!
Monday, May 23, 2011
51. Home
Action Bar
Dashboard
Monday, May 23, 2011
52. So...
• Use the patterns - they are designed for
delivering YOUR content
• Use the libraries - they provide
consistent and compatible
implementations
• Concentrate on the “painting” instead
of the “frame”
Monday, May 23, 2011
53. A real life example:
RomaSki
• Application for keeping under control
webcams from Ski Resorts in the Rome area
(I needed it)
• Compatibility Fragment Library
• Versioned Scale
Monday, May 23, 2011
58. Action Bar (was: “Title”)
• title Bar under HoneyComb is so powerful! Also has
tabs! is ACTION Bar
• ...forget it! Fragments Compability Library doesn’t
allow
• You have to inherit by compat FragmentActivity, not
the HoneyComb one, same classes but di erent
pkg!
Monday, May 23, 2011
61. Versioned Scale
• Android uses GestureDetectors for decoupling
• ScaleGestureDetector is in 2.2 and up
• 2.0 already had multitouch though: class
copypasted from source
• 1.6 single finger gesture: custom
ScaleGestureDetector
Monday, May 23, 2011
62. private OnScaleGestureListener mListener;
private ScaleGestureDetector internalDelegate;
private Canary nativeDelegate;
public ScaleGestureDetector(Context ctx, OnScaleGestureListener listener)
{
mListener = listener;
int buildInt = android.os.Build.VERSION.SDK_INT;
if (buildInt == android.os.Build.VERSION_CODES.DONUT) {
internalDelegate = new ScaleGestureDetector16(ctx, this);
} else if (buildInt == android.os.Build.VERSION_CODES.ECLAIR) {
internalDelegate = new ScaleGestureDetector21(ctx, this);
} else if (buildInt >= android.os.Build.VERSION_CODES.FROYO) {
try {
Canary.tryNewClass(ctx);
initalizeNative(ctx);
} catch (Throwable th) {
th.printStackTrace();
internalDelegate = new ScaleGestureDetector16(ctx, this);
}
} else {
throw new RuntimeException("Version not supported! " + buildInt);
}}
Monday, May 23, 2011
64. Design API for change
• The public interfaces of the Versioned
ScaleGestureDetector are same as SDK one
• In the future will be easy to switch back to SDK!
since
• IceCream Sandwich is expected for Q4 2011, with new
(unspecified) compatibility features!
Monday, May 23, 2011
66. Resources
• GoogleIO Schedule App src:
http://code.google.com/p/iosched/
• RomaSki src: https://github.com/hazam/RomaSki
https://github.com/hazam/hAndy
• Dan Morrill: Android Open Source & Compatibility Tech Lead
twitter: @morrildl
• HC Design Patterns: https://docs.google.com/present/view?
id=ah8kttmgmwgb_21d9rnw7d6
Monday, May 23, 2011
67. What was left out
• AndroidManifest filters: <supports_screen> will suprise
you,
• 2.3 adds <compatible-screens>
• Fragments Compatibility Library :/
• Accessory DevKit support for 2.3.4 library :/
• Google TV! (10ft experience, but mostly D-Pad)
Monday, May 23, 2011