2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 13,000 times in 2014. If it were a concert at Sydney Opera House, it would take about 5 sold-out performances for that many people to see it.

Click here to see the complete report.

Microsoft takes .NET open source and cross-platform,adds new development capabilities with Visual Studio 2015, .NET 2015 and Visual Studio Online

NEW YORK — Nov. 12, 2014 — On Wednesday, Microsoft Corp. reinforced its commitment to cross-platform developer experiences by open sourcing the full server-side .NET stack and expanding .NET to run on the Linux and Mac OS platforms. Microsoft also released Visual Studio Community 2013, a new free edition of Visual Studio that provides easy access to the Visual Studio core toolset. The announcements kicked off Microsoft’s Connect (); event, where the company released Visual Studio 2015 Preview and .NET 2015 Preview.

“With billions of devices in the market today, developers need tools that target many different form factors and platforms,” said S. Somasegar, corporate vice president, Developer Division, Microsoft. “Through Visual Studio and .NET we are committed to delivering a comprehensive end-to-end solution for developers to build and manage applications across multiple devices and platforms.”

Open, accessible and cross-platform

Delivering on its promise to support cross-platform development, Microsoft is providing the full .NET server stack in open source, including ASP.NET, the .NET compiler, the .NET Core Runtime, Framework and Libraries, enabling developers to build with .NET across Windows, Mac or Linux. Through this implementation, Microsoft will work closely with the open source community, taking contributions for future improvements to .NET and will work through the .NET Foundation.

“A strong, open source, cross-platform CLR opens significant new options for building large server-based systems,” said Brian McCallister, chief technology officer, Groupon. “This significantly expands the choices developers have when finding the right tool to solve their problem. I’m very excited to have access to the quality virtual machine and tooling of the CLR without having to completely rework our production infrastructure in order to run it!”

Visual Studio for every developer

Available Wednesday, Visual Studio Community 2013 is a free, fully featured edition of Visual Studio including full extensibility. Targeting any platform, from devices and desktop, to Web and cloud services, the community edition provides developers with easy access to Microsoft’s Visual Studio toolset for all nonenterprise application development. Developers can get started with Visual Studio Community 2013 here.

Visual Studio 2015 and .NET 2015: build for any device

Built from the ground up with support for iOS, Android and Windows, Visual Studio 2015 Preview makes it easier for developers to build applications and services for any device, on any platform.

To further support cross-platform mobile development with .NET, as part of their strategic partnership, Microsoft and Xamarin announced a new streamlined experience for installing Xamarin from Visual Studio, as well as announced the addition of Visual Studio support to its free offering Xamarin Starter Edition — available later in the year. In addition, for Web developers interested in building cloud-powered apps that target mobile devices, Microsoft delivered the final release of Apache Cordova tools. Developers can get started Visual Studio 2015 Preview here.

Building for the cloud

Microsoft on Wednesday announced the preview of ASP.NET 5.0, a streamlined framework and runtime optimized for cloud and server workloads. In addition, the new Connected Services Manager in Visual Studio 2015 makes it easier to connect applications to line-of-business API services such as the Office 365 API and SalesForce, among others.

Visual Studio Online: Agility and DevOps in the cloud

Building on a year of service enhancements, Microsoft announced additional capabilities for Visual Studio Online, its online service for development projects, by announcing additional capabilities for the service, including these:

  • Release Management as a service, available in preview, to enable customers to automate and manage application releases without the need to set up or maintain any service infrastructure.
  • Cloud Deployment Projects, to allow organizations to more easily and reliably provision and configure development, test and production environments in Azure.

Visual Studio 2013 update 4

Also on Wednesday, Microsoft announced the availability of Visual Studio 2013 Update 4, the fourth fully featured update in the past 12 months, which includes various productivity enhancements and additional capabilities. Download and product information can be found here.

Founded in 1975, Microsoft (Nasdaq “MSFT”) is the worldwide leader in software, services, devices and solutions that help people and businesses realize their full potential.

Note to editors: For more information, news and perspectives from Microsoft, please visit the Microsoft News Center athttp://news.microsoft.com. Web links, telephone numbers and titles were correct at time of publication, but may have changed. For additional assistance, journalists and analysts may contact Microsoft’s Rapid Response Team or other appropriate contacts listed at http://news.microsoft.com/microsoft-public-relations-contacts/.


Reference: http://news.microsoft.com/2014/11/12/microsoft-takes-net-open-source-and-cross-platform-adds-new-development-capabilities-with-visual-studio-2015-net-2015-and-visual-studio-online/

Material design with Polymer


Table of contents


Material design is a unified system of visual, motion, and interaction design that adapts across different devices. Material design is inspired by tactile materials, such as paper and ink. Material surfaces interact in a shared space. Surfaces can have elevation (z-height) and cast shadows on other surfaces to convey relationships.

Polymer’s paper elements collection implements material design for the web. The Polymer core elements collection provides a number of unthemed elements that you can use to achieve material design app layouts, transitions, and scrolling effects.

For more detail on the material design philosophy and guidelines, see the Material design specification.

For a sample of the material design patterns in use, see the Topeka sample app.

For quick visual demos of many of the paper elements, see the Paper elements sampler.

The Polymer core elements set includes several elements for application layout, including creating toolbars, app bars, tabs, and side nav consistent with the material design guidelines.

See Layout elements for information on using these elements.

To work well with the Polymer layout elements, you should make sure other parts of your app follow the same metrics described in the material design spec, such as:

  • Baseline grids
  • Keylines
  • Touch target size

Material design uses icons extensively. Polymer provides access to a large variety of scalable, tintable SVG icons using the <core-icon> element and its associated icon sets. Using <core-icon> can be as simple as:

<link rel="import" href="/components/core-icons/core-icons.html">
<core-icon icon="info"></core-icon>

core-icons.html is a utility import that includes the <core-icon> element and the default icon set, which includes over 150 common icons. Here are a few examples:

For details on using <core-icon> and its relatives, see Using core icons.

The paper elements collection includes a number of material-themed controls for all common areas of your application. The following table shows the common controls.

More examples
Toggle button
Icon button
More examples
Floating action button
Radio buttons
Progress bar
More examples

Dialogs, snackbars and toasts all appear as a separate sheet, overlaying the background. The paper element collection includes two elements.

  • A dialog (<paper-dialog>) is a modal window that can include a title, text, action buttons, and other controls.
  • A snackbar or toast (<paper-toast>) is a small, transient popup that includes a message and optionally a single action (such as “undo”).

Use the <paper-dialog> element to create a dialog. Set a title on a dialog using the heading published property.

You can use any kind of children inside the dialog. For action buttons, add the dismissive or affirmativeattributes to place the controls (typically buttons) at the bottom of the dialog:

  • dismissive actions, like Cancel, close the dialog and return to the previous screen without making changes. They’re displayed on the left.
  • affirmative actions, like OK or Save continue a process or confirm a decision. They’re displayed on the right.

The following example creates a dialog with two buttons:

<paper-dialog id="dialog" heading="Launch?"
  <p>This app would like to launch a small, unmanned vehicle
     into space.</p>
  <paper-button label="Cancel" dismissive></paper-button>
  <paper-button label="OK" affirmative default></paper-button>

In this example, the default button has a default attribute. The dialog doesn’t apply any special treatment for a default option; you can style it differently using CSS.

Dialogs are hidden by default. Call the dialog’s toggle method to show or hide it.

More examples

A <paper-toast> element appears at the bottom of the screen or on the lower-left on mobile. Use the textattribute to specify the text to display.

<paper-toast id="toast" text="Your draft has been discarded."></paper-toast>

Like a dialog, a <paper-toast> is hidden by default. Call the element’s open method to display it. The toast disappears after a timeout, or can be dismissed by swiping.

More examples

When designing your own components or using generic HTML elements such as <div>s, you can add material design effects using the <paper-ripple> and <paper-shadow> elements.

Material responds to input events with an touch ripple effect: an animation that moves out radially from the origin of the event. These effects are built into the paper elements collection:

When working with other elements, you can use the <paper-ripple> element to create a touch ripple effect.

To use <paper-ripple>, declare a <paper-ripple> element as a child of the element you want to add the effect to:

<div style="position: relative;">
  <paper-ripple fit></paper-ripple>

Touch the cards and icon below to see ripple effects.

Default ripple

Colored ripple

Circular ripple

The <paper-ripple> should be position: absolute and sized to fit the parent element. In this example, the fit layout attribute is used to position the ripple appropriately. (See layout attributes for information on fit and other layout attributes.)

You can clip the ripple to a circle by adding the circle class to the ripple’s classlist. Circular ripples are used for small buttons used in a grid layout (for example, icon buttons, number pads).

You can set the color of the ripple using the color CSS property.

