掲示板

Liferay Screens - Android

8年前 に Pratik Banerjee によって更新されました。

Liferay Screens - Android

New Member 投稿: 9 参加年月日: 16/01/12 最新の投稿
Need step by step help on Liferay Screens. I am new to it and trying for a Custom Screenlet. But not enough help I am getting. Can anyone please help me out. Any good tutorial on Liferay Screens?
thumbnail
8年前 に Denis Signoretto によって更新されました。

RE: Liferay Screens - Android

Expert 投稿: 375 参加年月日: 09/04/21 最新の投稿
Hi Patrik,

these are good starting point references about Liferay Screens and Android:


HTH !

Regards,
Denis.
8年前 に Pratik Banerjee によって更新されました。

RE: Liferay Screens - Android

New Member 投稿: 9 参加年月日: 16/01/12 最新の投稿
Hi Denis,

Thanks for sharing the links. I have already followed those. but not much help for Custom Screenlets. I want some step by step helper. There's an example "AddBookmarkScreenlet". I have followed that. But Some how not able to run the same. any other tutorial if there please let me know.

Regards,
Pratik
thumbnail
8年前 に Jose M. Navarro によって更新されました。

RE: Liferay Screens - Android

Regular Member 投稿: 138 参加年月日: 14/01/24 最新の投稿
Hi,

There's a tutorial that explains step by step how to create the AddBookmarkScreenlet in Android.

Basically, the steps are (described in the tutorial):
  • Create the ViewModel for your screenlet. It's a regular Java interface that defines the attributes (getters and setters) of your screenlet's UI. That is: the user input or output data of the screenlet. See AddBookmarkViewModel for a reference.
  • Create a view class. The view extends from any Android's layout class and implements the ViewModel. Typically you code here the behaviour of the screenlet action (add listeners, change components' attributes, fire actions, etc.). Main actions (like get or send information to the portal), are typically defered as user action. In such case, just call getParent().performUserAction("type-here-the-action-name", args). See AddBookmarkView for a reference.
  • Create the layout for that view: The layout belongs to a viewset, so you may have different layouts for the same screenlet (presenting the information in different ways). The layout is the typical Android one for a custom view. You add here your UI components (buttons, texts, etc). See bookmark_default layout for a reference.
  • Create the interactor: This is the class that will handle how the screenlet gets and sends its information. Typically you code here the backend/portal integration code (extending from BaseRemoteInteractor), but your screenlet may get the information from a local database and send it to a file in the filesystem. Since the interactor uses an interface listener and a kind of IoC pattern, you may need to create several things here. See this package for reference.
  • Create the screenlet to rule them all: This is the class that will be used in the final app. You need here to extend from BaseScreenlet, implement your own listener, get the attributes from the layout in the createScreenletView method, create an instance of your interactor in the createInteractor method and invoke your interactor in the onUserAction method. See AddBookmarkScreenlet for reference.


If you follow the tutorial, you'll read more details about these steps.

Good luck!