Nov 16, 2009

Android Jumpstart - Win HTC Hero Phone







PUNE Google Technology User Group

Pune GTUG presents Android Jumpstart Seminar. A seminar where we would get people excited, thrilled and ready on Android Platform

The Objective about this seminar is as follows

  1. Introduce Android
  2. Introduce the building blocks and architecture
  3. Talk on Building an Application on Android comprising of all the building blocks


Lucky draw winner wins an HTC Hero phone from our esteemed sponsors Quick Office and Synerzip







Date and Time

21st November 2009, Saturday morning 10:00 am to 2:00 p.m

Venue

The Orbett Hotel - 1238/2, Apte Road, Deccan Gymkhana, Pune – 411004

Click here for Location on Google Maps

Registration

Registration is at the Venue. No preregistration of the event. There are no fees

Schedule

  • 10:00 a.m to 10:30 a.m – Registration
  • 10:30 a.m to 12:30 p.m – Seminar
  • 12:30 p.m to 2:00 p.m
  • Talk from QuickOffice + Synerzip for exciting Android Opportunities
  • Lucky Draw to give away HTC Hero Phone

Event is sponsored by Quick Office and Synerzip.


Here is the Presentation we will use for the Seminar

Sep 1, 2009

Seminar on Google Wave - Building Gadgets and Robots

Google Wave is a new model for communication and collaboration on the web, coming later this year.
Here's a preview of just some of the aspects of this new tool.


What is a wave?



A wave is equal parts conversation and document. People can communicate and work together with richly formatted text, photos, videos, maps, and more.
A wave is shared. Any participant can reply anywhere in the message, edit the content and add participants at any point in the process. Then playback lets anyone rewind the wave to see who said what and when.
A wave is live. With live transmission as you type, participants on a wave can have faster conversations, see edits and interact with extensions in real-time.






Seminar Topics
- Introduction to Google Wave
- Building Extensions to Google Wave
- Building Gadgets - Walk through of building a Gadget
- Building Robots - Walk through of building a Java based Robot

Presentation on Google Wave







Date - 12th September 2009 - 4:00 p.m to 7: p.m
Venue - Synerzip Softech - L1 (Ground floor)
Dnyanvatsal Commercial Complex,
Opposite Vanadevi mandir,
Karve Nagar,
Pune, India 411052
Tel: 91-9923085006




Jul 23, 2009

Why one has to use a Handler in Android?

Following is inferred from the documentation about a Handler

The handler is used to schedule a runnable on the message queue of the thread that created the handler. it is mostly used to schedule UI updates on the UI thread

The one think I could not understand why I can't use any thread to update UI.

I did some experiment for the same.

Here I tried to update a TextView after every 1 second for 50 seconds using a normal thread and it failed. I got an exception

package org.punegtug.sample;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.TextView;

public class HandlerTest extends Activity {
private TextView textView = null;
private int index = 0;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.main);
textView = (TextView) findViewById(R.id.textView);
textView.setText("index="+index);
}

/*
* (non-Javadoc)
*
* @see android.app.Activity#onPause()
*/
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}

/*
* (non-Javadoc)
*
* @see android.app.Activity#onResume()
*/
@Override
protected void onResume() {

Runnable runnable = new Runnable() {

@Override
public void run() {
index = 0;
while (index < 50) {

//Tried to access text from UI component textView
String text= textView.getText().toString();

//Directly tried to update UI in this thread
textView.setText("index="+index++);


try {
// do what you want to do before sleeping
Thread.currentThread().sleep(1000);// sleep for 1000 ms
// do what you want to do after sleeptig
} catch (InterruptedException ie) {
// If this thread was intrrupted by nother thread
}

}

}

};
Thread thread = new Thread(runnable);
thread.start();


}

}

But the following code with Handler worked

t android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.TextView;

public class HandlerTest extends Activity {
private TextView textView = null;
private int index = 0;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.main);
textView = (TextView) findViewById(R.id.textView);
textView.setText("index="+index);
}

/*
* (non-Javadoc)
*
* @see android.app.Activity#onPause()
*/
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}

/*
* (non-Javadoc)
*
* @see android.app.Activity#onResume()
*/
@Override
protected void onResume() {
final Handler handler = new Handler(new Handler.Callback() {

@Override
public boolean handleMessage(Message msg) {
textView.setText("index="+index++);
return false;
}
});
Runnable runnable = new Runnable() {

@Override
public void run() {
index = 0;
while (index < 50) {

//Tried to access text from UI component textView
String text= textView.getText().toString();

//Indirectly tried to update UI in this thread
handler.sendEmptyMessage(0);


try {
// do what you want to do before sleeping
Thread.currentThread().sleep(1000);// sleep for 1000 ms
// do what you want to do after sleeptig
} catch (InterruptedException ie) {
// If this thread was intrrupted by nother thread
}

}

}

};
Thread thread = new Thread(runnable);
thread.start();


}

}