paper-ripple {
  color: red;

When using a paper element, check the element API doc to find the CSS selector to style the ripple. Most elements that have a ripple have a <paper-ripple> in the shadow DOM with an ID of ink or ripple. For example, to style a button:

paper-button::shadow #ripple {
  color: blue;

To style a checkbox:

paper-checkbox::shadow #ink {
  color: blue;

Material has an apparent elevation (z-height) and casts shadows. In Polymer, elements can have a z-height between 0 and 5. Material can raise or lower in response to user input.

The paper-elements have shadow effects built-in. For example, a <paper-button> declared with theraisedButton attribute appears raised above thesurface it rests on, and raises up when touched.

When building your own elements or using standard DOM elements, you can use the <paper-shadow>element to create the appropriate shadow effect.

To apply a shadow to an element, simply add a <paper-shadow> element as a child element of a relatively positioned element. The <paper-shadow> element automatically adds the shadow to its parent element:

 <div style="width: 100px; height: 100px;" relative>
   <paper-shadow z="3"></paper-shadow>

You can change the z-height of the target element by setting z on the <paper-shadow> element. Z values range from 0 (no shadow) to 5.

z = 1

z = 3

z = 5

The apparent height of the element (the z-height value) is absolute — that is, an element with a z-height of 3 casts the same size shadow regardless of the z-heights of the background elements. In addition, the z-height does not affect the stacking order of elements. To change stacking order of sibling elements, use the z-indexCSS property as usual.

You can apply a shadow to a different element (other than the parent element) by setting the<paper-shadow> element’s target property. However, the target must still be an element that accepts children. (For example, you can’t add a shadow directly to an <img> element.)

Note: The <paper-shadow> element sets its target to overflow: visible so the shadows are visible outside of the element’s borders. If you need to clip inner content, use another container inside the shadowed container.

More examples

Support for transitions is rapidly evolving. The <core-animated-pages> element displays a single child element at a time, and provides support for sophisticated transitions between two children, or pages.

You can define a set of transitions to be executed when transitioning between pages. To provide visual continuity across transitions, animated pages support hero transitions, where a selected element on the starting page appears to morph into a related element on the ending page. Use hero transitions to link important elements together, while using a simpler transition such as a cross-fade for the remaining elements.

For example transitions, see the <core-animated-pages> demos. The Topeka sample app also demonstrates a number of transitions in context.

The <core-scroll-header-panel> element supports a number of scrolling effects described in the material design spec, including condensing and expanding the toolbar as the user scrolls and hiding or showing the toolbar.

For resizing toolbars, <core-scroll-header-panel> lets you define how to transition the toolbar’s contents between states — resizing text, showing or hiding /components, and cross-fading between backgrounds, for example.

See the <core-scroll-header-panel> demos for some examples of the effects possible.


reference: https://www.polymer-project.org/docs/elements/material.html

Live up Presentation on PowerPoint with SSRS

This post talks about incorporating the report into Office/PowerPoint as opposed to exporting to these formats. The report information is positioned at the selected location in the document, and for it to stay as refreshable content.

1) Incorporating in Microsoft Word

I thought this might be possible, using Fields in Word, and with some poking about I managed to get it to work.

Firstly, open your Word document and insert a Field object:

Make the field type “Include Text” and paste in the URL to your SSRS report.

The format of the URL looks like this (again, assuming you are using SSRS in integrated mode with SharePoint):


More information on the URL format can be found here:


You can also use a “LINK” field to embed the report output – this gives a little more flexibility in how the content is to be interpreted.

To refresh the object, simply right click on the report content:


2) Incorporating in PowerPoint

Unfortunately there isn’t any native way to do the same thing, as PPT doesn’t have the same concept of the Field object that we can use as a container for the SSRS output. We can embed the report output as an image into the document by inserting an image and pasting in the URL to the report as shown below:


However, this doesn’t retain the link information so the image is not refreshable.

Enter a very useful PPT addin called LiveWeb. It allows you to embed a web frame onto a PPT slide and have it refresh each time you run the slide show. So by providing the appropriate URL to the report viewer we can have updating SSRS output directly into our PPT. Woot!


A couple of caveats:

  • It seems the addin only works with the 32-bit edition of Office. I was getting error messages when I tried to use it with my host machine 64-bit installation.
  • It’s an addin so it’s a separate file that would need to be deployed to each client machine that need to run these slide shows.
  • The content of the web page is only shown when the slideshow is running – in edit mode there is a placeholder image as shown below.


At the suggestion of Shashank (Me Smile), I did some further fiddling to see if we could get a similar result by embedding a Word document with an embedded IncludeText field into the PowerPoint slide. And as it turns out, it works!

Firstly, open Word and link in your required SSRS output as documented in point 1 above. Then select the part of the Word document that includes the field and chose “Copy”. Hint: to accurately select the field, right-click on it and choose “Toggle Field Codes”.

Then go to PowerPoint and on the slide where you want the content, insert an Object and select a Microsoft Word Document – this will place a Word frame on the slide:


You can then paste the selected text from the Word document into this frame and the Field object will still allow you to refresh the SSRS content:


Reference: http://blogs.technet.com/b/sqlman/archive/2010/06/15/incorporating-reporting-services-reports-in-word-and-powerpoint.aspx

What is ITIL?

What is ITIL?

ITIL is the most widely adopted approach for IT Service Management in the world.  It provides a practical, no-nonsense framework for identifying, planning, delivering and supporting IT services to the business.

ITIL: Overview and Benefits

ITIL advocates that IT services must be aligned to the needs of the business and underpin the core business processes. It provides guidance to organizations on how to use IT as a tool to facilitate business change, transformation and growth.

The ITIL best practices are currently detailed within five core publications which provide a systematic and professional approach to the management of IT services, enabling organizations to deliver appropriate services and continually ensure they are meeting business goals and delivering benefits.

The five core guides map the entire ITIL Service Lifecycle, beginning with the identification of customer needs and drivers of IT requirements, through to the design and implementation of the service into operation and finally, on to the monitoring and improvement phase of the service.

Adopting ITIL can offer users a huge range of benefits that include:

  • improved IT services
  • reduced costs
  • improved customer satisfaction through a more professional approach to service delivery
  • improved productivity
  • improved use of skills and experience
  • improved delivery of third party service.

For further information on the ITIL Service Management approach and its benefits, see pdf  ITIL: The Basics White Paper.

For further information on the Benefits of ITIL, see pdf  Executive Briefing: ITIL Benefits.

ITIL Users

ITIL has been adopted by thousands of organizations worldwide, such as NASA, the UK National Health Service (NHS), HSBC bank and Disney™. ITIL is also supported by quality services from a wide range of providers including examination institutes, accredited training providers and consultancies, software and tool vendors and well known service providers such as IBM, Telefonica, HP and British telecom (BT).

A comprehensive qualifications scheme offering a variety of training courses and certifications has been developed against the guidance. This scheme can help organizations to effectively implement ITIL, achieving success by ensuring that employees have the relevant knowledge, skills and techniques, but most importantly, ensuring the entire organization is using a common language and are fully invested in the process.

ITIL Best Practices also underpin the foundations of ISO/IEC 20000 (previously BS15000), the International Service Management Standard for organizational certification and compliance. Organizations can therefore implement ITIL to achieve organizational certification.

Further ITIL Resources

Further information on ITIL, its practical application and benefits can be downloaded from the Best Management Practice website. See the links below to access this information:

pdf An Introductory Overview of ITIL – a free to download publication published by TSO in association with it SMFi.

ITIL Technical and White Papers – a series of papers on ITIL and its alignment with other service management approaches.

pdf Using PRINCE2 and ITIL together – this Case Study explains how using ITIL and PRINCE2 helped successfully set up an offshore service desk.

pdf Disney’s ITIL Journey – a case study on Disney’s adoption of ITIL


Reference: http://www.itil-officialsite.com/WhatisITIL.aspx

9-step CIO survival guide

1.Don’t Panic!

Change creates opportunities. The current state of flux means you now have the opportunity to define what the role of CIO means to your organization. “CIOs are actually in a unique position because their roles are evolving,” says Mighael Botha, CTO North America at Software AG. “In finance, things are pretty much the same quarter-to-quarter and year-to-year. But CIOs can go out and say, ‘This is what I want this role to mean for my organization.’ It’s time to strategically look at what you can do to really accelerate the business.”

2.Assess Your Process Landscape

In IT, it’s common to talk about the 80/20 barrier: You spend 80 percent of your time and resources keeping the lights on, leaving 20 percent for innovation. And innovation is required if you want to transform the role of the CIO. There’s no magic bullet to change that ratio, but you can move the needle in the right direction a little bit at a time.

“The first thing to really look at is your process landscape within IT,” says Botha. “You have to really identify the areas that take up the most of your time. Look for ways to streamline and automate internal IT processes. Maybe I can automate some things that would enable me to move the need from 80 to 75.”

3.Identify Your Staff’s Talents and Form a Strike Team

Getting the right people in the right positions can help you carve out more time to innovate. Identify the talents of the various people on your staff, make sure you have them in the right positions and ask them how their jobs could be streamlined to spend less time on maintenance and more on innovation. Consider forming an ‘IT strike team’ focused on research and development.

“If you get like-minded individuals together that you can task with a certain goal, you sometimes get more momentum,” Botha says. “They want to enact that change. Positive thinking and positive actions grow additional positive thoughts and ideas. It sparks new interest in getting stuff done more productively.”

4.Stop Saying ‘No!’

