Saturday, March 27, 2010

Top 5 Home Screen Features For Android Developers


Android has several very intriguing components that add many dynamic capabilities to your home screen. The trend is slowly migrating towards dynamic home screens. The static screens you have been accustomed to are over. Users want access to information faster and with fewer clicks. Patent filings are a very good barometer for the future direction of mobile operating systems and home screen patents are one of them. Dynamic home screens are definitely a trend. In fact, Android provides many intriguing home screen components that you can leverage right now to create a more efficient and dramatic user experience:

App Widgets

App Widgets are small application components that you can embed on your home screen. If you need instant access to important data, these compact portlet-like components are an ideal choice.
Advantages:
  • Compact design
  • Provides portlet-like capabilities for your home screen
  • Quick and simple to access
  • Refresh frequency is configurable


Quick Search Box

Quick search boxThe Quick Search Box is an extremely powerful feature. It is the ubiquitous Google search function available directly on your Android device. In addition to its Google Web search capabilities, users can also search their local device and applications too. The only caveat with Quick Search is that users must opt-in to search their applications.
Advantages:
  • The only search function your device will ever need
  • Leverages the power of Google Search
  • Displays results in a consistent framework
  • Available directly from your home screen


Live Wallpapers

Live Wallpapers are interactive backgrounds that are available on your home screen. Most of the current Live Wallpaper apps in this space are of the fun and whimsical type. However, if you wanted your calendar, appointments, or stock streamer available here it can be accomplished.
Advantages:
  • Quick and simple to access
  • Refresh frequency can be customized
  • These are simply apps exposed to the background


Live Folders

A Live Folder is a real-time view of data. Live Folders can be launched from your home screen via a shortcut.
Advantages:
  • Quick and simple to access
  • Data is refreshed in real-time


Status Bar Notifications

Status Bar Notifications conveniently alert the user from the home screen. In addition to an icon or text notification you can also be notified via sound, vibration, or flashing lights.
Advantages:
  • Quick and simple to access
  • Alerts can notify users in real-time

Sunday, March 14, 2010

No Fluff Just Stuff: Minneapolis Summary (Spring)

The No Fluff Just Stuff conference was back in Minneapolis. Here is a brief recap of the sessions I attended:

Friday Sessions

Encryption on the JVM: Boot Camp

Key points:
  • Anything can be cracked with time, money, and hardware. The goal is to make it an infeasible task.
  • The Java Cryptography Extention (JCE) within the JDK is a good library. However, JASYPT was the speakers preferred encryption library.
  • Is all of your sensitive information encrypted?

Encryption on the JVM: Advanced Techniques

Key points:

Hadoop: Divide and Conquer Gigantic Datasets (Intro)

Key points:
  • Hadoop is an extremely performant solution for searching enormous amounts (terabytes) of unstructured data (HTML, XML, images). The performance advantage is achieved from partitioning the search across a cluster of worker nodes.


Keynote: How (not why) Agile Works!

Key points:
  • Agile works for the following three reasons:
    1. It provides continuous feedback loops
    2. Improves communication
    3. It is fun!


Saturday Sessions

Grails - How to Build Enterprise Apps

Key points:
  • The GORM capabilities are nice. It is not necessary to code trivial finder methods. For example, Person.findAllByAgeLessThan(16) is implicitly available. The convention works as follows: .findAllBy(). Very convenient.


Implementing Evolutionary Architecture

Key points:
  • Restful Web Services are appealing because they are scalable and free.
  • What is the value of leveraging Hypermedia as the engine of application state (HATEAOS)? This strategy completely decouples the server-side workflow from the client. For example, imagine we have a wizard-style workflow where the user makes decisions and clicks the "next" button as they continue through each step. As the server processes the requests, it will update the state of the workflow and respond with a list of allowable transitions (URI links) that the user may perform next. What is the advantage? If the workflow changes in the future we only have to update the workflow on the server-side. No client-side changes will be necessary because the server is dynamically driving the UI's navigation by returning the allowable URI links following each request.


Implementing Emergent Design

