codenameone

Forcing permission in marshmallow devices codenameone

Deadly 提交于 2019-12-06 04:54:23
I have created a NativeTest.java 1.code: import com.codename1.system.NativeInterface; public interface NativeTest extends NativeInterface{ public void dispatchTakePictureIntent(); } generated the native interfaces inside native\android\pathToNativeiImpl NativeTestImpl.java code: public class NativeTestImpl { static final int REQUEST_IMAGE_CAPTURE = 1; public void dispatchTakePictureIntent() { if(!com.codename1.impl.android.AndroidNativeUtil.checkForPermission(Manifest.permission.READ_PHONE_STATE, "App requires camera permission for scanner")){ // you didn't get the permission, you might want

AES cbc padding encryption/decryption on cross platform (.net c# and codename one bouncy castle)

自古美人都是妖i 提交于 2019-12-06 04:17:15
Encryption/Decryption won't work in cross platform. I have used this link to encrypt/decrypt text using bouncy castle AES cipher within codename one. AES Encryption/Decryption with Bouncycastle Example in J2ME While from server side (.net) , i am using this link to implement same method. http://zenu.wordpress.com/2011/09/21/aes-128bit-cross-platform-java-and-c-encryption-compatibility/ now i am not getting any error but encrypted from codename one will not getting fully decrypted on server side and vice a versa. any one please help me out on this. Code from Codename one: import org

how can two sidemenus be used in codenameone?

六月ゝ 毕业季﹏ 提交于 2019-12-06 04:10:59
I want to add sidemenus at both left and right side.How can it be done in codenameone ? getToolbar().addCommandToSideMenu(new Command(" Menu 1 ")); I can left sidemenu by using above code and i want to add that on right also. The Toolbar class no longer supports the right side menu. This functionality has always been problematic and was deprecated a while back. We might re-introduce it with the new "on top" side menu rewrite but right now that functionality is too new. 来源: https://stackoverflow.com/questions/44259277/how-can-two-sidemenus-be-used-in-codenameone

Make the sidemenu slide OVER the form in Codename One

人走茶凉 提交于 2019-12-06 04:07:44
The current behavior of the sidemenu in Codename One is that the sidemenu pushes the current form aside as it comes out. I need to have the sidemenu slide over the form without displacing it instead. It appears that the only options are to modify the underlying code for the sidemenu or to utilize some other component in a way that would mimic sidemenu behavior. From a conversation I had with CN1 support, modifying the underlying code sounds problematic and I haven't been happy with the results thus far of layering other components on top of the form. Has anyone else been able to successfully

Textscreen in Codename One, how to read text file?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 02:50:43
I want to add a help screen to my Codename One App. As the text is longer as other strings, I would like put it in a separate file and add it to the app-package. How do I do this? Where do I put the text file, and how can I easily read it in one go into a string? (I already know how to put the string into a text area inside a form) In the Codename One Designer go to the data section and add a file. You can just add the text there and fetch it using myResFile.getData("name"); . You can also store the file within the src directory and get it using Display.getInstance().getResourceAsStream("

CodenameOne - change color of checkbox in theme

[亡魂溺海] 提交于 2019-12-06 01:39:07
I'm using the 'Blue Flat' theme in a cn1 project, and the checkboxes in a MultiButton component (I suppose following the Button text color) are completely white, making them invisible on a white background. I've tried changing their foreground color in the theme (in the GUI Builder theme tab), I tried replacing the theme files with checkboxes of a darker shade, but nothing seems to affect it. How can I make the MultiButton checkbox a different color? The blue theme customizes the checkbox image theme constant which you can remove at which case it should derive theme colors: https://www

How to add `apply plugin` to build.gradle in Codename One Android project in order to add native library?

一笑奈何 提交于 2019-12-05 23:24:06
I looked through the Advanced Topics on Codename One's website but haven't found anything on how to implement instructions for native Android libraries that require adding apply plugin:[plugin name here] to the application's top-level build.gradle file. Is there a way to do this? There is no current way of adding a new plugin entry, I've added a new build hint android.gradlePlugin which should be available in the next server update (Friday 29th of September 2017). You should be able to use it like this (untested): android.gradlePlugin=apply plugin: 'pluginA';apply plugin: 'pluginB'; 来源: https:

How do I add dependencies to the root-level build.gradle file in my Codename One Android app?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 21:14:52
I already added the android.gradleDep build hint with the proper "compile'....' " hint for the 3rd party library I want to integrate. (In this case, Firebase). In the root-level build.gradle file in a Codename One Android app, how can I: add a classpath dependency to the buildscript section? add a maven dependency in the allprojects section? EDIT: 3. Add a plugin, such as: apply plugin: 'com.google.gms.google-services' For a visual example: buildscript { dependencies { classpath 'com.google.gms:google-services:3.1.0' // google-services plugin } } allprojects { dependencies { maven { url "https

codename one remove back button on ios

↘锁芯ラ 提交于 2019-12-05 18:24:26
I removed the title of the form because I don't want it. when I did that, a back button on the iOS(On android back button does not show) started to show on the bottom of the form. I've tried to override showForm() in the StateMachine and invoke setTitle("") but the back button is still there. @Override public Form showForm(String resourceName, Command sourceCommand) { Form f = super.showForm(resourceName, sourceCommand); f.setTitle(""); return f; }; Is there a way to remove that back button? That's not the way. Override allowBackTo as: protected boolean allowBackTo(String formName) { return