profile
viewpoint
Francesco Galgani jsfan3 Italy https://www.informatica-libera.net/ I love the open-source philosophy: share knowledge, share skills, improve yourself.

issue closedjsfan3/CN1Libs-VideoOptimizer

please add a feature to check if that lib support arm64

When I compiled my app with this library, the android system don't let me to install it.

Tested in model:alcatel 5099A Os: android 8.0 CPU: ARMv7

when I removed this lib my app it was installed success

closed time in a month

DurankGts

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha 000cfdb64da4f7c9370b5e938ca942144767d99a

Update README.md

view details

push time in a month

push eventjsfan3/CN1Libs-WowzaLiveStreaming

Francesco Galgani

commit sha 80d5d521cf12b053b715917e3bbdc7e174588c5b

Update README.md

view details

push time in a month

issue openedjsfan3/CN1Libs-WowzaLiveStreaming

Wowza GoCoder versions used in this CN1Lib

You don't need to download GoCoder to debug this CN1Lib, however, for reference, I used: https://www.informatica-libera.net/gocoder_cn1lib/GoCoder-1.9.0.zip

created time in a month

issue openedjsfan3/CN1Libs-WowzaLiveStreaming

How to remove unwanted architectures

Note that the WowzaGoCoderSDK.framework folder included in this CN1Lib is not the same included in the gocoder-sdk-ios-build-1377-v1.9.0 folder provided by Wowza.

The difference is that I remove unwanted architectures (to prevent issues on publishing the app in the store).

I used: lipo WowzaGoCoderSDK -remove i386 -remove x86_64 -output WowzaGoCoderSDK.new

(After that, I removed WowzaGoCoderSDK and I renamed WowzaGoCoderSDK.new to WowzaGoCoderSDK)

created time in a month

issue openedjsfan3/CN1Libs-WowzaLiveStreaming

How to debug in XCode

Currently the build server doesn't include the podspecs and frameworks in the sources zip.

Download the file: customPod.zip

and extract the WowzaGoCoderSDK.podspec file and the WowzaGoCoderSDK.framework to the dist directory of the sources produces by the build server.

Then open the terminal, cd to the dist folder and execute pod install. After that, you can use the project with Xcode.

created time in a month

push eventjsfan3/CN1Libs-WowzaLiveStreaming

Francesco Galgani

commit sha 0cba81a66615170109fb38860362dbd74234774e

Update README.md

view details

push time in a month

PR opened codenameone/CodenameOneLibs

Wowza Live Streaming for Codename One (CN1Lib)

https://github.com/jsfan3/CN1Libs-WowzaLiveStreaming

+12 -0

0 comment

2 changed files

pr created time in a month

push eventjsfan3/CodenameOneLibs

Francesco Galgani

commit sha c403c57f3050b9f9dd8ec126361d836156bfe215

Wowza Live Streaming Events For the license, I wrote "mixed" because it includes both open and closed sources: it's better explained on the github readme https://github.com/jsfan3/CN1Libs-WowzaLiveStreaming/

view details

push time in a month

push eventjsfan3/CodenameOneLibs

Francesco Galgani

commit sha c912b5a48b597d82ba7c7108de46a6616da1482a

Wowza Live Streaming Events for Codename One https://github.com/jsfan3/CN1Libs-WowzaLiveStreaming

view details

push time in a month

fork jsfan3/CodenameOneLibs

3rd party extensions for Codename One apps

fork in a month

push eventjsfan3/CN1Libs-WowzaLiveStreaming

Francesco Galgani

commit sha 72bb5371e633bf84dc5e306f7d3b31c3693969a2

Update README.md

view details

push time in a month

create barnchjsfan3/CN1Libs-WowzaLiveStreaming

branch : master

created branch time in a month

created repositoryjsfan3/CN1Libs-WowzaLiveStreaming

Wowza Live Streaming for Codename One (CN1Lib)

created time in a month

issue commentjsfan3/CN1Libs-VideoOptimizer

please add a feature to check if that lib support arm64

Starting from now, the CN1Lib update is available. Open the "Extensions" window, click on update and then refresh cn1lib files.

Let me known if this update solves your issue.

DurankGts

comment created time in 2 months

PR opened codenameone/CodenameOneLibs

Added support for Arm v7

Reference: https://github.com/jsfan3/CN1Libs-VideoOptimizer/issues/2

+1 -1

0 comment

2 changed files

pr created time in 2 months

push eventjsfan3/CodenameOneLibs

Francesco Galgani

commit sha 6106581546f1ed31ba157a5d1f0fde6e45a53270

Added support for Arm v7 Reference: https://github.com/jsfan3/CN1Libs-VideoOptimizer/issues/2

view details

push time in 2 months

push eventjsfan3/CodenameOneLibs

Francesco Galgani

commit sha ae283c710b959883a896857f7cd6bc088207a18d

Added support for Arm v7 Reference: https://github.com/jsfan3/CN1Libs-VideoOptimizer/issues/2

view details

push time in 2 months

fork jsfan3/CodenameOneLibs

3rd party extensions for Codename One apps

fork in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha a6fbb7d39ee459beac761d71b5610f7d332ae828

Added support for Arm v7 Reference: https://github.com/jsfan3/CN1Libs-VideoOptimizer/issues/2

view details

push time in 2 months

