Package com.mitac.api.libs
Class Launcher
- java.lang.Object
-
- com.mitac.api.libs.ApiBindBase
-
- com.mitac.api.libs.Launcher
-
public class Launcher extends ApiBindBase
This class provides Launcher custom related APIs.
-
-
Constructor Summary
Constructors Constructor Description Launcher(android.content.Context context)
This constructor will not bind the service automatically.Launcher(android.content.Context context, ServiceStatusCallback callback)
This constructor will bind the service automatically.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAppShortcut(java.lang.String packageName, java.lang.String className, java.lang.String title, int screen, int x, int y)
Add app shortcut to the screen.boolean
addOnHotseat(java.lang.String packageName, java.lang.String className, java.lang.String title, int x)
Add app to the hotseatboolean
addWidget(java.lang.String packageName, java.lang.String className, int screen, int x, int y, int spanX, int spanY)
Add app widget to the screen.void
bindService()
bind serviceboolean
isServiceReady()
Check if service is ready.boolean
remove(long id)
Remove app shortcut.boolean
remove(java.lang.String name)
Remove app shortcut.boolean
remove(java.lang.String packageName, java.lang.String className)
Remove app shortcut.boolean
removeAll()
Remove everything from the screen.void
unbindService()
unbind service
-
-
-
Constructor Detail
-
Launcher
public Launcher(android.content.Context context)
This constructor will not bind the service automatically. Please callbindService()
at least once before using APIs.- Parameters:
context
- better to useContext.getApplicationContext()
to prevent memory leaks- Throws:
java.lang.IllegalArgumentException
- if context is null.
-
Launcher
public Launcher(android.content.Context context, ServiceStatusCallback callback)
This constructor will bind the service automatically.- Parameters:
context
- better to useContext.getApplicationContext()
to prevent memory leakscallback
- used to get the notification when service is ready.- Throws:
java.lang.IllegalArgumentException
- if context or callback is null.- See Also:
ServiceStatusCallback
-
-
Method Detail
-
bindService
public void bindService()
Description copied from class:ApiBindBase
bind service- Specified by:
bindService
in classApiBindBase
-
unbindService
public void unbindService()
Description copied from class:ApiBindBase
unbind service- Specified by:
unbindService
in classApiBindBase
-
addWidget
public boolean addWidget(java.lang.String packageName, java.lang.String className, int screen, int x, int y, int spanX, int spanY)
Add app widget to the screen.- Parameters:
packageName
- App package nameclassName
- App class namescreen
- Launcher page starts from 0x
- Widget column positiony
- Widget row positionspanX
- Widget size for columnspanY
- Widget size for row- Returns:
- false if remote fail.
-
addAppShortcut
public boolean addAppShortcut(java.lang.String packageName, java.lang.String className, java.lang.String title, int screen, int x, int y)
Add app shortcut to the screen.- Parameters:
packageName
- App package nameclassName
- App class nametitle
- App title or labelscreen
- Launcher page starts from 0x
- Shortcut column positiony
- Shortcut row position- Returns:
- false if remote fail.
-
addOnHotseat
public boolean addOnHotseat(java.lang.String packageName, java.lang.String className, java.lang.String title, int x)
Add app to the hotseat- Parameters:
packageName
- App package nameclassName
- App package nametitle
- App title or labelx
- Hotseat position which starts from 0- Returns:
- false if remote fail.
-
removeAll
public boolean removeAll()
Remove everything from the screen.- Returns:
- false if remote fail.
-
remove
public boolean remove(java.lang.String name)
Remove app shortcut.- Parameters:
name
- App title or label name- Returns:
- false if remote fail.
-
remove
public boolean remove(java.lang.String packageName, java.lang.String className)
Remove app shortcut.- Parameters:
packageName
- package nameclassName
- class name- Returns:
- false if remote fail.
-
remove
public boolean remove(long id)
Remove app shortcut.- Parameters:
id
- App shortcut id- Returns:
- false if remote fail.
-
isServiceReady
public boolean isServiceReady()
Check if service is ready.- Returns:
true
if ready; false otherwise.
-
-