codenameone

Is there a way to save a Graphics object in Codename One without without taking a screenshot?

情到浓时终转凉″ 提交于 2019-12-23 03:44:06
问题 The question is in the title. For example how can I save g in a file in the following snippet ? public void paints(Graphics g, Image background, Image watermark, int width, int height) { g.drawImage(background, 0, 0); g.drawImage(watermark, 0, 0); g.setColor(0xFF0000); // Upper left corner g.fillRect(0, 0, 10, 10); // Lower right corner g.setColor(0x00FF00); g.fillRect(width - 10, height - 10, 10, 10); g.setColor(0xFF0000); Font f = Font.createTrueTypeFont("Geometos", "Geometos.ttf").derive

Buttons in Codename One form inactive on Android actual device but work under simulator

感情迁移 提交于 2019-12-23 03:35:08
问题 In my Codename One app I have 2 Forms A & B. A Form includes a MapContainer updated every 10 s and a floating button. If the user clicks on the floating button, they can take a picture and then a Dialog is shown and if they choose "OK" the B Form is shown : new B_Form(theme).show(); // (where theme is the Resources used in A Form). This B Form includes buttons to take some action (ie record audio, play the recorded audio, go to Form A). The buttons work in the simulator (although recording is

Invoke different methods if a Codename One Button receives a short tap or a long tap

旧街凉风 提交于 2019-12-23 03:07:26
问题 I need to implement a Codename One Button enough "smart" to invoke different methods if it's tapped for a short time or for a long time. How can I achieve this requirement? 回答1: Try something like this: Button b = new Button() { private long pressTime; public void pressed() { pressTime = System.currentTimeMillis(); } public void released(int x, int y) { if(System.currentTimeMillis() - pressTime > LONG_TAP_TIME) { longTap(); } else { shortTap(); } } }; 来源: https://stackoverflow.com/questions

Native Back on Codenameone after using Toolbar class

▼魔方 西西 提交于 2019-12-23 02:55:10
问题 When I use the Toolbar class to customize my Toolbar for added functionality the native back command disappears, is there a way of getting it back? 回答1: What do you mean disappear? This is how i use Toolbar API: Toolbar t = new Toolbar(); myForm.setToolbar(t); t.setTitle("My title"); Command back = new Command("back") { @Override public void actionPerformed(ActionEvent evt) { myForm.showBack(); } }; myForm.setBackCommand(back); t.addCommandToLeftBar(back); This will take care of both Android

Codename one retrieving location at regular time intervals

北城以北 提交于 2019-12-23 02:49:09
问题 I am trying to get location coordinates using code name one using the following code loc = LocationManager.getLocationManager().getCurrentLocation(); I am invoking the above method to run at regular intervals by calling it inside a UITimer . The problem is I am not able to get the accurate location using the above code. Even though this method is called for every 10 seconds I see change in coordinates only at 4-5 minutes interval. I am testing by carrying the device in vehicle which is moving

Missing App Store icon codename one build

自作多情 提交于 2019-12-23 02:48:20
问题 I have created an app using codename one. It uploads to the google store for testing fine but when I try to upload it for TestFlight using the App Loader I get an error: "Missing App Store Icon. iOS Apps must include a 1024x1024px App Store Icon in PNG format. Without providing the icon in the Asset Catalog or via iTunes Connect, apps cannot be submitted for App Review or Beta App Review. Refer to https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/app-icon/ for more

Adding firebase to Codename One

折月煮酒 提交于 2019-12-23 02:47:11
问题 I am developing my app using the Codename One framework and using Firebase to store my data in the cloud. In order to use all Firebase potential I would like to add it to my app, but since I am not using Android Studio nor Xcode, I don't know how I can do this. ¿do you know if it is even possible to add Firebase to Codename One? 回答1: It is possible since the codapps.io mooc did just that using the REST API for firebase. Unfortunately I can't seem to find any of their sources online and the

Notification icon is white on the notification tray

微笑、不失礼 提交于 2019-12-23 02:41:12
问题 My app icon on the notification tray became white on android 5. I have seen this Notification bar icon turns white in Android 5 Lollipop , but how can I change it on my codenameone app. 回答1: It is possible to place a 24x24 icon named "ic_stat_notify.png" under the src/ folder of the app. The icon can be white with transparency areas. The build server picks up this image and uses it as the notification icon if found on the project. 来源: https://stackoverflow.com/questions/34995371/notification

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

你离开我真会死。 提交于 2019-12-23 02:41:09
问题 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

How to test an Android native code snippet with Codename One?

只谈情不闲聊 提交于 2019-12-23 02:32:59
问题 First off I am used to programming with Java that's why I am using Codename One to develop mobile applications. However sometimes I see some code in Android "format" that I am interested on testing. I know how to set up basic native interface thanks to Codename one tutorial. For example, I would like to test this snippet about real time sound processing. However it involves initializing some variable in the Android onCreate() method with data that is available in this method such as am =