java


Time controls in Android


I'm building my Main() method for a game I am developing in Eclipse, and I wanted to know if there are any time related classes already created in the Android SDK.
What I wanted to do was to make my Main() method loop through a While loop then wait 100 milliseconds, then loop again. I just need to know how I could make the loop wait.
Try this code. You can read more about the Java timer API here.
import java.util.Timer;
...
int delay = 0; // initial delay
int period = 100; // repeat every 100 ms
new Timer().scheduleAtFixedRate(new TimerTask() {
public void run() {
// Your while loop goes here
}
}, delay, period);

Related Links

Is there a way for a Java app to gain root permissions?
Tests for Android Content Provider strange behavior
Issue when printing out from a CSV file. It prints out an address instead of what it is in the CSV file. Does anyone know how to fix it?
Can't compare string turned into integer java
How to check another button while action performed
BeanCreationException : Invocation of init method failed
How to restrict if condition only one time execution in java
How to handle transaction in Spring with weblogic and JPA
How to use hibernate to query for an object with a nested object that has a nested collection of objects
How to get a the output to a console as a string in java [closed]
How to make button changes repaint -during- method, not after?
Store Jtextfield input in Arraylist then print contents of Arraylist
1D array frequency counter for other methods
Android RSA encryption from public string
Java - store objects in a hierarchy that follows their class inheritance
NoClassDefFoundError though .jar is correctly included

Categories

HOME
pandas
winforms
fluentd
heroku
push-notification
comparison
hashmap
android-4.4-kitkat
blueprintjs
cross-validation
session-variables
here-api
windows-server-2012
decimal
designer
plunker
paging
java-3d
opencover
cloudhub
wijmo
facebook-access-token
chromebook
intel-pin
social-media
instant-messaging
lightswitch-2013
kendo-ui-grid
form-data
cloud-code
web-mining
swift3.0.2
serverside-rendering
starteam
c11
twitch
webdriver-manager
dynamic-reports
password-encryption
midl
btrace
executenonquery
upstart
worksheet
pebble-watch
jxcore
directory-structure
android-cursor
spring-mongodb
nxt
radtreelist
thrust
xml-attribute
plottable.js
phpcas
lemon
metaclass
tarjans-algorithm
android-listview
unity5.2.3
lustre
typekit
applescript-objc
has-many-through
eol
aapt
htmlcleaner
didselectrowatindexpath
java.nio.file
floating-point-precision
jplaton
jquery-mobile-dialog
html-editor
type-equivalence
android-hardware
tinn-r
viewswitcher
bigcouch
mercurial-server
doh
mongomapper
coda-slider
gin
user-friendly
brewmp
exchange-server-2003
data-driven
privilege
spec#
scripting-languages
dbisam

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App