So I could, one can not update a UI component in any other thread than UI thread. However, getting values from existing UI components in any thread (e.g textView.getText()) works fine.

Hence we need to use Handler.

Soon, I will send a post about Looper.

Jun 16, 2009

Google Visualization API and Code Playground Discussion

Let's talk on Google Visualization API this saturday (20th of June 2009). I will also introduce you to Google Code Playground, an excellent tool to try the Google's javascript based APIs

With Google Visualization APIs you can do the following thing
1. Pull data from datasources like Google Spreadsheet or your own PHP or Java Servlet DataSource
2. Pull Data in SQL fashion with Select Queries and Where clauses
3. Render the data in
a. Data Table
b. Various Charts and Graphs
c. Any third party visualization libraries

With Google Code Playground any one can learn in hours Google's javascript based APIs like
1. Google Maps
2. Google Search
3. Google Translation
etc

Come and join us this saturday at
Venue
Dnyanvatsal Commercial Complex, Floor 5
Survey No. 23, Plot No. 189,
Karve Nagar,
Pune, India 411052
Contact no. - 9923085006
See on Google Map
http://www.synerzip.com

Between
4:00 p.m to 6:00 p.m, Saturday, 20th June 2009

May 27, 2009

Android - Introductory Session

Getting Started with Android - 6th June 2009 - 4:00 p.m

Pune GTUG would be meeting on 6th June 2009 at 4:00 p.m at the below mentioned venue for the topic "Introduction to Android".

Venue
Dnyanvatsal Commercial Complex
Survey No. 23, Plot No. 189,
Karve Nagar,
Pune, India 411052
Contact no. - 9923085006
See on Google Map
http://www.synerzip.com

Agenda for this meet is as follows

  1. Brief History of Android
  2. Android Phones
  3. Android Experiments
  4. What is Android?
  5. What’s in new SDK
  6. Android Architecture in detail
  7. Application Fundamentals
  8. User Interface
  9. Resources and Assets
  10. Data Storage
  11. Content Providers
  12. Security and Permissions
  13. Developing Android Applications In Eclipse, with ADT
  14. First Android Application
  15. Further Reading
Speaker Bio - Sushrut Bidwai
  • Writing a book on Android (near future)
  • Leading a team of 15+ programmers in Nasik.
  • Works mainly on Java centric technologies and that too specifically on Google centric like GWT, Android, GAE for Java.
  • Provide information content to fellow developers through our blogs like androidcompetencycenter.com .
  • Worked with Persistent Systems and YagnaIQ (Pune based startup) at the start of career.
  • Rest of the things can be found on http://sushrutbidwai.com/about
 If you have any issues feel free to write to pune-gtug mailing list.

May 26, 2009

We're changing !

Recently there have been some great progress in Pune GTUG. To mention a few of them are here.

  • A new domain name

  • Yes, we got our own domain name as http://www.punegtug.org. This means more freedom and our wider & better existance on the web.


  • A fresh look

  • We are working on a fresh look and feel of the site, that would match perfectly with our ideas.


  • Expect More events and meets

  • We are constantly looking forward to organize more and more meets, sessions and workshops. So, you should expect more of them in coming days.


  • Our email

  • If you have any knowledge that you would like to share on the Pune GTUG platform, here is our email id info@punegtug.org. Suggestions and your thoughts are most welcome.



There are couple of more things on the roadmap, but it's too early to release them :-)
So, till then just wait for the surprise.

May 19, 2009

Back to Basics - Cross Site Scripting - How web 2.0 mashups really work?

Cross Site Scripting the term may not be familiar to many of us. Instead let me explain this in a lay man's terms - Web 2.0 mashups. 

Web 2.0 mashups - Making the browser connect to various sources (rss, webservices) on the internet and cook up a usable application out of all these sources. A Web 2.0 mashup is typically a html page with some javascript which make all this happen.

A simple example of a mashup could be using a feed from craigslist (or any rent/sell house site) and map the listings on a map (say google map). The services which are used in this example are rss feed from the source, reverse geo lookup (address to co ordinate converstion service from google map) and google map itself. All done in a html page without the need of any server.


Now that we know about Web 2.0 mashups we should now move on to Cross Site Scripting.

