codenameone

How to achieve Floating Action Button in Codenameone?

假装没事ソ 提交于 2019-12-04 07:31:37
Floating Action button in android is good option. I want this in my codenameone application. I have tried it by using LayeredLayout, by having two layouts. I'm unable to achieve it perfectly. The button is keep moving along with the scroll. how to fix the button to the right bottom of the screen without affecting when the background layer is scrolling. Here is how i tried. Form myForm = new Form(); myForm.setLayout(new LayeredLayout()); myForm.setTitle("Floating Action Button"); SpanLabel lbl = new SpanLabel("some long text"); Container conBottom = new Container(); conBottom.setLayout(new

usesCleartextTraffic not permitted

旧时模样 提交于 2019-12-03 21:41:55
问题 I use to send build to codenameone for year, but suddenly all the newly android build apps is not working with http protocol, getting "java.io.IOException: Cleartext HTTP traffic to domainname.com not permitted." I search through google but not finding any solutions about android for codenameone. I understand apple had force this to https, but not android. Can somebody help here? Try to play around the codenameone setting page for this project to add a build hint android.xapplication=

SunCertPathBuilderException: unable to find valid certification path to requested target in CN1 app

故事扮演 提交于 2019-12-03 09:10:44
Please can you help. I have a Codenameone app that issues a GET request to a cloud Tomcat 8 server, and expects back some response JSON. Importantly this is a HTTPS call. When i run the request in Postman it works fine: https://www.mydomain.co.uk:8443/MyProject/v1/generate_token The same URL through my browser works and shows as 'Secure' and i can see my certificate details. I have bought a certificate for my SSL/TLS configuration, and seems to function fine in the logs on startup. In the simulator i get back the following error at the point of reading the response back from the URL call -

In Codename One, why can I not get FileInputStream to import or compile?

匆匆过客 提交于 2019-12-02 15:54:28
问题 Here are my imports: import com.codename1.ui.*; import com.codename1.ui.util.*; import com.codename1.ui.plaf.*; import com.codename1.ui.events.*; import com.codename1.io.*; import com.codename1.ui.layouts.*; import java.io.*; I cannot get this code to compile: InputStream in = new FileInputStream("users.csv"); Here is the error: C:\Users\Isaac\Documents\NetBeansProjects\CodenameOne_TESTING\src\com\fakecompany\testapp\MyApplication.java:119: error: cannot find symbol InputStream in = new

Obtain OAuth2 Access Token for Dropbox Core API with Codenameone's Oauth2 Class

我与影子孤独终老i 提交于 2019-12-02 14:39:14
问题 I'm trying to use codenameone's Oauth2 Class to obtain an access token for Dropbox's Core API. The code I'm using is as follows: Oauth2 auth = new Oauth2("https://www.dropbox.com/1/oauth2/authorize", "<APP KEY>", "https://www.google.com", ""); Oauth2.setBackToParent(true); auth.showAuthentication(new ActionListener(){ public void actionPerformed(ActionEvent evt) { //get authentication token System.out.println(evt.getSource()); } }); When I run my app in the simulator, I'm presented with a web

Multi Line Button in codename one

两盒软妹~` 提交于 2019-12-02 13:03:15
问题 I have to display a text line as a button. The text of line is more then limit of line so when i display it in button it scroll the text rather then display multi line button. Please help to make it multi line. 回答1: You can use MultiButton but you will have to do linebreaks yourself. Alternatively you can use a TextArea which supports multi line and if you don't need the pressed state you can just set it to editable false and use setUIID("Button") to make it look like a button. If you need

Obtain OAuth2 Access Token for Dropbox Core API with Codenameone's Oauth2 Class

人走茶凉 提交于 2019-12-02 10:19:54
I'm trying to use codenameone's Oauth2 Class to obtain an access token for Dropbox's Core API. The code I'm using is as follows: Oauth2 auth = new Oauth2("https://www.dropbox.com/1/oauth2/authorize", "<APP KEY>", "https://www.google.com", ""); Oauth2.setBackToParent(true); auth.showAuthentication(new ActionListener(){ public void actionPerformed(ActionEvent evt) { //get authentication token System.out.println(evt.getSource()); } }); When I run my app in the simulator, I'm presented with a web component that contains the log-in page for the OAuth2 authentication (like it's supposed to) but when

CodenameOne stopped working after build

白昼怎懂夜的黑 提交于 2019-12-02 09:29:18
I have an odd issue with codenameone, and I'm not even sure what went wrong. I've tried to "send windows phone build", and don't think I have changed anything else since then. However, after I did so the simulator wouldn't launch and kept saying my imports were wrong. They weren't, the suggested solution was importing once that were already in. The errors I get Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect

How to add dynamic data in the renderer created using UI builder?

北战南征 提交于 2019-12-02 07:07:58
问题 How to add dynamic data in the renderer created using UI builder? create a render from ui builder and dynamic data to populate list. protected boolean initListModelList(List cmp) { cmp.setModel(new com.codename1.ui.list.DefaultListModel(new String[] {"Firstname", "LastName", "Email"})); return true; } 回答1: The renderer doesn't contain the data only the logic for presenting the data. The model is the one that contains the data. To create a renderer check out this: http://www.codenameone.com

Error using split method in Codenameone

蹲街弑〆低调 提交于 2019-12-02 06:47:25
问题 I have created a new Codenameone project. It contains the following code: String values = "one, two, tree"; String[] v = values.split(","); When I build the project, I got this error: location: variable definition of type String error: cannot find symbol String[] v = values.split(","); symbol: method split(String) However, if I take the sample project "MapsDemo" and use the split method, everything is ok. What can be the problem? Thanks. 回答1: Codename One supports a subset of Java 5 and