Use elgg webservices api to login user

Hi,

I am trying to integrate elgg with android and facebook. The current strategy is:

1) I have a native android application with facebook login setup. The user logs in to facebook from my app.

2) I then have some exposed methods in the web services api to use the user uid and login/create user

The problem is, the login works fine on a browser, but not on the phone. I have using login($user);

I am wondering could it be because of ell using sessions and cookies?? Is this task possible at all??

I also looked at the core login script in elgg/actions/login and it uses something called elgg_authenticate($username,$password);

could anybody please explain this further.

Thanks