Android OS Forum banner
1 - 1 of 1 Posts

·
ResiDEV 3V0
Joined
·
53 Posts
Android Business Card Program - Open Code for DIY Use
Decided to make an Android .apk program Business Card instead of getting boring cardboard ones.


http://doesitpew.blogspot.com/2011/09/re-wrote-android-business-card-apk-into.html



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.

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:
<br />
/*[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]Written by and for Childofthehorn<br />
doesitpew.blogspot.com<br />
[email protected][/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]***Re-written in Processing for Android for ease of re-use by others in September 2011.***<br />
[URL=http://wiki.processing]http://wiki.processing[/URL].org/w/Android<br />
^ All instructions are above!!!![/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]This program serves as a unique calling card for those looking for something beyond cardboard.[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]*/[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]//////////////////////////////////////////////////////////////////<br />
//****************************************************************<br />
// PAY ATTENTION HERE - ADD THE LINKS FOR YOUR PAGES!!!!!<br />
//****************************************************************<br />
//////////////////////////////////////////////////////////////////[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]String your_Blog = ;		//make sure that this is a LINK<br />
String your_Facebook = ;	//make sure that this is a LINK<br />
String your_Name = ;		//make sure that this is a LINK<br />
String your_Twitter = ;	 //make sure that this is a LINK<br />
String your_LinkedIn = ;	//make sure that this is a LINK<br />
String your_CoverLetter = ; //make sure that this is a LINK<br />
String your_Resume = ;	  //make sure that this is a LINK[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]//LOGIC FOR BUTTONS AND ACTIONS<br />
//*dont touch unless you know how to code<br />
boolean blog = false;<br />
boolean linked = false;<br />
boolean fb = false;<br />
boolean twit = false;<br />
boolean ok = false;<br />
boolean res = false;<br />
boolean qual = false;<br />
boolean cl = false;<br />
boolean rfid = false;<br />
boolean hifi = false;<br />
boolean ch = false;<br />
boolean sensor = false;<br />
boolean splash = false;<br />
boolean ipod = false;<br />
boolean evo = false;<br />
boolean zoe = false;<br />
boolean game = false;<br />
boolean speak = false;<br />
boolean eb = false;<br />
boolean main = false;[/size][/color][/size][/font][/color]<br />
<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]// IMAGE NAMES!!!!!!<br />
PImage b;<br />
PFont font;<br />
PImage blogger;<br />
PImage in;<br />
PImage facebook;<br />
PImage twitter;<br />
PImage projects;<br />
PImage resume;<br />
PImage cube;<br />
PImage cover;<br />
PImage q;<br />
PFont ffont;<br />
PImage menu;[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]/////////////////////////////////////////<br />
// SET UP ALL PICTURES<br />
////////////////////////////////////////<br />
//////////////////////////////////////////////////////////////////<br />
//****************************************************************<br />
// PAY ATTENTION HERE - ADD THE PICS FOR YOUR PAGES!!!!!<br />
//****************************************************************<br />
//////////////////////////////////////////////////////////////////[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]void setup(){<br />
  <br />
  b = loadImage("mio.jpg"); //Picture of yourself or whatever<br />
