cancel
Showing results for 
Search instead for 
Did you mean: 

Get the current Logged on User on Mobile Client

Former Member
0 Kudos

Hi

I have to display the current logged in User of the Mobile client in my application. I think I have to use the User and UserManager API for that. But the thing is I am not able to instantiate the class to use the methods in it.I think I have to create a session object for using these classes, but in Session API I can see that I will have to create a new session and I want to use the current session.

Please tell me how to use these APIs and get the instance of User or UserManager.

Regards,

Priya

Accepted Solutions (1)

Accepted Solutions (1)

former_member206242
Active Participant
0 Kudos

try using OCARoot.getInstance() to get the user details.

Regards,

Nipun

Former Member
0 Kudos

Hi Nipun,

i am using Laptop client and I think OCARoot API is for PDA Client. Can you tell me the similar method for Laptop client.

Regards,

Priya

former_member206242
Active Participant
0 Kudos

You can use this in laptop applications:

User user = UserManagerSPI.getSPIInstance(MWDSessionManager.getSession()).getCurrentUser();

Regards,

Nipun

Former Member
0 Kudos

Hi Priya,

You can try with:

User user = UserManager.getInstance().getCurrentUser();

The User interface has methods to get relevant information (for ie. getName() or getFirstName()), take a look on the [javadocs|http://help.sap.com/javadocs/nwmobile/SP3/laptops/com/sap/ip/me/api/user/User.html]

Best Regards,

Simon.

Answers (0)