codenameone

Codename One - Avoid screen size change on Android on app startup

不想你离开。 提交于 2019-12-08 03:28:20
问题 This issue produce two unwanted effects on Android: one execution of the SizeChangedListener (at app startup) that I don't want; a visible and unwanted resizing of the Form background (with the option Style.BACKGROUND_IMAGE_SCALED_FILL ) after the app is just started. The following code, tested on Samsung Galaxy S8+, produces this log: 12-18 00:49:45.594 D/SizeChangedListener(17264): [EDT] 0:0:0,22 - Initial Screen size: 1080 * 2008 12-18 00:49:45.596 I/System.out(17264): showKeyboard false

Codename One APK Manifest for Android TV

瘦欲@ 提交于 2019-12-08 03:22:16
问题 (Note for the readers: this question is referred only to Codename One) As I previously told in Use a Codename One app for a tv box with tv remote control, I published in the Play Store my first Codename One app for Android TV. It works fine with my Android TV-Box, but it was reject. I received the following e-mail by the Google Play support: Thank you for contacting the Android TV Team. I see that there is some confusion regarding the issues we found in your app. Your TV APK manifest must

How to use variables to refer to Components in codename one?

和自甴很熟 提交于 2019-12-08 02:28:06
问题 I created a UI with the UIBuilder. Instead of always using the findXXXX () , I would love to do something like this in the Statemachine : public class Statemachine ... { private Container c; private Tabs t; initVars () { initAll(); } .... private initAll () { Container c = findContainer(); Tabs t = findTabs(); ... } } and use them as c.getYYY() . Is this possible? If yes, how? 回答1: Yes you can do that, but not advisable. The danger of it is when you have 2 components with the same name on

Is it possible to make rounded image (via mask) on Multibutton (Codename One)

限于喜欢 提交于 2019-12-08 02:05:49
问题 I have an InfiniteScrollAdapter in which I use Multibutton to display a list featuring a photo and its description. It works well but I need to make the photo rounded. That's why I got inspired by the official guide on image masking. Unfortunately what I get is only a black round. Here is the code I used: MultiButton[] cmps = new MultiButton[reports.size()]; for (int iter = 0; iter < reports.size(); iter++) { Report currentReport = reports.get(iter); if (currentReport == null) {

Codename One Back Command on left and Menu on Right

妖精的绣舞 提交于 2019-12-08 02:01:55
问题 i am trying to make an app in Codename one where i want to create a handburger menu on the right side at the top of the screen and a back button on the left side, but cannot get it to work I know it can be done where you have a handburger menu on the left side and a button on the right side. I made a picture of how I want it to look like. The back button is added in paint and not through the code. Picture of app example below is the code that I have used to get the menu on the right side.

How to get unique identifiacation number of iphone

半城伤御伤魂 提交于 2019-12-08 01:18:11
问题 I want to get unique id of iphone.currently I am using Display.getInstance().getUdid(); but it gives different unique id each time I install an application on iphone. Can you please let me how to resolve it? 回答1: You can no longer get the Unique id per device because of apples revised security policy . identifierForVendor is the best alternative you can go for. You can try UIDevice *device = [UIDevice currentDevice]; NSString *currentDeviceId = [[device identifierForVendor]UUIDString]; 回答2:

Use a Codename One app for a tv box with tv remote control

大憨熊 提交于 2019-12-08 00:57:47
问题 I tried to install a Codename One app on a tv box that runs Android 7. It works, except the fact that I cannot use the tv remote control to switch from a Button to another (I need to enable the mouse pointer simulation to tap the Buttons, that is not user friendly). Any idea to manage this use case? Or the problem is that I'm using a BrowserComponent? 回答1: I’ve just published in the Play Store my first Codename One app for Android TV (I hope that it will be approved). I confirm that it can be

Carousel with thumbnail images at the bottom

六月ゝ 毕业季﹏ 提交于 2019-12-08 00:27:28
In a Codenameone app, I'm trying to develop a carousel with a thumbnail list at the bottom. I've used Tabs control to display files (of diff types like images, video, text, button etc) in carousel style in the center of a form and another Tabs control to display thumbanail images (of the first carousel files) at the bottom of the form. When a user selects a thumbnail image in the bottom carousel, corresponding component should be displayed in the first carousel. hi.add(BorderLayout.CENTER, mainCarousel); hi.add(BorderLayout.SOUTH, bottom_tab); bottom_tab.addSelectionListener((i1, i2) -> { //

How to post JSON to a REST webservice in codenameone

一曲冷凌霜 提交于 2019-12-08 00:21:24
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 postResponse() { try { json.put("firstname", fname.getText()); json.put("middlename", mname.getText()); json

How to read nested JSON in Codename One

一笑奈何 提交于 2019-12-08 00:21:17
问题 I have been following the instructions here: https://www.codenameone.com/javadoc/com/codename1/io/JSONParser.html to retrieve a value from a json file. I have managed to read the top level value of my json content - however I cannot see how to read the value of a nested tag e.g. using this file ... { "glossary":{ "title":"example glossary", "GlossDiv":{ "title":"S", "GlossList":{ "GlossEntry":{ "ID":"SGML", "SortAs":"SGML", "GlossTerm":"Standard Generalized Markup Language", "Acronym":"SGML",