Firstly lets understand what is the main hurdle in cross site scripting. Its called as Single Origin policy, if a page is loaded from xyz.com and tries to send a ajax request to abc.com, the browser does not allow it. This is not a bug but a feature, for security reasons. 





If this is so, how can any one use google services directly from the webpage which are not hosted on google.com. The answer is simple JSONP. You should know about JSON before you proceed ahead.

Even though the browser restricts sending ajax requests to other domains, it allows javascripts (even at runtime) from other domains in the html code. 

Lets take a very simple example, one of the services http://www.freehoroscope.com/json gives out a JSON string like this

[
  {"date":"12/12/2008", 
    "Aries":"The day looks good for you....",
    "...","...",
    "Cancer","You will meet some one special today....",
    ".....","....",
    "Sagitarius","Career front there would be good news for you...."
   }
]

Now a javascript eval() function could instantly convert this text into a javascript object and this object can be used to create daily horoscope html.

The problem is I am serving my site from xyz.com and I can't send ajax request to http://www.freehoroscope.com/json. 





Solution is instead of ajax request, I embed a javascript (using dom operations) in my html code at run time 
(div.innerHTML="<s cript src="' http://www.freehoroscope.com/jsonp?callback"="printHoro'>").

Notice I am calling a slightly different url -  http://www.freehoroscope.com/jsonp (notice the extra p at the end)

Lets see what this url gives out the following javascript - 
--------------------------------------------------------------
var data=[
  {"date":"12/12/2008", 
    "Aries":"The day looks good for you....",
    "...","...",
    "Cancer","You will meet some one special today....",
    ".....","....",
    "Sagitarius","Career front there would be good news for you...."
   }
];
printHoro(data);
--------------------------------------------------------------

Its quite similar to the json response just that the response is put in a variable and the function is added at the end. Notice the function name is the same as what we passed in the query string (The server put this callback name into the javascript it throws out).

What happens now is once the javascript is loaded, it creates a variable data and calls the javascript function printHoro. In short you will have to add the printHoro function which will actually be your call back function to render the horoscope
<>
function printHoro(data){
  document.getElementById("date").innerHTML=data[0].date;
  document.getElementById("aries").innerHTML=data[0].Aries;
  ....
}
< / sc ript>





If you have any questions on this mail it to pune-gtug.googlegroups.com





May 16, 2009

Pics from Pune-GTUG Sessions

The most recent session conducted by Pranav Prakash on Google App Engine

Great Session on Google App Engine at Pune-GTUG this saturday :)

We had a blast at Pune GTUG Meet this Saturday. Almost 22-25 people turned up, we hardly had a place to hit every one.

Thanks to Pranav for taking the execellent presentation on Google App Engine. Special thanks to Navin Kabra to make the session live, with all the insights he provided.

Here is the presentation from the session used by Pranav.

May 13, 2009

Google App Engine - Getting Started

Google App Engine - Getting Start
Pune GTUG meets this Saturday (16th of May) to discuss Google App Engine
Agenda Topics
1. Little talk about Cloud Computing
2. Getting Started with Google App Engine Python
3. Live Examples on Google App Engine 
4. Question and Answer
5. Introduction to Google App Engine Java (if time permits)

Speaker: Pranav Prakash

Date : Saturday 16th of May 2009 at 4:00 p.m

Venue: 


Dnyanvatsal Commercial Complex 
Survey No. 23, Plot No. 189,
Karve Nagar,
Pune, India 411052
Contact no. - 9923085006
See on 
Google Map

Apr 18, 2009

Getting Started with Gadgets and OpenSocial - 18th April 2009 Pune GTUG meet

In the Pune GTUG meet scheduled on 18th of April 2009, we will be talking about "Getting Started with Gadgets and OpenSocial".

Here are the agenda topics
1. Very short introduction to Gadgets and OpenSocial
2. Getting Started with Gadgets
    - Basic Anotomoy of a Gadget
    - Initialization of Gadget code
    - Understanding Views in Gadget
    - Making Ajax Requests from gadgets (Cross site) using gadgets.io.makeRequest
    - Making Ajax Posts from gadgets (Cross site) using gadgets.io.makeRequest
3. Getting Started with OpenSocial
   - Sending Gifts to friends example 
   - Introducing the Gifts RestFul Application built on Java Google App Engine
   - Walk through OpenSocial Code of sending gifts to friends. Getting list of gifts sent to friends. Getting list of gifts received from friends
   - Walk through Activity Stream - Sending updates or Bragging about sending gifts to your friends.

Here are the sample code which we will discuss in this session.

