Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,813,360 Members 50,365 Now Online
XDA Developers Android and Mobile Development Forum

[APP] Android Business Card program - Simple code for DIY use

Tip us?
 
Childofthehorn
Old
(Last edited by Childofthehorn; 21st September 2011 at 07:46 AM.)
#1  
Childofthehorn's Avatar
Recognized Developer - OP
Thanks Meter 163
Posts: 252
Join Date: Jun 2010
Location: DFW, Texaaas

 
DONATE TO ME
Default [APP] Android Business Card program - Simple code for DIY use

Android Business Card Program - Open Code for DIY Use
Decided to make an Android .apk program Business Card instead of getting boring cardboard ones.



All of the project names link back to the project post when tapped.


Took 6 hours from concept to finish while watching TV and catering to potential future in-laws.


DOWNLOAD: http://www.sendspace.com/file/k7wyst

EDIT 9/21/2011
I REWROTE THE PROGRAM USING PROCESSING FOR ANDROID (took NO-TIME whatsoever)


Now, you can use the basic code to make your own simple business card program by replacing my info with yours.

I made the sections really easy so all you have to do is add your own icon pictures and links. I made this template because of people I know wanting to be able to do it themselves and its an easy intro to programming as well as using the Processing core. When you get more advanced, you can bring the Processing core into Eclipse and have more fun. It simplifies intro Android programming for non-programmers to get in the game!
Code:
/*

Written by and for STACY DEVINO
doesitpew.blogspot.com
stacydevino@gmail.com

***Re-written in Processing for Android for ease of re-use by others in September 2011.***
http://wiki.processing.org/w/Android
^ All instructions are above!!!!

This program serves as a unique calling card for those looking for something beyond cardboard.

*/

//////////////////////////////////////////////////////////////////
//****************************************************************
// PAY ATTENTION HERE - ADD THE LINKS FOR YOUR PAGES!!!!!
//****************************************************************
//////////////////////////////////////////////////////////////////

String your_Blog = ;        //make sure that this is a LINK
String your_Facebook = ;    //make sure that this is a LINK
String your_Name = ;        //make sure that this is a LINK
String your_Twitter = ;     //make sure that this is a LINK
String your_LinkedIn = ;    //make sure that this is a LINK
String your_CoverLetter = ; //make sure that this is a LINK
String your_Resume = ;      //make sure that this is a LINK

//LOGIC FOR BUTTONS AND ACTIONS
//*dont touch unless you know how to code
boolean blog = false;
boolean linked = false;
boolean fb = false;
boolean twit = false;
boolean ok = false;
boolean res = false;
boolean qual = false;
boolean cl = false; 
boolean rfid = false;
boolean hifi = false;
boolean ch = false;
boolean sensor = false;
boolean splash = false;
boolean ipod = false;
boolean evo = false;
boolean zoe = false;
boolean game = false;
boolean speak = false;
boolean eb = false;
boolean main = false;


// IMAGE NAMES!!!!!!
PImage b;
PFont font;
PImage blogger;
PImage in;
PImage facebook;
PImage twitter;
PImage projects;
PImage resume;
PImage cube;
PImage cover;
PImage q;
PFont ffont;
PImage menu;

/////////////////////////////////////////
// SET UP ALL PICTURES
////////////////////////////////////////
//////////////////////////////////////////////////////////////////
//****************************************************************
// PAY ATTENTION HERE - ADD THE PICS FOR YOUR PAGES!!!!!
//****************************************************************
//////////////////////////////////////////////////////////////////

void setup(){
   
  b = loadImage("mio.jpg"); //Picture of yourself or whatever
  
  //Find your own 128x128 pictures (PNG is Better) for your icons and put the names here
  blogger = loadImage("128x128.png");
  in = loadImage("128x128.png");
  //cube = loadImage("Cube.png"); // This would be a background picture
  facebook = loadImage("128x128.png");
  twitter = loadImage("128x128.png");
  projects = loadImage("128x128.png");
  resume = loadImage("128x128.png");
  menu = loadImage("128x128.png");
  cover = loadImage("128x128.png");
  q = loadImage("128x128.png"); 
} 

///////////////////////////////////////////
// HOME PAGE RETURN
//////////////////////////////////////////

void home(){
  
  if(ok == true || res == true){
         
          res = false; 
          cl = false;
          qual = false; 
          rfid = false;
          hifi = false;
          ch = false;
          sensor = false;
          splash = false;
          ipod = false;
          evo = false;
          zoe = false;
          game = false;
          speak = false;
          eb = false;
          ok = false;
  }
}

