Codename One : Open picture on iOS with execute() - codenameone

I need to open a photo collage (an image) the user made. So I use Display.getInstance().execute(montage.getMontageFullPath()); which works on Android device and Codemane One simulator but not on iOS (neither on the device nor on Xcode Simulator).
The image is saved as expected on the iPhone album but it does not open as it used to be. The only change I made to my code is to use the native interface to make the image appear on the album (ie the photo gallery).
I read this blog posting about canExecute(String url) but when I use it, it is null on Android so if I use it as a test before running execute(), the latter is never run. I can't remember what happened on iOS, but the gallery was not open either.
What are the reasons why execute() would not open an image on iOS whereas it does open the image on Android and on CN1 simulator ?
Thanks for helping me,

The canExecute method is a 3 mode result:
null - means unknown
True means it should work
False means it shouldn't work
So you can treat null & true as the same.
This should work implicitly in iOS see this newer post but make sure that the URL you give is one within your app home otherwise we can't make any guarantees.

Related

how can i change the language in messages in input tag

i'm building a web app with capacitor js and react js.
i'm creating a button to when i click the button to upload image file.
in android it works well, but in ios when i click the button it prints three options like above picture.
i want to make those options to korean.
i knew the language of the messages are depends on system language.
so i already checked the system language setting by window.navigator.language
it already setted in korean.
and then i dont know reason why, it prints in korean when i open a app in native safari browser.
this problem only occurs when i open the web in the app i built by capacitor
someone please give me some hints .
You can set the development region in your ios/App/App/Info.plist file:
<key>CFBundleDevelopmentRegion</key>
<string>ko</string>

Open App Settings tapping a Codename One Button

Is there any code that I can insert in the ActionListener of a Codename One Button to open the app settings on iPhone and on Android?
I saw something similar in other apps, for example to help the user to manually change the app permissions. In my case, I'd like to easily open the app settings to inspect the amount of total storage taken by the app (as suggested in https://stackoverflow.com/a/53992872/2670744) and other infos provided by Android and iOS.
I haven't tried this but execute("app-settings:") (from Display or CN) might work. If not you will need to use native code, specifically:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
As mentioned here: How to open settings from my iPad application (Objective-C)

How can I call Waze App from codename in IOS devices

I wrote a CodeNameOne Mobile App that launches "Waze App" and starts a visual navigation that helps our users (health professionals) reach at houses of their respective patients.
This App works fine in Android devices.
I simply call "Display.getInstance().execute(url)" method and all done. (Great!!!).
But , in iOS devices, this feature doesn't work.
I expected the same code should work on all platforms.
For iOS devices do I need to do some specific code or configuration?
Any help will be appreciated.
Thanks
I suggest trying this URL:
waze://?q=123%20main%20st%20San%20Jose%20California
Found it on the Waze developer website.
Display.execute should work if you want to explicitly invoke Waze but you should probably use canExecute to make sure it's available (notice that canExecute returns Boolean and NOT boolean as it has 3 modes).
Assuming you just want to navigate somewhere you can just call openNativeNavigationApp.

Using AsyncUpload on mobile device (Galaxy SII)

EDIT :
This morning i've test it with iphone 4 and its working perfectly so its probably specific on Android (i'm using Version 4.1.2) Vs AsyncUpload Control
I am currently creating a file upload section on a web page that can be view on every type of device (Computer, Tablets and mobile phone). When i test the file upload section on a standard computer everything works perfectly. When i test it on mobile phone (I'm using Samsung Galaxy S2 with all the latest update) i have access to the files on my phone. I can select the file that i want and it seems to upload perfectly ( I got the green dot from the telerik control which means that the upload has been successful ) but in fact the file created in the template directory of the control ( app_data\RadUploadTemp ) has a size of 0 bytes. So when i press my submit button, the file copied in my working directory is invalid and cannot be read. You can test it yourself on a telerik demo page.
http://demos.telerik.com/aspnet-ajax/asyncupload/examples/additionalfields/defaultcs.aspx
When i upload a file on this page from my mobile phone, the file size is always 0... So from there i know that its not something with my code but its something between the control and the mobile browser.
I have asked my question on telerik forum but i didn't get any answer yet.
Does someone know if there is a limitation from mobile browser to upload file using RadAsyncUpload control
And by the way, RadAsyncUpload control use the html5 File API first, if the browser cannot use it, the control will try to use flash/silverlight. if its still not working, it will use standard IFrame module to upload the file.
Here are some docs about the control http://www.telerik.com/help/aspnet-ajax/asyncupload-overview.html
I would like to know if someone else can test it on the demo page and let me know if it works. If not , anyone have an alternative solution to upload file from mobile phone ?
Thanks !
Sebastien
Here is the code to solve the problem on Android. i was not able to put it in my comment.
Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; };
Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function() {return false; };
Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function() {return false; };
I just added a kind of If (android) do the code
Cheers !

Issue in clicking on the browse button with selenium in IE

I am Clicking on the browse button in IE using Selenium Webdriver code in an upload file utility by reading the co-ordinates of the browse text. Whlie the code works fine in some machines in IE and firefox both, in yet another machine the same code is working for firefoxx but the browse button becomes unclickable in IE. We checked the settings in internet options, everything looks alike in both machines.
Please let us know if anyone faced any such issue and the resolution that could work.
If there is any other way to upload the file in your app by avoiding the "Browser" button method, then that is always preferred. Some people will use Apache HTTPComponents to do a POST upload to the servlet that the "Browse" button refers to. That is by far the preferred method rather than using WebDriver. The problem with the Browse button is that it opens native OS controls ( in some cases) and the only way you can control those is by using the Sikuli API to click on elements based on finding them with matching screenshots. Also, if you use Sikuli, you can't run multiple browser tests on the same machine since each test will block screen comparisons of another test and that will rule you out of using RemoteWebDriver.

Resources