codenameone

Creating two Dimensional array with existing arrays in java

丶灬走出姿态 提交于 2020-01-14 09:06:14
问题 I have four arrays of strings and I would like to create a two dimensional array of 3 columns and dynamic rows. the arrays are like: String[] first_name; String[] last_name; String[] unit; String[] phone_number; Object[][] obj = new Object[first_name.length()][3] My problem is how do I achieve something like this: obj = {first_name[index] + " " + last_name[index], unit[index], phone_number[index]} Please help out!!! 回答1: I am assuming that by dynamic rows you mean that it depends on the

com.codename1.l10n.ParseException: Invalid timezone value in codenameone

与世无争的帅哥 提交于 2020-01-14 06:06:12
问题 I'm doing a sample in CN1 and in this sample i tried to convert the date from one pattern to another. here is method what i'm using : private String convertDateFormat(String fromDate) { DateFormat df=new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy"); Date d= null; try { d = df.parse(fromDate); } catch (ParseException e) { e.printStackTrace(); } df=new SimpleDateFormat("yyyyMMdd"); System.out.println(df.format(d)); return df.format(d); } calling the method String convertedDate =

com.codename1.l10n.ParseException: Invalid timezone value in codenameone

↘锁芯ラ 提交于 2020-01-14 06:06:06
问题 I'm doing a sample in CN1 and in this sample i tried to convert the date from one pattern to another. here is method what i'm using : private String convertDateFormat(String fromDate) { DateFormat df=new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy"); Date d= null; try { d = df.parse(fromDate); } catch (ParseException e) { e.printStackTrace(); } df=new SimpleDateFormat("yyyyMMdd"); System.out.println(df.format(d)); return df.format(d); } calling the method String convertedDate =

Source event strange latitude & longitude

纵饮孤独 提交于 2020-01-14 05:34:05
问题 My name is Cyrille and i'm working on a map app on codename one. The goal is to make an app that can search around the user for companies (with a search bar) and add companies they want to a list. Then the list appear in the main window and clicking on them show it on the map. I've got a problem with the event part on codename one. Here's a part of my code : PointLayer point = new PointLayer(new Coord(lat.doubleValue(), lng.doubleValue()), companyName, null); pl.addPoint(point); pl

Codename One landscape oriented Form in a portrait locked app

僤鯓⒐⒋嵵緔 提交于 2020-01-14 04:53:08
问题 I have a Codename One app which orientation is locked to portrait. That app is build to Android and iOS. It's a social and the portrait orientation is fine, except for video and images when they are landscape oriented. To see a full screen image in a landscape orientation, I workarounded the problem rotating the image before showing it. However I suppose that the same workaround is not applicable to play a video. How can I programmatically change the orientation of a Form to landscape when

Call Log.p(…) in native iOS code (Codename One)

折月煮酒 提交于 2020-01-14 04:37:09
问题 This question is relevant only for Codename One native interfaces. In Codename One, native code, iOS, I'm trying to do: com_codename1_io_Log_p___java_lang_String(CN1_THREAD_GET_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [goCoderLicensingError localizedDescription])); but I get: Implicit declaration of function 'com_codename1_io_Log_p___java_lang_String' is invalid in C99 What's wrong? Thank you 回答1: You need to include the header at the top. Specifically: #include "com

How to make an immediate reading location using GPS

雨燕双飞 提交于 2020-01-14 04:17:50
问题 I wrote a "Codenameone App" that needs to make Location's measures in some situations and it needs to read immediately (at time). To accomplish this goal, I'm using method "getLocationSync(long timeout=10000)" from Display object. The code is something like that: Location loc = LocationManager .getLocationManager() .getCurrentLocationSync(10000); The JavaDoc of this method says it executes a measure at moment and advises: "Notice that his method will block until a result is returned so you

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

梦想与她 提交于 2020-01-14 04:16:08
问题 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,

Codename One - ToastBar when “No connectivity detected”

ぃ、小莉子 提交于 2020-01-14 03:07:27
问题 What is a correct approach to deal with Internet connection unavailability (that is common on mobile devices)? Maybe it's a big question (or maybe not), however I didn't find any Codename One tutorial / article / video or API to deal with an unstable Internet connection (that is the normality on mobile) without errors or unexpected behaviors. I've found an app (Protonmail) that has a functionality that I would like to replicate in my apps. Please look at the following two screenshot: the

Codename One - Popup like Form Transition

眉间皱痕 提交于 2020-01-14 02:54:48
问题 as per the material guidelines on transitions, I want to establish a certain look and feel on app screens to convey a hierarchy for these. Meaning, everything that transitions left to right is on same level or importance. Smaller forms or brief user inputs will transition in and out as simple popups, not horizontally but vertically. Expected behaviour: The slide form uses the default transition. Show() will slide the source to the left and the destination slides in from the right. showback()