issue commentcodenameone/CodenameOne

404 error trying to import CN1Lib

This issue is now solved

jsfan3

comment created time in 2 months

issue closedcodenameone/CodenameOne

404 error trying to import CN1Lib

Could you please see this bug report, I suppose that the cause of the error is something that I cannot solve, because there is a 404 error trying to import my VideoOptimizer CN1Lib:

https://github.com/jsfan3/CN1Libs-VideoOptimizer/issues/1

Thank you

closed time in 2 months

jsfan3

issue closedjsfan3/CN1Libs-VideoOptimizer

Lib is not imported after refresh cn1 libs in Codenameone

Please tell me why this lib is not imported after refresh cn1 libs in codenameone

closed time in 2 months

DurankGts

issue commentjsfan3/CN1Libs-VideoOptimizer

Lib is not imported after refresh cn1 libs in Codenameone

This issue is now solved.

DurankGts

comment created time in 2 months

issue commentjsfan3/CN1Libs-VideoOptimizer

Lib is not imported after refresh cn1 libs in Codenameone

I sent a PR with the missing file, this should fix the issue soon.

DurankGts

comment created time in 2 months

issue commentjsfan3/CN1Libs-VideoOptimizer

please add a feature to check if that lib support arm64

Ok, thank you for the report.

I compiled mobileffmpeg with the options —disable-arm-v7a --disable-arm-v7a-neon, because I supposed that these cpus are not more in the market. I compiled it only for Arm64, but Armv7 is a 32bit cpu (correct me if I’m wrong).

I’ll make soon a new version of this cn1lib that supports also armv7, probably tomorrow.

DurankGts

comment created time in 2 months

issue commentcodenameone/CodenameOne

404 error trying to import CN1Lib

I'm sorry, I forgot the file :) I've just submitted a new pull request including the missing CN1Lib

jsfan3

comment created time in 2 months

PR opened codenameone/CodenameOneLibs

Missing CN1Lib

Reference: https://github.com/codenameone/CodenameOne/issues/2937#issuecomment-545519698

+0 -0

0 comment

1 changed file

pr created time in 2 months

push eventjsfan3/CodenameOneLibs

Francesco Galgani

commit sha 8d3205706ddbac8a6ea6be96c8395539c06a2d4f

Missing CN1Lib Reference: https://github.com/codenameone/CodenameOne/issues/2937#issuecomment-545519698

view details

push time in 2 months

fork jsfan3/CodenameOneLibs

3rd party extensions for Codename One apps

fork in 2 months

issue openedcodenameone/CodenameOne

404 error trying to import CN1Lib

Could you please see this bug report, I suppose that the cause of the error is something that I cannot solve, because there is a 404 error trying to import my VideoOptimizer CN1Lib:

https://github.com/jsfan3/CN1Libs-VideoOptimizer/issues/1

Thank you

created time in 2 months

issue commentjsfan3/CN1Libs-VideoOptimizer

Lib is not imported after refresh cn1 libs in Codenameone

Thank you for your interest in this CN1Lib and for your report.

I've just tried to import this CN1Lib on two new projects and in both of them the CN1Lib is not imported correctly. There is a 404 error, as in the screenshot below. Clicking on "Retry" doesn't solve the issue, the error remains. If I tap on "Cancel", it seems to success, but it's a false positive feedback. The build hints included in the CN1Lib are not added and the CN1Lib is not usable.

A valid test to see if the CN1Lib is imported is the following line: VideoOptimizer videoOptimizer = new VideoOptimizer();

Because there is a server error, I'm going to report this bug on the Codename One Github issues page.

404

DurankGts

comment created time in 2 months

create barnchjsfan3/WowzaCustomPod

branch : master

created branch time in 2 months

created repositoryjsfan3/WowzaCustomPod

created time in 2 months

created repositoryjsfan3/CN1Libs-WowzaLiveStreaming-HelperPod

For the use of CN1Libs-WowzaLiveStreaming

created time in 2 months

create barnchjsfan3/CN1Libs-WowzaLiveStreaming-CustomPod

branch : master

created branch time in 2 months

created repositoryjsfan3/CN1Libs-WowzaLiveStreaming-CustomPod

Helper pod for CN1Libs-WowzaLiveStreaming

created time in 2 months

create barnchjsfan3/CN1Libs-WowzaLiveStreaming-CustomPod

branch : master

created branch time in 2 months

created repositoryjsfan3/CN1Libs-WowzaLiveStreaming-CustomPod

Helper Pod for CN1Libs-WowzaLiveStreaming

created time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha 81ec70ec2b732d7dad292e15a0dc0c20b0ffe151

Update README.md

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha f9d252ef1b55350bea588f18f900bc73e59cefa1

Update README.md

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha b27051949a0154eb98701893eb2b800258a2569c

Update README.md

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha 9c9de61b23b69138bb418b26ce740fa53b967d95

Update README.md

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha 1dd8226fe737d11b7f7a5e087a0d35bcffcc81b6

Update README.md

view details

push time in 2 months

delete branch jsfan3/CodenameOneLibs

delete branch : patch-2

delete time in 2 months

issue commenttanersener/mobile-ffmpeg

Get the percentage of FFMpeg execution

Out of curiosity, I have just published my library that include yours: https://github.com/jsfan3/CN1Libs-VideoOptimizer

jsfan3

comment created time in 2 months

PR opened codenameone/CodenameOneLibs

Added Video Optimizer CN1Lib

Video optimizer for Android and iOS Codename One apps, for fast upload. It allows to get info about a video, get a preview image of a video and optimize a video for fast upload (currently it uses default compression values both on Android and on iOS according to the best trade-off of "quality / file length / time to compress" that I found).

The license is explained on the Github page.

+12 -0

0 comment

1 changed file

pr created time in 2 months

push eventjsfan3/CodenameOneLibs

Francesco Galgani

commit sha 4f11e4b0a03effd63cfaa2c5264f2f26510f0f8c

Added Video Optimizer CN1Lib

view details

push time in 2 months

push eventjsfan3/CodenameOneLibs

Francesco Galgani

commit sha 890827459e8c686aa783bedba8fb9080682ba17c

VideoOptimizer Info: https://github.com/jsfan3/CN1Libs-VideoOptimizer/

view details

push time in 2 months

startedcodenameone/CodenameOneLibs

started time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

francesco

commit sha 849fdb186a1af6dc22100b86bde9c18305fa0d29

Readme

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

francesco

commit sha 6559e35cfa62321cd3ba791360e7040ef0586694

Readme

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

francesco

commit sha 49f3c4f14359b388ad589675a476bc6b48a4349d

Readme

view details

push time in 2 months

create barnchjsfan3/CN1Libs-VideoOptimizer

branch : master

created branch time in 2 months

created repositoryjsfan3/CN1Libs-VideoOptimizer

Video optimizer for iOS and Android apps made with Codename One

created time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha a4437fcc176a7fd6bcd2331e551facd24bf9b502

Update README.md

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

francesco

commit sha a184f130d7205e744e9ced600fc6b0beb7524b5b

Javadocs

view details

push time in 2 months

create barnchjsfan3/CN1Libs-VideoOptimizer

branch : master

created branch time in 2 months

created repositoryjsfan3/CN1Libs-VideoOptimizer

created time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha e08a302f79dc47f6431f988b04e4e35621e9d1c4

Update README.md

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha 362c90f619981cf881fbe963c1505a0756fb4c2d

Update README.md

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha 7a3334338f077bde5a163da4153e2fb5ebab2b73

Update README.md

view details

push time in 2 months

push eventjsfan3/CN1Libs-VideoOptimizer

Francesco Galgani

commit sha 5ebbd301e966a22b64442bd2bdb2e23cdcf56394

Update README.md

view details

push time in 2 months

create barnchjsfan3/CN1Libs-VideoOptimizer

branch : master

created branch time in 2 months

created repositoryjsfan3/CN1Libs-VideoOptimizer

Video optimizer for Android and iOS Codename One apps, for fast upload

created time in 2 months

issue commenttanersener/mobile-ffmpeg

Get the percentage of FFMpeg execution

Thank you very much! I hope you will keep to make this project updated.

Tomorrow I'll publish an open source CN1Lib (Codename One Library) that includes your MobileFFmpeg library. I sent you a small donation using PayPal.

jsfan3

comment created time in 2 months

issue openedtanersener/mobile-ffmpeg

Get the percentage of FFMpeg execution

Thank you for this project.

On Android, assuming to use an example as reported in the README.md, that is FFmpeg.execute("-i file1.mp4 -c:v mpeg4 file2.mp4");, how can I get the percentage of that execution?

created time in 2 months

issue commentcodenameone/CodenameOne

Sudden Crash on iOS when manipulating images from the camera. [Refer Issue #2285].

Could not you get a native log of the crash?

mailsenthil77

comment created time in 3 months

issue commentcodenameone/CodenameOne

Sudden Crash on iOS when manipulating images from the camera. [Refer Issue #2285].

@mailsenthil77 My code fits the requirement of my app and it's a bit complex because it's inside several classes. However, I can try to help you. I've just written and tested for you this commented example: https://github.com/jsfan3/Codename-One-Snippets/blob/master/TestCapture.java

mailsenthil77

comment created time in 3 months

push eventjsfan3/Codename-One-Snippets

Francesco Galgani

commit sha c40d413f023cd4bcd7b20a80f926b7b96d8d1b30

Update README.md

view details

push time in 3 months

push eventjsfan3/Codename-One-Snippets

Francesco Galgani

commit sha c06161c20436b628de88c0cb042bcf7908286b88

Create TestCapture.java

view details

push time in 3 months

push eventjsfan3/Codename-One-Snippets

Francesco Galgani

commit sha 4e9719256cb213aa73de2fe4aeba2a71d44b031d

Update README.md

view details

push time in 3 months

create barnchjsfan3/Codename-One-Snippets

branch : master

created branch time in 3 months

created repositoryjsfan3/Codename-One-Snippets

created time in 3 months

issue commentcodenameone/CodenameOne

Sudden Crash on iOS when manipulating images from the camera. [Refer Issue #2285].

@mailsenthil77 Consider that there are also other causes of crash. For example, the show method of Form should be called as soon as possible: if before the show your app needs some seconds to manipulate the images, probably iOS kills the app. In a similar case, it's better to show the Form immediately and manipulate the images in a separate single thread different from the EDT, also to maintain the app reactive. If you do that, remember to don't violate the EDT: while scaling should work off the EDT some other image manipulations might not.

mailsenthil77

comment created time in 3 months

issue commentcodenameone/CodenameOne

Sudden Crash on iOS when manipulating images from the camera. [Refer Issue #2285].

@mailsenthil77 What exactly do you do when manipulating images? For example, do you use Image.createImage(...) or Image.scaled(...)? I solved iOS crashes when manipulating images simply stopping to use these two APIs. Instead of Image.createImage(...) I use EncodedImage.create(...) and instead of Image.scaled(...) I use ImageIO.save(...) to scale the images. In this way there is an huge difference on RAM: for example, to load 20 photos at 12MP, Image.createImage(...) requires about 1GB of RAM (minimum), while EncodedImage.create(...) requires a lot less (see the Javadoc). Moreover, ImageIO.save(...) has no impact on RAM in compare to Image.scaled(...).

mailsenthil77

comment created time in 3 months

issue commentcodenameone/CodenameOne

[BUG] CN.openGallery (GALLERY_IMAGE_MULTI) crashes on iOS 12 trying to open 32 images

@shannah Thank you, I've just checked on my Iphone that the issue if fixed.

jsfan3

comment created time in 3 months

issue commentcodenameone/CodenameOne

[BUG] CN.openGallery (GALLERY_IMAGE_MULTI) crashes on iOS 12 trying to open 32 images

Thank you Shai, but it's not related to that https://github.com/codenameone/CodenameOne/issues/2285, it's a different kind of problem.

The discussion and the code examples reported in https://github.com/codenameone/CodenameOne/issues/2285 are very interesting, however I've already solved that kind of issues in my actual app, also thanks to your suggestion on Stack Overflow. Currently I can load 150 photos in the same Form (both in iOS and Android) without any crash or memory issue, thanks to the use of EncodedImage instead of Image, plus resizing the images using ImageIO instead of Image.scaled, plus several other optimizations (such as using a single EasyThread to insert images instead of multiple EasyThread instances, such as detect the type of files returned by the Gallery using the Util.guessMimeType, such as use images as a "fit" background of buttons - that imply an automatic resizing -, etc.). I've done a lot of tests to solve memory issues, I found a trade-off between image quality and use of memory.

This problem is a different. Please look at the test case I reported: I only log the full paths of the selected images in the gallery, I don't create Images or EncodedImages instances, I don't use Image.scaled or similar.

My test case, as it is, always reproduce this issue on my iPhone X trying to select a lot of photos (32 in this example). I've also just reproduced it on a device farm using an iPhone XR device and selecting 26 photos. The problem is that I haven't any log, because this kind of crash breaks the log functionality of the device farm I'm using (and currently I haven't a MacOS to do tests locally).

jsfan3

comment created time in 3 months

delete branch jsfan3/CodenameOne

delete branch : patch-1

delete time in 3 months

issue openedcodenameone/CodenameOne

[BUG] CN.openGallery (GALLERY_IMAGE_MULTI) crashes on iOS 12 trying to open 32 images

CN.openGallery (GALLERY_IMAGE_MULTI) crashes on iOS 12 trying to open 32 images.

Tested on iPhone X.

Test case:

        Form hi = new Form("Hi World", BoxLayout.y());
        Button btn = new Button("Open gallery");
        SpanLabel log = new SpanLabel("");
        hi.addAll(btn, log);
        hi.show();

        btn.addActionListener(l -> {
            // Start content "BasePageForm-InnerBoxImages"
            CN.openGallery(new ActionListener() {
                public void actionPerformed(ActionEvent ev) {
                    if (ev != null && ev.getSource() != null && ((String[]) ev.getSource()).length > 0) {

                        String[] filesPaths = (String[]) ev.getSource();
                        String debug = "Original file paths taken from Gallery:";
                        for (String str : filesPaths) {
                            debug += "\n" + str;
                            Log.p(debug, Log.DEBUG);
                        }
                        log.setText(debug);
                        hi.revalidate();
                    }
                }
            }, CN.GALLERY_IMAGE_MULTI);
        });

created time in 3 months

push eventjsfan3/CodenameOne

Francesco Galgani

commit sha 78c6a2dc72f0275c385595e1e90c381fc5047b2c

Fixed a small mistake Fixed a small mistake

view details

push time in 3 months

PR opened codenameone/CodenameOne

Added methods to guess mime types

Codename One lacks of methods to guess mime types (OpenJDK8 provides them). Sometimes they could be useful: for example, my Android phone returns files from Gallery without extension. Checking if a given file is an Image, for example, is a lot faster and without RAM usage trying to guess the mime type than trying to instantiate an Image object.

Currently supported mime types:

application/java-vm, application/msword, application/pdf, image/photoshop, application/postscript, audio/mp3, application/x-java-serialized-object, text/html, application/xml, image/bmp, image/tiff, image/gif, image/x-bitmap, image/x-pixmap, image/png, image/jpeg, image/jpg, application/acad, audio/basic, audio/x-wav, application/zip

In future we can add other mime types with other Pull Requestes. Note that my implementation is similar but not equal to the OpenJDK8 implementation: inside the code, I inserted two links for reference.

+219 -0

0 comment

1 changed file

pr created time in 3 months

push eventjsfan3/CodenameOne

Francesco Galgani

commit sha ebd3e0ec4894c1e6fef5a6d2c61d2019a64e3e42

Added methods to guess mime types Codename One lacks of methods to guess mime types (OpenJDK8 provides them). Sometimes they could be useful: for example, my Android phone returns files from Gallery without extension. Checking if a given file is an Image, for example, is a lot faster and without RAM usage trying to guess the mime type than trying to instantiate an Image object. Currently supported mime types: application/java-vm, application/msword, application/pdf, image/photoshop, application/postscript, audio/mp3, application/x-java-serialized-object, text/html, application/xml, image/bmp, image/tiff, image/gif, image/x-bitmap, image/x-pixmap, image/png, image/jpeg, image/jpg, application/acad, audio/basic, audio/x-wav, application/zip In future we can add other mime types with other Pull Requestes. Note that my implementation is similar but not equal to the OpenJDK8 implementation: inside the code, I inserted two links for reference.

view details

push time in 3 months

issue commentcodenameone/CodenameOne

[BUG] Transcompiling error to iOS

@shannah Thank you!

jsfan3

comment created time in 3 months

issue commentcodenameone/CodenameOne

[BUG] Transcompiling error to iOS

@ramsestom Thank you for the suggestion, but in Java 8 String[] result = new String[] {"", ""}; and String[] result = {"", ""}; is exactly the same thing, without any difference. To demonstrate that, I checked that in both cases the bytecode produced by the compiler is the same, that is the following.

(Note the nice optimization of the compiler that makes my split method a lot more efficient replacing my += operator between strings with the use of StringBuilder)

  public static java.lang.String[] split(java.lang.String, java.lang.Character);
    Code:
       0: iconst_2
       1: anewarray     #32                 // class java/lang/String
       4: dup
       5: iconst_0
       6: ldc           #33                 // String
       8: aastore
       9: dup
      10: iconst_1
      11: ldc           #33                 // String
      13: aastore
      14: astore_2
      15: iconst_0
      16: istore_3
      17: aload_0
      18: invokevirtual #34                 // Method java/lang/String.toCharArray:()[C
      21: astore        4
      23: aload         4
      25: arraylength
      26: istore        5
      28: iconst_0
      29: istore        6
      31: iload         6
      33: iload         5
      35: if_icmpge     125
      38: aload         4
      40: iload         6
      42: caload
      43: invokestatic  #17                 // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      46: astore        7
      48: iload_3
      49: ifne          66
      52: aload         7
      54: aload_1
      55: invokevirtual #35                 // Method java/lang/Character.equals:(Ljava/lang/Object;)Z
      58: ifeq          66
      61: iconst_1
      62: istore_3
      63: goto          119
      66: iload_3
      67: ifne          96
      70: new           #20                 // class java/lang/StringBuilder
      73: dup
      74: invokespecial #21                 // Method java/lang/StringBuilder."<init>":()V
      77: aload_2
      78: iconst_0
      79: dup2_x1
      80: aaload
      81: invokevirtual #23                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      84: aload         7
      86: invokevirtual #36                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      89: invokevirtual #24                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      92: aastore
      93: goto          119
      96: new           #20                 // class java/lang/StringBuilder
      99: dup
     100: invokespecial #21                 // Method java/lang/StringBuilder."<init>":()V
     103: aload_2
     104: iconst_1
     105: dup2_x1
     106: aaload
     107: invokevirtual #23                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     110: aload         7
     112: invokevirtual #36                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
     115: invokevirtual #24                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     118: aastore
     119: iinc          6, 1
     122: goto          31
     125: aload_2
     126: areturn
jsfan3

comment created time in 3 months

issue openedcodenameone/CodenameOne

[BUG] Transcompiling error to iOS

I have the suspect that the following test case demonstrates a transcompiling error from Java to the iOS native language. The following code works as expected on Android and on Simulator, but it fails with a NullPointerException on iOS because of the line result[0] += character;. Maybe my split code is not the best, but it should be valid: please correct me if I'm wrong.

public void start() {
        if(current != null){
            current.show();
            return;
        }
        Form hi = new Form("Test Split", BoxLayout.y());
        String text = "Abc-123456-7890";
        String[] tokens = split(text, '-');
        hi.add(new Label("Original string: " + text));
        hi.add(new Label("Token 1: " + tokens[0]));
        hi.add(new Label("Token 2: " + tokens[1]));
        hi.show();
    }
    /**
     * Similar to tokenize, but in this case it splits the string always in two
     * tokens, according to the first occurence of the given separator.
     *
     * @param text
     * @param separator
     * @return a string array of two tokens: if the saparator is not found, the
     * first token is equal to the given text and the second token is an empty
     * string
     */
    public static String[] split(String text, Character separator) {
        String[] result = {"", ""};
        boolean separatorFound = false;
        for (Character character : text.toCharArray()) {
            if (!separatorFound && character.equals(separator)) {
                separatorFound = true;
                continue;
            }
            if (!separatorFound) {
                result[0] += character;
            } else {
                result[1] += character;
            }
        }
        return result;
    }

Android screenshot: Screenshot_20190914-105504

iOS crash report log:

[EDT] 0:0:0,4 - Codename One revisions: 7dd4e7d08b3442d90959477ee52a5ae8c4361b29

[EDT] 0:0:0,8 - Exception: java.lang.NullPointerException - null
java.lang.NullPointerException
    at net_informaticalibera_tests_MyApplication.split:93
    at net_informaticalibera_tests_MyApplication.start:56
    at net_informaticalibera_tests_MyApplicationStub.run:31
    at com_codename1_ui_Display.processSerialCalls:1298
    at com_codename1_ui_Display.mainEDTLoop:1093
    at com_codename1_ui_RunnableWrapper.run:120
    at com_codename1_impl_CodenameOneThread.run:176
    at java_lang_Thread.runImpl:153
[EDT] 0:0:0,9 - Exception in TestSplit version 1.0
[EDT] 0:0:0,9 - OS ios
[EDT] 0:0:0,9 - Error java.lang.NullPointerException: null
[EDT] 0:0:0,9 - Before the first form!
[EDT] 0:0:0,10 - Exception: java.lang.NullPointerException - null
java.lang.NullPointerException
    at net_informaticalibera_tests_MyApplication.split:93
    at net_informaticalibera_tests_MyApplication.start:56
    at net_informaticalibera_tests_MyApplicationStub.run:31
    at com_codename1_ui_Display.processSerialCalls:1298
    at com_codename1_ui_Display.mainEDTLoop:1093
    at com_codename1_ui_RunnableWrapper.run:120
    at com_codename1_impl_CodenameOneThread.run:176
    at java_lang_Thread.runImpl:153
[Network Thread] 0:0:0,447 - Failed to parse expires date sun 13-sep-20 08:45:20 gmt for cookie

created time in 3 months

issue commentcodenameone/CodenameOne

[RFE] Codename One Build App email link

To be more clear about this RFE: currenctly there is no way to copy the link of the APKs (tested with Google Chrome on Linux).

jsfan3

comment created time in 3 months

issue openedcodenameone/CodenameOne

[RFE] Codename One Build App email link

It seems that the only missing functionality in the Codename One Build App is "e-mail Link", that I use every time that I need to allow other people to test my builds. If you plan to keep the "legacy dashboard" forever it is not a ploblem, but if you plan to replace the old dashboard with the new one, could you plase add that functionality? Thank you

created time in 3 months

issue openedcodenameone/CodenameOne

[BUG] Codename One Build App wrong remaining days

In the Codename One Build App the number of remaining days is wrong: in my case, it reports 45 days instead of 3 days.

created time in 3 months

delete branch jsfan3/CodenameOne

delete branch : patch-1

delete time in 3 months

PR opened codenameone/CodenameOne

Some fixes

Motivation: http://docs.oracle.com/javase/6/docs/api/java/text/DateFormat.html doesn't provide examples of patterns, while https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html provides examples and explanations that (mostly) apply to this class. I also added a link to the discussion on Stack Overflow. The Javadoc of the parse() method was wrong because it wasn't a Javadoc (note that it started with /* instead of /**) and so it resulted wrongly as "not implemented" in your official Javadoc (because the Javadoc of the overridden parse() method of the DateFormat class reports that it's not implemented). I fixed it with an actual Javadoc. I also added an exception that is more significant than the exception thrown by the superclass if a template is not provided.

+8 -8

0 comment

1 changed file

pr created time in 3 months

push eventjsfan3/CodenameOne

Francesco Galgani

commit sha e3f835c4eb97f04b6ab3bf5923a5dd74cb7e17f7

Some fixes Motivation: http://docs.oracle.com/javase/6/docs/api/java/text/DateFormat.html doesn't provide examples of patterns, while https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html provides examples and explanations that (mostly) apply to this class. I also added a link to the discussion on Stack Overflow. The Javadoc of the parse() method was wrong because it wasn't a Javadoc (note that it started with /* instead of /**) and so it resulted wrongly as "not implemented" in your official Javadoc (because the Javadoc of the overridden parse() method of the DateFormat class reports that it's not implemented). I fixed it with an actual Javadoc. I also added an exception that is more significant than the exception thrown by the superclass if a template is not provided.

view details

push time in 3 months

fork jsfan3/CodenameOne

Write once run anywhere native mobile apps using with Java 8 or Kotlin. Supports iOS (iPhone/iPad), Android, Windows (UWP) & others

https://www.codenameone.com/

fork in 3 months

issue closedcodenameone/CodenameOne

RFE: Add a method to choose the position of the AutoCompleteTextField popup

After spending a lot of hours trying to investigate the bug https://github.com/codenameone/CodenameOne/issues/2906, I give up: I cannot find a test case and I cannot fix it by myself. It seems to be too much specific of my app, for unknown reasons.

However, a possible solution is this RFE: could you add a method to choose the position of the AutoCompleteTextField popup? I mean to manually set if the popup should be over the TOP of the TextField or under the BOTTOM.

For example, look at this screenshot (taken on my Android 7 device). The popup is shown under the VKB, but I can prevent that behaviour if you allow me to set that I want it over the TOP of the TextField.

Thank you for your support.

Screenshot_autocompletetextfield

closed time in 3 months

jsfan3

PR opened codenameone/CodenameOne

Implementation of my RFE 2911

These changes implement my RFE https://github.com/codenameone/CodenameOne/issues/2911

+21 -4

0 comment

1 changed file

pr created time in 3 months

push eventjsfan3/CodenameOne

Francesco Galgani

commit sha 8c5eebd25c2f1f5eee1910872788ba608fe8b62e

Implementation of my RFE https://github.com/codenameone/CodenameOne/issues/2911 These changes implement my RFE https://github.com/codenameone/CodenameOne/issues/2911

view details

push time in 3 months

issue commentcodenameone/CodenameOne

[BUG] AutoCompleteTextField stopped at all to work in some Forms

SOLVED! (After days of trials...) I'm sorry, the cause of this issue on Android only was not in the AutoCompleteTextField class, but in my override of some methods of that class, that, for some reason, it was ok in the past but it's not ok now. I removed my code and now the AutoCompleteTextField works fine also on Android.

jsfan3

comment created time in 3 months

issue closedcodenameone/CodenameOne

[BUG] AutoCompleteTextField stopped at all to work in some Forms

Probably this is my less precise bug report, without test case (because I didin't find it): my AutoCompleteTextComponents stopped at all to work in some Forms (on Android only, they are fine on iOS), while they continue to work in other Forms. The fact is that I didn't touched that code, because in the last two weeks I worked to other code.

So, in few words: I'm having a lot of odd issues with TextAreas and AutoCompleteTextFields, as I reported in other bug reports (https://github.com/codenameone/CodenameOne/issues/2905, https://github.com/codenameone/CodenameOne/issues/2906, https://github.com/codenameone/CodenameOne/issues/2907).

The common aspects of these bugs are that:

  • none of them existed until about two weeks ago;
  • I didn't touched my code;
  • all these bugs are on Android only.

So I suppose that you modified something that impacts on TextAreas and on the VKB on Android.

closed time in 3 months

jsfan3

issue commentcodenameone/CodenameOne

[BUG] Test case for "next" button of the VKB

The current implementation of public TabIterator getTabIterator(Component start) inside Form relies on ComponentSelector and on a Comparator that uses getTabIndex(). This is fine in a lot of cases, but it produces unwanted results when we replace, remove or hide components. That's why I think that your API implementation should be fixed or enhanced.

Now I've just wrote and tested a different implementation of getTabIterator that works correctly with the test case that I provided (it fixes the issues on Android, iOS and Simulator). Of course my following implementation cannot be used as it is in all situations. In particular, my implementation is ok if the inputs are in a single column and it considers only TextAreas and Pickers, but it could not be ok if there are more columns (it depends by the specific use case) and if we want to consider all kinds of inputs.

Moreover, I didn't find yet a working solution for my actual app.

    public void start() {
        if (current != null) {
            current.show();
            return;
        }
        Random random = new Random(System.currentTimeMillis());
        int numberOfComponents = 100;
        Form hi = new Form("Test Case Android bug", new TextModeLayout(numberOfComponents, 1)) {
            @Override
            public Form.TabIterator getTabIterator(Component start) {
                // Note: I cannot call the constructor of TabIterator because it has private access,
                // that's why I workaround the problem calling super.getTabIterator
                // and then I remove all its items to get an empty TabIterator
                Form.TabIterator iterator = super.getTabIterator(start);
                while (iterator.hasNext()) {
                    iterator.remove();
                }

                SortedSet<Component> cmpsSet = getAllFocusableCmps(this);
                if (cmpsSet.isEmpty()) {
                    Log.p("getTabIterator returning empty iterator because no focusable components were found", Log.DEBUG);
                    return iterator;
                }
                // Note: if "start" is the last item of the iterator, we can return
                // an empty iterator to avoid a "next" button to the first item
                // on Android VKB
                if (cmpsSet.last() == start) {
                    Log.p("getTabIterator returning empty iterator because the given \"start\" component is the last component", Log.DEBUG);
                    return iterator;
                }

                // Note: if "start" is not contained in the iterator list, maybe it's better
                // to return an empty iterator
                if (!cmpsSet.contains(start)) {
                    Log.p("getTabIterator returning empty iterator because the given \"start\" component is not in the iterator list (that contains " + cmpsSet.size() + " items)", Log.DEBUG);
                    return iterator;
                }
                for (Component cmp : cmpsSet) {
                    iterator.add(cmp);
                }
                iterator.setCurrent(start);
                Log.p("getTabIterator returning " + cmpsSet.size() + " components", Log.DEBUG);

                return iterator;
            }

            private SortedSet<Component> getAllFocusableCmps(Container cnt) {
                TreeSet<Component> list = new TreeSet<>(new Comparator() {
                    @Override
                    public int compare(Object o1, Object o2) {
                        if (o1 instanceof Component && o2 instanceof Component) {
                            Component cmp1 = (Component) o1;
                            Component cmp2 = (Component) o2;
                            if (cmp1.getAbsoluteY() < cmp2.getAbsoluteY()) {
                                return -1;
                            } else if (cmp1.getAbsoluteY() > cmp2.getAbsoluteY()) {
                                return 1;
                            } else if (cmp1.getAbsoluteX() < cmp2.getAbsoluteX()) {
                                return -1;
                            } else if (cmp1.getAbsoluteX() > cmp2.getAbsoluteX()) {
                                return 1;
                            } else {
                                return 0;
                            }
                        } else {
                            // this cannot happen
                            throw new IllegalArgumentException("o1 and o2 must be Components");
                        }
                    }
                });
                for (Component cmp : cnt.getChildrenAsList(true)) {
                    if (cmp.isVisible() && !cmp.isHidden()) {
                        if (cmp instanceof TextArea && ((TextArea) cmp).isEditable()) {
                            list.add(cmp);
                        } else if (cmp instanceof Picker && ((Picker) cmp).isEnabled()) {
                            list.add(cmp);
                        } else if (cmp instanceof Container) {
                            list.addAll(getAllFocusableCmps((Container) cmp));
                        }
                    }
                }
                return list;
            }
        };
        InputComponent[] fields = new InputComponent[numberOfComponents];
        for (int i = 0; i < fields.length; i++) {
            if (random.nextInt(2) != 0) {
                fields[i] = new TextComponent().label("Type here");
            } else {
                if (random.nextInt(2) != 0) {
                    fields[i] = PickerComponent.createDate(new Date()).label("Date");
                } else {
                    fields[i] = PickerComponent.createDurationMinutes(0).label("Duration");
                }
            }
        }
        hi.addAll(fields);
        hi.show();
        UITimer.timer(100, false, hi, () -> {
            for (int i = 0; i < fields.length; i++) {
                if (random.nextInt(2) != 0) {
                    TextComponent newField = new TextComponent().label("Type here");
                    hi.replace(fields[i], newField, null);
                    fields[i] = newField;
                }
            }
            for (int i = 0; i < fields.length; i++) {
                if (random.nextInt(2) != 0) {
                    fields[i].remove();
                }
            }
            for (int i = 0; i < fields.length; i++) {
                if (random.nextInt(2) != 0) {
                    if (fields[i].getParent() != null) {
                        fields[i].setVisible(false);
                        fields[i].setHidden(true);
                    }
                }
            }
            hi.revalidate();
        });
    }
jsfan3

comment created time in 3 months

issue closedcodenameone/CodenameOne

[BUG] hi.getContentPane().getComponentAt(i).remove() fails

Test case:

Form hi = new Form("Hi World", BoxLayout.y());
        for (int i=0; i<100; i++) {
            hi.add(new Label("Test"));
        }
        hi.show();
        for (int i=0; i<99; i++) {
            Log.p(hi.getContentPane().getComponentCount() + "");
            hi.getContentPane().getComponentAt(i).remove();
        }
        hi.revalidate();
        Log.p(hi.getContentPane().getComponentCount() + "");

In my opinion this code is correct and it doesn't do anything of special: it adds 100 Labels and then it removes the first 99 Labels. But it fails, this is the log:

[EDT] 0:0:0,77 - 100
[EDT] 0:0:0,78 - 99
[EDT] 0:0:0,78 - 98
[EDT] 0:0:0,78 - 97
[EDT] 0:0:0,78 - 96
[EDT] 0:0:0,78 - 95
[EDT] 0:0:0,78 - 94
[EDT] 0:0:0,78 - 93
[EDT] 0:0:0,79 - 92
[EDT] 0:0:0,79 - 91
[EDT] 0:0:0,79 - 90
[EDT] 0:0:0,79 - 89
[EDT] 0:0:0,79 - 88
[EDT] 0:0:0,79 - 87
[EDT] 0:0:0,79 - 86
[EDT] 0:0:0,79 - 85
[EDT] 0:0:0,79 - 84
[EDT] 0:0:0,79 - 83
[EDT] 0:0:0,80 - 82
[EDT] 0:0:0,80 - 81
[EDT] 0:0:0,80 - 80
[EDT] 0:0:0,80 - 79
[EDT] 0:0:0,80 - 78
[EDT] 0:0:0,80 - 77
[EDT] 0:0:0,80 - 76
[EDT] 0:0:0,80 - 75
[EDT] 0:0:0,80 - 74
[EDT] 0:0:0,81 - 73
[EDT] 0:0:0,81 - 72
[EDT] 0:0:0,81 - 71
[EDT] 0:0:0,81 - 70
[EDT] 0:0:0,81 - 69
[EDT] 0:0:0,81 - 68
[EDT] 0:0:0,81 - 67
[EDT] 0:0:0,81 - 66
[EDT] 0:0:0,81 - 65
java.lang.IndexOutOfBoundsException: Index: 50, Size: 50
[EDT] 0:0:0,81 - 64
[EDT] 0:0:0,81 - 63
[EDT] 0:0:0,81 - 62
[EDT] 0:0:0,81 - 61
[EDT] 0:0:0,81 - 60
[EDT] 0:0:0,82 - 59
[EDT] 0:0:0,82 - 58
[EDT] 0:0:0,82 - 57
[EDT] 0:0:0,82 - 56
[EDT] 0:0:0,82 - 55
[EDT] 0:0:0,82 - 54
[EDT] 0:0:0,82 - 53
[EDT] 0:0:0,82 - 52
[EDT] 0:0:0,82 - 51
[EDT] 0:0:0,82 - 50
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at com.codename1.ui.Container.getComponentAt(Container.java:1749)
	at net.informaticalibera.tests.Count.start(Count.java:61)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.codename1.impl.javase.Executor$3$1.run(Executor.java:256)
	at com.codename1.ui.Display.processSerialCalls(Display.java:1298)
	at com.codename1.ui.Display.mainEDTLoop(Display.java:1093)
	at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
	at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

Tested on the Simulator.

closed time in 3 months

jsfan3
more