Key points:
  • Code == Design
  • Delay design decisions until the last responsible moment.
  • Eliminating technical debt must be a continuous process. You may evaluate your technical debt with Sonar.
  • Code analysis tools:
    • ckjm (analyze coupling)
    • x-ray (Eclipse plug-in to analyze system complexity)
    • Structure101 (Currently used on the Spring framework)


HTML 5 ... and the Kitchen Sink

Key points:

Sunday Sessions

Architecting Code for Concurrent Execution

Key points:
  • The preferred design strategy is to manage concurrency concerns at an architectural level. Traditionally, we have leveraged concurrency via Java's synchronized keyword at the method level. Successfully managing concurrency at a low level can become challenging. Instead, prefer to leverage architectural design patterns to simplify concurrency management. Several design patterns for consideration include:
  • Functional languages are inherently thread-safe because all their objects are immutable.


Introducing Spring Roo

Key points:
  • Spring Roo can help provide Grails-like scaffolding. A valuable tool for rapid prototyping.

Sunday, February 7, 2010

Android: Ideal Platform for Busy Java Developers



Android is an appealing technology for Java developers. The platform provides many new capabilities and possibilities. In addition, the learning curve is relatively small.


Learning Curve Matrix
ToolSkillsetDescription
NewExisting
Java XAndroid applications are written using the Java programming language. This should be a major advantage for Android because the Java community is extremely strong.

A skillset that deserves more attention when developing mobile applications is performance. Java developers must adhere to coding practices that optimize performance. Mobile development is the only platform where production devices will run much slower than your local development environment. For example, the emulator running on your local PC will have much greater network bandwidth, RAM, and processing power compared to the mobile devices running in production. Although, within Eclipse you can configure the network speed you want your emulator to simulate. This is a valuable feature for simulating the speed of your application across different performing mobile networks.
Android SDKX The Android SDK is the only new skillset that must be acquired for existing Java developers. The Android developer documentation is very informative and the SDK install has sample applications for nearly every SDK feature. In addition to learning the SDK, developers will also need to become familiar with the Android architecture, lifecycle, and mobile design guidelines. Android's developer documentation contains substantial information within each of these areas.
IDE XThe preferred IDE for developing Android applications is with Eclipse and the Android Development Tools (ADT) plugin. Experienced Eclipse developers should have a complete development environment setup in about ten minutes when following the quick start guide. However, other IDE's are supported for Android development too.
Debugger XDebugging Android applications is simple. It is identical to what you have become accustomed to within Eclipse. Simply set your breakpoints and run your application in Debug mode.

The Dalvik Debug Monitor Server (DDMS) is an extremely helpful debug tool that's included within the ADT plugin. It contains features for monitoring threads, CPU usage, memory consumption, and garbage collection. In addition, it allows the developer to mock incoming calls, SMS messages, location controls (GPS positioning), and network speed and latency.
Deploy XRunning your Android application is identical to running a Java application. Within Eclipse, you simply right-click on your project and select Run As -> Android Application.


Again, the ideal advantage Android has for Java developers is the rapid setup and the productivity of leveraging many existing skills. Mobile development requires application developers to think in a slightly new paradigm. Android allows Java developers to focus on this new paradigm exclusively.


Favorite Android Links

Saturday, January 16, 2010

Bulletproof SSO with SAML 2.0

Bulletproof status is difficult to achieve. Even bulletproof glass is a myth. Is it possible to achieve bulletproof status with an SSO implementation? First, lets start with a code review checklist of assertions that must all pass in order to achieve bulletproof status.

Code Review Checklist for a Web Browser SSO Profile


The Web Browser SSO Profile with Redirect/POST bindings is the most common SSO implementation. The checklist will focus primarily on this profile. If interested, Google has an extremely helpful static demo and reference implementation of this SSO profile online.

Validate Message Confidentiality and Integrity

  • SSL 3.0 is the most common solution to guarantee message confidentiality and integrity. Refer to SAML Security (section 4) for additional information. This step will help counter the following attacks:
    • Eavesdropping 7.1.1.1
    • Theft of User Authentication Information 7.1.1.2
    • Theft of the Bearer Token 7.1.1.3
    • Message Deletion 7.1.1.6
    • Message Modification 7.1.1.7
    • Man-in-the-middle 7.1.1.8

  • A digitally signed message with a certified key is the most common solution to guarantee message integrity and authentication. Refer to SAML Security (section 4) for additional information. This step will help counter the following attacks:
    • Man-in-the-middle 6.4.2
    • Forged Assertion 6.4.3

