Package arc
Interface Application
- All Superinterfaces:
Disposable
- All Known Implementing Classes:
AndroidApplication
,HeadlessApplication
,IOSApplication
,MockApplication
,SdlApplication
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addListener
(ApplicationListener listener) Adds a new application listener.default void
Call this before update() in each backend.default void
dispose()
Disposes of core resources.void
exit()
Schedule an exit from the application.default long
Returns a list of all the application listeners used.default long
getType()
default int
default boolean
default boolean
default boolean
default boolean
isIOS()
default boolean
isMobile()
default boolean
isWeb()
default boolean
openFolder
(String file) Open a folder in the system's file browser.default boolean
Launches the default browser to display a URI.void
Posts a runnable on the main loop thread.default void
removeListener
(ApplicationListener listener) Removes an application listener.void
setClipboardText
(String text) Methods inherited from interface arc.util.Disposable
isDisposed
-
Method Details
-
getListeners
Seq<ApplicationListener> getListeners()Returns a list of all the application listeners used. -
addListener
Adds a new application listener. -
removeListener
Removes an application listener. -
defaultUpdate
default void defaultUpdate()Call this before update() in each backend. -
getType
Application.ApplicationType getType()- Returns:
- what
Application.ApplicationType
this application has, e.g. Android or Desktop
-
isDesktop
default boolean isDesktop() -
isHeadless
default boolean isHeadless() -
isAndroid
default boolean isAndroid() -
isIOS
default boolean isIOS() -
isMobile
default boolean isMobile() -
isWeb
default boolean isWeb() -
getVersion
default int getVersion()- Returns:
- the Android API level on Android, the major OS version on iOS (5, 6, 7, ..), or 0 on the desktop.
-
getJavaHeap
default long getJavaHeap()- Returns:
- the Java heap memory use in bytes.
-
getNativeHeap
default long getNativeHeap()- Returns:
- the Native heap memory use in bytes. Only valid on Android.
-
getClipboardText
-
setClipboardText
-
openFolder
Open a folder in the system's file browser.- Returns:
- whether this operation was successful.
-
openURI
Launches the default browser to display a URI. If the default browser is not able to handle the specified URI, the application registered for handling URIs of the specified type is invoked. The application is determined from the protocol and path of the URI. A best effort is made to open the given URI; however, since external applications are involved, no guarantee can be made as to whether the URI was actually opened. If it is known that the URI was not opened, false will be returned; otherwise, true will be returned.- Parameters:
URI
- the URI to be opened.- Returns:
- false if it is known the uri was not opened, true otherwise.
-
post
Posts a runnable on the main loop thread. -
exit
void exit()Schedule an exit from the application. On android, this will cause a call to pause() and dispose() some time in the future, it will not immediately finish your application. On iOS this should be avoided in production as it breaks Apples guidelines. -
dispose
default void dispose()Disposes of core resources.- Specified by:
dispose
in interfaceDisposable
-