<br />
  //Find your own 128x128 pictures (PNG is Better) for your icons and put the names here<br />
  blogger = loadImage("128x128.png");<br />
  in = loadImage("128x128.png");<br />
  //cube = loadImage("Cube.png"); // This would be a background picture<br />
  facebook = loadImage("128x128.png");<br />
  twitter = loadImage("128x128.png");<br />
  projects = loadImage("128x128.png");<br />
  resume = loadImage("128x128.png");<br />
  menu = loadImage("128x128.png");<br />
  cover = loadImage("128x128.png");<br />
  q = loadImage("128x128.png");<br />
} [/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]///////////////////////////////////////////<br />
// HOME PAGE RETURN<br />
//////////////////////////////////////////[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]void home(){<br />
<br />
  if(ok == true || res == true){<br />
		<br />
		  res = false;<br />
		  cl = false;<br />
		  qual = false;<br />
		  rfid = false;<br />
		  hifi = false;<br />
		  ch = false;<br />
		  sensor = false;<br />
		  splash = false;<br />
		  ipod = false;<br />
		  evo = false;<br />
		  zoe = false;<br />
		  game = false;<br />
		  speak = false;<br />
		  eb = false;<br />
		  ok = false;<br />
  }<br />
}[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]//////////////////////////////////////////////<br />
// MAIN LOOP<br />
/////////////////////////////////////////////[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]void draw(){<br />
  if(res == false || ok == false){<br />
  background(0);<br />
  //image(cube, 0, 0);<br />
  font = loadFont("OldDreadfulNo7BT-Regular-48.vlw");<br />
  textFont(font, 48);<br />
  text(your_Name, 45, 75);<br />
  image(b, 110, 120);<br />
  image(blogger, 30, 470);<br />
  image(in, 170, 470);<br />
  image(facebook, 320, 470);<br />
  image(twitter, 30, 625);<br />
  image(projects, 170, 625);<br />
  image(resume, 320, 625);<br />
<br />
  // Left buttom<br />
  if (blog == true) {<br />
	link(your_Blog);<br />
	blog = false;<br />
  }<br />
  else if (linked == true) {<br />
	link(your_LinkedIn);<br />
	linked = false;<br />
  }<br />
  else if (fb == true) {<br />
	link(your_Facebook);<br />
	fb = false;<br />
  }<br />
  else if (twit == true) {<br />
	link(your_Twitter);<br />
	twit = false;<br />
  }<br />
  }<br />
  if (res == true) {<br />
	image(cube, 0, 0);<br />
	image(cover, 50, 100);<br />
	image(q, 170, 100);<br />
	ffont = loadFont("Vrinda-32.vlw");<br />
	textFont(ffont, 32);<br />
  <br />
	///////////////////////////////////////////////////////<br />
	//ENTER YOUR COVER LETTER AND PERSONAL INFORMATION HERE!<br />
	///////////////////////////////////////////////////////<br />
//////////////////////////////////////////////////////////////////<br />
//****************************************************************<br />
// PAY ATTENTION HERE<br />
//****************************************************************<br />
//////////////////////////////////////////////////////////////////<br />
	text("NAME HERE", 50, 275);<br />
	text("EMAIL HERE", 50, 325);<br />
	text("PHONE HERE", 50, 375);<br />
	text("CONTACT LINE", 50, 425);<br />
	text("BLOG HERE", 50, 475);<br />
	text("WEBPAGE HERE", 50, 525);<br />
	text("AKA HERE", 50, 575);<br />
	//Resume and Cover Letter links<br />
	if (qual == true){<br />
	  link(your_Resume);<br />
	  qual = false;<br />
	  res = false;<br />
	}<br />
	else if (cl == true){<br />
	   link(your_CoverLetter);<br />
	   cl = false;<br />
	   res = false;<br />
	}<br />
	image(menu, 170, 680);<br />
  }<br />
if (ok == true){<br />
   image(cube, 0, 0);<br />
   font = loadFont("OldDreadfulNo7BT-Regular-48.vlw");<br />
   textFont(font, 48);<br />
  //ENTER THE PAGE NAME YOU WANT<br />
   text("PAGE_NAME", 20, 75);<br />
   ffont = loadFont("Vrinda-32.vlw");<br />
   textFont(ffont, 32);<br />
  <br />
   //////////////////////////////////////////////////////////<br />
   // ENTER THE NAMES AND LINKS THAT YOU WANT YOUR PROJECT TO USE<br />
   //////////////////////////////////////////////////////////<br />
   //////////////////////////////////////////////////////////////////<br />
//****************************************************************<br />
// PAY ATTENTION HERE - ADD THE LINKS and NAMES FOR YOUR PROJECTS!!!!!<br />
//****************************************************************<br />
//////////////////////////////////////////////////////////////////<br />
  <br />
   text("PROJECT NAME", 50, 175);<br />
   if( rfid == true){<br />
	link("PROJECTLINK.html");<br />
	rfid = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 225);<br />
   if( hifi == true){<br />
	link("PROJECTLINK.html");<br />
	hifi = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 275);<br />
   if( ch == true){<br />
	link("PROJECTLINK.html");<br />
	ch = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 325);<br />
   if( sensor == true){<br />
	link("PROJECTLINK.html");<br />
	sensor = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 375);<br />
   if( splash == true){<br />
	link("PROJECTLINK.html");<br />
	splash = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 425);<br />
   if( ipod == true){<br />
	link("PROJECTLINK.html");<br />
	ipod = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 475);<br />
   if( evo == true){<br />
	link("PROJECTLINK.html");<br />
	evo = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 525);<br />
   if( zoe == true){<br />
	link("PROJECTLINK.html");<br />
	zoe = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 575);<br />
   if( game == true){<br />
	link("PROJECTLINK.html");<br />
	game = false;<br />
	ok = false;<br />
   }<br />
   text("PROJECT NAME", 50, 625);<br />
   if( speak == true){<br />
	link("PROJECTLINK.html");<br />
	speak = false;<br />
	ok = false;<br />
   }<br />
   text("I AM 8-BIT", 50, 675);<br />
   if( eb == true){<br />
	link("PROJECTLINK.html");<br />
	eb = false;<br />
	ok = false;<br />
   }<br />
   image(menu, 170, 680);<br />
}<br />
}<br />
///////////////////////////////////////////////////////////////////<br />
//*don't touch unless you need to change where it sees the clicks<br />
//////////////////////////////////////////////////////////////////<br />
void keyPressed(){<br />
	// doing other things here, and then:<br />
   if (key == CODED && keyCode == BACK && (res == true ||ok == true)) {<br />
	 keyCode = 0;<br />
	 println(res);<br />
	 println(ok);<br />
	  if(res == true) {<br />
		// you'll need to set keyCode to 0 if you want to prevent quitting (see above)<br />
		  res = false;<br />
		  cl = false;<br />
		  qual = false;<br />
	  }<br />
	  else if (ok == true) {<br />
		// you'll need to set keyCode to 0 if you want to prevent quitting (see above)<br />
		  rfid = false;<br />
		  hifi = false;<br />
		  ch = false;<br />
		  sensor = false;<br />
		  splash = false;<br />
		  ipod = false;<br />
		  evo = false;<br />
		  zoe = false;<br />
		  game = false;<br />
		  speak = false;<br />
		  eb = false;<br />
		  ok = false;<br />
	  }<br />
	}<br />
  }<br />
