Codename One - Picker values on IOS should appear center in landscape mode - codenameone

I would like to display the picker strings appear at the center of the picker for selection on IOS. Please give me an example if any one already tried it.

With every OS update or device change this component breaks because it uses the OS native widgets which are flaky as hell on iOS. We intend to release a completely new API that will render everything in Java and solve these constant regressions, hopefully it will be out for version 5.0 slated for June. We already have a proof of concept but these things take some time always.
You can file an issue on this specific issue but I'm not sure if we'll get a chance to address it. Notice that we need the exact device type and exact OS version as these matter a lot for this specific component.

Related

Broken button layout on the showcase

We are evaluating CodenameOne to adopt it as our platform.
In the Showcase App, the menu buttons layout gets broken (button smaller than the image) after changing to some Themes like the "Leather".
Tested on Samsung A5.
Is it an application or platform problem? And can you fix it?
Problem screenshot:
(not enough reputation yet to post images)
The leather theme is a legacy from circa 2014. We don't maintain it because it's gone out of vogue with current flat design styling. We haven't updated the kitchen sink either for 3 years too, since we're more focused on apps such as build.
2014 predated iOS 7 which changed a lot of details about the treatment of the status bar. That means the theme needs to be updated but because it's so full of images it's a bit of a pain. We chose to leave it there with the quirks since it shows off the versatility rather nicely although it's pretty much out of date.

How to embed the camera screen in the part of the main form?

I've some trouble regarding camera feature in codenameone.
I can use camera as full screen as follow:
com.codename1.capture.Capture.capturePhoto();
This opens full camera screen, however, I want it to be embedded in special part(e.g. square) of the main form.
I've heard native interface is needed for this. But I couldn't know the detail source code.
Is there any way to do this or to get any source code?
(PS: I'm looking for the solution for iOS/Android.)
This is now possible with a new cn1lib: https://github.com/codenameone/CameraKitCodenameOne
Original answer below:
Codename One didn't support z-ordering of peer components until recently so this was not reasonably possible until a couple of months ago when we introduced that feature.
This is now available in all supported Codename One platforms and thus it should be possible to create a cn1lib that will allow you to do just that.
We hope to build such a cn1lib ourselves but with our current workload I'm not sure when we'll get around to do it.

Codename one expect feature on DateTime Component

Our client expects the feature like DateTime Component editable on double topping the Dates or Time or AM/PM instead of scrolling more.
We see that feature on some apps, Can't we get his feature in Codename one. Which is very helpful and will make codename one powerful tool.
Here is a screenshot of what we expect from DateTime picker.
Is there a way to achieve this on Andriod and IOS platforms.
I'm not sure this will work as I'm not much of an Android guy but I made a change to the Android implementation that should allow the keyboard to open if you do:
myPicker.putClientProperty("showKeyboard", Boolean.TRUE);
This should start working following October 29th 2016 with the next update but since I didn't test it this might not work as expected.

Google Earth API in Silverlight Application

I have been handed over a Silverlight 4 application that uses the Google Earth API. We have an issue with newer versions of Google Earth: In Internet Explorer, the map displays as a white background with the text "ATL 10.00". In other browsers, the background is just white (cannot see any text).
It works with Google Earth version 6.0.3.2197 but not in any version after that.
I have read this thread
- but none of the suggestions there worked. I must note, though, that the JavaScript code for initializing GE in Silverlight is rather complex, but as far as I can se, the initialization of GE is done in the google.setOnLoadCallback function.
It would be nice, if someone knows what exactly the "ATL 10.00" message means.
Any help would be greatly appreciated!
EDIT
Please let me know if I should clarify in further detail.
UPDATE:
The problem was caused by 2 things and probably a combination of the two:
1. The container for the map was added dynamically with JavaScript into another div
2. The container's width and height was set to 0 in order to hide the map.
So, the solution for me was to render the containing div together with the rest of the DOM. In order to "hide" the map, I positioned it absolute beyond the bounds of the screen.
Hope this can guide others to solve similar problems.
ATL in referring to the Active Template Library in Windows. ATL in Windows is a set of template-based C++ classes that let developers create COM objects (rather like MFC and ActiveX).
10.00 here simply refers to version of ATL being used. Seeing it probably means that the COM object (GEPlugin in this case) has not been created or initialised properly in the browser. The blank screen with the version number in the centre is what the plugin looks like before it loads content.
So, it is not really an error message at all - indeed one could say it is really the failure of an error message to appear that you are seeing.
Anyhow, to answer your question in simple terms it means than the version of ATL that was used to create the plugin was version 10.00.
In practical terms it means that the plugin failed to initialise properly for some reason.

Use Auto layout or not iOS 6.x

I'm developing an app with Storyboard on iOS 6.1 (with many features - star ranking, sqlite DB, apple maps, etc..). Sometimes It happens that I have to disable the auto layout (for UIScrollView for example) or use code to work around the problem, but there are other examples. However when I disable it, I have to configure the UILabels with the exact width or other things.
What is the best option? Use auto layout or don't use it on iOS 6.x with Storyboard?
Autolayout, like many other features added to ios in recent years (arc and storyboards, for instance) was designed to ease development for both people who're just getting started in the iOS/Mac platform or for people who are already there but don't come from the old days of NeXT or OS X's infancy and thus could use some simplification to the whole development workflow.
One thing you could do is use autolayout by default, therefore making easier to write ViewControllers that perform both in portrait and in landscape, and disable it on those rare ocassions where you're more comfortable keeping everything using the old system of springs and struts. Another thing you can do is to also add Autolayout constraints in code instead of through Xcode's Interface Builder, if that suits your style better.
My advice is to use whatever system makes you more comfortable, no matter what the current trend is.
I don't use autolayout, because it's raw now. If you order constraints and then decide to move an element, you can get a real mess.
It's much safer to use springs and struts at this moment.
Upd.: But it's OK to use it in iOS7 - there are a lot of helpful tools for it in Xcode 5.
Honestly, this is up to preference but I never use auto layout and I doubt that I ever will. I guess I just prefer everything being exactly how I specify it and I don't trust auto layout.

Resources