Validate Protocol Usage

This is a common area for security gaps. In fact, Google's original SSO implementation suffered from a severe security flaw in this area. The flaw was identified with SATMC, a state-of-the-art model checker for security protocols. Their SSO profile was vulnerable to a Man-in-the-middle attack from a malicious SP (Service Provider). As ironic as it seems, the SSO Web Browser Profile is most susceptible to attacks from trusted partners. This particular security flaw was exposed because the SAML Response did not contain all of the required data elements necessary for a secure message exchange. Following the SAML Profile usage requirements for AuthnRequest (4.1.4.1) and Response (4.1.4.2) will help counter this attack. The Formal Analysis team documented these requirements in much simpler notation. Their documentation for required data elements were as follows:
  • AuthnRequest(ID, SP); An AuthnRequest must contain and ID and SP. Where ID is a string uniquely identifying the request and an SP identifies the Service Provider that initiated the request. Furthermore, the request ID attribute must be returned in the response (InResponseTo="<requestId>"). InResponseTo helps guarantee authenticity of the response from the trusted IdP. This was one of the missing attributes that left Google's SSO vulnerable.

  • Response(ID, SP, IdP, {AA} K -1/IdP); A Response must contain all these elements. Where ID is a string uniquely identifying the response. SP identifies the recipient of the response. IdP identifies the identity provider authorizing the response. {AA} K -1/IdP is the assertion digitally signed with the private key of the IdP.

  • AuthAssert(ID, C, IdP, SP); An authentication assertion must exist within the Response. It must contain an ID, a client (C), an identity provider (IdP), and a service provider (SP) identifier.

Validate Protocol Processing Rules

This is another common area for security gaps simply because of the vast number of steps to assert. Processing a SAML response is an expensive operation but all steps must be validated.
  • Validate AuthnRequest processing rules. Refer to SAML Core (3.4.1.4) for all AuthnRequest processing rules. This step will help counter the following attacks:
    • Man-in-the-middle (6.4.2)

  • Validate Response processing rules. Refer to SAML Profiles (4.1.4.3) for all Response processing rules. This step will help counter the following attacks:
    • Stolen Assertion (6.4.1)
    • Man-in-the-middle (6.4.2)
    • Forged Assertion (6.4.3)
    • Browser State Exposure (6.4.4)

Validate Binding Implementation

  • For an HTTP Redirect Binding refer to SAML Binding (3.4). To view an encoding example, you may want to reference RequestUtil.java found within Google's reference implementation.

  • For an HTTP POST Binding refer to SAML Binding (3.5). The caching considerations are also very important. If a SAML protocol message gets cached, it can subsequently be used as a Stolen Assertion (6.4.1) or Replay (6.4.5) attack.

Validate Security Countermeasures

Revisit each security threat that exists within the SAML Security document and assert you have applied the appropriate countermeasures for threats that may exist for your particular implementation. Additional countermeasures considererd should include:
  • Prefer IP Filtering when appropriate. For example, this countermeasure could have prevented Google's initial security flaw if Google provided each trusted partner with a separate endpoint and setup an IP filter for each endpoint. This step will help counter the following attacks:
    • Stolen Assertion (6.4.1)
    • Man-in-the-middle (6.4.2)

  • Prefer short lifetimes on the SAML Response. This step will help counter the following attacks:
    • Stolen Assertion (6.4.1)
    • Browser State Exposure (6.4.4)

  • Prefer OneTimeUse on the SAML Response. This step will help counter the following attacks:
    • Browser State Exposure (6.4.4)
    • Replay (6.4.5)


Need an architectural diagram? The SAML technical overview contains the most complete diagrams. For the Web Browser SSO Profile with Redirect/POST bindings refer to the section 4.1.3. In fact, of all the SAML documentation, the technical overview is the most valuable from a high-level perspective.