//////////////////////////////////////////////
// MAIN LOOP
/////////////////////////////////////////////

void draw(){
  if(res == false || ok == false){
  background(0);
  //image(cube, 0, 0);
  font = loadFont("OldDreadfulNo7BT-Regular-48.vlw"); 
  textFont(font, 48); 
  text(your_Name, 45, 75);
  image(b, 110, 120);
  image(blogger, 30, 470);
  image(in, 170, 470);
  image(facebook, 320, 470);
  image(twitter, 30, 625);
  image(projects, 170, 625);
  image(resume, 320, 625);
  
  // Left buttom
  if (blog == true) { 
    link(your_Blog);
    blog = false; 
  }
  else if (linked == true) { 
    link(your_LinkedIn);
    linked = false;
  }
  else if (fb == true) { 
    link(your_Facebook);
    fb = false;
  }
  else if (twit == true) { 
    link(your_Twitter);
    twit = false;
  }
  }
  if (res == true) { 
    image(cube, 0, 0);
    image(cover, 50, 100);
    image(q, 170, 100); 
    ffont = loadFont("Vrinda-32.vlw"); 
    textFont(ffont, 32);
    
    ///////////////////////////////////////////////////////
    //ENTER YOUR COVER LETTER AND PERSONAL INFORMATION HERE!
    ///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
//****************************************************************
// PAY ATTENTION HERE
//****************************************************************
//////////////////////////////////////////////////////////////////
    text("NAME HERE", 50, 275);
    text("EMAIL HERE", 50, 325);
    text("PHONE HERE", 50, 375);
    text("CONTACT LINE", 50, 425);
    text("BLOG HERE", 50, 475);
    text("WEBPAGE HERE", 50, 525);
    text("AKA HERE", 50, 575);
    //Resume and Cover Letter links
    if (qual == true){
      link(your_Resume);
      qual = false;
      res = false;
    }
    else if (cl == true){
       link(your_CoverLetter);  
       cl = false;
       res = false;
    }
    image(menu, 170, 680);
  }
 if (ok == true){
   image(cube, 0, 0);
   font = loadFont("OldDreadfulNo7BT-Regular-48.vlw"); 
   textFont(font, 48);
  //ENTER THE PAGE NAME YOU WANT 
   text("PAGE_NAME", 20, 75);
   ffont = loadFont("Vrinda-32.vlw"); 
   textFont(ffont, 32);
   
   //////////////////////////////////////////////////////////
   // ENTER THE NAMES AND LINKS THAT YOU WANT YOUR PROJECT TO USE
   //////////////////////////////////////////////////////////
   //////////////////////////////////////////////////////////////////
//****************************************************************
// PAY ATTENTION HERE - ADD THE LINKS and NAMES FOR YOUR PROJECTS!!!!!
//****************************************************************
//////////////////////////////////////////////////////////////////
   
   text("PROJECT NAME", 50, 175);
   if( rfid == true){
    link("PROJECTLINK.html");
    rfid = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 225);
   if( hifi == true){
    link("PROJECTLINK.html");
    hifi = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 275);
   if( ch == true){
    link("PROJECTLINK.html");
    ch = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 325);
   if( sensor == true){
    link("PROJECTLINK.html");
    sensor = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 375);
   if( splash == true){
    link("PROJECTLINK.html");
    splash = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 425);
   if( ipod == true){
    link("PROJECTLINK.html");
    ipod = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 475);
   if( evo == true){
    link("PROJECTLINK.html");
    evo = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 525);
   if( zoe == true){
    link("PROJECTLINK.html");
    zoe = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 575);
   if( game == true){
    link("PROJECTLINK.html");
    game = false; 
    ok = false;
   }
   text("PROJECT NAME", 50, 625);
   if( speak == true){
    link("PROJECTLINK.html");
    speak = false; 
    ok = false;
   }
   text("I AM 8-BIT", 50, 675);
   if( eb == true){
    link("PROJECTLINK.html");
    eb = false; 
    ok = false;
   }
   image(menu, 170, 680);
 } 
}
///////////////////////////////////////////////////////////////////
//*don't touch unless you need to change where it sees the clicks
//////////////////////////////////////////////////////////////////
void keyPressed(){
    // doing other things here, and then:
   if (key == CODED && keyCode == BACK && (res == true ||ok == true)) {
     keyCode = 0;
     println(res);
     println(ok);
      if(res == true) {
        // you'll need to set keyCode to 0 if you want to prevent quitting (see above)
          res = false; 
          cl = false;
          qual = false; 
      }
      else if (ok == true) {
        // you'll need to set keyCode to 0 if you want to prevent quitting (see above)
          rfid = false;
          hifi = false;
          ch = false;
          sensor = false;
          splash = false;
          ipod = false;
          evo = false;
          zoe = false;
          game = false;
          speak = false;
          eb = false;
          ok = false;
      }
    }
  }
