Mobile Processing GUI stuff:
Wanted to create an application where you can search for shoes and deals for the shoes on the mobile device. Used Mobile Processing to do it…
Pcontainer was used to make buttons and tags, labels etc. For this assignment i made 4 pages.
- splash page
- selection of mes , womens or childrens shoes (3 buttons)
-mens shoes ( airmax 90 0r air force one)
i wanted the picture to be a button. But this was not possible in mobile processing unless we create our own class and modify it. So for this we made the following class which references PMidletButton
public class PImageButton extends PMIDlet$PButton
{
protected PImage img;
public PImageButton(PMIDlet pmidlet, String label, PImage img)
{
super(pmidlet, label);
this.img = img;
}
protected void drawContent() {
super.drawContent();
image(img,0,0);
}
}
code for gui:
import processing.core.*;
public class MPGUIExample_007 extends PMIDlet
{
/*
First we declare some PContainers
These hold different GUI elements and we can use them
to hold all of the GUI elements for any particular screen
http://mobile.processing.org/reference/reference.php?name=PContainer
(Ignore the scrollbar stuff in the docs, it causes problems)
*/
PContainer screen0;
PContainer screen1;
PContainer screen2;
PContainer screen3;
PContainer screen4;
PContainer currentContainer;
PImageButton testImageButton, testImageButton1;
PButton button1a,button1b,button1c;
PButton button2;
PLabel label0;
PLabel label1;
PLabel label2;
PImageLabel imglabel0,imglabel1;
//————-screen3 airmax———————
PLabel label_airmax,list_label;
PList list;
PScrollBar sb_airmax;
//3333333333333333333
void setup()
{
PImage img = loadImage(”mobile.PNG”);
PImage img1 = loadImage(”page1_1.PNG”);
PImage img_btn1 = loadImage(”airmax90.PNG”);
PImage img_btn2 = loadImage(”airforce.PNG”);
imglabel0 = new PImageLabel(img);
imglabel1 = new PImageLabel(img1);
imglabel0.setBounds((width – img.width) / 2,
(height – img.height) / 2,img.width,
img.height);
imglabel1.setBounds(0,195,
img.width,
img.height);
testImageButton = new PImageButton((PMIDlet)this,”test”,img_btn1);
testImageButton.setBounds(0,10,width,height);
testImageButton1 = new PImageButton((PMIDlet)this,”test”,img_btn2);
testImageButton1.setBounds(130,10,width,height);
screen0 = new PContainer();
screen1 = new PContainer();
screen2 = new PContainer();
screen3 = new PContainer();
screen4 = new PContainer();
button1a = new PButton(”MEN”);
button1b = new PButton(”WOMEN”);
button1c = new PButton(”CHILDREN”);
button2 = new PButton(”World”);
button1a.setBounds(10,50,100,20);
button1b.setBounds(120,50,100,20);
button1c.setBounds(70,80,100,20);
screen1.add(button1a);
screen1.add(button1b);
screen1.add(button1c);
screen2.add(testImageButton);
screen2.add(testImageButton1);
screen0.add(imglabel0);
screen1.add(imglabel1);
label1 = new PLabel(”Choose what shoes to view”);
label2 = new PLabel(”Go ahead”);
// ***********************screen3airmax90
label_airmax = new PLabel(”Air Max 90″);
list_label = new PLabel(”Size: “);
list_label.setBounds(0, 0, width, 20);
//333333333333333333333333333333333333333333333333
/*
Set the size and location of the labels
*/
label0.setBounds(0,50,width,50);
label1.setBounds(5,5,width,30);
label2.setBounds(5,5,width,50);
// —————-screen3airmax90
label_airmax.setBounds(10,0,width,25);
//yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
/*
Add the labels to the containers
*/
screen0.add(imglabel0);
screen1.add(imglabel1);
screen1.add(label1);
screen2.add(label2);
//333333333333333333333333333333333333333333
screen3.add(label_airmax);
screen3.add(list_label);
int y = list_label.y + list_label.height;
//scroll bar on right side of screen 3
sb_airmax = new PScrollBar();
sb_airmax.setBounds(width – 4, y, 4, height -y);
list = new PList();
list.scrollbar = sb_airmax;
list.setBounds(20, 60, 20,20);
for (int i = 0; i < 15; i++) {
list.add(”size”+i);
}
screen3.add(list);
//33333333333333333333333333333333
/*
Tell the containers to start doing their thing
*/
screen0.initialize();
screen1.initialize();
screen2.initialize();
screen3.initialize();
screen4.initialize();
/*
Set current container equal to the container we want to display to start
*/
currentContainer = screen0;
}
void draw()
{
background(200);
/*
Draw the current container
We are switching up what the current container points to (is equal to) to change what is displayed
*/
currentContainer.draw();
}
/*
If a key is pressed, pass it along to the currentContainer
*/
void keyPressed()
{
if ( currentContainer == screen0);
{
currentContainer = screen1;
}
currentContainer.keyPressed();
}
/*
If a key is released, pass it along to the currentContainer
*/
void keyReleased()
{
currentContainer.keyReleased();
}
/*
When a container registers a keyPress and it thinks a button has been pressed
it passes it along to that button which generates a library event
*/
void libraryEvent(Object library, int event, Object data)
{
if (library == button1a)
{
// Switch the screen..
currentContainer = screen2;
}
else if (library == testImageButton)
{
println(”It worked!!”);
currentContainer = screen3;
}
else if (library == testImageButton1)
{
println(”It worked again!!”);
currentContainer = screen4;
}
}
//09786543444444444444444444444444444444444444
public class PImageButton extends PMIDlet$PButton
{
protected PImage img;
public PImageButton(PMIDlet pmidlet, String label, PImage img)
{
super(pmidlet, label);
this.img = img;
}
protected void drawContent() {
super.drawContent();
image(img,0,0);
}
}
}
Another week of Sanjay VS Flash:
This week i tried to make a simple game where you try to stop the ball before it hits the Line of death.
You use the left space bar to stop and the left arrow key to start again
on (keyPress “<Space>”)
{
//trace(”enterkeywsas presser”);
_root.ball.stop();
}
on (keyPress “<Left>”)
{
//trace(”enterkeywsas presser”);
_root.ball.play();
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.line)) {
_root.gotoAndStop(2);
}
This code was put in the ball movie clip.
The hitTest code is used to see if the ball hits the line or not. if it does go tofram number 2 which tells the player that they lost.
Matrimonial sites as Social Software:
Arranged marriage is a common practice in the Middle East, Asia and some parts of
The main reason for arranged marriage was so that the son or daughter does not marry out of the community and also social status. There is a tremendous difference between arranged marriages from, say the 1950’s and present. In the olden days the scenario was that the parents fix the marriages, the bride and the groom to be does not speak much and they come to know each other after the marriage. The present scenario is totally different. Now it is more relaxed and much more modernized. The boy and girl interact quite a bit after the marriage is fixed. They even go out on dates to get to know each other more.
In the olden days Indian families were quite large and they used all live together as a combined family, so finding a match was quite easy with the family’s contacts. Gone are the days of combined families and in are the days on nuclear families. A nuclear family’s contacts are not as vast as combined families, so they need other means to search for a match. So they use matrimonial sites to find a match.
With some research I have come to know that different matrimonial sites are viewed differently by different people. That is some sites seem more serious than other sites in terms on matrimony. Some people view shaadi.com as a dating site where as bharatmatrimony.com is considered a more serious site for marriage. The reason for this must be the marketing of the two sites. Even if you look at the sites they both have women on the site but shaadi.com shows a girl wearing a t-shirt which shows that she is modern where as bharatmatrimony.com has a girl wearing a more ethnic shirt which may portray that she is more serious about marriage.
Online matrimonial sites do a pretty good job taking various factors like family background, caste, religion, language, etc into consideration to give the marriage a more traditional feel to it. The matrimonial sites are designed in such a way they give it a social network kind of aesthetics to it. The profiles are very similar to facebook or friendster with a little more extra information requirement such as family background, star sign, astrology, height, body type, whether you are vegetarian or not, preferred dress style, etc. Idontwantdowry.com even lets you record your voice to describe yourself. Even though you cannot add friends to your list you are able to favorite profiles, so you can have easy access to these profiles.
Some sites even let the users chat with other users who are online, but this is a paid service. Also similar to other social network sites a user is able to add other profiles to their favorite list so they can go back to it at a later time.
One of the most important parts of matrimonial sites is the search criteria. Apart from the normal search options such as age, looks, complexion, religion and language some sites such as shaadi.com allows users to select a potential bride or groom by profession or city. Apart from the normal options a user can search for HIV positive matches and also a bride/groom with handicaps. A recently created site for connecting HIV positive people are positivesaathi.com (positive friend). This site was created with help from the Indian government for all the HIV positive people who want to get married. In
In bharatmatrimony.com a user cannot view the profile of another user if they do not meet the requirement of that user. That is there are settings that you can set so that people out side your requirement cannot view your profile. Bharatmatrimony.com has a feature known as verified profile. Once a profile is verified by a credit rating company and found that all the information provided is true the profile is given higher priority when searching for a potential bride/groom.
I conducted several interviews and found that a lot of people prefer to create their own profile rather than allow their parents to create it for them. This is due to the fact that the parents do not know what kind of match their son or daughter is looking for. They will look out for matches which they tend to like and whose family background is attractive. So many users create their own profile so that it is accurate and they find matches that they have something in common with. Such users often tend to ignore profiles which were created by anyone other than the user.
Nowadays people who use certain matrimonial sites are using it due to the fact that they do not have many avenues to meet people of the opposite sex. These are usually working people. Students in Universities rarely use matrimonial sites as they have many ways of meeting people of the opposite sex.
With growing popularity of western media Indians are thinking more westernized. Due to this many Indians prefer not to have an arranged marriage. They choose to meet someone, fall in love and then get married like in the Bollywood movies where romance is exaggerated. Interviewing some people I came to know that there are many people who use these matrimonial sites as a dating site rather than a marriage site, but they have a clear cut idea of the end goal which is marriage. It was found that people tend to meet people on these sites, chat with them and go on dates. Once they are comfortable with each other it is forgotten how they met. The relationship may or may not last, but if it does the site has been used to what it was created for.
There also a few people in the world who use matrimonial sites for entertainment like using normal social networking sites like facebook, friendster or orkut. These people like browsing profile after profile looking at the pictures and just reading their about me, and other details for entertainment. They do not use it for dating or marriage purposes. Such people are the fakesters of matrimonial sites.
Matrimonial sites are a boon for Indians who were born and brought up outside of
Most parents of Indians raised outside of India are extremely open to the notion of using matrimonial sites to find a husband or daughter for their children, as they are happy that they have some (if not all) say as to who their son or daughter marries and also that the match is Indian. Some traditional parents may not be open to matrimonial sites as they feel that the old way of searching through a match maker or family or friends is the way to go. Such parents do not trust profiles on matrimonial sites. They mostly will search for a match through known sources so that they have the full family background of the person they are seeking.
Even though matrimonial site may or may not be used solely for marriages they do bring about the aspect of connecting people like social networks. They allow people to have access to other people’s information when a match is required for marriage.
Matrimonial sites are catching on pretty quickly among the young, broad minded Indians with a connection to the Indian culture. They use it either as a dating site to meet people or they use it as a marriage site which was the original idea.
Flash Game
This week we were assigned to make a flash game. With my limited knowledge in flash i was kind of limited with my ideas. But tried some things out.
One game which i made was called Celebrity Head match where there are bodies and heads of Ozzie and Paris Hilton and it the heads can be mix and matched, so Oz’s head can go on Paris’ body.
I used simple code for this where when you press the arrow keys the heads move that way.
The other game is a game where there is a man and weird looking objects fall from the top and the man has to avoid hitting them. The man dies if he is hit by the ojjects.
I found a very important function ( atleast i think it is) in flash this.hitTest(_root.player) which allowed me to check if the objects hit the man.
onClipEvent (enterFrame) {
this._y += speed;//moves the enemy downwards
if (this.hitTest(_root.player)) {//if the enemy hits the player
blood._visible = true;
_root.gotoAndStop(2);//goto the second frame, which will be a gameover screen
So i was able to avoid huge code to check if the hit occurred.