codenameone

Littlemonkey QRcode scanner library patch issue while generating cn1lib library

孤街浪徒 提交于 2019-12-08 05:06:28
问题 I downloaded QRScanner project from https://github.com/littlemonkeyltd/QRScanner and replace "codename1.arg.android.xapplication=" line in codenameone_library_appended.properties file. While building the library, it gives following error. E:\QRScanner-master\src\org\littlemonkey\qrscanner\QRScanner.java:27Stubbing Class: E:\QRScanner-master\build\stubs\org/littlemonkey/qrscanner/NativeScanner.java : error: package com.codename1.ext.codescan does not exist 6 warnings import com.codename1.ext

From video to image in Codename One

扶醉桌前 提交于 2019-12-08 04:58:57
问题 Given a video (of arbitrary lenght in a format supported by the device) taken from the gallery, how can I extract the first frame as an EncodedImage? Thank you 回答1: Right now the only way to do that is through native code. Historically some platforms didn't support grabbing a video frame and we didn't revisit that over the past 7 years. You can file an RFE on this but right now I'm not sure when we'll get around to implementing it as media is painful. 来源: https://stackoverflow.com/questions

What is the correct way to display a HTML file downloaded and saved in the file system using codename one?

↘锁芯ラ 提交于 2019-12-08 04:53:06
问题 What is the correct way to display a HTML file downloaded and saved in the file system? I am able to download and save the html page in the .cn1 folder on Simulator but it doesn't display. I tested using the Page.html sample file found in the old Kitchen Sink demo. Also, how can I use hardcoded paths like file:///storage/emulated/0/Folder/Page.html instead? I have tried but nothing appears in common folders in the phone e.g. the Android folder. Below is what I have done so far! `Form fm_brw =

Keep Codename One components in invalid positions after app stop/resume

时光怂恿深爱的人放手 提交于 2019-12-08 04:48:42
问题 My question is about keeping components in invalid positions in the layered pane after app stop/resume. I have a nice animation that moves some components in the layered pane and I want that these components remains in their positions until an user interaction with them. I understood that when the app goes to the background, the stop() method is invoked: that method stores in the current variable the current Form reference. Then, when the app is resumed, the start() method is invoked, in

Clarification on how Codename One UITimer works

*爱你&永不变心* 提交于 2019-12-08 04:44:29
I need a clarification about the Codename One UITimer . For example, if I want to execute the same code every two seconds, a code like UITimer.timer(2000, true, () -> { do something; }); works until the user stays in the current Form ? Is that right? If I want to execute the same code every two seconds regardless the shown Form , have I to use something different from UITimer , like a custom separate thread? For example the following code? Form hi = new Form("Hi World", BoxLayout.y()); hi.add(new Label("Hi World")); hi.show(); EasyThread.start("MyTimer").run(() -> { boolean executeMe = true;

Codename One: Save Image to Storage and create small rounded preview

不羁的心 提交于 2019-12-08 04:42:52
问题 I have to problem with Images currently: 1) I can't save an Image to Storage because it is not supported to store it directly to the storage. I want users to be able to take a photo with the camera and then the created Photo has to be saved somewhere, so I can retrieve it later on again. Could you tell me how a) To save an Image b) How to retrieve it I found this Code piece made by Shai in Stackoverflow where another user asked how to save Images to Storage also. InputStream stream =

Codename one Upload a picture taken by the camera to amazon s3 bucket

喜你入骨 提交于 2019-12-08 04:32:27
问题 Original Question I have tried as you have suggested, there are few things I have run into few issues. Here are the following I did: filePath = Capture.capturePhoto(1024, -1); I had issue passing the S3_BUCKET_URL in the MutipartRequest Constructor so I used rq.setUrl(S3_BUCKET_URL) I had to add rq.setHttpMethod("PUT"); // since I got error as 405: Method was not supported Finally I got no errors and I did see a sub-folder created under the bucket I created. I set the url as "https://s3

Codenameone native maps offline?

纵饮孤独 提交于 2019-12-08 04:18:52
问题 it was brought to my attention that when I use the native maps in codenameone , and try to change the camera position the maps get blank , is there anyway that I could use the native maps functionality with no internet connection final String HTML_API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; final MapContainer cnt = new MapContainer(HTML_API_KEY); cnt.addMarker(EncodedImage.createFromImage(MarkerImg, false), new Coord(latitude, langitude), "", "", e3->{ }); Container root = LayeredLayout

How to post JSON to a REST webservice in codenameone

旧城冷巷雨未停 提交于 2019-12-08 04:14:11
问题 Can anyone can show me, with sample codes: How to post JSON to a REST webservice; and How to read the JSON response from the server; Using Codename One? Here is what i have tried which is returning bad request response from the server: Button b1 = new Button("Add Staff"); b1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { JSONObject json = new JSONObject(); try { ConnectionRequest post = new ConnectionRequest(){ @Override protected void

Errors with Codename One “Send iOS Build” and “Send Android Build”

两盒软妹~` 提交于 2019-12-08 04:11:12
问题 I had no problem with "Build Project"/"Rebuid Project" using IntelliJ IDEA for my Codename One project. Today, I just started to "Send iOS Build" and "Send Android Build" and got a spew of errors. For the one below, I cannot recognize why it failed, or where to find the "compiler error output" as described: For this next one, I can recognize it is referring to the java.time package (Java 8): I saw somewhere that I should include the "java.version=8" and I already did. Please help me to get my