Sign Up Screenlet for Android

Requirements

  • Android SDK 4.0 (API Level 15) or above
  • Liferay Portal 6.2 (CE or EE), Liferay 7.0 CE, Liferay DXP

Compatibility

  • Android SDK 4.0 (API Level 15) and above

Xamarin Requirements

  • Visual Studio 7.2
  • Mono .NET framework 5.4.1.6

Features

The Sign Up Screenlet creates a new user in your Liferay instance: a new user of your app can become a new user in your portal. You can also use this Screenlet to save new users’ credentials on their devices. This enables auto login for future sessions. The Screenlet also supports navigation of form fields from the device’s keyboard.

JSON Services Used

Screenlets in Liferay Screens call JSON web services in the portal. This Screenlet calls the following services and methods.

Service Method Notes
UserService addUser

Module

  • Auth

Views

  • Default
  • Material

screens-android-signup.png

The Sign Up Screenlet with the Default (left) and Material (right) Viewsets.

Portal Configuration

Sign Up Screenlet’s corresponding configuration in the Liferay instance can be set in the Control Panel by clicking Portal Settings and then Authentication.

screens-portal-signup.png

The portal’s authentication settings.

For more details, refer to the Configuring Portal Settings section of the User Guide.

Anonymous Requests

Anonymous requests are unauthenticated requests. Authentication is still required, however, to call the API. To allow this operation, the portal administrator should create a user with minimal permissions. To use Sign Up Screenlet, you need to use that user in your layout. You should add that user’s credentials to server_context.xml.

Offline

This Screenlet doesn’t support offline mode. It requires network connectivity.

Required Attributes

  • anonymousApiUserName
  • anonymousApiPassword

Attributes

Attribute Data type Explanation
layoutId @layout The layout used to show the View.
anonymousApiUserName string The user’s name, email address, or ID to use for authenticating the request. The portal’s authentication method defines which of these is used.
anoymousApiPassword string The password used to authenticate the request.
companyId number When set, a user in the specified company is authenticated. If not set, the company specified in LiferayServerContext is used.
autoLogin boolean Sets whether the user is logged in automatically after a successful sign up.
credentialsStorage enum Sets the mode for storing user credentials. The possible values are none, auto, and shared_preferences. If set to shared_preferences, the user credentials and attributes are stored using Android’s SharedPreferences class. If set to none, user credentials and attributes aren’t saved at all. If set to auto, the best of the available storage modes is used. Currently, this is equivalent to shared_preferences. The default value is none.
basicAuthMethod enum Specifies the authentication method to use after a successful sign up. This must match the authentication method configured on the server. You can set this attribute to email, screenName or userId. The default value is email.

Listener

The Sign Up Screenlet delegates some events to an object that implements the SignUpListener interface. This interface lets you implement the following methods:

  • onSignUpSuccess(User user): Called when sign up successfully completes. The user parameter contains a set of the created user’s attributes. The supported keys are the same as those in the portal’s User entity.

  • onSignUpFailure(Exception e): Called when an error occurs in the process.

0 (0 Votes)
Login Screenlet for Android Previous