Wednesday, March 5, 2008

Does networking sites make profit?

Social networking sites like Facebook/Orkut does benefit by increasing users, how?

1. The higher the users, the more coverage each ad gets. These sites get ads from ad providers & have a robust ad tracking software which tracks the ad coverage, frequency, benefit for ad provider in addition to a plethora of other factors. Hence if ebay provides an ad on facebook, ebay will have an ad tracking software to understand the advantages ebay is having by placing ads. Users click on the adverts on the site & get lured to buy products sometimes. The discussion goes on how ads help in form of banners/lists/flash on sites.

2. These sites track user's behaviour & deliver specific ads which in directed towards each individual depending on his/her behaviour. Thus, the success of ads being potential increases.

3. Today, such networking sites are just one of the many applications provided by software giants. Like Google having orkut, Microsoft having Myspace, etc etc. What they try to do is to maximize users in order to market themselves & attract those users to other products of their's like mail apps, chat apps, etc etc. After all. its an era of marketing gimmicks !

The most popular of the ad provider/consumer products are offered by Google. These are adsense & adwords.

Keep adding inputs.

Tuesday, March 4, 2008

What is Web 2.0?

Since a long time there has been quite a lot of confusion on the definition of Web 2.0. Exactly, what is it? The confusion is caused due to various reasons. One of the major reasons is that whenever anything new comes up in technology, people tend to derive the source of the invention assuming that its something new & fresh. Well, thats not the case with Web 2.0 - it was always there. Just the way its being consumed now has made headlines and brought the buzzword Web 2.0 in the forefront of application developments.

Conceptually, its a knowledge-driven environment. Its the idea, the way, the process rather than anything solid & real and delivers user-rich interactivity. It is also a marketing gimmick to focus on the Web 2.0 techniques in order to collaborate & deliver such contents.

Web 2.0 sites often feature a rich, user-friendly interface based on Ajax, Flex or similar rich media.

The features of this buzzword are:
  • Rich user experience
  • User participation
  • Dynamic content
  • Web standards
Some of the technologies used to render Web 2.0 applications are:
  • Html / javascript / ajax
  • Flex / java / silverlight
  • Tags / meta data
  • Cascading style sheets
  • Xml / json based api
  • Weblogs / blogs
  • Syndication feeds in rss / atom
  • Wiki
  • Mashups
Google is perhaps the pioneer of Web 2.0 but they did not invent Web 2.0. They made use of such techniques which later got termed as standards for Web 2.0 experiences.

This is the definition from my end - will appreciate & acknowledge inputs.

Sunday, March 2, 2008

Flex cross-domain security problem

In this blog I comment on one of the hurdles I faced while executing flex-flash based apps on the net. By a thumb rule flash apps cannot directly access outside urls. I was in this case trying to consume some feed urls for my site and had a hard time understanding the problem initially since I was relatively new to flex.

I had come across the Flash cross-domain security problem & hence my flex apps were not able to connect to outside urls. This is one of the security features on the internet to disallow direct flash access to resources.

There are two ways to avoid this:
1. To allow access to the flash app by giving permission in the crossdomain.xml of the site being accessed.
2. Indirectly access the resources via a php/asp script.

The first option is not feasible since none of the site will expose holes in their security by allowing access to flash apps.

Here, I write about the second feasible option whereby we access the resource (rss feed / web service) via a php/asp script. This PHP script takes a "url" parameter, which is the XML file (or XML-RPC service) you are trying to reach. If you're trying to load http://rss.google.com/rss/topstories.rss, the new url you would access would be something like:
http://www.my_website.com/xml_proxy.php?url=http://rss.google.com/rss/topstories.rss.

Here the name of the php file having the script is xml_proxy.php.

Here is the content of the php file:


$post_data = $HTTP_RAW_POST_DATA;

$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($post_data);

$ch = curl_init( $_GET['url'] );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

if ( strlen($post_data)>0 ){
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}

$response = curl_exec($ch);

if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
print $response;
}

?>

This is a simple script taking the url as the input parameter, hits the remote server, gets the response & prints it out to be consumed by our flex app.
By the way, do remember that your hosting web server should support php executions. Even I got this script from one of the sites on the net. Cheers !

Thursday, February 28, 2008

Google Sites finally launches in Google Apps

Google has finally launched Google Sites. This product comes after buying the wiki company - JotSpot sometime back. They have bundled it with Google Apps & I managed to see the changes today on my extended website on google apps. Its very much like any other web based page editing tools primary having two main features:

First, you can set it up so anyone you want can edit a Google Sites page (or you can keep it private).
And second, it records all changes and lets you change things so you can un-do these edits.

This serves the purpose of multiple people editing pages or creating sites. Also, you dont have to know html in order to publish pages through Google Sites. Google Sites makes it easy to embed other elements from its Apps or Doc suite, including spreadsheets and presentations, and also YouTube videos and iGoogle widgets!

Finally, its Google yet again with a feature packed tool bundled into their spectrum of innovative products. Go Google Go !

J2ME - Item State Listener

How can you find out when the value in the TextField has been changed?

You must use the ItemStateListener interface and register the listener to the form. The easiest way is to implement ItemStateListener on the form that contains your TextField and put your code into the itemStateChanged method.

class MyClass extends Form implements ItemStateListener
{
public MyClass()
{
setItemStateListener(this);
}

public void itemStateChanged(Item item)
{
...
}
}

Another approach would be to create an anonymous class and register it with the form:

public class MyClass extends MIDlet
{
public void startApp()
{
Form form = new Form("My Test");
// an anonymous class
ItemStateListener listener = new ItemStateListener()
{
public void itemStateChanged(Item item)
{
// do something
}
};

// register for events
form.setItemStateListener(listener);
...
display.setCurrent(form);
}
}


This is just one of the concepts of J2ME I have been learning for the last few days. Will keep posting more...

Sunday, February 24, 2008

J2ME Mobile Network Usage - Avoid deadlock

Avoid deadlock situations while connecting to network resources from mobiles. I used to get the following warning while trying to use network resources during a j2me application development:

Warning: To avoid potential deadlock, operations that may block, such as
networking, should be performed in a different thread than the
commandAction() handler.

Here is the way to counter this problem by using a separate thread in order to connect to the network. This ensures avoidance of deadlock situations in your application. In the run method I am calling the getConn() method which connects to the network resource. The next switchDisplayable method was a business requirement to goto the next screen.

new Thread(new Runnable() {

public void run() {
try {
getConn();
switchDisplayable(null, getWaitScreenRegRoom());
} catch (Exception e) {
}
}
}).start();


Comment with better approaches.

Sunday, December 16, 2007

Time Flies

Hi!

As you can see, its been quite a while after which I am writing.... Well - being home time flies like anything. I somehow managed to extract timepieces from my currently very busy schedule & come up with this first version of my site. I plan to put a feedback page soon, time permitting!

For the time being, visitors may just use the comments of my blog to provide their valuable feedback.

See you soon. Till then take care...