codenameone

Out Of Memory in Codename One

旧时模样 提交于 2019-12-13 18:17:04
问题 My app used the SidePanel menu as navigation and when I show new form or open sidebar panel, the app takes more and more memory. Possible, it depended on using some Image processing (to mask image to circle) in SideBar and a lot of using URLImage class for downloading images. But most likely due to the fact that I did not free memory of the previous form. How I can free this memory? Code of changing forms: public void showForm(FormBuilder form) { if ( current == null || ( ! form.getForm()

unable to build my app

蹲街弑〆低调 提交于 2019-12-13 05:44:46
问题 Hi World App is running in simulator but not generating the BUILD files. I am getting this error goBlank: testFail: setupJavac: jar: [echo] Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller [echo] code size and wider device support [copy] Copying 1 file to E:\rainforest\rfl1\rfl1-1\testcodenameone\build\tmp [javac] E:\rainforest\rfl1\rfl1-1\testcodenameone\build.xml:131: warning: 'includeantruntime' was not set, defaulting to

Prevent that the app get stopped or paused by the OS

我的未来我决定 提交于 2019-12-13 04:31:03
问题 I'm developing and Android application on CodenameOne that needs to send a web request every 5 minutes even when minimized. How can I achieve this behavior in order to prevent that the request get stopped or paused by the OS? 回答1: You cant do that from the activity, you'll need to create background service. http://developer.android.com/training/run-background-service/create-service.html 回答2: Use AlarmManager to set up your every-five-minute operation. Have it trigger a BroadcastReceiver ,

Is it possible to invoke other mobile app from a code name one app

匆匆过客 提交于 2019-12-13 01:25:36
问题 I want to invoke google maps app by passing it location details from a code nameone mobile app. Is it possible? 回答1: In Android here is the way to open any other app How to call one android application from another android application Now in codename one you can use native interface to make native call http://www.codenameone.com/blog/native-interface.html you can uses this CN1 native interface with iPhone as well but you have to write iOS code for that You can invoke a 3rd party app from

TextFields not updating/repainting correctly on codenameone

懵懂的女人 提交于 2019-12-12 19:28:41
问题 I have a problem with TextFields not updating correctly when they gain focus using the virtual keyboard in Codenameone apps on Android devices. I gave the TextField a value (value '0') and added multiples underneath each other. I then pressed on a TextField , where it gains focus, and I type something in. Once the value is entered, I press 'Next' on the virtual keyboard, and the value in the next TextField (the '0') gets bolded (there's 2 '0' values on top of one another). When I then press

Codename One - UITimer when the app is in backgroud or the smartphone is idle

限于喜欢 提交于 2019-12-12 09:08:51
问题 This question is related to a previous one: Codename One - Notify something to the user every five minutes I discovered that UITimer doesn't work when the app is in background or when the smartphone is idle. Consider the following code (tested on Android): public void start() { if (current != null) { current.show(); return; } Form hi = new Form("Five minutes alert", BoxLayout.y()); hi.add(new Label("Alert every five minutes...")); Button button = new Button("Go to background"); button

Using two WebBrowsers on codename one (layout management)

三世轮回 提交于 2019-12-12 05:19:41
问题 I want to display two webbrowsers on one screen, the first show an URL and the second show a custom banner. I tried with a table layout to display two rows, and set the weight on 80% for the first and 20% for the second. But when I run the app only the first shows up, and cover 100% of the height This is what I want: Is this possible? 回答1: Please check this codes it should solve protected void beforePage(Form f) { f.setScrollableY(false); TableLayout.Constraint c1 = new TableLayout.Constraint

Access and use in Codename One native Android classes

无人久伴 提交于 2019-12-12 01:54:19
问题 I know that Codename One and Android are completely different frameworks. But the question is, How can I access in Codename One classes from native Android? eg: I want to create a method called onCreat() that looks like this: public void onCreate(Bundle savedInstanceState){} In Android you have to import the package import android.os.Bundle; How can I integrate this package (for onCreat() ) and other packages from Android in codenamed One? What should I set in Code Name One that I can access

How to create dynamic radiobuttons in CodenameOne

独自空忆成欢 提交于 2019-12-11 19:07:56
问题 Using CodenameOne, I created an array of RadioButtons based on the count of records on a database table. Container searchDisplayContainer = findMyContainer(f); for(int i=0; i < records.length; i++) { RadioButton rdb = new RadioButton(); rdb.setName("rdb"+i); rdb.setText("rdb"+i); rdb.setGroup("locations"); searchDisplayContainer.addComponent(rdb); } With this code, a number of RadioButtons are displayed on the simulator screen. My problem is that after displaying the radiobuttons, I cannot

Optimizing the space in the client's storage with CodenameOne

一个人想着一个人 提交于 2019-12-11 17:26:14
问题 In Codenameone I have the following code: String url = "http://www.example.com/advertisement.png"; String key = "goose_id-"+System.currentTimeMillis(); Dimension dimension = new Dimension(200, 200); ImageDownloadService.createImageToStorage(url, label, key, dimension); // Please note that every image will be assigned to // a storage key that begins with "goose_id_" string In this way, every time I change the file advertisement.png in the server the user, in his device, will get a different