Using Data from device??

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
drumdemon7GA727d
Posts: 14
Joined: Mon Dec 05, 2011 5:35 pm

Using Data from device??

Post by drumdemon7GA727d » Sun Jan 22, 2012 12:29 am

How do I make an app that uses information already on the iphone or android. For example, if i wanted to make an app that counted down to December 25, what should i put in the code so that the app takes the date and time information from the device, so it knows exactly how many days hours etc til christmas?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Using Data from device??

Post by Dixie » Sun Jan 22, 2012 2:45 am

drumdemon...

I can't be bothered to get into counting down the hours until the next christmas day, but this will get you started...

Code: Select all

on mouseUp
   put the long date into today
   put "12/25/2012" into christmas
   
   convert today to seconds
   convert christmas to seconds
   put "There are" && (christmas - today)/86400 && "days left until Christmas"
end mouseUp
be well

Dixie

drumdemon7GA727d
Posts: 14
Joined: Mon Dec 05, 2011 5:35 pm

Re: Using Data from device??

Post by drumdemon7GA727d » Sun Jan 22, 2012 10:48 pm

ohh cool thanks =]

Post Reply