About simulator screenshot-taking function

57 views
Skip to first unread message

P5music

unread,
Apr 15, 2021, 10:50:34 AM4/15/21
to CodenameOne Discussions
Would it be possible to have a modification of the simulator behaviour about the screenshot taking procedure?
What is certainly needed by developers who have BrowserComponents in their app's layout is being able to have screenshots with correct dpi of the BC.

At present time it is not possible to set the simulator window at exact device pixel width/height, even "zoom" state is not guarantee of exact pixel measure, I do not know why. 
Furthermore, I see that when taking the screenshot the size changes just for a moment while the BC is not proportionated.

I could resort to sizing the simulator window up to a value in cm's that corresponds to official device physical size, being that the BC will be faithful to cm size on screen, it is native on Window, like on the devices.

At present time I can just set the size of the simulator window
and
take a screenshot by myself on Windows screen, not using the function of the simulator itself.
But this could be not possible, I have yet to check with third party utilities
because the MS utility cannot take all the area if it exceeds the screen dimensions,
like it happens with iPhoneX skin in portrait mode.

So it is a suggestion or a request, I do not know.
Regards

Shai Almog

unread,
Apr 15, 2021, 11:55:04 PM4/15/21
to CodenameOne Discussions
Screenshots of native widgets such as browser component have always been an issue in Codename One. We tried repeatedly to fix that but it relates to core problems in Java SE. If you need native widgets in the shot the only way to get a screenshot is on the device.

P5music

unread,
Apr 16, 2021, 2:13:10 AM4/16/21
to CodenameOne Discussions
OK
So the only way is to create Android avds with the same resolution of iOS devices to make screenshots or just the BC part.
Regards 

Shai Almog

unread,
Apr 16, 2021, 11:42:53 PM4/16/21
to CodenameOne Discussions
Yes. That would work. Or just getting an iOS device.

P5music

unread,
Apr 17, 2021, 2:15:53 AM4/17/21
to CodenameOne Discussions
Every time you stress the possibility of using a real iOS device.
Convince yourself instead:
Apple asks for screenshots from 4 different devices at least. And if you want screenshots with very high resolution they are the most expensive devices from Apple.
So it would be unpractical, especially for the people you are targeting with CodenameOne, that is supposed to relieve from using Apple products and tools, if you  ponder about that.
Regards

Shai Almog

unread,
Apr 17, 2021, 10:11:07 PM4/17/21
to CodenameOne Discussions
No. That is no longer true. They need one screenshot which they adapt.
Furthermore, there are tools out there that take screenshots and adapt them to size/skin to fit in stores.

Working on an app without trying it on an actual device is a mistake. Our purpose isn't to remove the need to use Apple devices. We let you avoid using a Mac (although I personally use a Mac) but you need the device you're building an app for. The simulator can only go so far...You need at least an iphone and an iPad when targeting iOS.
Message has been deleted

P5music

unread,
Apr 18, 2021, 3:15:33 AM4/18/21
to CodenameOne Discussions
In fact I do not know what kind of applications are created with CN1, maybe many of them have just simple forms and so on.
But when just a BrowserComponent is added to the layout, it would be very bad to have scaled images with controls in the user interface and the HTML content being weirdly sized.
It would be not a professional or acceptable result, according to me.
Furthermore my app has very different outcomes according to the device it is run on, like an old iPad or the newest iPad Pro.

As I said before I test on real iOS device, because I have mainly to check out possible CN1 issues.

But it is not a realistic scenario that one person or company has one iPad and one iPhone to perform tests and screenshots, while they have no Mac.
Rather they have a lot of Java code to be reused, this I aknowledge is a good reason to use CN1, not only not having a Mac.
Or they believed CN1 relieved them from Apple stuff completey, that is no true as far as I learned.
Regards

Chen Fishbein

unread,
Apr 18, 2021, 5:30:50 AM4/18/21
to CodenameOne Discussions
If your app targets iOS you must have the device CN1 or other similar tools cannot relieve you from having the devices.
CN1 is a development tool which will help you to develop for your targets platforms using java or kotlin but it is not as a testing product, although contain some helper utils

P5music

unread,
Apr 18, 2021, 6:38:41 AM4/18/21
to CodenameOne Discussions
Hi Chen,
I have to say that a cross-platform tool, especially one that supports so many platforms like CN1, cannot be just as useful as to use Java code.
Its only way of serving developers in a suitable way is relieving them from having to test on all devices and all OS versions.

If it is like you say, it is wrong, I am sorry.

Of course a final test on the real OS has to be performed possibly, and it is not difficult, but it is just to check on the OS, and by the way it would be very difficult to test on the various OS versions the way you say too.
I tested on Android device, but the emulator would be enough for my app in fact, so what can be done on Android should be possible on iOS (I cannot say if it is possible now with maven, but it is not like pressing a button in the IDE menu). 
I also will have tests performed on one iOS device to assess if the filesystem is handled correctly (on Android it seems to be broken) and other checks, but certainly I have to create screenshots by some editing and by the use of the Android emulator for correct dpi of BC and sizing of its content.
Regards

Chen Fishbein

unread,
Apr 18, 2021, 12:49:41 PM4/18/21
to CodenameOne Discussions
It has nothing to do with the cross platform supported platforms even when you only target Android you still need to test your app on several actual devices.
CN1 is a development tool, it's challenge is to relieve you from working with different languages and different API's and from writing your app multiple times (which is B.T.W a HUGE challenge) not from testing your app on different devices.

P5music

unread,
Apr 18, 2021, 2:59:00 PM4/18/21
to CodenameOne Discussions
Google provides the emulator for any form factor, any OS version.
Apple provides the simulator for any form factor, any OS version.
The large majority of the mobile app-making community is not testing on several devices as you say, this is not happening at all, whatever wiki website is advising it.
I only agree is that some tests have to be performed on real devices but just to make some assessment. And it is true especially for cross-platform projects, that can only have a subset of features, having a solid and stable universal app in return. 
In general, as I said the issues are mainly for the OS versions, so it is not possible to test on real devices with so many OS versions.
If apps are well made they encompass being solid. Now I know CN1 cannot be even compared to other cross-platform solutions, that are backed up by huge communities and companies.
Regards
Reply all
Reply to author
Forward
0 new messages