Historically, a big part of the CIO’s role has been taking cost out of the business. In many cases, this has led to ‘no’ as the first response to user requests. Rather than saying ‘no,’ seek to understand the user’s problem and seek a solution. Otherwise, today’s users will simply go around you. “‘No’ has become the word I hate the most from my staff ,” says Noah Broadwater, CTO of Sesame Workshop, the producer of Sesame Street. “Instead, you say: ‘I understand, let me look into a solution.’ If you say, ‘Let me understand what you’re trying to solve, and I’ll try to help you,’ then they don’t go around you.”

5.Embrace Enable and Govern Strategy

Removing ‘no’ from the vocabulary doesn’t mean abdicating responsibility for security, but it does mean ‘centralize and control’ can no longer be your guiding doctrine. Instead, you need to embrace the idea of ‘enable and govern.’

“Users just show up with their iPads and smartphones,” says Kevin Wright, CIO and senior vice president of Services and Technology at Softchoice. “For IT it’s created this situation where if we continue to try to control, centralize and block, we’ll fail. If we allow it to all just happen, then data doesn’t get governed, security gets breached and complexity increases. We need to enable the business and give them benefits while governing them.”

6.Leave Your Office

Changing the way IT supports and services the business requires truly understanding the needs of the business. You can’t do that from your desk. “Today, the budget has really moved away from the CIO,” Botha says. “The dollars really sit with the business owners. It is important for the CIO to get more in touch with the business, to learn the lingo, to really understand the vertical space you’re responsible for. The only way to do it is really to get into the field. A good starting point might be an industry get-together.”

7.Seek the Sponsorship of Your C-Level Peers

You can’t transform IT by yourself. You need the sponsorship of your C-level peers. A steering committee with stakeholders from across the business, including other functions like HR and legal, can help. And it’s important to help them understand that transforming the IT function is a process; it won’t happen overnight.

“I don’t think transforming IT into a business partner is something you can accomplish in a year,” Botha says. “It’s really about establishing a roadmap. IT has historically been a reactive business as opposed to a proactive business. You need to explain the roadmap for their success and get input from them about how IT can become a better business partner. And you need to measure success and report back on that success.”

8.Talk to Partners

When getting in touch with the business, don’t limit yourself to understanding the challenges of internal stakeholders. Sit down with your company’s business customers, partners and suppliers. Learn what’s going on in their businesses and how you can help your company become a better business partner.

9.Prototype Rapidly

Plan big, start small, fail fast and scale appropriately. When undertaking new projects, ground them in business objectives and simple metrics, and fight for a single, empowered business owner who can guide the big picture direction and tactical decisions of the project. Pilot as soon as possible and get user feedback to guide the future direction.

“The CIO of the future may look a lot like a venture capitalist—maintaining principles for what makes a solid investment, defining the boundaries upon which deals will be conducted, and driving funding, staffing and strategic support based on often-changing needs and the emerging value of individual initiatives,” say Suketu Gandhi, principal of Deloitte Consulting, and Bill Briggs, director of Deloitte Consulting.

Reference: http://www.itworld.com/slideshow/129276/9-step-cio-survival-guide-383389#slide11

What is Domino?

Domino is the name of the applications and messaging server program for the Lotus Corporation‘s Lotus Notes product, a sophisticated groupware application that is installed in many corporations. Notes lets a corporation and its workers develop communications- anddatabase-oriented applications so that users at different geographic locations can share files with each other, comment on them publicly or privately (to groups with special access), keep track of development schedules, work projects, guidelines and procedures, plans, white papers, and many other documents, including multimedia files. Lotus uses the Domino name to refer to a set of Notes server applications. Notes itself refers to the overall product.

 Ask your Lotus Domino questions at ITKnowledgeExchange.com

The Notes and Domino servers interact with other Notes/Domino servers in a distributednetwork. As changes are made to a database at one server, updates are continually forwarded to replicated copies of these databases at the other servers so that users are always looking at the same information. In general, Notes follows the client/server model. The replication updates are made using Remote Procedure Call (RPC) requests. Notes can be coordinated with Web servers and applications on a company’s intranet.
Reference : http://searchdomino.techtarget.com/definition/Domino

AS/400 (IBM iSeries, AS/400e, eServer iSeries/400)

The AS/400 – formally renamed the “IBM iSeries,” but still commonly known as AS/400 – is a midrange server designed for small businesses and departments in large enterprises and now redesigned so that it will work well in distributed networks with Web applications. The AS/400 uses the PowerPC microprocessor with its reduced instruction set computertechnology. Its operating system is called the OS/400. With multi-terabytes of disk storage and a Java virtual memory closely tied into the operating system, IBM hopes to make the AS/400 a kind of versatile all-purpose server that can replace PC servers and Web servers in the world’s businesses, competing with both Wintel and UNIX servers, while giving its present enormous customer base an immediate leap into the Internet.

 Ask your AS/400 questions at ITKnowledgeExchange.com

The AS/400, one of IBM’s greatest success stories, is widely installed in large enterprises at the department level, in small corporations, in government agencies, and in almost every industry segment. It succeeded another highly popular product, the System/36 and was itself based on a later, more sophisticated product, the System/38. AS/400 customers can choose from thousands of applications that have already been written and many have been “Web-enabled.” IBM points to the AS/400’s “uptime” of 99.9%.

The AS/400 comes with a database built-in. One widely-installed option is Domino (Noteswith a Web browser).

According to IBM, these are some important new uses for the AS/400:

  • Data warehousing: With multi-gigabytes of RAM and multi-terabytes of hard disk space, the AS/400 can be a repository for large amounts of company data to which data mining could be applied.
  • Java application development: With its closely integrated Java virtual machine and new tools designed by IBM for building commercial applications with Java, the AS/400 can be used as a development system.
  • Web and e-commerce serving: Equipped with a Web server and applications designed to support e-commerce (taking orders, tracking orders, providing service to customers, working with partners and suppliers) and with firewall capabilities, the AS/400 can handle Internet serving for a moderate-size company.
  • Corporate groupware services: Assuming that Domino and Notes have been included with the system, it’s designed to quickly provide a corporation with sophisticated e-mail, project file sharing, whiteboards, and electronic collaboration.

Reference: http://search400.techtarget.com/definition/AS-400

How to decode MTSMS Origination number in Oracle PL/SQL?

CDR is generally known as data file for storing Traffic in Telecom Company.
With ASN.1 format decoder, It could not convert all value of each field in CDR.

Incoming SMS is an example.

How to decode it to be readable with the following hexa number?

Origination field value:

****************************CDR 9958****************************
cdr_type: MTSMSRecord
location:(LAC: 03 F3 CELLID: 76 C3)
deliveryTime:2013-04-01 09:45:35 + 0700
basicService:( 21)
additionalChgInfo:( 02)


********************************* Oralce Function *********************************

create or replace function fx_GetSMSOriginationNumber(origin VARCHAR2)

return varchar2 is
v_str VARCHAR2(1000);
v_str2 varchar2(1000);
v_rev_str varchar2(1000);
v_firstChar VARCHAR2(10);
n_loop_n number := 0;

FOR i IN 1..length(origin)/2 LOOP

v_rev_str := ”;
v_rev_str := substr(origin,(n_loop_n + 1),2);

SELECT REVERSE(v_rev_str) INTO v_rev_str from dual;

v_str2 := v_str2 || v_rev_str;

n_loop_n := n_loop_n + 2;


v_firstChar := substr(v_str2,1,1);

–if LENGTH(TRIM(TRANSLATE(v_firstChar, ‘ +-.0123456789′, ‘ ‘))) = ” then
if to_number(v_firstChar) < 1 then
v_str2 := utl_raw.cast_to_varchar2(hextoraw(v_str2)) ;
v_str2 := substr(v_str2,1,LENGTH(v_str2) – 1);
end if;

return v_str2;



Mobile Network Operators and the Cloud

Olafur Ingthorsson is an IT professional in Reykjavik, Iceland who writes about cloud computing at Cloud Computing Topics

I recently had an interesting discussion with a UK-based consultant about the role of mobile network operators (MNOs) in the cloud and how they would deal with the surging mobile traffic. The discussion also related to data centers, network interconnections and proximity of data.

This article is the first of two about our conversation and is a general description of how I see MNOs currently positioned to the cloud. The second article will be somewhat more technically inclined.

Telecoms are late entering the cloud domain

Companies bring different perspectives to cloud computing, depending on their market, location, jurisdiction, and industry. In addition, the “cloud” has a very open meaning and encompasses a variety of configurations, mainly public, private and hybrid clouds.

Generally it has been said that SMEs and startups are more inclined to go for public cloud services (web servers, storage, etc.), while larger companies move more cautiously and either prefer to establish a private cloud environment or a hybrid context. When it comes to software as a service (SaaS), it‘s clear that companies of all sizes are already moving a lot of services into the cloud, including CRM (Salesforce), email and office applications (Office365, Google Apps, etc). I believe this trend will continue. These services and some others that do not entail sensitive data have been successfully delivered cross-borders and continents, without even enterprise customers necessarily knowing the exact location of data or data centers origin.

