AI2 Component  (Version nb184)
Clock.java
Go to the documentation of this file.
1 // -*- mode: java; c-basic-offset: 2; -*-
2 // Copyright 2009-2011 Google, All Rights reserved
3 // Copyright 2011-2012 MIT, All rights reserved
4 // Released under the Apache License, Version 2.0
5 // http://www.apache.org/licenses/LICENSE-2.0
6 
7 package com.google.appinventor.components.runtime;
8 
23 
24 
25 import java.util.Calendar;
26 import java.util.GregorianCalendar;
27 
63 @DesignerComponent(version = YaVersion.CLOCK_COMPONENT_VERSION,
64  description = "<p>Non-visible component that provides the instant in time using the internal clock on th"
65  + "e phone. It can fire a timer at regularly set intervals and perform time calculations, manipulations, and conversions.</p> "
66  + "<p>Methods to convert an instant to text are also available. Acceptable patterns are empty string, MM/DD/YYYY HH:mm:ss a, or MMM d, yyyy"
67  + "HH:mm. The empty string will provide the default format, which is \"MMM d, yyyy HH:mm:ss a\" for FormatDateTime \"MMM d, yyyy\" for FormatDate. "
68  + "To see all possible format, please see <a href=\"https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html\" _target=\"_blank\">here</a>. </p> ",
69  category = ComponentCategory.SENSORS,
70  nonVisible = true,
71  iconName = "images/clock.png")
72 @SimpleObject
73 public class Clock extends AndroidNonvisibleComponent
75  Deleteable {
76  private static final int DEFAULT_INTERVAL = 1000; // ms
77  private static final boolean DEFAULT_ENABLED = true;
78 
79  private TimerInternal timerInternal;
80  private boolean timerAlwaysFires = true;
81  private boolean onScreen = false;
82 
88  public Clock(ComponentContainer container) {
89  super(container.$form());
90  timerInternal = new TimerInternal(this, DEFAULT_ENABLED, DEFAULT_INTERVAL);
91 
92  // Set up listeners
94  form.registerForOnStop(this);
96 
97  if (form instanceof ReplForm) {
98  // In REPL, if this Clock component was added to the project after the onResume call occurred,
99  // then onScreen would be false, but the REPL app is, in fact, on screen.
100  onScreen = true;
101  }
102  }
103 
104  // Only the above constructor should be used in practice.
105  public Clock() {
106  super(null);
107  // To allow testing without Timer
108  }
109 
115  @SimpleEvent(
116  description = "The Timer event runs when the timer has gone off.")
117  public void Timer() {
118  if (timerAlwaysFires || onScreen) {
119  EventDispatcher.dispatchEvent(this, "Timer");
120  }
121  }
122 
129  category = PropertyCategory.BEHAVIOR,
130  description ="Interval between timer events in ms")
131  public int TimerInterval() {
132  return timerInternal.Interval();
133  }
134 
145  defaultValue = DEFAULT_INTERVAL + "")
147  public void TimerInterval(int interval) {
148  timerInternal.Interval(interval);
149  }
150 
158  category = PropertyCategory.BEHAVIOR,
159  description = "Fires timer if true")
160  public boolean TimerEnabled() {
161  return timerInternal.Enabled();
162  }
163 
171  defaultValue = DEFAULT_ENABLED ? "True" : "False")
173  public void TimerEnabled(boolean enabled) {
174  timerInternal.Enabled(enabled);
175  }
176 
185  category = PropertyCategory.BEHAVIOR,
186  description = "Will fire even when application is not showing on the "
187  + "screen if true")
188  public boolean TimerAlwaysFires() {
189  return timerAlwaysFires;
190  }
191 
199  @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN, defaultValue = "True")
201  public void TimerAlwaysFires(boolean always) {
202  timerAlwaysFires = always;
203  }
204 
205  // AlarmHandler implementation
206 
207  @Override
208  public void alarm() {
209  Timer();
210  }
211 
218  @SimpleFunction (description = "Returns the phone's internal time.")
219  public static long SystemTime() {
220  return Dates.Timer();
221  }
222 
223  @SimpleFunction(description = "Returns the current instant in time read from "
224  + "phone's clock.")
225  public static Calendar Now() {
226  return Dates.Now();
227  }
228 
240  description = "Returns an instant in time specified by MM/dd/YYYY hh:mm:ss or "
241  + "MM/dd/YYYY or hh:mm.")
242  public static Calendar MakeInstant(String from) {
243  try {
244  return Dates.DateValue(from);
245  } catch (IllegalArgumentException e) {
246  throw new YailRuntimeError(
247  "Argument to MakeInstant should have form MM/dd/YYYY hh:mm:ss, or MM/dd/YYYY or hh:mm",
248  "Sorry to be so picky.");
249  }
250  }
251 
260  @SimpleFunction(description = "Returns an instant in time specified by year, month, date in "
261  + "UTC.\nValid values for the month field are 1-12 and 1-31 for the day field.")
262  public Calendar MakeDate(int year, int month, int day) {
263  int jMonth = month - 1;
264  try {
265  GregorianCalendar cal = new GregorianCalendar(year, jMonth, day);
266  cal.setLenient(false);
267 
268  // A non-lenient GregorianCalendar throws an exception upon
269  // calculating its time or calendar field values if any out-of-range field value has been set.
270  cal.getTime();
271  } catch (IllegalArgumentException e) {
273  }
274 
275  Calendar instant = Dates.DateInstant(year, month, day);
276  return instant;
277  }
278 
287  @SimpleFunction(description = "Returns an instant in time specified by hour, minute, second in "
288  + "UTC.")
289  public Calendar MakeTime(int hour, int minute, int second) {
290  Calendar instant = new GregorianCalendar();
291  try {
292  instant.set(Calendar.HOUR_OF_DAY, hour);
293  instant.set(Calendar.MINUTE, minute);
294  instant.set(Calendar.SECOND, second);
295  } catch (IllegalArgumentException e) {
297  }
298  return instant;
299  }
300 
314  description = "Returns an instant in time specified by year, month, date, hour, minute, "
315  + "second in UTC.")
316  public Calendar MakeInstantFromParts(int year, int month, int day, int hour, int minute, int second) {
317  int jMonth = month - 1;
318  Calendar instant = null;
319  try {
320  instant = new GregorianCalendar(year, jMonth, day);
321  instant.setLenient(false);
322 
323  // A non-lenient GregorianCalendar throws an exception upon
324  // calculating its time or calendar field values if any out-of-range field value has been set.
325  instant.getTime();
326  } catch (IllegalArgumentException e) {
327  form.dispatchErrorOccurredEvent(this, "MakeInstantFromParts", ErrorMessages.ERROR_ILLEGAL_DATE);
328  }
329 
330  instant = Dates.DateInstant(year, month, day);
331 
332  try {
333  instant.set(Calendar.HOUR_OF_DAY, hour);
334  instant.set(Calendar.MINUTE, minute);
335  instant.set(Calendar.SECOND, second);
336 
337  } catch (IllegalArgumentException e) {
338  form.dispatchErrorOccurredEvent(this, "MakeInstantFromParts", ErrorMessages.ERROR_ILLEGAL_DATE);
339  }
340 
341  return instant;
342 
343  }
344 
352  @SimpleFunction(description = "Returns an instant in time specified by the milliseconds since "
353  + "1970 in UTC.")
354  public static Calendar MakeInstantFromMillis(long millis) {
355  Calendar instant = Dates.Now(); // just to get our hands on an instant
356  instant.setTimeInMillis(millis);
357  return instant;
358  }
359 
367  @SimpleFunction (description = "Returns the instant in time measured as milliseconds since 1970.")
368  public static long GetMillis(Calendar instant) {
369  return instant.getTimeInMillis();
370  }
371 
372  @SimpleFunction(description = "Returns an instant in time some duration after the argument")
373  public static Calendar AddDuration(Calendar instant, long quantity) {
374  Calendar newInstant = (Calendar) instant.clone();
375  Dates.DateAddInMillis(newInstant, quantity);
376  return newInstant;
377  }
378 
379  @SimpleFunction(description = "Returns an instant in time some seconds after the given instant.")
380  public static Calendar AddSeconds(Calendar instant, int quantity) {
381  Calendar newInstant = (Calendar) instant.clone();
382  Dates.DateAdd(newInstant, Calendar.SECOND, quantity);
383  return newInstant;
384  }
385 
386  @SimpleFunction(description = "Returns an instant in time some minutes after the given instant.")
387  public static Calendar AddMinutes(Calendar instant, int quantity) {
388  Calendar newInstant = (Calendar) instant.clone();
389  Dates.DateAdd(newInstant, Calendar.MINUTE, quantity);
390  return newInstant;
391  }
392 
393  @SimpleFunction(description = "Returns an instant in time some hours after the given instant.")
394  public static Calendar AddHours(Calendar instant, int quantity) {
395  Calendar newInstant = (Calendar) instant.clone();
396  Dates.DateAdd(newInstant, Calendar.HOUR_OF_DAY, quantity);
397  return newInstant;
398  }
399 
400  @SimpleFunction(description = "Returns an instant in time some days after the given instant.")
401  public static Calendar AddDays(Calendar instant, int quantity) {
402  Calendar newInstant = (Calendar) instant.clone();
403  Dates.DateAdd(newInstant, Calendar.DATE, quantity);
404  return newInstant;
405  }
406 
407  @SimpleFunction(description = "Returns An instant in time some weeks after the given instant.")
408  public static Calendar AddWeeks(Calendar instant, int quantity) {
409  Calendar newInstant = (Calendar) instant.clone();
410  Dates.DateAdd(newInstant, Calendar.WEEK_OF_YEAR, quantity);
411  return newInstant;
412  }
413 
414  @SimpleFunction(description = "Returns an instant in time some months after the given instant.")
415  public static Calendar AddMonths(Calendar instant, int quantity) {
416  Calendar newInstant = (Calendar) instant.clone();
417  Dates.DateAdd(newInstant, Calendar.MONTH, quantity);
418  return newInstant;
419  }
420 
421  @SimpleFunction(description = "Returns an instant in time some years after the given instant.")
422  public static Calendar AddYears(Calendar instant, int quantity) {
423  Calendar newInstant = (Calendar) instant.clone();
424  Dates.DateAdd(newInstant, Calendar.YEAR, quantity);
425  return newInstant;
426  }
427 
435  @SimpleFunction (description = "Returns duration, which is milliseconds elapsed between "
436  + "instants.")
437  public static long Duration(Calendar start, Calendar end) {
438  return end.getTimeInMillis() - start.getTimeInMillis();
439  }
440 
447  @SimpleFunction (description = "Converts the duration to the number of seconds.")
448  public static long DurationToSeconds(long duration) {
449  return Dates.ConvertDuration(duration, Calendar.SECOND);
450  }
451 
458  @SimpleFunction (description = "Converts the duration to the number of minutes.")
459  public static long DurationToMinutes(long duration) {
460  return Dates.ConvertDuration(duration, Calendar.MINUTE);
461  }
462 
469  @SimpleFunction (description = "Converts the duration to the number of hours.")
470  public static long DurationToHours(long duration) {
471  return Dates.ConvertDuration(duration, Calendar.HOUR_OF_DAY);
472  }
473 
480  @SimpleFunction (description = "Converts the duration to the number of days.")
481  public static long DurationToDays(long duration) {
482  return Dates.ConvertDuration(duration, Calendar.DATE);
483  }
484 
491  @SimpleFunction (description = "Converts the duration to the number of weeks.")
492  public static long DurationToWeeks(long duration) {
493  return Dates.ConvertDuration(duration, Calendar.WEEK_OF_YEAR);
494  }
495 
502  @SimpleFunction (description = "Returns the second of the minute (0-59) from the instant.")
503  public static int Second(Calendar instant) {
504  return Dates.Second(instant);
505  }
506 
513  @SimpleFunction(description = "Returns the minute of the hour (0-59) from the instant.")
514  public static int Minute(Calendar instant) {
515  return Dates.Minute(instant);
516  }
517 
524  @SimpleFunction (description = "Returns the hour of the day (0-23) from the instant.")
525  public static int Hour(Calendar instant) {
526  return Dates.Hour(instant);
527  }
528 
535  @SimpleFunction (description = "Returns the day of the month (1-31) from the instant.")
536  public static int DayOfMonth(Calendar instant) {
537  return Dates.Day(instant);
538  }
539 
546  @SimpleFunction (description = "Returns the day of the week represented as a "
547  + "number from 1 (Sunday) to 7 (Saturday).")
548  public static int Weekday(Calendar instant) {
549  return Dates.Weekday(instant);
550  }
551 
558  @SimpleFunction (description = "Returns the name of the day of the week from the instant.")
559  public static String WeekdayName(Calendar instant) {
560  return Dates.WeekdayName(instant);
561  }
562 
569  @SimpleFunction (description = "Returns the month of the year represented as a "
570  + "number from 1 to 12).")
571  public static int Month(Calendar instant) {
572  return Dates.Month(instant) + 1;
573  }
574 
581  @SimpleFunction (description = "Returns the name of the month from the instant, e.g., January, "
582  + "February, March...")
583  public static String MonthName(Calendar instant) {
584  return Dates.MonthName(instant);
585  }
586 
593  @SimpleFunction(description = "The year")
594  public static int Year(Calendar instant) {
595  return Dates.Year(instant);
596  }
597 
607  @SimpleFunction (description = "Returns text representing the date and time of an"
608  + " instant in the specified pattern")
609  public static String FormatDateTime(Calendar instant, String pattern) {
610  try {
611  return Dates.FormatDateTime(instant, pattern);
612  } catch (IllegalArgumentException e){
613  throw new YailRuntimeError(
614  "Illegal argument for pattern in Clock.FormatDateTime. Acceptable values are empty string, MM/dd/YYYY hh:mm:ss a, MMM d, yyyy HH:mm "
615  + "For all possible patterns, see https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html",
616  "Sorry to be so picky.");
617  }
618  }
619 
629  @SimpleFunction (description = "Text representing the date of an instant in the specified pattern")
630  public static String FormatDate(Calendar instant, String pattern) {
631  try {
632  return Dates.FormatDate(instant, pattern);
633  } catch (IllegalArgumentException e){
634  throw new YailRuntimeError(
635  "Illegal argument for pattern in Clock.FormatDate. Acceptable values are empty string, MM/dd/YYYY, or MMM d, yyyy. "
636  + "For all possible patterns, see https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"
637  ,"Sorry to be so picky.");
638  }
639  }
640 
649  @SimpleFunction (description = "Text representing the time of an instant")
650  public static String FormatTime(Calendar instant) {
651  return Dates.FormatTime(instant);
652  }
653 
654  @Override
655  public void onStop() {
656  onScreen = false;
657  }
658 
659  @Override
660  public void onResume() {
661  onScreen = true;
662  }
663 
664  @Override
665  public void onDestroy() {
666  timerInternal.Enabled(false);
667  }
668 
669  @Override
670  public void onDelete() {
671  timerInternal.Enabled(false);
672  }
673 }
com.google.appinventor.components.runtime.EventDispatcher
Definition: EventDispatcher.java:22
com.google.appinventor.components.runtime.ReplForm
Definition: ReplForm.java:62
com.google.appinventor.components.runtime.util.Dates.ConvertDuration
static long ConvertDuration(long duration, int intervalKind)
Definition: Dates.java:174
com.google.appinventor.components.runtime.Clock.DayOfMonth
static int DayOfMonth(Calendar instant)
Definition: Clock.java:536
com.google.appinventor.components.runtime.Clock.onDelete
void onDelete()
Definition: Clock.java:670
com.google.appinventor.components.annotations.SimpleFunction
Definition: SimpleFunction.java:23
com.google.appinventor.components.runtime.util.Dates.FormatTime
static String FormatTime(Calendar date)
Definition: Dates.java:240
com.google.appinventor.components.runtime.util.Dates.Timer
static long Timer()
Definition: Dates.java:363
com.google.appinventor.components.runtime.Clock.FormatDate
static String FormatDate(Calendar instant, String pattern)
Definition: Clock.java:630
com.google.appinventor.components.runtime.Clock.DurationToSeconds
static long DurationToSeconds(long duration)
Definition: Clock.java:448
com.google.appinventor.components.runtime.Form.registerForOnDestroy
void registerForOnDestroy(OnDestroyListener component)
Definition: Form.java:817
com.google.appinventor.components.runtime.util.ErrorMessages
Definition: ErrorMessages.java:17
com.google.appinventor.components.runtime.util.Dates.Second
static int Second(Calendar date)
Definition: Dates.java:353
com.google.appinventor.components.runtime.util
-*- mode: java; c-basic-offset: 2; -*-
Definition: AccountChooser.java:7
com.google.appinventor.components.runtime.Clock.FormatDateTime
static String FormatDateTime(Calendar instant, String pattern)
Definition: Clock.java:609
com.google.appinventor.components.common.YaVersion
Definition: YaVersion.java:14
com.google.appinventor.components.runtime.Clock.FormatTime
static String FormatTime(Calendar instant)
Definition: Clock.java:650
com.google.appinventor.components.runtime.AlarmHandler
Definition: AlarmHandler.java:14
com.google.appinventor.components.annotations.DesignerProperty
Definition: DesignerProperty.java:25
com.google.appinventor.components.runtime.Clock.DurationToWeeks
static long DurationToWeeks(long duration)
Definition: Clock.java:492
com.google.appinventor.components.runtime.Clock.AddYears
static Calendar AddYears(Calendar instant, int quantity)
Definition: Clock.java:422
com.google.appinventor.components.runtime.Form.registerForOnResume
void registerForOnResume(OnResumeListener component)
Definition: Form.java:740
com.google.appinventor.components.runtime.Clock.TimerAlwaysFires
boolean TimerAlwaysFires()
Definition: Clock.java:188
com.google.appinventor.components.runtime.Clock.onResume
void onResume()
Definition: Clock.java:660
com.google.appinventor.components.runtime.util.Dates.FormatDateTime
static String FormatDateTime(Calendar date, String pattern)
Definition: Dates.java:201
com.google.appinventor.components.runtime.util.Dates.DateAdd
static void DateAdd(Calendar date, int intervalKind, int interval)
Definition: Dates.java:79
com.google.appinventor.components
com.google.appinventor.components.common.PropertyTypeConstants.PROPERTY_TYPE_NON_NEGATIVE_INTEGER
static final String PROPERTY_TYPE_NON_NEGATIVE_INTEGER
Definition: PropertyTypeConstants.java:206
com.google.appinventor.components.runtime.Clock.SystemTime
static long SystemTime()
Definition: Clock.java:219
com.google.appinventor.components.runtime.util.Dates.Year
static int Year(Calendar date)
Definition: Dates.java:399
com.google.appinventor.components.runtime.Clock.MakeDate
Calendar MakeDate(int year, int month, int day)
Definition: Clock.java:262
com.google.appinventor.components.runtime.Clock.Now
static Calendar Now()
Definition: Clock.java:225
com.google.appinventor.components.common.PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN
static final String PROPERTY_TYPE_BOOLEAN
Definition: PropertyTypeConstants.java:35
com.google.appinventor.components.runtime.Clock.AddDays
static Calendar AddDays(Calendar instant, int quantity)
Definition: Clock.java:401
com.google.appinventor.components.runtime.util.Dates.Day
static int Day(Calendar date)
Definition: Dates.java:161
com.google.appinventor.components.runtime.Clock.TimerEnabled
void TimerEnabled(boolean enabled)
Definition: Clock.java:173
com.google.appinventor.components.annotations.DesignerComponent
Definition: DesignerComponent.java:22
com.google.appinventor.components.runtime.Clock.DurationToHours
static long DurationToHours(long duration)
Definition: Clock.java:470
com.google.appinventor.components.annotations.SimpleEvent
Definition: SimpleEvent.java:20
com.google.appinventor.components.annotations.PropertyCategory.BEHAVIOR
BEHAVIOR
Definition: PropertyCategory.java:15
com.google.appinventor.components.runtime.Clock.TimerInterval
int TimerInterval()
Definition: Clock.java:131
com.google.appinventor.components.runtime.Clock.DurationToMinutes
static long DurationToMinutes(long duration)
Definition: Clock.java:459
com.google.appinventor.components.runtime.util.Dates.Weekday
static int Weekday(Calendar date)
Definition: Dates.java:377
com.google.appinventor.components.runtime.Clock.MonthName
static String MonthName(Calendar instant)
Definition: Clock.java:583
com.google.appinventor.components.runtime.util.TimerInternal.Interval
int Interval()
Definition: TimerInternal.java:72
com.google.appinventor.components.runtime.Clock.Clock
Clock(ComponentContainer container)
Definition: Clock.java:88
com.google.appinventor.components.runtime.Clock.AddMinutes
static Calendar AddMinutes(Calendar instant, int quantity)
Definition: Clock.java:387
com.google.appinventor.components.runtime.OnResumeListener
Definition: OnResumeListener.java:14
com.google.appinventor.components.runtime.util.TimerInternal.Enabled
boolean Enabled()
Definition: TimerInternal.java:95
com.google.appinventor.components.runtime.util.Dates.MonthName
static String MonthName(Calendar date)
Definition: Dates.java:332
com.google.appinventor.components.runtime.Clock.Year
static int Year(Calendar instant)
Definition: Clock.java:594
com.google.appinventor.components.runtime.Clock.Month
static int Month(Calendar instant)
Definition: Clock.java:571
com.google.appinventor.components.runtime.Clock.Clock
Clock()
Definition: Clock.java:105
com.google.appinventor.components.runtime.EventDispatcher.dispatchEvent
static boolean dispatchEvent(Component component, String eventName, Object...args)
Definition: EventDispatcher.java:188
com.google.appinventor.components.runtime.Clock.AddMonths
static Calendar AddMonths(Calendar instant, int quantity)
Definition: Clock.java:415
com.google.appinventor.components.runtime.AndroidNonvisibleComponent
Definition: AndroidNonvisibleComponent.java:17
com.google.appinventor.components.runtime.Clock.MakeInstant
static Calendar MakeInstant(String from)
Definition: Clock.java:242
com.google.appinventor.components.runtime.Clock.TimerInterval
void TimerInterval(int interval)
Definition: Clock.java:147
com.google.appinventor.components.runtime.Clock.MakeTime
Calendar MakeTime(int hour, int minute, int second)
Definition: Clock.java:289
com.google.appinventor.components.runtime.util.Dates.FormatDate
static String FormatDate(Calendar date, String pattern)
Definition: Dates.java:221
com.google.appinventor.components.runtime.errors.YailRuntimeError
Definition: YailRuntimeError.java:14
com.google.appinventor.components.annotations.SimpleProperty
Definition: SimpleProperty.java:23
com.google.appinventor.components.runtime.Clock.Weekday
static int Weekday(Calendar instant)
Definition: Clock.java:548
com.google.appinventor.components.runtime.Clock.TimerEnabled
boolean TimerEnabled()
Definition: Clock.java:160
com.google.appinventor.components.annotations.PropertyCategory
Definition: PropertyCategory.java:13
com.google.appinventor.components.runtime.Clock.Hour
static int Hour(Calendar instant)
Definition: Clock.java:525
com.google.appinventor.components.runtime.Clock
Definition: Clock.java:73
com.google.appinventor.components.runtime.ComponentContainer
Definition: ComponentContainer.java:16
com.google.appinventor.components.runtime
Copyright 2009-2011 Google, All Rights reserved.
Definition: AccelerometerSensor.java:8
com.google.appinventor.components.runtime.util.Dates.DateValue
static Calendar DateValue(String value)
Definition: Dates.java:128
com.google.appinventor.components.runtime.Component
Definition: Component.java:17
com.google.appinventor.components.runtime.util.Dates
Definition: Dates.java:24
com.google.appinventor.components.runtime.Deleteable
Definition: Deleteable.java:15
com.google.appinventor.components.common
Definition: ComponentCategory.java:7
com.google.appinventor.components.runtime.Clock.Timer
void Timer()
Definition: Clock.java:117
com.google.appinventor.components.common.ComponentCategory
Definition: ComponentCategory.java:48
com.google.appinventor.components.runtime.OnStopListener
Definition: OnStopListener.java:15
com.google.appinventor.components.runtime.Clock.DurationToDays
static long DurationToDays(long duration)
Definition: Clock.java:481
com.google.appinventor.components.runtime.Clock.Second
static int Second(Calendar instant)
Definition: Clock.java:503
com.google.appinventor.components.runtime.Form.dispatchErrorOccurredEvent
void dispatchErrorOccurredEvent(final Component component, final String functionName, final int errorNumber, final Object... messageArgs)
Definition: Form.java:1011
com.google.appinventor.components.runtime.util.TimerInternal
Definition: TimerInternal.java:17
com.google.appinventor.components.runtime.Clock.AddWeeks
static Calendar AddWeeks(Calendar instant, int quantity)
Definition: Clock.java:408
com.google.appinventor.components.runtime.Form.registerForOnStop
void registerForOnStop(OnStopListener component)
Definition: Form.java:793
com.google.appinventor.components.annotations.SimpleObject
Definition: SimpleObject.java:23
com.google.appinventor.components.runtime.util.Dates.Month
static int Month(Calendar date)
Definition: Dates.java:321
com.google.appinventor.components.runtime.Clock.TimerAlwaysFires
void TimerAlwaysFires(boolean always)
Definition: Clock.java:201
com.google.appinventor.components.runtime.Clock.Duration
static long Duration(Calendar start, Calendar end)
Definition: Clock.java:437
com.google.appinventor.components.runtime.Clock.MakeInstantFromParts
Calendar MakeInstantFromParts(int year, int month, int day, int hour, int minute, int second)
Definition: Clock.java:316
com.google
com.google.appinventor.components.runtime.Clock.AddHours
static Calendar AddHours(Calendar instant, int quantity)
Definition: Clock.java:394
com.google.appinventor.components.runtime.Clock.Minute
static int Minute(Calendar instant)
Definition: Clock.java:514
com
com.google.appinventor.components.runtime.Clock.MakeInstantFromMillis
static Calendar MakeInstantFromMillis(long millis)
Definition: Clock.java:354
com.google.appinventor.components.runtime.util.Dates.Now
static Calendar Now()
Definition: Dates.java:342
com.google.appinventor.components.runtime.util.Dates.Minute
static int Minute(Calendar date)
Definition: Dates.java:305
com.google.appinventor.components.runtime.errors
Definition: ArrayIndexOutOfBoundsError.java:7
com.google.appinventor.components.runtime.util.ErrorMessages.ERROR_ILLEGAL_DATE
static final int ERROR_ILLEGAL_DATE
Definition: ErrorMessages.java:193
com.google.appinventor.components.runtime.Clock.WeekdayName
static String WeekdayName(Calendar instant)
Definition: Clock.java:559
com.google.appinventor.components.runtime.ComponentContainer.$form
Form $form()
com.google.appinventor.components.runtime.util.Dates.WeekdayName
static String WeekdayName(Calendar date)
Definition: Dates.java:388
com.google.appinventor.components.runtime.util.Dates.DateAddInMillis
static void DateAddInMillis(Calendar date, long millis)
Definition: Dates.java:106
com.google.appinventor.components.runtime.Clock.onStop
void onStop()
Definition: Clock.java:655
com.google.appinventor.components.runtime.AndroidNonvisibleComponent.form
final Form form
Definition: AndroidNonvisibleComponent.java:19
com.google.appinventor.components.runtime.Clock.AddDuration
static Calendar AddDuration(Calendar instant, long quantity)
Definition: Clock.java:373
com.google.appinventor.components.runtime.Clock.alarm
void alarm()
Definition: Clock.java:208
com.google.appinventor.components.common.PropertyTypeConstants
Definition: PropertyTypeConstants.java:14
com.google.appinventor.components.runtime.OnDestroyListener
Definition: OnDestroyListener.java:15
com.google.appinventor.components.runtime.Clock.AddSeconds
static Calendar AddSeconds(Calendar instant, int quantity)
Definition: Clock.java:380
com.google.appinventor.components.annotations
com.google.appinventor.components.runtime.Clock.onDestroy
void onDestroy()
Definition: Clock.java:665
com.google.appinventor
com.google.appinventor.components.runtime.util.Dates.DateInstant
static Calendar DateInstant(int year, int month, int day)
Definition: Dates.java:253
com.google.appinventor.components.runtime.Clock.GetMillis
static long GetMillis(Calendar instant)
Definition: Clock.java:368
com.google.appinventor.components.runtime.util.Dates.Hour
static int Hour(Calendar date)
Definition: Dates.java:294