codenameone

Is there a way to limit the duration of an audio capture in Codename One?

女生的网名这么多〃 提交于 2019-12-08 04:07:08
问题 In my Codename One app, I need to limit the duration of an audio capture to few seconds. I call Capture.captureAUdio() for that and there does not seem to be an equivalent to Capture.capturePhoto(w, h) that could bound the captured audio to a given duration. What I've done so far is measure the audio capture duration and if it is too long then ask the user to start again if they will. But I find it a bit cumbersome. Is there anything better that can be done ? Any hint appreciated, 回答1: No.

Codename One APK Manifest for Android TV: build hints

风格不统一 提交于 2019-12-08 04:07:03
问题 This question is releated to: Codename One APK Manifest for Android TV I found some documentation here: https://developer.android.com/training/tv/start/start In this documentation, it's written that If you do not include the CATEGORY_LEANBACK_LAUNCHER intent filter in your app, it is not visible to users running Google Play on TV devices. I tried to use the following two build hints (with include sources): android.xpermissions=<uses-feature android:name="android.software.leanback" android

Relayout of Text field that is being editted scrambles text in simulator

两盒软妹~` 提交于 2019-12-08 03:59:53
问题 I want the user to enter an artbitrary number of keywords (or keyphrases). To this end, I have a row of TextFields, one for each keyword. I add a new TextField to the row when all existing ones have text in them, so the user can enter another keyword. The addition of a new TextField happens when a character is added to the last empty TextField; i.e. that TextField is being editted when a new TextField is added. Furthermore, the existing TextFields will be moved and resized when adding a new

Codename One - Notify something to the user every five minutes

大兔子大兔子 提交于 2019-12-08 03:54:40
问题 I need to notify something to the user every five minutes, regardless the app is running in foreground or background and regardless the user is using the smartphone or not. My first attempt was to use "UITimer" + "Display.getInstance().vibrate(10000)", but the vibrate method doesn't do anything in my Android smartphone. My next attempt was to the LocalNotification. Maybe the LocalNotification API documentation is not correct, because using 10 as time (like in the API example) produces a

Codename One - tests.dat file needed when using build.unitTest=1

自古美人都是妖i 提交于 2019-12-08 03:49:22
问题 I created a test extending the AbstractTest class. The test works correctly in Netbeans: I right-click on the project name, then on "Test". Of course the Netbeans test in done in the Codename One Simulator. I want to repeat the test on several real devices, as I asked in "Codename One - Test Recorder: execute a test on a real device" So I added the build.unitTest=1 build hint and I checked that my build.xml contains: <target name="test-for-ios-device" depends="clean,copy-ios-override,copy

CodenameOne - Android app fails to start when building with android.buildToolsVersion=27

只谈情不闲聊 提交于 2019-12-08 03:49:07
问题 I'm using gcm and the app failed to start due to this error: AndroidRuntime: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/net.segoia.opengroups.mobile-1/base.apk:classes2.dex) This was caused by this line: InstanceID instanceID = InstanceID.getInstance(this); The problem is that when building for api level 27, support for

How to force a SpanLabel to break it's String

99封情书 提交于 2019-12-08 03:41:38
问题 I'm currently designing the sidemenu of a new app. The idea is to have an accordion with four containers inside which uses a TableLayout with two columns. The containers are filled with components grouping an icon (ScaleImageLabel) atop of a SpanLabel, the group being lead by a Button. In order to have an homogeneous sidemenu, I want that each component has the same width, so I've put all in a setSameWidth, BUT, here is my problem: Some components have a longer text than others, and if one of

Crash on iOS with Picker

橙三吉。 提交于 2019-12-08 03:34:55
问题 I have a problem with my application on iOS only (iPad 9.7" 11.3.1) when I launch a new Form with a Picker in it (created with GUI Builder). Thanks to a Mac I was able to see some logs : java.lang.NullPointerException at com_codename1_impl_ios_IOSImplementation.instanceofObjArray:7464 at com_codename1_io_Util.instanceofObjArray:470 at com_codename1_ui_spinner_Picker.setType:781 at fr_aaa_bbb_Saisie.initGuiBuilderComponents:462 at fr_aaa_bbb_Saisie._INIT__:71 at fr_aaa_bbb_Saisie._INIT__:67 at

How to detect a 'pinch out' in a list of containers?

独自空忆成欢 提交于 2019-12-08 03:33:07
问题 I want to be able to pinch two containers in a list of containers away from each other to insert a new empty container between them. Similar to how the iPhone app “Clear” inserts new tasks (see for example the very first picture on this page https://www.raywenderlich.com/22174/how-to-make-a-gesture-driven-to-do-list-app-part-33 - the small red container is inserted when the two sorounding containers are pinched away from each other). Any hints on how I can achieve this in Codename One? 回答1:

Codename one Native Map not showing

此生再无相见时 提交于 2019-12-08 03:29:27
I'm using the native map CN1Lib for my project. I followed the instructions from here and added the required build hints. In simulator the map looks fine but when I export it to android (debug on android studio), the map only shows as a gray rectangle with "Google" on the left bottom. I thought it was a problem about google api so I created a few new api keys at google console. All keys were not limited. Google Maps Android API was also enabled, but the problem persists. I've also checked that in the AndroidManifest.xml in the exported apk the correct api is contained. Below are the build