codenameone

Codename One Animation Trouble (also in Solitaire demo)?

做~自己de王妃 提交于 2019-12-05 17:17:23
What happened to Codename One animations? I use a lot of them and as of december my app is no longer working. When I left things in June everything was fine (and was so for more than a year). My app is a draughts (checkers) game and is available in the app stores since 2013. After seeing the CN1 Poker demo, I completely rewrote my GUI as I wanted to add those kind of animations to my app. What happens now is that I suddenly get index out of bound exceptions. I narrowed this down to the following situation: cont.addComponent(comp); ... ... cont.getComponent(0); <-- index out of bound exception:

Adding image in java code in code name

混江龙づ霸主 提交于 2019-12-05 13:40:26
I am new in code name one. I have to add image in a container(flow layout) with specific width and height. 1: codenameone's guide says that we have to add image in resource folder. Where is that resource folder? 2: To create image i am using createImage(path) of image class. if we put image file in resource folder then what is path of that image. 3: Is here any type restriction of image file in it. Please help. When you put the image you would like to add in your src folder the code should look as followed: Label i = new Label(); Image img = Image.createImage("/imageToAdd.png"); i.setIcon(img)

Error When building a large Codename One Application During the Dex Phase

蓝咒 提交于 2019-12-05 00:56:20
I got an error in the build server when sending an Android build during the dex phase. Googling a bit I learned that there is a hard limit of 64K functions (including all libs, the heaviest is google play services), or you can use the multiple dex mechanism. How do I activate this for Codename One? I understand Codename One uses Ant and as far as I understand this only works for gradle. FYI this is the workaround, that splits google play services into sub libraries with native android: http://android-developers.blogspot.com.es/2014/12/google-play-services-and-dex-method.html I had a very

Codenameone plugin giving null pointer exception

岁酱吖の 提交于 2019-12-04 20:43:18
I am using intelli Idea and i have installed codenameone plugin. It worked fine since morning. Now i'm trying to open my form with gui builder but it giving me this below exception. Also it show to disable the plugin and i have tried same. I have uninstalled and installed again plugin but still it showing me same error while trying to open form in GUI Builder. Any help appreciated Thanks java.lang.NullPointerException at com.codename1.plugin.intellij.actions.GUIBuilderAction.actionPerformed(GUIBuilderAction.java:65) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:197)

How to code an iPhone style popup menu in CN1?

独自空忆成欢 提交于 2019-12-04 19:51:18
It has probably been covered before, but I couldn’t google anything. What is the best approach for making an iPhone-style pop-up selection menu like attached picture? I've tried with a Dialog , but I haven't found an elegant way to add the Commands so they appear nicely and both trigger the action and close the dialog at the same time. And showing a Cancel entry separately is not supported by a ComponentGroup . See this sample: Form hi = new Form("Pop"); Button pop = new Button("Pop"); pop.addActionListener(e -> { Dialog dlg = new Dialog(); // makes the dialog transparent dlg.setDialogUIID(

Codename one gui builder does not work

我与影子孤独终老i 提交于 2019-12-04 19:48:18
I am trying to use code name one new GUI designer tool. Version - Codename one GUI builder 3.7.3 Eclipse - Used Oxygen and Mars both. Java - tried 7 and 8 both. My problem is i cannot add any containers or any component to the design area. Once i add one it suddenly disappear. ( Simply cannot create any UI) I cannot change the layout even.Always it shows Layered layout and cannot change. I have created a java 7 as well as java 8 code name projects but nothing works. I followed - https://www.codenameone.com/blog/using-the-new-gui-builder.html According to tutorial Figure 14. The features of the

Re textArea growByLimit issues in layerLayout

◇◆丶佛笑我妖孽 提交于 2019-12-04 19:18:51
I set the textArea setGrowByContent true and setGrowLimit to 2, but there is always only one row. So i twisted the code and increase the height of textArea by twice if the size of textArea is greater than Button size. Below is the codes. My issue is at the end of the question: Button homeButtonn = new Button(btnIcon){ @Override protected Dimension calcPreferredSize() { System.out.println("Button size: " + super.calcPreferredSize()); return super.calcPreferredSize(); } @Override public void setUIID(String id) { super.setUIID("homeButtonn"); } }; TextArea buttonTitle = new TextArea(title){

Codename one GPS provider and current location

十年热恋 提交于 2019-12-04 18:27:39
I am working on an iOS app with codename one . I want to get the current location and send it by SMS. I got this code from Java Android Studio, I don't know how to get the current location and also check if GPS is turned on. I tried below, but without success (I'm not sure how they start the GPS and get the location) LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE); boolean enabledGPS = service.isProviderEnabled(LocationManager.GPS_PROVIDER); if (!enabledGPS) { //alert GPS is off } LocationManager locationManager = (LocationManager) getSystemService(Context

Codenameone refresh list of images without reloading the page

隐身守侯 提交于 2019-12-04 18:02:47
I am Working on an app with requirement where we need to create a dynamic image gallery which refreshes after few minutes.When refresh happens three things should happen without reloading the page 1) Obsolete images should be removed 2) New Images should be added 3) Non Obsolete images should stay (not reload) 4) Images should be stacked next to each other as it will be mostly used on tablet I was looking at Boxlayout or FlowLayout and I can add the image but I am not sure how to delete it dynamically .I was able to set UUID for the image component but was not able to get component based on

Multiple Codename One CSS

泪湿孤枕 提交于 2019-12-04 17:51:59
Is it possible to use more CSSes in the same Codename One project? Use case 1: I want different styles in different parts of the app or I want to replace at all the current styling. Use case 2: I want that the current style is derived from several CSSes, like in a web page There is currently no support for that in the CSS implementation that's integrated into the plugin. The old implementation allowed that but we simplified some things so the conversion process will be fluid. Since multiple resource files and layered themes are supported internally by Codename One this should probably be easy