void mousePressed(){

  if (mouseX > 20 && mouseX < 150 && mouseY > 470 && mouseY < 600 && res == false && ok == false) {
    blog = true;   
  } 
  else if (mouseX > 160 && mouseX < 300 && mouseY > 470 && mouseY < 600 && res == false && ok == false) {
    linked = true;   
  } 
  else if (mouseX > 310 && mouseX < 450 && mouseY > 470 && mouseY < 600 && res == false && ok == false) {
    fb = true;   
  } 
  else if (mouseX > 20 && mouseX < 150 && mouseY > 610 && mouseY < 760 && res == false && ok == false) {
    twit = true;   
  } 
  else if (mouseX > 160 && mouseX < 300 && mouseY > 610 && mouseY < 760 && res == false) {
    ok = true;
  } 
  else if (mouseX > 310 && mouseX < 450 && mouseY > 610 && mouseY < 760 && ok == false) {
    res = true;
  } 
  else if (res == true && mouseX > 20 && mouseX < 150 && mouseY > 100 && mouseY < 220 ) {
    cl = true;
  }
  else if (res == true && mouseX > 160 && mouseX < 350 && mouseY > 100 && mouseY < 220 ) {
    qual = true;
  }
  else if (ok == true &&  mouseY > 135 && mouseY < 174 ) {
    rfid = true;
  }
  else if (ok == true &&  mouseY > 175 && mouseY < 220 ) {
    hifi = true;
  }
  else if (ok == true && mouseY > 225 && mouseY < 274 ) {
    ch = true;
  }
  else if (ok == true &&  mouseY > 275 && mouseY < 324 ) {
    sensor = true;
  }
  else if (ok == true && mouseY > 325 && mouseY < 374 ) {
    splash = true;
  }
  else if (ok == true &&  mouseY > 375 && mouseY < 424 ) {
    ipod = true;
  }
  else if (ok == true && mouseY > 425 && mouseY < 474 ) {
    evo = true;
  }
  else if (ok == true &&  mouseY > 475 && mouseY < 524 ) {
    zoe = true;
  }
  else if (ok == true && mouseY > 525 && mouseY < 574 ) {
    game = true;
  }
  else if (ok == true && mouseY > 575 && mouseY < 624 ) {
    speak = true;
  }
  else if (ok == true && mouseY > 625 && mouseY < 674 ) {
    eb = true;
  }
  else if ( mouseY > 675 && (ok == true || res == true)) {
    home();
  } 
  
  else {
    linked = fb = twit = false;
  }
}
 
allchannels99
Old
#2  
Senior Member
Thanks Meter 16
Posts: 190
Join Date: Sep 2010
Location: Atlanta, Georgia

 
DONATE TO ME
You are amazing!
 
XsMagical
Old
#3  
XsMagical's Avatar
Senior Member
Thanks Meter 6,357
Posts: 5,586
Join Date: Apr 2011
Location: Ft. Myers

 
DONATE TO ME
I hope that's not your real number on there...
 
EVOMG
Old
(Last edited by EVOMG; 24th June 2011 at 09:54 PM.) Reason: spelling
#4  
Junior Member
Thanks Meter 4
Posts: 5
Join Date: Apr 2011
Where do I begin...

1) Why is this app (if you can call it that) front-page news? It's not an app that lets you or me make a "business card." It's an "app" that is hard-coded with this chick's own information and links. How is this useful to anyone else but her? Way to go XDA, you just gave her free publicity for something that is of no benefit to the rest of the community.

2) Congratulations Stacy. You wrote an app in 6 hours that is essentially a bunch of links and images. This is groundbreaking somehow? At least if this was an app that allows the user create their own version of a business card, it might have some use to the community, but as it stands it's basically self-publicizing drivel. Which leads me to...

3) Even if this app did allow the end-user to create their own business card, I can barely fathom the logistics of how useless that would be in a real world environment. Is someone really going to go around downloading "Business Card" APKs for every person they come into contact with? I know I sure as hell don't want 200 apps taking up my phone's memory. There's already a solution for this problem. It's called a contact list.

Give me a break XDA, does anyone actually screen these apps before they make front-page news, or does someone just go "omg blond chick" and post a story?
The Following 3 Users Say Thank You to EVOMG For This Useful Post: [ Click to Expand ]
 
