Modifier and Type | Method and Description |
---|---|
InfantiumResponse |
addDynamicField(DynamicField d_field)
Add new DynamicField
|
InfantiumResponse |
addDynamicFields(List<DynamicField> d_fields)
Add a List of DynamicFields that will appear in the Gameplay.
|
InfantiumResponse |
addElement(Element element)
Add new Element
|
InfantiumResponse |
addElements(List<Element> elements)
Add a List of Elements that will appear in the Gameplay.
|
InfantiumResponse |
addEvent(Event event)
Add an Event to the current Rawdata.
|
InfantiumResponse |
addEvents(List<Event> events)
Add a list of Events to the current Rawdata.
|
InfantiumResponse |
addGoal(Goal goal)
Add a Goal to the current Rawdata.
|
InfantiumResponse |
addGoals(List<Goal> goals)
Add a list of Goals to the current Rawdata.
|
void |
clearReceivers()
Very specific method to be called only by Apps that cannot overwrite the onPause and onResume
Android methods.
|
InfantiumResponse |
closeGameplay()
End of the gameplay (Ebook or Game).
|
InfantiumResponse |
createGameplay()
Creates a new Gameplay obtaining the gameplay_id and the gameplay_uuid.
|
InfantiumResponse |
createGameplay(String subcontent_uuid)
Creates a new Gameplay obtaining the gameplay_id and the gameplay_uuid.
|
static InfantiumSDK |
getInfantiumSDK(Context context)
This function exposes the unique instance whereby InfantiumSDK can be accessed.
|
static InfantiumSDK |
getInfantiumSDK(Context context,
String server,
Boolean debug)
This function exposes the unique instance whereby InfantiumSDK can be accessed.
|
void |
getPlayerUUIDFromApp()
Called by OnResume to get the player from the App
|
InfantiumResponse |
newBasicInteraction(String t,
String goal_type)
Adds an interaction with the screen.
|
InfantiumResponse |
newBasicInteraction(String t,
String object_type,
String goal_type)
Adds an interaction with the screen.
|
InfantiumResponse |
newBasicInteraction(String t,
String object_type,
String goal_type,
Integer lifetime)
Adds an interaction with the screen.
|
InfantiumResponse |
newBasicInteraction(String t,
String object_type,
String goal_type,
Integer n_concurrent_oks,
Integer n_concurrent_kos)
Adds an interaction with the screen.
|
InfantiumResponse |
newBasicInteraction(String t,
String object_type,
String goal_type,
Integer lifetime,
Integer n_concurrent_oks,
Integer n_concurrent_kos)
Adds an interaction with the screen.
|
void |
onPauseInfantium()
Method to be called when overwriting the onPause method of Android
|
void |
onResumeInfantium()
Method to be called when overwriting the onResume method of Android
|
void |
restartRawdata()
Restarts and cleans all the data in the Rawdata
|
Boolean |
returnToInfantiumApp(Activity activ)
Returns the user interaction to the Infantium App
|
void |
sendEbookRawData(int num_page,
boolean text,
boolean read_to_me)
Send the EBook Rawdata.
|
void |
sendGameRawData()
Send the Game Rawdata.
|
void |
sendVideoRawdata(int view_time,
int pause,
int rewind,
int forward,
int replay)
Set the rawdata of the Video.
|
InfantiumResponse |
setContentAppUUID(String contentapp_uuid)
Set Contentapp_uuid from the game or ebook.
|
InfantiumResponse |
setContentUUID(String content_uuid)
Set the content_uuid from the video or ebook
|
void |
setDeveloperCredentials(String api_user,
String api_key)
Set the developer's credentials in order to contact with the API.
|
void |
setDeveloperHandler(InfantiumAsyncResponseHandler handler)
In this function the developer defines a InfantiumAsyncResponseHandler where all the asyncronous communications will be received.
|
void |
setDeviceInfo(int heightPixels,
int widthPixels)
Set the device dimensions
|
InfantiumResponse |
setPlayerUUID(String player_uuid)
Obtain the information from the player and his related tutor.
|
static void |
setResumeAndPauseDeactivated(Boolean resumeAndPause) |
InfantiumResponse |
setSubContentUUID(String subcontent_uuid)
Set the subContentapp_uuid from the game.
|
InfantiumResponse |
startPlaying()
Restarts the Rawdata timestamp.
|
InfantiumResponse |
triggerExistingEvent(String event_id)
Adds the triggering of an existing event
|
InfantiumResponse |
triggerExistingEvent(String event_id,
String triggered_by)
Adds the triggering of an existing event
|
public static final String version
public static InfantiumSDK getInfantiumSDK(Context context)
context
- public static InfantiumSDK getInfantiumSDK(Context context, String server, Boolean debug)
context
- server
- debug
- public static void setResumeAndPauseDeactivated(Boolean resumeAndPause)
resumeAndPause
- public void getPlayerUUIDFromApp()
public Boolean returnToInfantiumApp(Activity activ)
returnToInfantiumApp
in interface ISDK
activ
- The current activity (this) of the app including the SDKpublic void setDeviceInfo(int heightPixels, int widthPixels)
setDeviceInfo
in interface ISDK
widthPixels
- Width of the device.heightPixels
- Height of the device.IllegalArgumentException.
public void setDeveloperCredentials(String api_user, String api_key)
setDeveloperCredentials
in interface ISDK
api_user
- The developer's personal user.api_key
- The developer's personal key.public void setDeveloperHandler(InfantiumAsyncResponseHandler handler)
setDeveloperHandler
in interface ISDK
handler
- The asyncronous handler instance.public InfantiumResponse setContentAppUUID(String contentapp_uuid)
setContentAppUUID
in interface ISDK
contentapp_uuid
- - The uuid of the contentapp.public InfantiumResponse setContentUUID(String content_uuid)
setContentUUID
in interface ISDK
content_uuid
- - The UUID of the content.public InfantiumResponse setSubContentUUID(String subcontent_uuid)
setSubContentUUID
in interface ISDK
subcontent_uuid
- - The UUID of the subcontentapp.public InfantiumResponse setPlayerUUID(String player_uuid)
setPlayerUUID
in interface ISDK
player_uuid
- - The UUID of the player.setContentAppUUID(String)
public InfantiumResponse createGameplay(String subcontent_uuid)
createGameplay
in interface ISDK
subcontent_uuid
- - The UUID of the subcontent.public InfantiumResponse createGameplay()
createGameplay
in interface ISDK
setContentUUID(String)
public InfantiumResponse closeGameplay()
closeGameplay
in interface ISDK
createGameplay(String)
,
createGameplay()
public InfantiumResponse startPlaying()
startPlaying
in interface ISDK
public InfantiumResponse addElement(Element element)
addElement
in interface ISDK
element
- - The element object.public InfantiumResponse addElements(List<Element> elements)
addElements
in interface ISDK
elements
- - A list of Elements.public InfantiumResponse addDynamicField(DynamicField d_field)
addDynamicField
in interface ISDK
d_field
- - The DynamicField object.public InfantiumResponse addDynamicFields(List<DynamicField> d_fields)
addDynamicFields
in interface ISDK
d_fields
- - A list of DynamicFields.public void sendVideoRawdata(int view_time, int pause, int rewind, int forward, int replay)
sendVideoRawdata
in interface ISDK
view_time
- - View time in milliseconds.pause
- - Amount of times the video has pausedrewind
- - Amount of times the video been rewindedforward
- - Amount of times the video been forwardedreplay
- - Amount of times the video been replayedsetContentUUID(String)
public void sendEbookRawData(int num_page, boolean text, boolean read_to_me)
sendEbookRawData
in interface ISDK
num_page
- - The page number of the book.text
- - true if the page contains text and false if not.read_to_me
- - true if the book reads to the player or false if not.setContentAppUUID(String)
,
createGameplay()
public void sendGameRawData()
sendGameRawData
in interface ISDK
setContentAppUUID(String)
,
createGameplay(String)
public void restartRawdata()
restartRawdata
in interface ISDK
public void onPauseInfantium()
onPauseInfantium
in interface ISDK
public void onResumeInfantium()
onResumeInfantium
in interface ISDK
public void clearReceivers()
clearReceivers
in interface ISDK
public InfantiumResponse addGoal(Goal goal)
public InfantiumResponse addGoals(List<Goal> goals)
public InfantiumResponse addEvent(Event event)
public InfantiumResponse addEvents(List<Event> events)
public InfantiumResponse newBasicInteraction(String t, String goal_type)
newBasicInteraction
in interface ISDK
t
- - The type of the interaction. Check the Dev Center for more info.goal_type
- - The goal which had to be achieved by this movement.public InfantiumResponse newBasicInteraction(String t, String object_type, String goal_type)
newBasicInteraction
in interface ISDK
t
- - The type of the interaction. Check the Dev Center for more info.object_type
- - The object/element of interaction.goal_type
- - The goal which had to be achieved by this movement.public InfantiumResponse newBasicInteraction(String t, String object_type, String goal_type, Integer lifetime)
newBasicInteraction
in interface ISDK
t
- - The type of the interaction. Check the Dev Center for more info.object_type
- - The object/element of interaction.goal_type
- - The goal which had to be achieved by this movement.lifetime
- - The available timespan the kid had to make this choice, in milliseconds.public InfantiumResponse newBasicInteraction(String t, String object_type, String goal_type, Integer n_concurrent_oks, Integer n_concurrent_kos)
newBasicInteraction
in interface ISDK
t
- - The type of the interaction. Check the Dev Center for more info.object_type
- - The object/element of interaction.goal_type
- - The goal which had to be achieved by this movement.n_concurrent_oks
- - The amount of other correct solutionsn_concurrent_kos
- - The amount of other incorrect solutionspublic InfantiumResponse newBasicInteraction(String t, String object_type, String goal_type, Integer lifetime, Integer n_concurrent_oks, Integer n_concurrent_kos)
newBasicInteraction
in interface ISDK
t
- - The type of the interaction. Check the Dev Center for more info.object_type
- - The object/element of interaction.goal_type
- - The goal which had to be achieved by this movement.lifetime
- - The available timespan the kid had to make this choice, in milliseconds.n_concurrent_oks
- - The amount of other correct solutionsn_concurrent_kos
- - The amount of other incorrect solutionspublic InfantiumResponse triggerExistingEvent(String event_id)
triggerExistingEvent
in interface ISDK
event_id
- -public InfantiumResponse triggerExistingEvent(String event_id, String triggered_by)
triggerExistingEvent
in interface ISDK
event_id
- -triggered_by
- -