codenameone

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

戏子无情 提交于 2019-12-07 00:45:38
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[] skus = {"ParametresGeneraux.getFullVersionSKU()"}; if (ParametresGeneraux.getPurchase()

Writing a string at a given position in a drawing in Codename one

佐手、 提交于 2019-12-07 00:42:26
I am building an app where at some point I use a form with a layeredLayout. In this form I already have 2 labels stacked on top of each other and I want to write a string in a specific area. The first image (the deepest one) is an image from the device camera and the second image on top of the first one is a png file with transparent background. Both of them have a larger resolution than the screen resolution that's why I am using the following code to display them : findPhotoBase3().getUnselectedStyle().setBackgroundType(Style.BACKGROUND_IMAGE_SCALED_FIT); findDecoration3().getUnselectedStyle

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

99封情书 提交于 2019-12-06 22:58:25
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! 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 that aren't loaded yet, then the javascript will result in an error. If you want to ensure that the page has

Android build fails in codenameone build sever

◇◆丶佛笑我妖孽 提交于 2019-12-06 21:47:31
My android build fails after build and this is the error log i get Total time: 1 mins 16.631 secs Stopped 0 compiler daemon(s). Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':dexRelease'.] from daemon DaemonInfo{pid=5907, address=[10331ba5-2501-41cc-aa13-52a0ba46bd51 port:41817, addresses:[/0:0:0:0:0:0:0:1%1, /127.0.0.1]], idle=false, context=DefaultDaemonContext[uid=2862cb6d-50e8-4321-a1fa-590435e89f0f,javaHome=/usr/java/jdk1.7.0_67,daemonRegistryDir=/home/ec2-user/.gradle/daemon,pid

Previous form does not completely disappears on Codename One

ε祈祈猫儿з 提交于 2019-12-06 21:31:27
My app written with Codename One involves showing a camera preview In a main form. I have used the native interface implementation to make it work on Android (iOS later). The app also includes in app purchase to upgrade to full version. That's why a form is shown regularly to suggest the user to upgrade. They can also choose to upgrade later which causes this upgrade to full version form to disappear and make the main form with the camera preview to appear. Yet on real devices sometimes the upgrade to full version form does not completely disappears and there are reminiscences of it on the

Codename one scrollbar coming back

爷,独闯天下 提交于 2019-12-06 21:04:30
Scrollbar coming back when I send new Android build. I was add this code to hide scrollbar and everything fine, I didn't change anything. UIManager.getInstance().setLookAndFeel(new DefaultLookAndFeel(UIManager.getInstance()) { @Override public void bind(Component cmp) { if (cmp instanceof Container) { cmp.setScrollVisible(false); } } }); I'm not sure why this fails but a better approach would be defining the theme constant scrollVisibleBool=false . 来源: https://stackoverflow.com/questions/45659299/codename-one-scrollbar-coming-back

Keep Codename One components in invalid positions after app stop/resume

。_饼干妹妹 提交于 2019-12-06 20:35:32
My question is about keeping components in invalid positions in the layered pane after app stop/resume. I have a nice animation that moves some components in the layered pane and I want that these components remains in their positions until an user interaction with them. I understood that when the app goes to the background, the stop() method is invoked: that method stores in the current variable the current Form reference. Then, when the app is resumed, the start() method is invoked, in particolar this code: if (current != null) { current.show(); return; } The problem of this approch is that

Scrolling down not working when dragging an element and simultaneously adding/removing components to the form

让人想犯罪 __ 提交于 2019-12-06 19:17:26
When I am dragging an element down, the form doesn't scroll down when the dragging reaches the bottom. The reason for this may be that I am manipulating the content of the form by adding an empty placeholder component under the dragged component, and then removing and adding the placeholder each time the dragged component moves over another component. I call revalidate each time the placeholder is removed/added. Strange thing is that the scrolling works fine when dragging upwards. Any suggestions for what could be the cause and how I may fix it? Thanks 来源: https://stackoverflow.com/questions

Codenameone plugin giving null pointer exception

天涯浪子 提交于 2019-12-06 17:09:22
问题 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

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

拜拜、爱过 提交于 2019-12-06 16:52:44
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. 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 verification code sent via an SMS. That's exactly what JAT (which was built with Codename One) does. 来源: https:/