Using Maps in Codename One - codenameone

Can anyone assist me in adding a Map to a Form in Codename One? I've been reading and searching, and can't find an "updated" demo/tutorial on using the library effectively.
IDE - IntelliJ
Build Tool - Maven

The old code works mostly the same as it did. The github project instructions are up to date and should work as expected. Just add the dependency and get the API keys from Google.
Then all you need to do is create a BorderLayout Form and place the map within it. E.g.:
Form mapForm = new Form(new BorderLayout());
mapForm.add(CENTER, mapContainerInstance));
mapForm.show();

Related

v2 to v3 Transition for Form Recognizer

Because FR v3.0 is still Preview mode, so I went v2.1 Quickstarts, "Analyze using a Prebuilt model", Navigate to the Form Recognizer Sample Tool.
Using Form Type = "Invoice" to test many size and text including handwriting, very happy with the results, especially returned JSON file structure:
...
"analyzeResult":
{
...
readResults:[...],
pageResults:[...]
...
}
For large/complex image/doc, use pageResults.tables[0].cells based on rowIndex and columnIndex, I can easily piece each row text restoring the whole doc. For small/simple image/doc or when pageResults.tables.length==0, use readResults.lines achieve the same OCR outcome, like one-size-fits-all, perfect!
Next is my own hands-on for the same images, Samples, JavaScript. Because I've been using Invoice only, so I picked recognizeInvoice.js, great sample, easy and simple to follow. Even it's v3 and missing readResults and pageResutls, I'm still able to use invoice.pages[0].tables[0].cells achieve the same result for large/complex image/doc. For small/simple image found 2 issues:
invoice.pages[0].tables.length = 0, so no text values.
only text value is NRT LLC. of invoice.fields.VendorName.value, all other printed text and handwriting returned by v2.1 are gone!
I believe there must be some reasons at MS side for the above changes, for us it means v3 is not backward compatible. And more importantly we wouldn't be able to know if the image fits a model and/or will return something before submitting, even we provide a list of choices of models users may frustrate by extra manual work. At the moment all we can do is switching back to Google. So,
where is the v2.x sample code and when will MS discontinue v2.x?
how does v2.x transit to v3?
Below is my navigation route. Thank you and really appreciate the great work!
It is a bit confusing, but the versions of the #azure/ai-form-recognizer package on NPM are one major version ahead of the Form Recognizer API versions. The preview API version "2021-09-30-preview" (REST API "v3") can be used with Form Recognizer SDK version 4.0.0-beta.2. REST API version v2.1 (GA) is used with SDK version 3.2.0. On the README for #azure/ai-form-recognizer 3.2.0, it explains this:
Note: This package targets Azure Form Recognizer service API version 2.x.
I'm guessing based on what you've said that you are using the latest stable version 3.2.0 of the SDK. When extracting data using a prebuilt or custom model in this version, tables are attached to pages, and pages are attached to Forms, so you can access a table by looking through the forms:
const poller = await client.beginRecognizeInvoices(inputs);
const invoices = await poller.pollUntilDone();
const table = invoices[0].pages[0].tables[0];
If a table appears on a page that isn't associated with any form (no form appears on that page), it can't be accessed using this method. That feature is present in the new beta SDK for the new preview API, but in the current SDK to get all pages (regardless of whether or not they contain a form), you could consider using the beginRecognizeContent method.

IPFS for collaborative text editing

I am new to ReactJS and IPFS, trying to create webpages with textarea where, when I type in textarea of webpage 1 it should reflect on the other and vice versa. Also, I need to do this with ipfs. Any help in understanding how to proceed on this. I tried installing yjs, http-server and ipfs. used textarea binding, but couldn't able to replicate. Help me with steps on how I can achieve this.
You actually have access to some good examples on how to do this, see:
Decentralized Real-Time Collaborative Documents https://blog.ipfs.io/30-js-ipfs-crdts.md
The video tutorial of the above post https://www.youtube.com/watch?v=-kdx8rJd8rQ
Here is a fully built app that uses the tech above https://peerpad.net

Using intermediate appPage xpages mobile

I have a simple issue, but I don´t how to solve the problem.
Using XPages Mobile controls, I have a document with some actions, and one of them is "Send to Signature".
The workflow is: select the signer of document (from names) and send to signature.
I need to show for the current user, one field to select the signer (I already have a field with typeahead funcion to select him).
I would like to use an intermediate appPage for this, but when I´m in the new appPage, the currentDocument is gone.
How can I use the same document (opening from a dataView) for solve this problem?
Can I navigate between appPages (inside SinglePageApp) using the currentDocument??
Thanks in advance
It might be worth looking at Mobile Value Picker on OpenNTF. The mobile prefix may need setting in XSP Properties to "Mobile_" (or it could be that I messed around with the development version after the last upload). But it gives code to have a button / link to go to a subsequent appPage to select values from a list. It starts from a DataView, to a document, to the selection page.
The project has not changed for a couple of years, but I've just tested it in Chrome setting user agent to Android and it still seems to work fine on 9.0.1 FP2.

Reuse model and store from ExtJS in Sencha Touch

I already have an ExtJS app but now I'm trying to build a mobile version with Sencha Touch. I want the browser to detect if it's running on mobile or not. That works fine, but what is my next step?
I have it redirected to a /mobile folder with a new index.html and that works fine until I try to reach classes from a parent class.
Is it possible to load the mobile app.js instead of the extjs app.js in the primary index.html?
I don't think you will be able to get away with having just one application. Ultimately you would need to create two different apps - one using ExtJs framework, another using Sencha Touch.
Whether you will be able to share some code is a good question. I think you should be able to share models, but that's about it. And even though - I would not recommend doing that either. Because even if show similar information from the same back end in both full and mobile version of your application, you might not need all of it in the mobile application. And if you don't need all of it - your models will be different.

some Ext JS 2.3.0 classes do not work on my pc

I am new to Ext JS. I am trying to develop with Ext JS 2.3.0. I downloaded the BoxSelect extension from http://www.sencha.com/forum/showthre...acebook-s-one) but it doesn't seem to work on my pc. I also realised that the Ext.app.SearchField class does not work on my pc as well. Does any one have any ideas as to why this is happening?
Thanks.
Try with download of the whole set up so that no need of different js file for different activity in ExtJs. http://www.sencha.com/products/extjs/download/ . Even I am new to all this and i am accessing through apache server. Also check with declaration of same files. Please also see version of JS.

Resources