codenameone

NSAllowsArbitraryLoadsInWebContent in CN1

江枫思渺然 提交于 2019-12-19 04:23:21
问题 I'm trying to deal with Apple's http restrictions on Codename One. According to iOS Cocoa keys doc, NSAllowsArbitraryLoadsInWebContent will work on iOS 10 following these instructions: An optional Boolean value that applies only to content to be loaded into an instance of the following classes: WKWebView UIWebView (iOS only) WebView (macOS only) Set this key’s value to YES to obtain exemption from ATS policies in your app’s web views, without affecting the ATS-mandated security of your

iOS debug build install fails

折月煮酒 提交于 2019-12-19 03:40:22
问题 I have a CN1 test project which was last built and successfully installed on various test devices in mid January 2017. In rebuilding this project using the current CN1 version with the same certificate, provisioning profile and devices it now fails to install with the "Unable to Download App... could not be installed at this time." message. Any suggestions as to what the issue might be? I have also created a small test project using artifacts from a different Apple developer account with the

Saving an Image Locally in Codename One Project

随声附和 提交于 2019-12-19 02:35:09
问题 I've followed the tutorial of creating a camera capture page in this video: http://www.youtube.com/watch?v=nF4eqzVcsic So my code at the moment looks like this: protected void onCamera_CaptureButtonAction(Component c, ActionEvent event) { String i = Capture.capturePhoto(); if (i != null) { try { Image img = Image.createImage(i).scaledHeight(500); findCameraLabel().setIcon(img); } catch (Exception ex) { } } } I had a look at the CameraDemo application, but can't seem to locate any files being

How to force permission “android.permission.CAMERA” to be added to manifest in Codename one

半世苍凉 提交于 2019-12-18 17:12:19
问题 I am trying to show a live preview of the rear facing camera in Codename One. I use for that the native interface (I am targetting Android first). To allow my app to use the camera without messing up with build hints, I added these lines in my Main Form : if (Capture.hasCamera()){ Dialog.show("Appareil photo détecté", "Votre matériel est bien équipé d'un appareil photo!", "OK", null); } I did that because Codename One blog stated android.hardware.camera & android.permission.RECORD_AUDIO - are

How to force permission “android.permission.CAMERA” to be added to manifest in Codename one

China☆狼群 提交于 2019-12-18 17:11:13
问题 I am trying to show a live preview of the rear facing camera in Codename One. I use for that the native interface (I am targetting Android first). To allow my app to use the camera without messing up with build hints, I added these lines in my Main Form : if (Capture.hasCamera()){ Dialog.show("Appareil photo détecté", "Votre matériel est bien équipé d'un appareil photo!", "OK", null); } I did that because Codename One blog stated android.hardware.camera & android.permission.RECORD_AUDIO - are

java.net.ConnectException: fail to connect to localhost/127.0.0.1(port 8080): connect failed:ECONNREFUSED….(Codename One App)

不想你离开。 提交于 2019-12-18 16:54:27
问题 After build android application , I scanned the generated QRcode and install the application on galaxy s4 successfully. But when I try to do some search using the app I got the following exception: "java.net.ConnectException: fail to connect to localhost/127.0.0.1(port 8080): connect failed:ECONNREFUSED…." Please check the attached picture for more clarity. The app works correctly on simulator. I OFF the firewall of my system but that doesn't solve the issue. Please how can I solve this

Codename One - BrowserComponent: custom user-agent

寵の児 提交于 2019-12-18 07:19:35
问题 I've read the BrowserComponent API, but I didn't find any setUserAgent() method. How can I force the BrowserComponent to use a custom user-agent string? Thank you very much for any help. 回答1: It's not really documented since it isn't supported everywhere but should work fine on Android and iOS. This should work: browserComponent.setProperty("useragent", yourUserAgentHere); 来源: https://stackoverflow.com/questions/45786836/codename-one-browsercomponent-custom-user-agent

Event handling anomaly

爱⌒轻易说出口 提交于 2019-12-18 06:57:10
问题 After the last library update (my jar files dates is 22. Oct.) The event handling does not work as expected. For example the SwipeEvent in SwipeableContainer and the ActionListener in FloatinAutton works. But the button and MultiButton does not. I debuged it. Does not fall into any EventDispatcher instance that includes relevant listener. So the handler code defined in the form (multiButton.addActionListener(e -> {...) is not called anymore. This phenomenon can be reproduced by recompiling

Why do I get a different behviour in Codename One simulator than on a real Android device?

半城伤御伤魂 提交于 2019-12-18 05:16:16
问题 I am trying to figure out why I get a different behaviour in the simulator (iPhone, Nexus, Nexus5, ... skins ) VS on an Android real device with the following code (my goal is to draw a text over a background image and save the whole in background image resolution) : Please note that the GUI was done with the Designer. protected void beforeMain(Form f) { // The drawing label will contain the whole photo montage f.setLayout(new LayeredLayout()); final Label drawing = new Label(); f

Own Tabs Container of Buttons: how to initialize all of them doing the same?

霸气de小男生 提交于 2019-12-14 02:35:28
问题 I just created my own Container, its structure looks like this: Container |- TabsContainer |-Button1 |-Button2 |-Button3 ... It should be like this: and be positioned at the bottom of the screen, like this: in every Form I create. When I add this custom Container to the 4 of my Forms, I still want all of the buttons to do the exact same thing. How could I do this? And In what function? before ? I already tried onPostShow() of my login Screen by getting all of them with their unique component