What you ever wanted to know about pda development in mobile 7.1 (part 3)
This is another post of our Netweaver Mobile 7.1 series where we share best practices and tips and tricks for development of mobile applications. The available blogs in this series are
- What you ever wanted to know about pda development in mobile 7.1 (part 1)
- What you ever wanted to know about pda development in mobile 7.1 (part 2)
- What you ever wanted to know about pda development in mobile 7.1 (part 3)
- What you ever wanted to know about pda development in mobile 7.1 (part 4)
This is the 3rd post in this series. It describes how the autologin feature of Netweaver Mobile 7.1 helps to increase productivity during development.
During development of an Netweaver Mobile application redeploying components and restarting the container is required quite often. It can become annoying to login to the container on each startup again, especially when the container is running on a PDA and no keyboard is available. It would be preferable to skip the login to shorten the roundtrip time.
To achieve this Netweaver Mobile 7.1 offers a feature called “autologin” to supply the username and password credentials through Java system properties. So it is not necessary anymore to enter the credentials manually in the login screen. The name of the according system properties are mobile.dbguser.name and mobile.dbguser.password. These have to be appended to your startup command line. If you use myuser / mypass as username / password the appropriate line is
-Dmobile.dbguser.name=myuser -Dmobile.dbguser.password=mypass
For the desktop version of the client it has to be added to MI/bin/startup.bat, the wince version uses MI/bin/launch.properties. E.g. after modification the startup.bat looks somehow like this:
set MOBILE_JVM_OPTS=%MOBILE_JVM_OPTS% -Dmobile.home=.. -Dtomcat.home=.. omcat -Dmobile.dbguser.name=myuser -Dmobile.dbguser.password=mypass
"%JAVA_HOME% injava" -Xmx512M -classpath "%MOBILE_BIN%sap.com~tc~mobile~cfs~startup~impl.jar" %MOBILE_JVM_OPTS% com.sap.tc.mobile.cfs.startup.pda.Startup %MOBILE_OPTS%
If the container is started from within Eclipse the arguments can be added to the VM arguments of the launch configuration.
Note: The user is not automatically created by setting these system properties, so you still have to manually create it on your first container login. To login with a different user you can just use the logoff menu entry to come to the login screen again.
This hint applies to Netweaver Mobile 7.1 beginning with SP3 and a recent patch level.
you can try the property "com.sap.tc.mobile.sync.passwordhandling", which should provide the wanted functionality. The property supports 3 different values:
local - The login password is always used as sync password (you never have to enter the password)
once - The sync password is only asked one time and stays in memory until you restart the container
atSync - each time (default)
For your usecase something like com.sap.tc.mobile.sync.passwordhandling=local should work. Just apply it the same way as the autologin properties.
Your blog and comment on the same has solved a part of my problem of multiple password entry.
I have another requirement. I am creating an Sales Order on Mobile. Now the problem that I see is that the sales order will get created with the user maintained in the Backend Adapter Destination. However I will need that it gets created by the actual user who initiated the request from PDA. How is this End to End SSO configuration possible.
Looking forward for a prompt response.
Regards,
Shubham
I forwarded the question to a colleague who can hopefully answer your question.
Regards,
Daniel