codenameone

How to check if an app has already been purchased - CodenameOne

廉价感情. 提交于 2019-12-02 04:59:33
My application can buy an in-app product which I have configured on the google developer account. The product is a buy-once product. I would like to know how to check if this item has already been bought (in codenameone) and handle it based on result of query. Here is a code extract: if(p.isManagedPaymentSupported()) { if(p.wasPurchased(id)){ boolUpdate = true; Form f = (Form)createContainer(resPath,"Search"); beforeSearch(f); f.show(); }else{ Display.getInstance().callSerially(new Runnable() { public void run() { Boolean confirmAction = Dialog.show("Buy Product?","","Yes","No"); if

Multi Line Button in codename one

匆匆过客 提交于 2019-12-02 03:57:28
I have to display a text line as a button. The text of line is more then limit of line so when i display it in button it scroll the text rather then display multi line button. Please help to make it multi line. You can use MultiButton but you will have to do linebreaks yourself. Alternatively you can use a TextArea which supports multi line and if you don't need the pressed state you can just set it to editable false and use setUIID("Button") to make it look like a button. If you need something more elaborate you can use the lead component approach to build a button from a text area, to

CodeNameOne Google Maps

孤街醉人 提交于 2019-12-01 14:02:22
I am getting an error when I run a google maps app on an android for codename one. When I run it on the emulator I am getting no error. When I run it on a phone I get. an internal application error occurred java.lang RuntimeException: waited too long for browser bridge I think the problem is that I need to add build hints. I can find where to add them but I am not sure what format they should be in. I am also not sure what to add. I think I found a post that said I needed to add android.xapplication= android:value="YOUR KEY"/> android.xpermissions= But I am not sure what format that looks like

CodenameOne: VKB changes the screen

守給你的承諾、 提交于 2019-12-01 13:28:34
I have a an app developed on CodenameOne platform where I have textfields for manuel input. Each time when the VKB shows on android, the contents of the screen are pushed to bottom and especially the textfield becomes so thin that no characters can be seen. How can I prevent this? On android when the VKB is launched the Form gets a sizeChanged event, to prevent this behavior you can declare the textfields parent container as a scrollable Y container BoxLayout Y 来源: https://stackoverflow.com/questions/34577064/codenameone-vkb-changes-the-screen

CodeNameOne Google Maps

▼魔方 西西 提交于 2019-12-01 13:12:26
问题 I am getting an error when I run a google maps app on an android for codename one. When I run it on the emulator I am getting no error. When I run it on a phone I get. an internal application error occurred java.lang RuntimeException: waited too long for browser bridge I think the problem is that I need to add build hints. I can find where to add them but I am not sure what format they should be in. I am also not sure what to add. I think I found a post that said I needed to add android

Reading the crash log

时光毁灭记忆、已成空白 提交于 2019-12-01 12:59:43
I see ArrayIndexOutOfBounds Exception thrown but there are three different methods in the following lines in the code. How would I read the log to find out which of the following lines the error being thrown at. Please advise. This is an exception from writing to an encrypted storage. It's thrown by the cypher code. It's unclear why this failed or due to what action but it might be related to logging. 来源: https://stackoverflow.com/questions/52900649/reading-the-crash-log

Facebook Login Graph API returns wrong profile picture URL

半腔热情 提交于 2019-12-01 12:58:47
I'm using Facebook graph API by calling https://graph.facebook.com/v2.10/me?access_token=xxxxxxxxxxxxxxxxxx&fields=id,email,name,first_name,last_name,gender,age_range,picture.width(512).height(512),locale,link,timezone,updated_time which returns the json response I was expecting. Something like this: { "id": "1234567890987654321", "email": "xxxxxx\u0040example.com", "name": "xxxx xxxx", "first_name": "xxxx", "last_name": "xxxx", "gender": "xxxxx", "age_range": { "min": 21 }, "picture": { "data": { "height": 720, "is_silhouette": false, "url": "https://scontent.fna.fbcdn.net/v/t1.0-1/p720x720

Codename One - Modify a font size in a theme like in an hashtable

帅比萌擦擦* 提交于 2019-12-01 12:47:45
In the previous question Codename One - Method to enlarge or reduce all the fonts in all the styles I replied with a method that iterates all the values of a theme and, if a given value is an istance of Font, it changes its font size of a given percentage. The problem is that it doesn't work as expected, because some fonts are changed and others are not. For example, if I have the following font size of a Label (3.1mm) in my theme.xml, that Label font size it's not changed: <font key="Label.font" type="ttf" face="0" style="0" size="0" name="native:MainThin" family="native:MainThin"

LittleMonkey QRScanner library build issue

◇◆丶佛笑我妖孽 提交于 2019-12-01 12:36:02
I've used littleMonkey QRScanner library but it works in simulator(shows scanner not supported dialog box). But when I build the project it gives build error. PS: I've deleted all build hints and refresh lib again but still same problem. I've kept cn1-codescan.cn1lib and QRScanner.cn1lib as suggested in https://github.com/littlemonkeyltd/QRScanner My code: import org.littlemonkey.qrscanner.QRScanner; import com.codename1.ext.codescan.ScanResult; QRScanner.scanQRCode(new ScanResult() { public void scanCompleted(String contents, String formatName, byte[] rawBytes) { Dialog.show("Completed",

Reading the crash log

孤者浪人 提交于 2019-12-01 12:03:21
问题 I see ArrayIndexOutOfBounds Exception thrown but there are three different methods in the following lines in the code. How would I read the log to find out which of the following lines the error being thrown at. Please advise. 回答1: This is an exception from writing to an encrypted storage. It's thrown by the cypher code. It's unclear why this failed or due to what action but it might be related to logging. 来源: https://stackoverflow.com/questions/52900649/reading-the-crash-log