codenameone

Codename One: User interface layout on simulator and a real Android device are complete different

依然范特西╮ 提交于 2019-12-07 15:05:33
Well, it is the first time I tested my app on a real Android device. The user interface layout is shockingly different from the simulator. Please see images: The code are the same and nothing had been modified. Android version is 5.1.1. The code to display the screen is: private final void show() { loginSignupForm = new Form(null, new BorderLayout()); Tabs loginSignupTabs = new Tabs(); Image splashScreenImage = theme.getImage("Starlent_logo25x25.png"); ((Label) loginSignupForm.getToolbar().getTitleComponent()).setIcon(splashScreenImage); Style loginSignupStyle = UIManager.getInstance()

How to add `apply plugin` to build.gradle in Codename One Android project in order to add native library?

烂漫一生 提交于 2019-12-07 13:26:05
问题 I looked through the Advanced Topics on Codename One's website but haven't found anything on how to implement instructions for native Android libraries that require adding apply plugin:[plugin name here] to the application's top-level build.gradle file. Is there a way to do this? 回答1: There is no current way of adding a new plugin entry, I've added a new build hint android.gradlePlugin which should be available in the next server update (Friday 29th of September 2017). You should be able to

Textscreen in Codename One, how to read text file?

早过忘川 提交于 2019-12-07 12:21:04
问题 I want to add a help screen to my Codename One App. As the text is longer as other strings, I would like put it in a separate file and add it to the app-package. How do I do this? Where do I put the text file, and how can I easily read it in one go into a string? (I already know how to put the string into a text area inside a form) 回答1: In the Codename One Designer go to the data section and add a file. You can just add the text there and fetch it using myResFile.getData("name"); . You can

parse4cn1 has some issue when working with Node JS and parse-server open source

旧城冷巷雨未停 提交于 2019-12-07 06:37:31
The parse4cn1 library works well with parse.com but it has some issues when working with Node 4.3.2 and parse-server open source . For example, when calling the ParseUser.signup() function, the "Invalid key name" exception is always happened. I tried to debug and figure out that the ParseCommand object should add the ParseConstants.CONTENT_TYPE_JSON to its header in order to make it can work. I don't why because it still works without doing this with parse.com . Another issue is the ParseQuery.find() is always failed when using the ParseQuery.whereContainedIn() . The server exception is

How can I use twitter for sign in to my Codename one application

天涯浪子 提交于 2019-12-07 03:09:27
I am trying to sign in with twitter in my Codename one application, but when I am clicking on login button it will redirect to twitter, but not asking for credentials, It just throws a following error: Whoa there! There is no request token for this page. That's the special key we need from applications asking to use your Twitter account. Please go back to the site or application that sent you here and try again; it was probably just a mistake. below is my code: twitter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { Oauth2 Tauth = new Oauth2(

How to integrate Interswitch Payment SDK for Android in codename one

不打扰是莪最后的温柔 提交于 2019-12-07 02:14:24
Pls , I want to integrate payment gateway using Interswitch Payment SDK for Android in codename one. I have the complete guide through this place I dont know how to go about this in codename one as the tutorial focused on android studio. PlS I really need this to work in codename one. Pls I need a guide about this to make it work in codename one. Thanks You'll need to use a native interface. See the link below, but also search on the CodenameOne website, as I recall there being a three-part series as well (it's a bit older now). Also, you might look at the Braintree CN1Lib as a similar example

CodeNameOne Dynamically created Form, how to “Back”

让人想犯罪 __ 提交于 2019-12-07 01:46:34
问题 In an actionListener for a button we would like to create a Form on the fly. Eg Something like Button b = new Button("Clickme"); b.setActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { Form f = new Form(); Container c = new Container(); ... f.addComponent(c); f.show(); } }); Which works fine..... but "back" button will not work Does anyone know the correct way of implementing a dynamic form in an actionListener, or jumping to a predefined form through and

CodenameOne plan for the cloud storage API

左心房为你撑大大i 提交于 2019-12-07 01:38:31
Since CodenameOne doesn't support "the cloud storage API" any more and the parse.com is going to retire soon as well. Does CodenameOne has any plan to release a new Cloud Storage API or provide suggestions/guidelines to help developers to deal with the parse4cn1 library code, cloud code, database structure and data in parse.com? That is something you will have to figure out yourself as parse4cn1 was initially contributed by a community member and wasn't developed by Codenameone team. You can use a simple webservices created in php, python or java, hosted along your content with any ISP. You

How to locate environment path in codename one

倖福魔咒の 提交于 2019-12-07 00:53:32
For the following commands to work, make sure you have "ant", "mvn", and "git" in your environment PATH. pls I need to add the following to the environment part. $ git clone https://github.com/shannah/cn1-iap-demo-server $ cd cn1-iap-demo-server $ ant install-deps. I dont know how to locate environment path on my system. pls help That's Unix/Linux and unrelated to Codename One. One would setup an environment path as such: export PATH=/path/to/ant/binary:$PATH 来源: https://stackoverflow.com/questions/41789807/how-to-locate-environment-path-in-codename-one

Background music (MediaManager.createBackgroundMedia) causes crashes at app closing/opening

余生长醉 提交于 2019-12-07 00:48:29
I have an issue with background music playback in my app (it's a game), for some reason app crashes if you remove app from Android's recent apps list, switching to another app works fine, in other words, if I put app in background and then resume, it works, music stops and resumes (please see the code below), but if I kill the app then it crashes As far as I know this only happens on Android 6, I have tested on LG Nexus 5 and Samsung Galaxy S7, sometimes app doesn't crash when you kill it, but does crash when you start it after This doesn't happen on Android 8 init() String fileName =