Open App Settings tapping a Codename One Button - codenameone

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)

Related

How to configure a specific setting of ios or android phone in th background if my react native app is open in foreground?

First of all I'm new as React-Native programmer. Currently I want to add a button to my React-Native(Expo) app, in which the user can turn off or on a setting. Is this possible and if so, how can I do that? For example in Android > Settings > Mobile Networks > Turn off mobile roaming?
Thank you in advance
I have tried to use HeadlessJS or a module called background actions. But there are no well documented examples and I also don't know if those modules answer my question. Because my task is more "straightforward" since I keep the app running in the foreground.

Launch to google play and iOS app store to download a different app

I have separate user and PRO app. If a user downloads the PRO app I would like to give them the option to download the user version with a simple button to take them to download the user version from the relevant store. I'm looking for some guidance on the best way to achieve this.
You can use CN.execute("uri of my app"). You can check the CN.getProperty("Platform", "android").equals("ios") to check if this is iOS and use the itunes URL. Otherwise you can use the Android URL.
On the desktop this will open the browser but on the device it will launch the appstore.
See this post: https://www.codenameone.com/blog/rating-widget.html

After i create a APK to PWA i see toolbar of browser

I have a problem with my first PWA.
I have created one with reactjs and configured good manifest.
I follow step by step google guide.
PWA, works perfectly, and i see "add to home button".
After QA i wanted to publish it in store.
I used https://appmaker.xyz/pwa-to-apk.
Now i have app publish in the store but when i open it, i see a browser toolbar and i can't use it as a native app.
Someone can help me?
How about using TWA (Trusted Web Activity)?
Using Trusted Web Activities
This can be achieved by proving that the app and the web trust each other.
If you can prove it, you can prevent the browser toolbar from being displayed.
I'm sorry if you don't get the answer you want.

access googledrive or icloud from app using codenameone

I want to manually allow user to save the the data from app directly to google drive or iCloud. Suppose, I have an image and when user clicks save button he need to get option to save to icloud or google drive anyone of these in the iOS device. How can i achieve this in codenameone are there any plugin, api or library avaliable? As goggle provided google-api-services for android application. How I achieve this in iOS.
Thanks for your help.
Doing this with an image should be easy. Just use the share feature in Codename One:
// will return false on the simulator but work in iOS/Android
if(Display.getInstance().isNativeShareSupported()) {
Display.getInstance().share("", fileSystemPathToImage, imageMimeType);
}
Suggestions of where to save should be based on the things available in your device e.g. Facebook, iCloud, Drive, Dropbox etc.

Demo Glassware via screenshare

I have built a demo application that I want to demo to a room of people. How do I go about sharing my google glass screen with the audience? I saw that in Google I/O, engineers were using something to share their screen with the audience, how do I get that?
The MyGlass Android app has a feature called "screencast" - if, for example, you set up a Nexus 10 with MyGlass, you can then use the mini-HDMI out to project the screencast to a large audience (I'm not sure how you'd hook other Android devices up to a projects, but I know this Nexus 10 method works).
You can find the screencast function at the bottom of the main drop-down menu in the MyGlass home screen.
I would turn debug mode to "on" in my Glass settings and then use Android Screencast to display the view from Glass on my computer screen. From there I could use a projector or external monitor for demoing purposes.
There is also a cool jar that I found called droidAtScreen which uses ADB to render whats showing on the glass onto a GUI; no setup required, easy to use.

Resources