Kfunk
Old
#5  
Kfunk's Avatar
Senior Member
Thanks Meter 7,246
Posts: 2,729
Join Date: May 2010
Location: McKinney, TX

 
DONATE TO ME
Quote:
Originally Posted by XsMagical View Post
I hope that's not your real number on there...
I wonder how many hits her website has gotten this morning! Looks to be a useful app though.

BTW - welcome to Dallas!
 
studiorat
Old
#6  
studiorat's Avatar
Senior Member
Thanks Meter 23
Posts: 239
Join Date: Sep 2010
Location: West Haven
Quote:
Originally Posted by EVOMG View Post
Where do I begin...

1) Why is this app (if you can call it that) front-page news? It's not an app that lets you or me make a "business card." It's an "app" that is hard-coded with this chick's own information and links. How is this useful to anyone else but her? Way to go XDA, you just gave her free publicity for something that is of no benefit to the rest of the community.

2) Congratulations Stacy. You wrote an app in 6 hours that is essentially a bunch of links and images. This is groundbreaking somehow? At least if this was an app that allows the user create their own version of a business card, it might have some use to the community, but as it stands it's basically self-publicizing drivel. Which leads me to...

3) Even if this app did allow the end-user to create their own business card, I can barely fathom the logistics of how useless that would be in a real world environment. Is someone really going to go around downloading "Business Card" APKs for every person they come into contact with? I know I sure as hell don't want 200 apps taking up my phone's memory. There's already a solution for this problem. It's called a contact list.

Give me a break XDA, does anyone actually screen these apps before they make front-page news, or does some just go "omg blond chick" and post a story?

Priceless response!!!!, while the app seems to have merit, I agree who has the space to have these apks clogging up the memory, perhaps a step further integrate it with a database that can decode it and organize these , in digital form with little to no space requirements, with user access, kind of like a drop box for business associates, Or like a barcode for every android or yphone user , just like the blackberry devices have, your devices barcode and or PIN contains user and contact info, and stores it in your contacts
 
flavender
Old
#7  
Junior Member
Thanks Meter 0
Posts: 2
Join Date: Sep 2007
Thanks for that great tip.

Sent from my PC36100 using XDA App
 
UGPhilosopher
Old
#8  
Junior Member
Thanks Meter 0
Posts: 8
Join Date: Apr 2011
Quote:
Originally Posted by EVOMG View Post
Where do I begin...

1) Why is this app (if you can call it that) front-page news? It's not an app that lets you or me make a "business card." It's an "app" that is hard-coded with this chick's own information and links. How is this useful to anyone else but her? Way to go XDA, you just gave her free publicity for something that is of no benefit to the rest of the community.

2) Congratulations Stacy. You wrote an app in 6 hours that is essentially a bunch of links and images. This is groundbreaking somehow? At least if this was an app that allows the user create their own version of a business card, it might have some use to the community, but as it stands it's basically self-publicizing drivel. Which leads me to...

3) Even if this app did allow the end-user to create their own business card, I can barely fathom the logistics of how useless that would be in a real world environment. Is someone really going to go around downloading "Business Card" APKs for every person they come into contact with? I know I sure as hell don't want 200 apps taking up my phone's memory. There's already a solution for this problem. It's called a contact list.

Give me a break XDA, does anyone actually screen these apps before they make front-page news, or does someone just go "omg blond chick" and post a story?
lolz, I hope it was a mindless machine that posted that on the front page. I hear ya harsh cruel truth man, and you threw out some excellent points. I must say that when I clicked that link I expected something else, dare I say I thought I saw something EPIC but it was fueled by my imagination. Though I must say I must say this could be something potentially very useful if it could get past the "all about me" aspect.

I can see how little this was thought out without you saying so and I recommend not showing this to any potential employer as it paints a negative picture. If you want to create some more start by decentralizing it from being a standalone app and integrating contacts(thats what its for)

hope I don't sound quite as harsh as the honest guy above, but anything less would be deceiving you. I'm sure you can find plenty of help around here.

~UGP
 
Newklearx3
Old
#9  
Newklearx3's Avatar
Senior Member
Thanks Meter 30
Posts: 363
Join Date: Sep 2010
Location: New York
I should make an apk full of links and my number..... Maybe that'll get me to the front page :shrug:

Sent from my PC36100 using XDA Premium App
 
StarlahRain
Old
#10  
StarlahRain's Avatar
Junior Member
Thanks Meter 0
Posts: 14
Join Date: Jun 2011
Location: port saint lucie fla.
You just ruined her...

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes