The native file chooser dialog doesn't get invoked from within a BrowserComponent. I understand WebView has some limitations but there are ways to overcome this in Android.
Is there a workaround for CodenameOne? Any ideas on how to make it work?
This is a bit problematic because Android overcame it in a non-portable way. That means the workaround worked for older versions of Android, stopped working and then you needed a new workaround all the time.
But it was even more problematic because of permissions that made it really hard to do it well especially with Android 6+ permission types. All users that asked for this so far found a different way to implement file upload e.g. using the multipart class so this never became an issue that required a workaround (which would be non-trivial).
Related
Is there a way to integrate codenameone component in a native activity/fragment?.
The idea is having a codenameone library, that we use its native compilation as a library in an existing native project?
Many thanks for the reply
Maybe but probably not.
Codename One was very much designed to take over. The reason is that cross platform embedding is really difficult as the OSs have a very different concept of application embedding and lifecycle.
You can embed a native widget into Codename One "easily" but that's probably not enough.
Since in Android everything is an activity you might be able to hack something by packaging two apps into one APK and moving back and forth with the Codename One app. I wouldn't recommend it since we make a lot of assumptions and this might not work. You won't be able to do the same on other platforms either.
One strategy some developers took is to have two distinct apps that communicate between them via the cloud or via app URI calls (or both). This is a workable cross platform approach but it's also a bit painful and it isn't seamless to the user.
Is it possible to take a desktop app made with Electron js and somehow make it work on mobile? I read it's possible to convert React applications to Electron applications and I was wondering if it's possible to do it the other way around. It's likely it might not be possible to convert it 1:1 because of native functions etc. probably.
I haven't tried anything because I doubt it's possible - I just want confirmation.
Depends on what it does. If the functionality would work equally well on a website inside a browser then yes. You'll just need to store data somewhere else than on user's file system. But if the electron app uses native or node features, like accesses local files, then probably not so easily.
LayoutAnimation is a part of React Native that automatically animates components when the view is rendered.
The official documentation is here:
https://reactnative.dev/docs/layoutanimation
However, the examples in the docs do not work. Objects in the examples that are supposed to animate just jump from the starting position to the end position.
Here is an example of one of the Snacks in the documentation that does not appear to animate:
https://snack.expo.io/91MUQd5IH
This would lead one to the conclusion that this API is just not supported or no longer functional.
Is it the case that Layout Animation just does not work? Or if it does work under some circumstances, please share a link containing a working Snack / Gist with an extremely simple but working LayoutAnimation example.
UPDATE: LayoutAnimation possibly does not support web. Does anyone have any knowledge of this or who can refer the reader to an explanation in the docs?
LayoutAnimation is currently not supported properly in react-native-web. You can see that here: https://github.com/necolas/react-native-web#modules and here https://github.com/necolas/react-native-web/issues/1613, https://github.com/necolas/react-native-web/issues/1056. It doesn't seem to be a priority for the project at the moment so I wouldn't count on it being implemented.
On iOS/Android it's a different story. If we look here: https://reactnative.dev/docs/layoutanimation/ you can actually see this working properly by pressing play and selecting iOS for example.
On Android we have support as well but it might not work/crash. If you look over the issues open for react-native, you will see a lot of them mention issues with LayoutAnimation and Android. E.g. it crashes under certain conditions on Android: https://github.com/facebook/react-native/issues/27552 and https://github.com/facebook/react-native/issues/29919.
I don't recommend using LayoutAnimation, especially on Android, as it is highly experimental and might crash on some devices without warning.
If you want to try some more interesting animations with better performance, I recommend you try using the Animated API from ReactNative or the newer react-native-reanimated which is faster, more modern but still in alpha (I'm talking about the current, v2, version).
By my test the given link in the question post works properly:
Also, I test it on my friend's iPhone and it's worked properly too. But many of React Native features don't work properly on Web export. For example animations on RNW (React Native Web) works on Android/iOS exports but not on Web exports.
For such web situations, you should decouple the web component and make a separate file then write the desired animation on it.
I'm looking to add functionality to the built in Java SDK classes beyond the CLDC 1.1 standard which is where the API seems to be compatible with. Specifically looking to implement StringBuffer#replace(...)
What is the best way to go about this?
Thanks
cldc1.1 is a very old standard. Codename One supports far more than what that standard had but retained the filename due to legacy issues.
There is a guide on how to use the Codename One source and contribute it back to the git repository: http://codenameone.com/blog/how-to-use-the-codename-one-sources.html
However, the main issue is the need to fix this for all OS's which is pretty challenging.
To just fix the stubs for the method to appear to compile you can change the project here. However, this will only work for targets where the method is already there (Android, JavaSE etc.).
You will then need to make sure there is an implementation for all other targets:
For Windows you will need to fix the ikvm target and fork, for iOS you will need to fix the code in the JavaAPI directory under the VM directory for JavaScript you will need to contribute your changes to TeaVM if required.
For older platforms you will need to implement your changes into the retroweaver support although this might not be as relevant.
I'm building an application that is using CEF 3 (version 1650) in WPF (meaning I'm using OSR mode) using Xilium.CefGlue as a wrapper.
After a lot of research I've found several features I can't get to work nor workaround:
Focus Management - I need to tell when the last focusable item in the page lost focus due to a Tab press (or the first item due to Shift+Tab)
Javascript Alerts - I got them to work for standard schemes, but not for custom schemes (also found a bug regarding it). I'm looking for a way around it.
Favicons - Seems CEF3 did not implement favicon support. I guess I can look for favicon.ico in the root directory for standard schemes, but what about favicons linked in the HTML itself?
User Permission Notification - I only found permission request events for geolocation request, but I also need for other things such as getUserMedia. Any idea how?
Zoom - This one works except for getZoomLevel, that for some reason always returns zero. Does anyone knows why or how to get around it considering it does remember each page's last zoom?
Process Model - I can't get multiple browser windows opened manually (that is, not via javascript's openWindow) all with the same custom scheme to open in the same render process (already tried all different process model parameters I know of). As far as I understand, it should be possible. What am I missing?
Thank you in advance for your help.
Focus Management is it OnTakeFocus you are looking for?
Favicons has an open enhancement issue in the CEF project
For anyone who finds their way to this question, favicon support is now available in the official CEF builds.