void mousePressed(){[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]  if (mouseX > 20 && mouseX < 150 && mouseY > 470 && mouseY < 600 && res == false && ok == false) {<br />
	blog = true;  <br />
  }<br />
  else if (mouseX > 160 && mouseX < 300 && mouseY > 470 && mouseY < 600 && res == false && ok == false) {<br />
	linked = true;  <br />
  }<br />
  else if (mouseX > 310 && mouseX < 450 && mouseY > 470 && mouseY < 600 && res == false && ok == false) {<br />
	fb = true;  <br />
  }<br />
  else if (mouseX > 20 && mouseX < 150 && mouseY > 610 && mouseY < 760 && res == false && ok == false) {<br />
	twit = true;  <br />
  }<br />
  else if (mouseX > 160 && mouseX < 300 && mouseY > 610 && mouseY < 760 && res == false) {<br />
	ok = true;<br />
  }<br />
  else if (mouseX > 310 && mouseX < 450 && mouseY > 610 && mouseY < 760 && ok == false) {<br />
	res = true;<br />
  }<br />
  else if (res == true && mouseX > 20 && mouseX < 150 && mouseY > 100 && mouseY < 220 ) {<br />
	cl = true;<br />
  }<br />
  else if (res == true && mouseX > 160 && mouseX < 350 && mouseY > 100 && mouseY < 220 ) {<br />
	qual = true;<br />
  }<br />
  else if (ok == true &&  mouseY > 135 && mouseY < 174 ) {<br />
	rfid = true;<br />
  }<br />
  else if (ok == true &&  mouseY > 175 && mouseY < 220 ) {<br />
	hifi = true;<br />
  }<br />
  else if (ok == true && mouseY > 225 && mouseY < 274 ) {<br />
	ch = true;<br />
  }<br />
  else if (ok == true &&  mouseY > 275 && mouseY < 324 ) {<br />
	sensor = true;<br />
  }<br />
  else if (ok == true && mouseY > 325 && mouseY < 374 ) {<br />
	splash = true;<br />
  }<br />
  else if (ok == true &&  mouseY > 375 && mouseY < 424 ) {<br />
	ipod = true;<br />
  }<br />
  else if (ok == true && mouseY > 425 && mouseY < 474 ) {<br />
	evo = true;<br />
  }<br />
  else if (ok == true &&  mouseY > 475 && mouseY < 524 ) {<br />
	zoe = true;<br />
  }<br />
  else if (ok == true && mouseY > 525 && mouseY < 574 ) {<br />
	game = true;<br />
  }<br />
  else if (ok == true && mouseY > 575 && mouseY < 624 ) {<br />
	speak = true;<br />
  }<br />
  else if (ok == true && mouseY > 625 && mouseY < 674 ) {<br />
	eb = true;<br />
  }<br />
  else if ( mouseY > 675 && (ok == true || res == true)) {<br />
	home();<br />
  }<br />
<br />
  else {<br />
	linked = fb = twit = false;<br />
  }<br />
}[/size][/color][/size][/font][/color]<br />
[color="#000000"][font="Arial, sans-serif"][size="4"][color="#111111"][size="3"]
 
1 - 1 of 1 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top