When it comes to telecoms and data centers or cloud services, I think they are in a unique but fragile situation. Many telecoms already possess large and distributed data centers that have been used for hosting and colocation services for many years. However, compared to cloud services, these have generally been expensive, closed and slow in service provisioning. Most telecoms are late in entering the cloud ecosystem that already offers agility, self-service, pay-as-you-go and other cloud characteristics. However, there is also difference between geographical markets. For example, U.S. telecom providers like Verizon have been very keen on deploying enterprise-class cloud services, especially though their acquisition of Terremarkearlier this year.

Telecoms still have some important advantages, especially through existing, and often strong, customer relationship, billing expertise and customer services. All these are important for companies wanting to deploy cloud services in one way or another. Having said this, telecoms, through their existing customer relationship, can offer various bundling of cloud and telecom and/or network services making it still more feasible for customers to retain and expand their business with their telecom service provider. Also, industries that are moving cautiously to the cloud, including financial services and the health-sector, may be more likely to trust their current provider that can guarantee network performance and proximity of data.

When it comes to colocation services in particular, I believe these will gradually be replaced with “remote private cloud” services, like those Amazon and Rackspace are already offering. Companies can obtain a reserved infrastructure and extend their local network into a remote data center that can be accessed through secure and managed networks like MPLS via VPN, IPsec or similar. I am not fully aware how far telecoms have gone in offering remote private cloud services, assuming full web-based self-service and immediate access to infrastructure.

Mobile operators and the cloud

I personally do not think that mobile operators (MNOs) will be particularly strong in running data center based cloud applications and services. Their effort will mostly be gocused on the delivery of cloud service. through the core mobile network and the radio network itself.

However, to provide an improved service delivery, they may select to deploy managed network connections to any of the important cloud providers, but not rely totally upon Internet connections. Another issue is to “fetch” content that is being replicated and made accessible near to the end-user. This is already being done in increased manner through Content Delivery Networks like Akamai and Limelight Networks.

MNOs could possibly develop a strong proposition as cloud brokers, delivering selected cloud services and bundling with others services and billing – similar to telecoms perhaps. Although possible, this is not a straightforward approach, especially since the leading smartphone platform makers (Apple, Google) tend to shape the ecosystem according to their own strategy.  MNOs and telecoms are not exactly known for their agility and software prowess, compared to many others.

When it comes to LTE (long term evolution), the mobile network will have the ability to deliver cloud services better and faster with an increased bandwidth capacity of up to 100Mbit/s within each cell – and a pure IP-based traffic all the way to the handset. It should still not be forgotten that the bandwidth is a shared medium, so the service delivery can vary according to the number of users and usage pattern in each cell.

However, as the mobile core and radio network are domains of the MNOs, delivery and service quality can be managed up to a certain degree. Still, latency and congestion will continue to occur, but not necessarily within the mobile network, but perhaps somewhere in the backbone, such as in the Internet.

Backhaul in 4G mobile networks should not necessarily be a limiting factor, as LTE will mostly be restricted to cities and largely populated areas where network capacity and bandwidth are normally in abundance. As for proximity to cloud services, I believe these will increasingly be solved through CDNs as is already happening. Popular content is being replicated or cached to the edges, making it faster to deliver to end-users.

Reference : http://www.datacenterknowledge.com/archives/2011/10/31/mobile-network-operators-and-the-cloud/

The Profit Opportunities of Cloud Computing for Telecom Operators


Rising traffic volumes, falling incomes, the difficulties of managing facility investment and the increasingly complex needs of Business Continuity Planning are all examples of how the environment of Telecom Operators is changing. It is against this backdrop that many Operators have started to address the possibilities of Cloud-based business.
There have been many examples of Operators who have tentatively started free Cloud businesses, but are these really examples of a full Cloud business? Is it even possible to make money from Cloud businesses? These are common questions, and to answer them, Shinya Kukita of NEC replies:

Cloud services combine IT service provisioning capabilities with Network connectivity. A Cloud business has many advantages for Operators because they already possess the necessary tangible assets of IT and network capabilities, plus many relevant intangible assets such as a track record of trusted service, a large local customer base of SME with whom they are regularly in contact. Most importantly, they have the trust of their customers – nearly all customers view Operators as reliable, safe and secure enough to entrust them with valuable data.”

How Should Operators Take Advantage of their Strengths to Build a Profitable Business?

Ken Sugata responds:
“Operators provide telecommunication services, and are established entities in every country in which they operate (as well as being subject to each country’s local regulations). In the early days of Cloud Computing, when the ideal was for services to be globally homogeneous, Operators’ local presence and image were seen as a handicap, but it is now turning out to be quite the opposite. Operators should make their local or regional presence a key part of their Cloud business’ strategy. In particular, they should work together with local software vendors and expand their services from their SME and LME customer base in each market. One key area, as I see it, is for cloud applications to be customized for SMEs that have not heavily invested in IT up to now. These services should not simply be copies of general applications designed for the needs of large enterprises but take into account their business characteristics and conditions.”

Furthermore, a close eye should be kept on the trends in enterprise and Cloud services. For example, for large businesses, cloud-based general clerical software has come full circle but industry verticals, such as healthcare, education, retail and logistics are looking to reduce their investment in traditional IT solutions making them likely prospects as customers.

An Advantage of Cloud business is Synergy.

Cloud business is evolving to be more than just connecting IT resources and services. The next wave will address the specific needs of vertical industries such as healthcare, education, retail and government. This will result in increasing amounts of data being accumulated from outside the cloud, and the growing need to integrate services and processes will require a wider range of sensors and devices to be linked with an Operator’s Cloud.

Increasingly, Machine-to-machine (M2M) communications are coming to the forefront of services focused on vertical industries. This is a prime opportunity for Operators to both start and expand a Cloud business.

Reference: http://www.nec.com/en/global/solutions/cloud/innovation/

Advanced NFC for Android

This document describes advanced NFC topics, such as working with various tag technologies, writing to NFC tags, and foreground dispatching, which allows an application in the foreground to handle intents even when other applications filter for the same ones.

Working with Supported Tag Technologies

When working with NFC tags and Android-powered devices, the main format you use to read and write data on tags is NDEF. When a device scans a tag with NDEF data, Android provides support in parsing the message and delivering it in an NdefMessage when possible. There are cases, however, when you scan a tag that does not contain NDEF data or when the NDEF data could not be mapped to a MIME type or URI. In these cases, you need to open communication directly with the tag and read and write to it with your own protocol (in raw bytes). Android provides generic support for these use cases with the android.nfc.tech package, which is described in Table 1. You can use the getTechList() method to determine the technologies supported by the tag and create the corresponding TagTechnology object with one of classes provided by android.nfc.tech

Table 1. Supported tag technologies

Class Description
TagTechnology The interface that all tag technology classes must implement.
NfcA Provides access to NFC-A (ISO 14443-3A) properties and I/O operations.
NfcB Provides access to NFC-B (ISO 14443-3B) properties and I/O operations.
NfcF Provides access to NFC-F (JIS 6319-4) properties and I/O operations.
NfcV Provides access to NFC-V (ISO 15693) properties and I/O operations.
IsoDep Provides access to ISO-DEP (ISO 14443-4) properties and I/O operations.
Ndef Provides access to NDEF data and operations on NFC tags that have been formatted as NDEF.
NdefFormatable Provides a format operations for tags that may be NDEF formattable.

The following tag technlogies are not required to be supported by Android-powered devices.

Table 2. Optional supported tag technologies

Class Description
MifareClassic Provides access to MIFARE Classic properties and I/O operations, if this Android device supports MIFARE.
MifareUltralight Provides access to MIFARE Ultralight properties and I/O operations, if this Android device supports MIFARE.

Working with tag technologies and the ACTION_TECH_DISCOVERED intent

When a device scans a tag that has NDEF data on it, but could not be mapped to a MIME or URI, the tag dispatch system tries to start an activity with the ACTION_TECH_DISCOVERED intent. The ACTION_TECH_DISCOVERED is also used when a tag with non-NDEF data is scanned. Having this fallback allows you to work with the data on the tag directly if the tag dispatch system could not parse it for you. The basic steps when working with tag technologies are as follows:

  1. Filter for an ACTION_TECH_DISCOVERED intent specifying the tag technologies that you want to handle. SeeFiltering for NFC intents for more information. In general, the tag dispatch system tries to start aACTION_TECH_DISCOVERED intent when an NDEF message cannot be mapped to a MIME type or URI, or if the tag scanned did not contain NDEF data. For more information on how this is determined, see The Tag Dispatch System.
  2. When your application receives the intent, obtain the Tag object from the intent:
    Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
  3. Obtain an instance of a TagTechnology, by calling one of the get factory methods of the classes in theandroid.nfc.tech package. You can enumerate the supported technologies of the tag by callinggetTechList() before calling a get factory method. For example, to obtain an instance ofMifareUltralight from a Tag, do the following:

Reading and writing to tags

Reading and writing to an NFC tag involves obtaining the tag from the intent and opening communication with the tag. You must define your own protocol stack to read and write data to the tag. Keep in mind, however, that you can still read and write NDEF data when working directly with a tag. It is up to you how you want to structure things. The following example shows how to work with a MIFARE Ultralight tag.

