Consider:
How do I take a landscape shot with a mobile phone having part of the same landscape and the phone is also in the same picture?
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It only takes a minute to sign up.
Sign up to join this communityConsider:
How do I take a landscape shot with a mobile phone having part of the same landscape and the phone is also in the same picture?
If you want to do something like this, you need two phones. Take a landscape shot with the first one and display it on the screen. Use the second phone to take the shot you see. One challenge that remains is that the field of view of the second photo is narrow compared to most camera phones and narrower than the one displayed on the first phone. That can be solved by cropping the second photo. The second challenge is getting the blur in the background. Most camera phones use small apertures to get lots of depth of field. You may be able to get close enough to the first phone to blur the background. It might help both things to use an auxiliary lens on the second phone to increase the focal length, narrowing the field of view and decreasing the depth of field. I tried it and did not get that much blur on an iPhone 6S
This is a composite picture. They've taken two pictures:
They've then replaced the background of the "hand" photo with the sunset, and also pasted the sunset onto the phone, replacing the entire front of the phone with the image on a gradient background.
If you're trying to create the effect as close to straight-out-of-camera (SOOC) as possible, probably the most limiting factor will be the brightness of the phone's screen. That will determine the approximate light level for the entire scene.
For example, I did a rough re-creation of the image using my DSLR and my iPhone 7, just looking out my window. The iPhone 7 has an angle of view approximately equal to that of a 28mm lens on a full-frame camera. So I used 28mm at ƒ/4 (the widest aperture I could use on the lens, to get maximum background blur). Here is the result when exposed for the background:
Here's the result when exposed for the phone's screen:
Note that the problem isn't that the subject (my hand and phone) isn't lit correctly. Even if I had added light to illuminate my hand and phone, that wouldn't have made the image on the phone's screen any brighter. It would have washed out the phone's screen, just like when you try to use your phone outside under the sun (not in shade).
Therefore, creating this technique puts pretty strong constraints on what you can shoot and expect it to come out okay:
Aside from the lighting limitations, another limitation of this technique is the moiré pattern that results from using a digital camera to take a picture of an image that is presented on a digital screen. You can see this effect in my 2nd image: the grid and horizontal lines (most visible in the sky on my phone's screen, but it's actually all over the entire screen).
Note: This answer assumes you're trying to recreate as many of the parameters of the original example as possible. Because the image on the phone is just an in-focus scaled-down version of the blurred background scene, the main camera and the smartphone's camera should have the same field-of-view (or put another way, the same 35mm-equivalent focal length).
In instead, you wanted the phone's screen's image to just be an in-focus "keyhole" of the entire scene, your best bet will be to take an image of the "background" with your phone, zoom into portion of the scene that will be covered by your hand and phone when you take a picture of the scene with your 2nd camera. It will take a bit of manipulating the scene on your phone's screen and where you hold your phone in front of your 2nd camera. But if you do it correctly, you should be able to achieve an effect that is similar to the transparent computer desktop illusion fad from several years ago: