Service

abstract class Service : ForegroundService, IService

Author

"Martin Krischik" «krischik@users.sourceforge.net»

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
open class Binder : IBinder<Service_Type>
binder class to pass the reference to the service class to the activity;

Properties

Link copied to clipboard
private open var Bind: Service.Binder
used to bind the service to it's activity
Link copied to clipboard
private open var Calculator: ICalculator
Calculator engine
Link copied to clipboard
protected open var Calculator_Activity: ICalculatorCanvas
Activity to display the calculator (there can only be one!).
Link copied to clipboard
private val CALCULATOR_TART_UP_TIME: Int = 200
Link copied to clipboard
private open var Calculator_Thread: Thread
Thread in which the calculator runs.
Link copied to clipboard
private open var channelName: CharSequence

unique id for the foreground notification Channel.

Link copied to clipboard
val Companion: ForegroundService.Companion
Link copied to clipboard
private open var enabled: Boolean

Service currently running in foreground

Link copied to clipboard
private val Foreground_Channel_ID: String = "Foreground"

unique id for the foreground notification Channel.

Link copied to clipboard

tile for to display on the notification. Note: No notification is shown when set to null.

Link copied to clipboard
private val Interval: Int = 500000000

Foreground notification interval

Link copied to clipboard
private open var lastNotification: Long

Timestamp of last foreground notification

Link copied to clipboard
private val Notification_ID: Int = 32873234

unique id for the foreground notification — just a random int. (0x1f59b12)

Link copied to clipboard
private open var notificationIconId: Int

icon id to display on the notification. Note: No notification is shown when set to 0.

Link copied to clipboard
private val TAG: String
logging tag
private val TAG: NonExistentClass

logging tag

Link copied to clipboard
private val THREAD_START_UP_TIME: Int = 3000
Thread startup time.

Functions

Link copied to clipboard
open fun Calculator(): ICalculator
Calculator engine
Link copied to clipboard
protected open fun clone(): Any
Link copied to clipboard
abstract fun createCalculator(): ICalculator

Create Calculator engine.

Link copied to clipboard
open fun createNotification(actionClass: Class<out NonExistentClass>, text: Array<CharSequence>): NonExistentClass

create a notification builder to display the give two line of Text.

Link copied to clipboard

create a channel to use for foreground notifications

Link copied to clipboard
protected open fun displayNotifications(): Boolean

check if foreground notification should be displayed.

Link copied to clipboard
open fun equals(obj: Any): Boolean
Link copied to clipboard
protected open fun fatalError(Message: String)
Print Error message Stop Calculator and exit program.
Link copied to clipboard
protected open fun finalize()
Link copied to clipboard
open fun foreground(enable: Boolean, actionClass: Class<out NonExistentClass>, text: Array<CharSequence>)

Switch service to foreground and show a notification (which you have to sind API 5)

Link copied to clipboard
fun getClass(): Class<out Any>
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
calculator is started in service
Link copied to clipboard
fun notify()
Link copied to clipboard
fun notifyAll()
Link copied to clipboard
open fun onBind(intent: Intent): IBinder
Link copied to clipboard
open fun onDestroy()
Link copied to clipboard
open fun onStart(intent: Intent, startId: Int)
This is the old onStart method that will be called on the pre-2.0 platform.
Link copied to clipboard
open fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int
The new 2.0 startup code.
Link copied to clipboard
open fun onUnbind(intent: Intent): Boolean
Link copied to clipboard
abstract fun restoreStatus()
Restore calculator status
Link copied to clipboard
open fun run()
Initialise system and run virtual calculator CPU
Link copied to clipboard
abstract fun saveStatus()

Save calculator status

Link copied to clipboard
open fun setCalculatorActivity(Calculator_Activity: ICalculatorCanvas)
Set Canvas to display result read keyboard
Link copied to clipboard
open fun setForegroundNotificationData(channelName: CharSequence, title: CharSequence, iconId: Int)

set the parameter needed to display a foreground notification. Without the service will always run in background.

Link copied to clipboard
open fun toString(): String
Link copied to clipboard
fun wait()