package com.example.android.nfc;

import android.nfc.Tag;
import android.nfc.tech.MifareUltralight;
import android.util.Log;
import java.io.IOException;
import java.nio.charset.Charset;

public class MifareUltralightTagTester {

    private static final String TAG = MifareUltralightTagTester.class.getSimpleName();

    public void writeTag(Tag tag, String tagText) {
        MifareUltralight ultralight = MifareUltralight.get(tag);
        try {
            ultralight.writePage(4, "abcd".getBytes(Charset.forName("US-ASCII")));
            ultralight.writePage(5, "efgh".getBytes(Charset.forName("US-ASCII")));
            ultralight.writePage(6, "ijkl".getBytes(Charset.forName("US-ASCII")));
            ultralight.writePage(7, "mnop".getBytes(Charset.forName("US-ASCII")));
        } catch (IOException e) {
            Log.e(TAG, "IOException while closing MifareUltralight...", e);
        } finally {
            try {
            } catch (IOException e) {
                Log.e(TAG, "IOException while closing MifareUltralight...", e);

    public String readTag(Tag tag) {
        MifareUltralight mifare = MifareUltralight.get(tag);
        try {
            byte[] payload = mifare.readPages(4);
            return new String(payload, Charset.forName("US-ASCII"));
        } catch (IOException e) {
            Log.e(TAG, "IOException while writing MifareUltralight
            message...", e);
        } finally {
            if (mifare != null) {
               try {
               catch (IOException e) {
                   Log.e(TAG, "Error closing tag...", e);
        return null;

Using the Foreground Dispatch System

The foreground dispatch system allows an activity to intercept an intent and claim priority over other activities that handle the same intent. Using this system involves constructing a few data structures for the Android system to be able to send the appropriate intents to your application. To enable the foreground dispatch system:

    1. Add the following code in the onCreate() method of your activity:
      1. Create a PendingIntent object so the Android system can populate it with the details of the tag when it is scanned.
        PendingIntent pendingIntent = PendingIntent.getActivity(
            this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
      2. Declare intent filters to handle the intents that you want to intercept. The foreground dispatch system checks the specified intent filters with the intent that is received when the device scans a tag. If it matches, then your application handles the intent. If it does not match, the foreground dispatch system falls back to the intent dispatch system. Specifying a null array of intent filters and technology filters, specifies that you want to filter for all tags that fallback to the TAG_DISCOVERED intent. The code snippet below handles all MIME types for NDEF_DISCOVERED. You should only handle the ones that you need.
        IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED);
            try {
                ndef.addDataType("*/*");    /* Handles all MIME based dispatches.
                                               You should specify only the ones that you need. */
            catch (MalformedMimeTypeException e) {
                throw new RuntimeException("fail", e);
           intentFiltersArray = new IntentFilter[] {ndef, };
      3. Set up an array of tag technologies that your application wants to handle. Call theObject.class.getName() method to obtain the class of the technology that you want to support.
        techListsArray = new String[][] { new String[] { NfcF.class.getName() } };
    2. Override the following activity lifecycle callbacks and add logic to enable and disable the foreground dispatch when the activity loses (onPause()) and regains (onResume()) focus.enableForegroundDispatch() must be called from the main thread and only when the activity is in the foreground (calling in onResume() guarantees this). You also need to implement the onNewIntent callback to process the data from the scanned NFC tag.
public void onPause() {

public void onResume() {
    mAdapter.enableForegroundDispatch(this, pendingIntent, intentFiltersArray, techListsArray);

public void onNewIntent(Intent intent) {
    Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
    //do something with tagFromIntent

See the ForegroundDispatch sample from API Demos for the complete sample.

Reference : http://developer.android.com/guide/topics/connectivity/nfc/advanced-nfc.html

NFC Basics for Android

This document describes the basic NFC tasks you perform in Android. It explains how to send and receive NFC data in the form of NDEF messages and describes the Android framework APIs that support these features. For more advanced topics, including a discussion of working with non-NDEF data, see Advanced NFC.

There are two major uses cases when working with NDEF data and Android:

  • Reading NDEF data from an NFC tag
  • Beaming NDEF messages from one device to another with Android Beam™

Reading NDEF data from an NFC tag is handled with the tag dispatch system, which analyzes discovered NFC tags, appropriately categorizes the data, and starts an application that is interested in the categorized data. An application that wants to handle the scanned NFC tag can declare an intent filter and request to handle the data.

The Android Beam™ feature allows a device to push an NDEF message onto another device by physically tapping the devices together. This interaction provides an easier way to send data than other wireless technologies like Bluetooth, because with NFC, no manual device discovery or pairing is required. The connection is automatically started when two devices come into range. Android Beam is available through a set of NFC APIs, so any application can transmit information between devices. For example, the Contacts, Browser, and YouTube applications use Android Beam to share contacts, web pages, and videos with other devices.

The Tag Dispatch System

Android-powered devices are usually looking for NFC tags when the screen is unlocked, unless NFC is disabled in the device’s Settings menu. When an Android-powered device discovers an NFC tag, the desired behavior is to have the most appropriate activity handle the intent without asking the user what application to use. Because devices scan NFC tags at a very short range, it is likely that making users manually select an activity would force them to move the device away from the tag and break the connection. You should develop your activity to only handle the NFC tags that your activity cares about to prevent the Activity Chooser from appearing.

To help you with this goal, Android provides a special tag dispatch system that analyzes scanned NFC tags, parses them, and tries to locate applications that are interested in the scanned data. It does this by:

  1. Parsing the NFC tag and figuring out the MIME type or a URI that identifies the data payload in the tag.
  2. Encapsulating the MIME type or URI and the payload into an intent. These first two steps are described inHow NFC tags are mapped to MIME types and URIs.
  3. Starts an activity based on the intent. This is described in How NFC Tags are Dispatched to Applications.

How NFC tags are mapped to MIME types and URIs

Before you begin writing your NFC applications, it is important to understand the different types of NFC tags, how the tag dispatch system parses NFC tags, and the special work that the tag dispatch system does when it detects an NDEF message. NFC tags come in a wide array of technologies and can also have data written to them in many different ways. Android has the most support for the NDEF standard, which is defined by the NFC Forum.

NDEF data is encapsulated inside a message (NdefMessage) that contains one or more records (NdefRecord). Each NDEF record must be well-formed according to the specification of the type of record that you want to create. Android also supports other types of tags that do not contain NDEF data, which you can work with by using the classes in the android.nfc.tech package. To learn more about these technologies, see theAdvanced NFC topic. Working with these other types of tags involves writing your own protocol stack to communicate with the tags, so we recommend using NDEF when possible for ease of development and maximum support for Android-powered devices.

Note: To download complete NDEF specifications, go to the NFC Forum Specification Download site and seeCreating common types of NDEF records for examples of how to construct NDEF records.

Now that you have some background in NFC tags, the following sections describe in more detail how Android handles NDEF formatted tags. When an Android-powered device scans an NFC tag containing NDEF formatted data, it parses the message and tries to figure out the data’s MIME type or identifying URI. To do this, the system reads the first NdefRecord inside the NdefMessage to determine how to interpret the entire NDEF message (an NDEF message can have multiple NDEF records). In a well-formed NDEF message, the first NdefRecordcontains the following fields:

3-bit TNF (Type Name Format)
Indicates how to interpret the variable length type field. Valid values are described in described in Table 1.
Variable length type
Describes the type of the record. If using TNF_WELL_KNOWN, use this field to specify the Record Type Definition (RTD). Valid RTD values are described in Table 2.
Variable length ID
A unique identifier for the record. This field is not used often, but if you need to uniquely identify a tag, you can create an ID for it.
Variable length payload
The actual data payload that you want to read or write. An NDEF message can contain multiple NDEF records, so don’t assume the full payload is in the first NDEF record of the NDEF message.

The tag dispatch system uses the TNF and type fields to try to map a MIME type or URI to the NDEF message. If successful, it encapsulates that information inside of a ACTION_NDEF_DISCOVERED intent along with the actual payload. However, there are cases when the tag dispatch system cannot determine the type of data based on the first NDEF record. This happens when the NDEF data cannot be mapped to a MIME type or URI, or when the NFC tag does not contain NDEF data to begin with. In such cases, a Tag object that has information about the tag’s technologies and the payload are encapsulated inside of a ACTION_TECH_DISCOVERED intent instead.

Table 1. describes how the tag dispatch system maps TNF and type fields to MIME types or URIs. It also describes which TNFs cannot be mapped to a MIME type or URI. In these cases, the tag dispatch system falls back to ACTION_TECH_DISCOVERED.

For example, if the tag dispatch system encounters a record of type TNF_ABSOLUTE_URI, it maps the variable length type field of that record into a URI. The tag dispatch system encapsulates that URI in the data field of anACTION_NDEF_DISCOVERED intent along with other information about the tag, such as the payload. On the other hand, if it encounters a record of type TNF_UNKNOWN, it creates an intent that encapsulates the tag’s technologies instead.

Table 1. Supported TNFs and their mappings

Type Name Format (TNF) Mapping
TNF_ABSOLUTE_URI URI based on the type field.
TNF_EXTERNAL_TYPE URI based on the URN in the type field. The URN is encoded into the NDEF type field in a shortened form: <domain_name>:<service_name>. Android maps this to a URI in the form: vnd.android.nfc://ext/<domain_name>:<service_name>.
TNF_MIME_MEDIA MIME type based on the type field.
TNF_UNCHANGED Invalid in the first record, so falls back to ACTION_TECH_DISCOVERED.
TNF_WELL_KNOWN MIME type or URI depending on the Record Type Definition (RTD), which you set in the type field. See Table 2. for more information on available RTDs and their mappings.

Table 2. Supported RTDs for TNF_WELL_KNOWN and their mappings

Record Type Definition (RTD) Mapping
RTD_SMART_POSTER URI based on parsing the payload.
RTD_TEXT MIME type of text/plain.
RTD_URI URI based on payload.

How NFC Tags are Dispatched to Applications

When the tag dispatch system is done creating an intent that encapsulates the NFC tag and its identifying information, it sends the intent to an interested application that filters for the intent. If more than one application can handle the intent, the Activity Chooser is presented so the user can select the Activity. The tag dispatch system defines three intents, which are listed in order of highest to lowest priority:

  1. ACTION_NDEF_DISCOVERED: This intent is used to start an Activity when a tag that contains an NDEF payload is scanned and is of a recognized type. This is the highest priority intent, and the tag dispatch system tries to start an Activity with this intent before any other intent, whenever possible.
  2. ACTION_TECH_DISCOVERED: If no activities register to handle the ACTION_NDEF_DISCOVERED intent, the tag dispatch system tries to start an application with this intent. This intent is also directly started (without starting ACTION_NDEF_DISCOVERED first) if the tag that is scanned contains NDEF data that cannot be mapped to a MIME type or URI, or if the tag does not contain NDEF data but is of a known tag technology.
  3. ACTION_TAG_DISCOVERED: This intent is started if no activities handle the ACTION_NDEF_DISCOVERED orACTION_TECH_DISCOVERED intents.

The basic way the tag dispatch system works is as follows:

  1. Try to start an Activity with the intent that was created by the tag dispatch system when parsing the NFC tag (either ACTION_NDEF_DISCOVERED or ACTION_TECH_DISCOVERED).
  2. If no activities filter for that intent, try to start an Activity with the next lowest priority intent (eitherACTION_TECH_DISCOVERED or ACTION_TAG_DISCOVERED) until an application filters for the intent or until the tag dispatch system tries all possible intents.
  3. If no applications filter for any of the intents, do nothing.

Figure 1. Tag Dispatch System

Whenever possible, work with NDEF messages and the ACTION_NDEF_DISCOVERED intent, because it is the most specific out of the three. This intent allows you to start your application at a more appropriate time than the other two intents, giving the user a better experience.

Requesting NFC Access in the Android Manifest

Before you can access a device’s NFC hardware and properly handle NFC intents, declare these items in yourAndroidManifest.xml file:

  • The NFC <uses-permission> element to access the NFC hardware:
    <uses-permission android:name="android.permission.NFC" />
  • The minimum SDK version that your application can support. API level 9 only supports limited tag dispatch via ACTION_TAG_DISCOVERED, and only gives access to NDEF messages via the EXTRA_NDEF_MESSAGESextra. No other tag properties or I/O operations are accessible. API level 10 includes comprehensive reader/writer support as well as foreground NDEF pushing, and API level 14 provides an easier way to push NDEF messages to other devices with Android Beam and extra convenience methods to create NDEF records.
    <uses-sdk android:minSdkVersion="10"/>
  • The uses-feature element so that your application shows up in Google Play only for devices that have NFC hardware:
    <uses-feature android:name="android.hardware.nfc" android:required="true" />

    If your application uses NFC functionality, but that functionality is not crucial to your application, you can omit the uses-feature element and check for NFC avalailbility at runtime by checking to see ifgetDefaultAdapter() is null.

Filtering for NFC Intents

To start your application when an NFC tag that you want to handle is scanned, your application can filter for one, two, or all three of the NFC intents in the Android manifest. However, you usually want to filter for theACTION_NDEF_DISCOVERED intent for the most control of when your application starts. TheACTION_TECH_DISCOVERED intent is a fallback for ACTION_NDEF_DISCOVERED when no applications filter forACTION_NDEF_DISCOVERED or for when the payload is not NDEF. Filtering for ACTION_TAG_DISCOVERED is usually too general of a category to filter on. Many applications will filter for ACTION_NDEF_DISCOVERED orACTION_TECH_DISCOVERED before ACTION_TAG_DISCOVERED, so your application has a low probability of starting. ACTION_TAG_DISCOVERED is only available as a last resort for applications to filter for in the cases where no other applications are installed to handle the ACTION_NDEF_DISCOVERED orACTION_TECH_DISCOVEREDintent.

Because NFC tag deployments vary and are many times not under your control, this is not always possible, which is why you can fallback to the other two intents when necessary. When you have control over the types of tags and data written, it is recommended that you use NDEF to format your tags. The following sections describe how to filter for each type of intent.


To filter for ACTION_NDEF_DISCOVERED intents, declare the intent filter along with the type of data that you want to filter for. The following example filters for ACTION_NDEF_DISCOVERED intents with a MIME type oftext/plain:

    <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <data android:mimeType="text/plain" />

The following example filters for a URI in the form of http://developer.android.com/index.html.

    <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
    <category android:name="android.intent.category.DEFAULT"/>
   <data android:scheme="http"
              android:pathPrefix="/index.html" />


If your activity filters for the ACTION_TECH_DISCOVERED intent, you must create an XML resource file that specifies the technologies that your activity supports within a tech-list set. Your activity is considered a match if a tech-list set is a subset of the technologies that are supported by the tag, which you can obtain by calling getTechList().

For example, if the tag that is scanned supports MifareClassic, NdefFormatable, and NfcA, your tech-list set must specify all three, two, or one of the technologies (and nothing else) in order for your activity to be matched.

The following sample defines all of the technologies. You can remove the ones that you do not need. Save this file (you can name it anything you wish) in the <project-root>/res/xml folder.

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

You can also specify multiple tech-list sets. Each of the tech-list sets is considered independently, and your activity is considered a match if any single tech-list set is a subset of the technologies that are returned by getTechList(). This provides AND and OR semantics for matching technologies. The following example matches tags that can support the NfcA and Ndef technologies or can support the NfcB and Ndef technologies:

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

In your AndroidManifest.xml file, specify the resource file that you just created in the <meta-data> element inside the <activity> element like in the following example:

    <action android:name="android.nfc.action.TECH_DISCOVERED"/>

<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
    android:resource="@xml/nfc_tech_filter" />

For more information about working with tag technologies and the ACTION_TECH_DISCOVERED intent, seeWorking with Supported Tag Technologies in the Advanced NFC document.


To filter for ACTION_TAG_DISCOVERED use the following intent filter:

    <action android:name="android.nfc.action.TAG_DISCOVERED"/>

Obtaining information from intents

If an activity starts because of an NFC intent, you can obtain information about the scanned NFC tag from the intent. Intents can contain the following extras depending on the tag that was scanned:

To obtain these extras, check to see if your activity was launched with one of the NFC intents to ensure that a tag was scanned, and then obtain the extras out of the intent. The following example checks for theACTION_NDEF_DISCOVERED intent and gets the NDEF messages from an intent extra.

public void onResume() {
    if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {
        Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
        if (rawMsgs != null) {
            msgs = new NdefMessage[rawMsgs.length];
            for (int i = 0; i < rawMsgs.length; i++) {
                msgs[i] = (NdefMessage) rawMsgs[i];
    //process the msgs array

Alternatively, you can obtain a Tag object from the intent, which will contain the payload and allow you to enumerate the tag’s technologies:

Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);

Creating Common Types of NDEF Records

This section describes how to create common types of NDEF records to help you when writing to NFC tags or sending data with Android Beam. Starting with Android 4.0 (API level 14), the createUri() method is available to help you create URI records automatically. Starting in Android 4.1 (API level 16), createExternal() andcreateMime() are available to help you create MIME and external type NDEF records. Use these helper methods whenever possible to avoid mistakes when manually creating NDEF records.

This section also describes how to create the corresponding intent filter for the record. All of these NDEF record examples should be in the first NDEF record of the NDEF message that you are writing to a tag or beaming.


Note: We recommend that you use the RTD_URI type instead of TNF_ABSOLUTE_URI, because it is more efficient.

You can create a TNF_ABSOLUTE_URI NDEF record in the following way:

NdefRecord uriRecord = new NdefRecord(
    NdefRecord.TNF_ABSOLUTE_URI ,
    new byte[0], new byte[0]);

The intent filter for the previous NDEF record would look like this:

    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="http"
        android:pathPrefix="/index.html" />


You can create a TNF_MIME_MEDIA NDEF record in the following ways.

Using the createMime() method:

NdefRecord mimeRecord = NdefRecord.createMime("application/vnd.com.example.android.beam",
    "Beam me up, Android".getBytes(Charset.forName("US-ASCII")));

Creating the NdefRecord manually:

NdefRecord mimeRecord = new NdefRecord(
    NdefRecord.TNF_MIME_MEDIA ,
    new byte[0], "Beam me up, Android!".getBytes(Charset.forName("US-ASCII")));

The intent filter for the previous NDEF records would look like this:

    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="application/vnd.com.example.android.beam" />


You can create a TNF_WELL_KNOWN NDEF record in the following way:

public NdefRecord createTextRecord(String payload, Locale locale, boolean encodeInUtf8) {
    byte[] langBytes = locale.getLanguage().getBytes(Charset.forName("US-ASCII"));
    Charset utfEncoding = encodeInUtf8 ? Charset.forName("UTF-8") : Charset.forName("UTF-16");
    byte[] textBytes = payload.getBytes(utfEncoding);
    int utfBit = encodeInUtf8 ? 0 : (1 << 7);
    char status = (char) (utfBit + langBytes.length);
    byte[] data = new byte[1 + langBytes.length + textBytes.length];
    data[0] = (byte) status;
    System.arraycopy(langBytes, 0, data, 1, langBytes.length);
    System.arraycopy(textBytes, 0, data, 1 + langBytes.length, textBytes.length);
    NdefRecord record = new NdefRecord(NdefRecord.TNF_WELL_KNOWN,
    NdefRecord.RTD_TEXT, new byte[0], data);
    return record;

the intent filter would look like this:

    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="text/plain" />


You can create a TNF_WELL_KNOWN NDEF record in the following ways.

Using the createUri(String) method:

NdefRecord rtdUriRecord1 = NdefRecord.createUri("http://example.com");

Using the createUri(Uri) method:

Uri uri = new Uri("http://example.com");
NdefRecord rtdUriRecord2 = NdefRecord.createUri(uri);

Creating the NdefRecord manually:

byte[] uriField = "example.com".getBytes(Charset.forName("US-ASCII"));
byte[] payload = new byte[uriField.length + 1];              //add 1 for the URI Prefix
byte payload[0] = 0x01;                                      //prefixes http://www. to the URI
System.arraycopy(uriField, 0, payload, 1, uriField.length);  //appends URI to payload
NdefRecord rtdUriRecord = new NdefRecord(
    NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_URI, new byte[0], payload);

The intent filter for the previous NDEF records would look like this:

    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="http"
        android:pathPrefix="" />


You can create a TNF_EXTERNAL_TYPE NDEF record in the following ways:

Using the createExternal() method:

byte[] payload; //assign to your data
String domain = "com.example"; //usually your app's package name
String type = "externalType";
NdefRecord extRecord = NdefRecord.createExternal(domain, type, payload);

Creating the NdefRecord manually:

byte[] payload;
NdefRecord extRecord = new NdefRecord(
    NdefRecord.TNF_EXTERNAL_TYPE, "com.example:externalType", new byte[0], payload);

The intent filter for the previous NDEF records would look like this:

    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="vnd.android.nfc"

Use TNF_EXTERNAL_TYPE for more generic NFC tag deployments to better support both Android-powered and non-Android-powered devices.

Note: URNs for TNF_EXTERNAL_TYPE have a canonical format of:urn:nfc:ext:example.com:externalType, however the NFC Forum RTD specification declares that theurn:nfc:ext: portion of the URN must be ommitted from the NDEF record. So all you need to provide is the domain (example.com in the example) and type (externalType in the example) separated by a colon. When dispatching TNF_EXTERNAL_TYPE, Android converts the urn:nfc:ext:example.com:externalType URN to a vnd.android.nfc://ext/example.com:externalType URI, which is what the intent filter in the example declares.

Android Application Records

Introduced in Android 4.0 (API level 14), an Android Application Record (AAR) provides a stronger certainty that your application is started when an NFC tag is scanned. An AAR has the package name of an application embedded inside an NDEF record. You can add an AAR to any NDEF record of your NDEF message, because Android searches the entire NDEF message for AARs. If it finds an AAR, it starts the application based on the package name inside the AAR. If the application is not present on the device, Google Play is launched to download the application.

AARs are useful if you want to prevent other applications from filtering for the same intent and potentially handling specific tags that you have deployed. AARs are only supported at the application level, because of the package name constraint, and not at the Activity level as with intent filtering. If you want to handle an intent at the Activity level, use intent filters.

If a tag contains an AAR, the tag dispatch system dispatches in the following manner:

  1. Try to start an Activity using an intent filter as normal. If the Activity that matches the intent also matches the AAR, start the Activity.
  2. If the Activity that filters for the intent does not match the AAR, if multiple Activities can handle the intent, or if no Activity handles the intent, start the application specified by the AAR.
  3. If no application can start with the AAR, go to Google Play to download the application based on the AAR.


Note: You can override AARs and the intent dispatch system with the foreground dispatch system, which allows a foreground activity to have priority when an NFC tag is discovered. With this method, the activity must be in the foreground to override AARs and the intent dispatch system.

If you still want to filter for scanned tags that do not contain an AAR, you can declare intent filters as normal. This is useful if your application is interested in other tags that do not contain an AAR. For example, maybe you want to guarantee that your application handles proprietary tags that you deploy as well as general tags deployed by third parties. Keep in mind that AARs are specific to Android 4.0 devices or later, so when deploying tags, you most likely want to use a combination of AARs and MIME types/URIs to support the widest range of devices. In addition, when you deploy NFC tags, think about how you want to write your NFC tags to enable support for the most devices (Android-powered and other devices). You can do this by defining a relatively unique MIME type or URI to make it easier for applications to distinguish.

Android provides a simple API to create an AAR, createApplicationRecord(). All you need to do is embed the AAR anywhere in your NdefMessage. You do not want to use the first record of your NdefMessage, unless the AAR is the only record in the NdefMessage. This is because the Android system checks the first record of anNdefMessage to determine the MIME type or URI of the tag, which is used to create an intent for applications to filter. The following code shows you how to create an AAR:

NdefMessage msg = new NdefMessage(
        new NdefRecord[] {

Beaming NDEF Messages to Other Devices

Android Beam allows simple peer-to-peer data exchange between two Android-powered devices. The application that wants to beam data to another device must be in the foreground and the device receiving the data must not be locked. When the beaming device comes in close enough contact with a receiving device, the beaming device displays the “Touch to Beam” UI. The user can then choose whether or not to beam the message to the receiving device.

Note: Foreground NDEF pushing was available at API level 10, which provides similar functionality to Android Beam. These APIs have since been deprecated, but are available to support older devices. SeeenableForegroundNdefPush() for more information.

You can enable Android Beam for your application by calling one of the two methods:

An activity can only push one NDEF message at a time, so setNdefPushMessageCallback() takes precedence over setNdefPushMessage() if both are set. To use Android Beam, the following general guidelines must be met:

  • The activity that is beaming the data must be in the foreground. Both devices must have their screens unlocked.
  • You must encapsulate the data that you are beaming in an NdefMessage object.
  • The NFC device that is receiving the beamed data must support the com.android.npp NDEF push protocol or NFC Forum’s SNEP (Simple NDEF Exchange Protocol). The com.android.npp protocol is required for devices on API level 9 (Android 2.3) to API level 13 (Android 3.2). com.android.npp and SNEP are both required on API level 14 (Android 4.0) and later.

Note: If your activity enables Android Beam and is in the foreground, the standard intent dispatch system is disabled. However, if your activity also enables foreground dispatching, then it can still scan tags that match the intent filters set in the foreground dispatching.

To enable Android Beam:

  1. Create an NdefMessage that contains the NdefRecords that you want to push onto the other device.
  2. Call setNdefPushMessage() with a NdefMessage or call setNdefPushMessageCallback passing in aNfcAdapter.CreateNdefMessageCallback object in the onCreate() method of your activity. These methods require at least one activity that you want to enable with Android Beam, along with an optional list of other activities to activate.In general, you normally use setNdefPushMessage() if your Activity only needs to push the same NDEF message at all times, when two devices are in range to communicate. You usesetNdefPushMessageCallback when your application cares about the current context of the application and wants to push an NDEF message depending on what the user is doing in your application.

The following sample shows how a simple activity calls NfcAdapter.CreateNdefMessageCallback in theonCreate() method of an activity (see AndroidBeamDemo for the complete sample). This example also has methods to help you create a MIME record:

package com.example.android.beam;

import android.app.Activity;
import android.content.Intent;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.NfcAdapter.CreateNdefMessageCallback;
import android.nfc.NfcEvent;
import android.os.Bundle;
import android.os.Parcelable;
import android.widget.TextView;
import android.widget.Toast;
import java.nio.charset.Charset;

public class Beam extends Activity implements CreateNdefMessageCallback {
    NfcAdapter mNfcAdapter;
    TextView textView;

    public void onCreate(Bundle savedInstanceState) {
        TextView textView = (TextView) findViewById(R.id.textView);
        // Check for available NFC Adapter
        mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
        if (mNfcAdapter == null) {
            Toast.makeText(this, "NFC is not available", Toast.LENGTH_LONG).show();
        // Register callback
        mNfcAdapter.setNdefPushMessageCallback(this, this);

    public NdefMessage createNdefMessage(NfcEvent event) {
        String text = ("Beam me up, Android!\n\n" +
                "Beam Time: " + System.currentTimeMillis());
        NdefMessage msg = new NdefMessage(
                new NdefRecord[] { createMime(
                        "application/vnd.com.example.android.beam", text.getBytes())
          * The Android Application Record (AAR) is commented out. When a device
          * receives a push with an AAR in it, the application specified in the AAR
          * is guaranteed to run. The AAR overrides the tag dispatch system.
          * You can add it back in to guarantee that this
          * activity starts when receiving a beamed message. For now, this code
          * uses the tag dispatch system.
        return msg;

    public void onResume() {
        // Check to see that the Activity started due to an Android Beam
        if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {

    public void onNewIntent(Intent intent) {
        // onResume gets called after this to handle the intent

     * Parses the NDEF Message from the intent and prints to the TextView
    void processIntent(Intent intent) {
        textView = (TextView) findViewById(R.id.textView);
        Parcelable[] rawMsgs = intent.getParcelableArrayExtra(
        // only one message sent during the beam
        NdefMessage msg = (NdefMessage) rawMsgs[0];
        // record 0 contains the MIME type, record 1 is the AAR, if present
        textView.setText(new String(msg.getRecords()[0].getPayload()));

Note that this code comments out an AAR, which you can remove. If you enable the AAR, the application specified in the AAR always receives the Android Beam message. If the application is not present, Google Play is started to download the application. Therefore, the following intent filter is not technically necessary for Android 4.0 devices or later if the AAR is used:

  <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
  <category android:name="android.intent.category.DEFAULT"/>
  <data android:mimeType="application/vnd.com.example.android.beam"/>

With this intent filter, the com.example.android.beam application now can be started when it scans an NFC tag or receives an Android Beam with an AAR of type com.example.android.beam, or when an NDEF formatted message contains a MIME record of type application/vnd.com.example.android.beam.

Even though AARs guarantee an application is started or downloaded, intent filters are recommended, because they let you start an Activity of your choice in your application instead of always starting the main Activity within the package specified by an AAR. AARs do not have Activity level granularity. Also, because some Android-powered devices do not support AARs, you should also embed identifying information in the first NDEF record of your NDEF messages and filter for that as well, just in case. See Creating Common Types of NDEF records for more information on how to create records.

Reference : http://developer.android.com/guide/topics/connectivity/nfc/nfc.html

Nielsen survey: Social media sucking up most of our time

Dec 8, 2012 5:00 AM

Americans, you are spending every waking minute of your life online—or at least a sizable portion of your days.

According to Nielsen’s 2012 Social Media Report released this week, Americans spent 121 billion minutes on social networking sites between July 2011 and July 2012, up from 88 billion the previous year. Apps captured a large portion of those minutes, accounting for a third of overall social networking time.


The percentage of time Americans spent on social networking sites rose 37 percent to 121 billion minutes in the last year.


Facebook topped the list of most-visited social networks, as expected, but time spent on Pinterest’s website increased by more than 1000 percent year-over-year. Google+, Tumblr, and Twitter are also growing in popularity (and sucking away more of your time).

Apparently, spending all this time socializing online makes us feel really good about life. Nielsen reports that 76 percent of users have positive feelings after checking in on social networking sites. (Another fun fact: a third of 18- to 34-year-olds are on social media sites while using the bathroom. Way to multitask, everyone.)


During June 2012, a third of active Twitter users tweeted about TV-related content.


So, what exactly are we talking about when we’re Facebooking, tweeting, Tumbling, and pinning? A lot of our conversations revolve around what we’re watching on TV and trouble we’re having with companies. Data on the “second screen” phenomenon—using your smartphone or tablet while watching TV—is solidifying. Nielsen reports that 44 percent of American tablet owners and 38 percent of smartphone users have their devices in hand while watching TV. Almost half of those surveyed by Nielsen said they used social media to reach out to companies’ customer service arms.

Not surprisingly, mobile Web and smartphone apps are driving the increase in our online time, by 82 percent and 85 percent, respectively. Now that we carry our computers around with us wherever we go, tweeting or checking Facebook to pass the time has replaced reading a book or people-watching (unless you’re tweeting about the people you watch).

Social media traffic on PCs has dropped 5 percent in the last year, though time spent on social sites has increased 24 percent, Nielsen says. We may be turning to our phones for Web-surfing, but when we do use PCs, we’re on them for increasingly longer periods of time.

Now put down that phone for a bit and go outside.

reference : http://www.pcworld.com/article/2019194/nielsen-survey-social-media-sucking-up-most-of-our-time.html

Why ‘Do Not Track’ doesn’t change much about web privacy

Cookies were originally used to make logging into websites easier and make the day-to-day browsing experience more convenient for users. These days, only a fraction of the cookies stored inside your browser’s cache are used for logons or your convenience. The vast majority are dropped by ad servers when they place ads on your favorite websites to track your usage history.

Everything you always wanted to know about Web tracking (but were too paranoid to ask) ]

If you think this sounds like an invasion of privacy, you’re not alone. The makers of all the leading browsers agree and offer Do Not Track settings as a way to give users more control over the information that is collected about them.

How it works: When you set your browser to ‘Do Not Track’, the DNT=1 bit is sent by your browser with every HTTP request for a website, telling the website that you don’t want to be tracked by third-party cookies before it even loads. This should prevent the storage of third-party cookies and only allow cookies of the website you actually visited to be saved. The header clearly states that you’re opting out of analysis and, thus, behavioral ads. But DNT is not an ad blocking mechanism: Once enabled (and if a website supports it), it’s not going to turn your web into an ad free zone.


Trace your typical browsing routine with Firefox Collusion

To get a sense of how many ad networks really collect your data, I suggest you try the (free) FirefoxCollusion ad-on. Once enabled, it gives you a visual representation of how many ad networks placed cookies on your machine. Go ahead and visit 10-15 of your favorite websites and see what happens.


What’s wrong with DNT?

As I see it, there are four problems with DNT currently.

1. Once you enable DNT, you’ll see the real problem with it: You’re going to have the same old browsing experience you always had. Browsers can send the DNT=1 header until the cows come home, but if websites don’t accept it, there’s little to prevent the ad servers from dropping cookies.

The FTC urged ad companies to set up DNT and — to everyone’s surprise — the DAA (Digital Advertising Alliance) followed. But currently, Twitter is one of the few websites that actively respect DNT. Most websites see DNT as what it is: a voluntary setting.

2. Users may find the web a more annoying place to be with DNT enabled. For example, I saw car rental ads on the tech websites I visit regularly just because I browsed for rental cars a few days ago — that’s creepy and unwanted, yes, but at least it’s relevant. With DNT enabled, I still get ads, they’re just less targeted.

3. As I previously mentioned, Microsoft decided to enable DNT by default when the user opts for the “Express Settings” in the Windows 8 setup wizard. This move led Apache (which is used by 65% of website all around the world) to ignore the DNT header send by IE10.

4. And last but not least: While the intent of Do Not Track is pretty clear (cookies from a website that the user actively opens is ok, third-party cookies are not), the definition of what exactly a third-party cookie is is open for interpretation. Is a Microsoft ad cookie on a Microsoft website a third-party cookie? Or is it first party? I don’t have the answers. Neither does the W3C committee or any of its partners.

Setting Do Not Track in your browser

Don’t take my word for how well Do Not Track works (or doesn’t, as the case may be). Try it yourself. Here’s how to enable it in IE, Firefox, Chrome, and Safari:

Internet Explorer

IE9 supported Do Not Track, but with IE10 Microsoft has taken it a step further and made it a default setting: During the express setup of Windows 8 (which includes IE10), the “Always send Do Not Track header” is enabled by default. This caused quite a stir with the Tracking Protection Working Group of the W3C. However,Microsoft stuck to the plan and is shipping Windows 8 RTM with the header enabled.

Ad industry calls IE10’s ‘Do Not Track’ setting ‘unacceptable’ ]


Mozilla implemented DNT early with release 4 and is still allowing the user to opt-in using the “Tell web sites I do not want to be tracked” setting.

8 essential privacy extensions for Firefox ]


Google just recently added DNT to build 23 (Chromium). The respective setting can be found under the “Privacy” section of the browsers setting. Google Chrome, however, has yet to add Do Not Track to its developer build. I’m not exactly surprised that Google a big hesitant, as online ad revenue is big business for the search giant.

The smart paranoid’s guide to using Google ]


Apple added DNT with Safari 5. You’ll find this both on Windows and on the Mac in the settings menu under the “Privacy” tab. Just check the “Ask websites not to track me” box and you’re done.

The bottom line

Follow the DNT discussion, enable it if you like, but if you really don’t like being tracked, use tools such as Ad Blocker, DoNotTrackPlus, Ghostery, and NoScript and clean out your local cache regularly.

Now read: The first truly honest privacy policy

reference : http://www.itworld.com/security/299821/do-not-track-great-idea-or-futile-privacy-attempt?page=0,0