Friday 4 April 2014

Liferay Mobile SDK + Android + Custom Services part-1

Hi guys,

Today we are going to see how can we use Liferay custom services in ANDROID native app...!!

And we are going to see how can anyone build custom services with lifeary mobile sdk  and use that jar in native android app.

Why we need liferay mobile sdk ?? So for answer for that question,  Since the SDK is auto-generated, it also means that you can generate client side code for your custom portlet services as well and Our Liferay Mobile SDK makes it easier to create mobile apps that are connected to Liferay portals, it takes care of authentication, services discovery, JSON parsing and server error handling for you.

Lets start step by step......

First we create one custom service which gives user potraitId from the UserId. Because there are no service for getting potraitId from the userId in current sdk jar,So we have to build a new jar which is having this custom service which serve our purpose for showing Avatar image of User.

1) Create portlet for custom services (these service you are going to use in android app)
       --> Create simple liferay portlet with service (Refer below link to download portlet)
      download custom service portlet
please note that this portlet is compatible with Liferay6.2 because liferay mobile sdk supports Lifeary 6.2 version.
       --> After download you have to first build service -> build-wsdd -> build-wsdl
       --> Deploy this portlet on liferay 6.2
       --> For Cross check,Is your portlet services running or not ??You can hit below URL and check your custom service response with default interface provided by liferay(From the drop down you can select your portlet)
            http://localhost:8080/api/jsonws

2) You can download liferay mobile sdk from below url
       Liferay mobile sdk

3) Now we have to build custom jar for our custom services which are already deployed on the local server in first step.(Please verify your services are running, other wise SDK is unable to build jar with custom service)

Please stay tune for  building custom jar and how to call your custom service in native android application.
Next GOOD DAY...




     




No comments:

Post a Comment