codenameone

Manually trigger Pull to refresh on Container

故事扮演 提交于 2019-12-10 13:55:09
问题 If I want to manually trigger Pull to Refresh on Container in Codename One after the load of the form. Please advise if anyone have any idea. 回答1: It's easy, the trick is the use of the showListener . Suppose that this is the starting code (taken from the Codename One Developer Guide, section "Pull to refresh"): Form hi = new Form("Pull To Refresh", BoxLayout.y()); hi.getContentPane().addPullToRefresh(() -> { hi.add("Pulled at " + L10NManager.getInstance().formatDateTimeShort(new Date())); })

CodenameOne Error while trying to read theme property

拜拜、爱过 提交于 2019-12-10 12:27:21
问题 When I try to load just a simpel Codename1 Hello World tutorial app I get this error: java.io.IOException: Error while trying to read theme property: at com.codename1.ui.util.Resources.loadTheme(Resources.java:1475) at com.codename1.ui.util.Resources.openFileImpl(Resources.java:303) at com.codename1.ui.util.Resources.openFile(Resources.java:269) at com.codename1.ui.util.Resources.<init>(Resources.java:189) at com.codename1.ui.util.Resources.open(Resources.java:740) at com.codename1.ui.util

calling custom JavaScript function from codename one

给你一囗甜甜゛ 提交于 2019-12-10 12:24:57
问题 I recently came across the JSObject and JSFuntion, and it seemed really confusing. Can it be used to call custom JavaScript functions and return values back to my CN1 app? Or is it for some other function?. Thanks all 回答1: Check out the javadoc package overview for that: https://www.codenameone.com/javadoc/com/codename1/javascript/package-summary.html E.g. from that page: The following example shows an object with a simple add() method that just adds two numbers together: JSObject obj =

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

社会主义新天地 提交于 2019-12-10 11:46:01
问题 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

Reading the crash log

不问归期 提交于 2019-12-10 11:45:33
问题 I see ArrayIndexOutOfBounds Exception thrown but there are three different methods in the following lines in the code. How would I read the log to find out which of the following lines the error being thrown at. Please advise. 回答1: This is an exception from writing to an encrypted storage. It's thrown by the cypher code. It's unclear why this failed or due to what action but it might be related to logging. 来源: https://stackoverflow.com/questions/52900596/exception-being-thrown-for-arraycopy

Test In-App-Purchase in Codename One simulator results in Null Pointer Exception

风格不统一 提交于 2019-12-10 11:43:37
问题 Instead of creating a light and a full version of my app, I decided to go the freemium way and offer a button to upgrade from the light to the full version. The application is only available on the Google Play Store. So I created an in app purchase in the Play Store as described http://mobilecodetogo.blogspot.fr/2013/03/android-does-it-better-in-app-purchase.html. Here is the code that I implemented : if (buyFull) { if (ParametresGeneraux.getPurchase().isManagedPaymentSupported()) { String[]

Clarification on Codename One's BrowserComponent execute(String javaScript) method

爱⌒轻易说出口 提交于 2019-12-10 11:39:09
问题 There is the "execute(String javaScript)" method in the BrowserComponent class. Could you please explain how this work? When would the JavaScript be executed - after the page and any external .js files are fully loaded? If I pass a string which is to execute a method in an external .js file, would this work? Thanks! 回答1: BrowserComponent.execute(String) will execute the provide JS snippet in the current page of the browser at the time that you make the call. If your snippet references things

Codenameone:How to get the mobile number of current sim card in real device?

妖精的绣舞 提交于 2019-12-10 11:39:03
问题 How to get the mobile number of current sim card in real device and how to read meassage from mobile . I just want to read sim card number and messages of mobile. Can you please let me know how to resolve it. 回答1: Mobile devices don't provide that information for security/privacy reasons. You can access it in some low level Android API's but since this isn't portable we don't expose that. Notice that apps like whatsapp, uber, gettaxi etc. all ask you to type in your phone number then a

Will Parse4cn1 still work after Parse server retirement?

余生长醉 提交于 2019-12-10 11:31:31
问题 I've been looking for a way to send push notifications to Android, iOS and Windows phone devices. I've come across the Parse4cn1 library. This library uses Parse. However i saw on the Parse site that they will retire soon. I have the following questions regarding the Parse4cn1 library and the retirement of Parse. Does the Parse4cn1 library still work after Parse's retirement? Do i need to setup my own open source Parse server to support the push notifications and when i do this does it also

Alternative Methods in codenameone

[亡魂溺海] 提交于 2019-12-10 11:28:49
问题 I have been designing an application using CodeNameOne via Netbeans and have encountered some issues, notably the "cannot find symbol" compile-error. After further research, I discovered that it was due to CNO not supporting certain libraries/misc. I was wondering if there were alternate ways to use the following libraries/perform tasks: (Read from file) import java.io.File; symbol: class File location: package java.io (Throw FileNotFoundException) import java.io.FileNotFoundException; symbol