1. Anatomy of a Gadget - Gadget Version 1 
2. Initialization of a Gadget - Gadget Version 2
3. Understanding Views in a Gadget - Gadget Version 3
4. Making Ajax calls from Gadget - Gadget Version 4
5. Making Ajax posts from Gadget - Gadget Version 5
6. OpenSocial Sending Gifts to friends- Complete example of OpenSocial Gadget - OpenSocial Version 1


Also for those who are interested in building applications using Java on Google App Engine can refer to OpenSocialGifts app that i built for Google App Engine (Java) here - http://code.google.com/p/opensocial-java-appengine-gifts/ 

This application is running live here - http://3.latest.opensocialgifts.appspot.com/



Apr 10, 2009

"Getting Started with OpenSocial" meet moved to 18th of April

Getting Started with OpenSocial - 18th April 2009 - 3:00 p.m

We are changing the date for "Getting Started with OpenSocial" to 18th of April.

Pune GTUG would be meeting on 18th April 2009 at 3:00 p.m at the below mentioned venue for the topic "Getting Started with OpenSocial".

Dnyanvatsal Commercial Complex
Survey No. 23, Plot No. 189,
Karve Nagar,
Pune, India 411052
Contact no. - 9923085006
See on Google Map
http://www.synerzip.com

Agenda for this meet is as follows

1. General overview of OpenSocial (But participates are expected to read about OpenSocial)
2. Getting started with a simple Gadget
3. Getting started with a simple OpenSocial Application
4. Overview of RestFul APIs for Server side OpenSocial Applications

Mar 27, 2009

Enriching you site with Google Web Search Results, Map Search Result, Video Search Results etc

This presentation tells how to use Google Ajax Search API to enrich you site with 
1. Web Search Results
2. Image Search Results
3. Video Search Results
4. Map Search Results
and various other search results and Wizards.

Please down this example zip before going through the presentation




You can also refer to the old blog posts on this blog

OpenSocial Presentation for Students (Given at PICT Concepts event)

This presentation was given at PICT Concepts 2009 Event by Pune-GTUG.

The main audience were Engineering Students at this Event.

Mar 25, 2009

Follow Pune GTUG on twitter



GTUG Meet -11 April-2009 : 3:00 p.m - Getting Started with OpenSocial

Getting Started with OpenSocial - 11th April 2009 - 3:00 p.m

Pune GTUG would be meeting on 11th April 2009 at 3:00 p.m at the below mentioned venue for the topic "Getting Started with OpenSocial".

Dnyanvatsal Commercial Complex
Survey No. 23, Plot No. 189,
Karve Nagar,
Pune, India 411052
Contact no. - 9923085006
See on Google Map
http://www.synerzip.com

Agenda for this meet is as follows

1. General overview of OpenSocial (But participates are expected to read about OpenSocial)
2. Getting started with a simple Gadget
3. Getting started with a simple OpenSocial Application
4. Overview of RestFul APIs for Server side OpenSocial Applications

GTUG Meet -28-March-2009 : 3:00 p.m - Enriching your site with Google Maps search, News, Blog Feed, Video Search, Video Bar, Book Bar, Book Search

GTUG meeting to discuss - Enriching your site with Google Maps search, News, Blog Feed, Video Search, Video Bar, Book Bar, Book Search

Pune GTUG is meeting this Saturday (28th March 2009) at 3:00 p.m at the following venue

Dnyanvatsal Commercial Complex
Survey No. 23, Plot No. 189,
Karve Nagar,
Pune, India 411052
Contact no. - 9923085006
See on Google Map
http://www.synerzip.com


Agenda for the Meet
1. General Overview of enriching your site or blog with more live data

2. What all options are available
- Searches
- Web
- Picture
- Video
- Local
- Feeds
- News
- Blogs
- Richer Wizards

3. How to add these to your site or blog or company's web site

Mar 22, 2009

Survey Result

The Survey Result is out. Following are the most popular topics of the survey result

1. Overview of Google Technologies
2. OpenSocial - Building OpenSocial Apps
3. Enriching your site with Google Maps search, News, Blog Feed, Video Search, Video Bar, Book Bar, Book Search

One of this would be topic of our next GTUG meet. The mostly likely one seems to be
Overview of Google Technologies
or
Enriching your site with Google Maps search, News, Blog Feed, Video Search, Video Bar, Book Bar, Book Search

as these topics cover more breadth then depth.



Look out for my next post which will announce the venue and date. Btw we now have a permanent venue available for Pune GTUG meetings, so we can meet more often and regularly