Forums

Home » Mobile » Liferay Mobile SDK

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Vishnudas Lokhande
Sample liferay android project
May 26, 2014 4:26 AM
Answer

Vishnudas Lokhande

Rank: Regular Member

Posts: 147

Join Date: May 27, 2013

Recent Posts

HI all ,

i have created one sample liferay android app..
that is to retrieve contact and contact details.

but i am getting error that is R class is not found in com.liferay.mobile.sample..

The import com.liferay.mobile.sample.R cannot be resolved

How to resolve this , there is no class with name R in the package..

i did see source code for same project on github..

it is using import com.liferay.mobile.sample.R..in DetailsActivity,MainActivity.
Bruno Farache
RE: Sample liferay android project
May 26, 2014 4:36 AM
Answer

Bruno Farache

LIFERAY STAFF

Rank: Liferay Master

Posts: 584

Join Date: May 14, 2007

Recent Posts

The R class is generated by Android Studio or Eclipse + ADT plugin, you need those IDEs to develop Android apps.
Vishnudas Lokhande
RE: Sample liferay android project
May 26, 2014 4:52 AM
Answer

Vishnudas Lokhande

Rank: Regular Member

Posts: 147

Join Date: May 27, 2013

Recent Posts

I am using Liferay developer studio..
first i downloaded ADT bundle..in that sdk is there..

IN LDS i installed ADT tools and then i used downloaded sdk..

and then i installed liferay mobile sdk.

is there anything missing..
Vishnudas Lokhande
RE: Sample liferay android project
May 26, 2014 6:39 AM
Answer

Vishnudas Lokhande

Rank: Regular Member

Posts: 147

Join Date: May 27, 2013

Recent Posts

I downloaded source code from github.
and now it's working..
but only thing is it's not retrieving user list .

it's showing only test user and it's details.

my liferay portal server is running on localhost.

i changed ip address but no result.

please tell me what ip address i should write.
Bruno Farache
RE: Sample liferay android project
May 26, 2014 7:56 AM
Answer

Bruno Farache

LIFERAY STAFF

Rank: Liferay Master

Posts: 584

Join Date: May 14, 2007

Recent Posts

It should be http://10.0.2.2:8080, as described in its documentation.
Vishnudas Lokhande
RE: Sample liferay android project
May 27, 2014 3:11 AM
Answer

Vishnudas Lokhande

Rank: Regular Member

Posts: 147

Join Date: May 27, 2013

Recent Posts

I tried with http://10.0.2.2:8080 but no result..

Now i am trying with my system ip and it's working.. but getting only one contact that is TEST.



I updated portal-ext.properties with this..
json.service.auth.token.hosts.allowed=127.0.0.1,SERVER_IP
json.service.auth.token.enabled=false
jsonws.web.service.public.methods=*
jsonws.servlet.hosts.allowed=127.0.0.1,SERVER_IP
Bruno Farache
RE: Sample liferay android project
May 27, 2014 4:53 AM
Answer

Bruno Farache

LIFERAY STAFF

Rank: Liferay Master

Posts: 584

Join Date: May 14, 2007

Recent Posts

Are you running the app on the emulator or on a real device? If it's emulator, from the Android tools, http://10.0.2.2:8080 should work by default. If it's a device, you need to put your computer network IP.

Which Liferay version are you using? These properties shouldn't be necessary on 6.2. Do you have more users other than test? If not, it's only going to display the test user.
Vishnudas Lokhande
RE: Sample liferay android project
May 27, 2014 7:01 AM
Answer

Vishnudas Lokhande

Rank: Regular Member

Posts: 147

Join Date: May 27, 2013

Recent Posts

Thanks Bruno,

Now it's working fine
and showing all users with their details.
Bruno Farache
RE: Sample liferay android project
May 27, 2014 6:38 PM
Answer

Bruno Farache

LIFERAY STAFF

Rank: Liferay Master

Posts: 584

Join Date: May 14, 2007

Recent Posts

Glad it worked Lokhande. Could you share with us what was wrong?
Vishnudas Lokhande
RE: Sample liferay android project
May 27, 2014 10:36 PM
Answer

Vishnudas Lokhande

Rank: Regular Member

Posts: 147

Join Date: May 27, 2013

Recent Posts

I had only one user . I added more users to site.
Adnan Yaqoob
RE: Sample liferay android project
November 26, 2014 1:03 PM
Answer

Adnan Yaqoob

Rank: New Member

Posts: 9

Join Date: June 30, 2014

Recent Posts

I've configured ADT plugin and SDK as per guide but class R is not generated, any special steps to perform?

Adnan
Gregory Amerson
RE: Sample liferay android project
December 5, 2014 5:22 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1032

Join Date: February 16, 2010

Recent Posts

Adnan Yaqoob:
I've configured ADT plugin and SDK as per guide but class R is not generated, any special steps to perform?

Adnan


Can you share with us your ADT plugin version and IDE version and then also make sure that Project > Build Automatically is turned on (checkbox is visible) and then also check the error log and ( window > show view > other > error log ) and share with us any relevant errors.
Adnan Yaqoob
RE: Sample liferay android project
December 5, 2014 9:42 AM
Answer

Adnan Yaqoob

Rank: New Member

Posts: 9

Join Date: June 30, 2014

Recent Posts

Gregory,

Please find below the info you requested
IDE: Eclipse ( Kelper) 4.3.2
Android Development Tools 23.0.4.1468518 com.android.ide.eclipse.adt.feature.feature.group The Android Open Source Project
Automatically build is turned on

The R file was not getting generated. Then I downloaded the code from github and attempted to build using gradlew. During the process I came up with some error but finally able to sort out the issue today.

I would definitely appreciate you for reaching out to support

Adnan