Tag Archives: listener

How to show two different DatepickerDialogs on same activity with only one listener function in android?

By | September 1, 2012

In android for each time picker Dialog we can associate with a dialog. So with this dialog and a global variable we can have any number of Dialog listeners. Here is the sample java code. This is the layout file – main.xml MyAndroidAppActivity .java Please leave your valuable comments on this post.

How to move a body manually in Box2D? or Give a force to a body in Box2D, iPhone.

By | April 28, 2012

This is a sample code to move a body in Box2D . First you have to make a body with variable name “moving_rec” and call the below function in a schedular at regular intervals. -(void) moveBody{ b2Vec2 force = b2Vec2(0,0); force = b2Vec2(0,3); //Giving the x an y to negative will move the body in… Read More »

Java Applet MouseEvents

By | April 22, 2012

A simple event based applet applications is described below First importing the necessary header files // Demonstrate the mouse event handlers. import java.awt.*; import java.awt.event.*; import java.applet.*; /* <applet code=”MouseEvents” width=300 height=100> </applet> */ Next step is to create a class which implements the “MouseListener” and “MouseMotionListener “ public class MouseEvents extends Applet implements MouseListener, MouseMotionListener {… Read More »

Listening incoming sms message in Android

By | May 1, 2011

When a new sms message is received by the device, a Broadcast Receiver is registered. For this IntentFilter filter = new IntentFilter(SMS_RECEIVED); registerReceiver(receiver_SMS, filter); should be included . Also sms are sent in PDU’s(Protocol Description Units) format, which act as an encapsulation. Inorder to extract from PDU to byte array messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i]); method… Read More »

Make your own gesture application in ANDROID or How to use gestures in ANDROID?

By | April 5, 2011

Hi all…. In this tutorial I will teach you how to make use of Gestures in ANDROID and make your own application. Follow the below steps exactly to get an idea of how to use gestures. 1. Make a gesture Library. 2. Add your own gestures into it. 3. Export it to your applications and… Read More »

How to set an item selected in Spinner in ANDROID?

By | February 19, 2011

This code helps yoy to set an item in your combobox(spinner) in ANDROID. Here my_spinner is the combobox which we call as spinner in ANDROID. Declare it in your XML file and link to it by using the following code…. my_spinner= (Spinner)findViewById(R.id.my_spinner); After that in your code set an item Listener for the spinner using… Read More »

How to read and write an XML file in Adobe AIR or Flex?

By | January 15, 2011

AIR treats the XML files as just as normal file and so you can proceed using the FileStream classs. Please take a look at the sample code. Just copy and paste the following code to your main.MXML file and you are done. Please post your comments on this post