How can I use SM to change the resolution if I am running the same scripts on two devices without involving HP UFT scripting, in my case Samsung Tab2 and Tab4?
Can you please elaborate further on what exactly you are trying to do? In your script, you declare the device(s) which you are testing against. The script should playback on any device for the same application. However, this may be affected if the application is extensively different between different screen devices such as phones and tablet, where the controls and layouts may be different. This would require custom scripting or different scripts to overcome such issues. It is not possible to change the device resolution.
Unless you are using Image Recognition, the resolution should not affect playback if you are using scripting for NATIVE controls using their properties etc (xpath).