The title says it all. I am trying to make a calculator and of course, a calculator has a division symbol. The text of the button in the XML file can be changed to an obelus but pressing the button can't input the symbol in the Edittext. Instead, a diamond with a questionmark pops out instead. I am also having a problem with the multiplication symbol(not just the letter x but the right multiplication symbol)
Here is a code snippet:
if(Character.isDigit(temp.charAt(temp.length()-1))) {
editText.append("÷");
decf = 2;
ansf = 0;
btnDel.setText("DEL");
}
Got to be an encoding issue. Try "\u00F7"
Here's the docs:
http://www.fileformat.info/info/unicode/char/00f7/index.htm
Related
I am trying to use Odoo with the application Barcode & QR code Keyboard, from Nikola Antonov (just an example, I do not know if there are better options), in order to read barcodes for the pickings.
The first problem I had to face was I had to show the keyboard in this picking view
So I needed to create an input field in order to click in it and show the Android Keyboard, or in this case the Nikola Antonov keyboard. Then, I had to assign the function handler to this input text field:
this.$('#input_text_barcodes').on('keyup', self.getParent().barcode_scanner.handler);
The function is only working as expected if I use the normal Android Keyboard (AOSP) and only with numbers. The letters of the Android Keyboard or whatever character of the Nikola Antonov Keyboard are not working (only the backspace)
this.handler = function(e){
self.$('#aux_label').text('>> CODE: ' + e.which)
self.$('#aux_label').text('>> KEY CODE: ' + e.keyCode)
self.$('#aux_label').text('>> KEY: ' + e.key)
// [...]
I tried switching the languages of the keyboard as well, but with the same result
Should I change the keyup event?
Is there other way to catch the characters?
Finally I have asked to the developer of the application directly and he solved the problem quite fast. He made it work with numeric keys, that is enough for what I wanted to achieve.
Basically, i have a list of Nepali Unicode strings something like {"युनिकोड १ ","युनिकोड २","युनिकोड ३"}.
Now, Firstly, I have a text view in Xamarin (Android) and tried to set the text property using couple of methods:
UnicodeTextView.Text="युनिकोड १"; //direct method
var font = Typeface.CreateFromAsset(_activity.Assets, "kantiput.TTF");//kantiput.TTF Is a Nepali font.
UnicodeTextView.Typeface = font;
var font = Typeface.CreateFromAsset(_activity.Assets, "kantiput.TTF");
UnicodeTextView.SetTypeface(font, TypefaceStyle.BoldItalic);
and none of them worked.
When using the first option nothing was displayed, and on working with last two
and there were some BOX character visible.
For first case when i directly tried to set the value:
Before setting value:
After setting value:
Samething with the ListAdapter.
Can anyone suggest me how can we display unicode sentences in TextView, EditText, Toast ?
I want result something like this :
with TextView :
and here is the weird behavior :
and i tried all those code that are in comment too. Still didn't find any luck.
I am working in android.
In toast I checked like the following:
Toast.makeText (this, "\u0c05 \u0c06", Toast.LENGTH_SHORT).Show();
For first two letters of Telugu alphabet s. It worked.
If you have the font file you can obtain unicode codes for the various glyphs in the online software available at
https://opentype.js.org/index.html
Under page glyph inspector.
I tested your code, the first direct method UnicodeTextView.Text="युनिकोड १"; works fine by my side both with single TextView or TextView in ListView.
Or you may try this code:
if (Android.OS.Build.VERSION.SdkInt >= Android.OS.Build.VERSION_CODES.N)
{
UnicodeTextView.Text = Android.Text.Html.FromHtml("युनिकोड १", Android.Text.FromHtmlOptions.ModeLegacy).ToString();
}
else
{
UnicodeTextView.Text = Android.Text.Html.FromHtml("युनिकोड १").ToString();
}
I'm trying to display this Unicode character in a Toast message:
http://graphemica.com/%E2%AE%8C
It is embedded in a Xml file that contains all the strings of the Android application, like this
<string name="back_press">Click again ⮌ to exit</string>
The message shown from the Toast is the one in the image
toast message
Can you help me to solve this problem?
Thank you in advance.
You should use the Unicode character, in your case U+2B8C and replace U+ by 1x, but you should look for another icon because that one doesn't exist, search one you like in here.
For this example I've used the back arrow:
int unicode = 0x2B05;
String textIcon = new String(Character.toChars(unicode));
Toast.makeText(getApplicationContext(), "Your text here" + textIcon, Toast.LENGTH_LONG).show();
And that should view your icon.
i'm using Adobe Flash Air for IOS & Android problem now is the Arabic RTL i can't write arabic.
My
Input Text is Classic not " TLF Text "
The TLF problem is the keyboard not showing up in android..
Example
1) Did you try doing some research? I googled as3 "android" keyboard not showing.
What's wrong with solutions suggested on first page results of the above link?
2) Consider using Stage text and there's an introduction article about it.
3) Try something like below (untested) as a starting point. Hard to fix your code since none shown.
Also read this guide first. Might be useful.
var testInput : TextField = new TextField();
testInput.needsSoftKeyboard = true;
testInput.type = "input";
testInput.addEventListener(FocusEvent.FOCUS_IN, onFocusText);
stage.addChild(testInput);
function onFocusText( e:FocusEvent ):void
{
testInput.requestSoftKeyboard();
}
I have been using tesseract (tess-two to be more precise)to make an app in android to recognize certain non conventional symbols. The purpose is to identify the symbol and redirect to the description of said symbol.
The symbols can be recognized almost perfectly whether they are alone in the image or they are next to each other... except for two (the ones below).
symbols omitted from recognition
Both of these symbols are not recognized when alone, BUT THEY ARE CORRECTLY RECOGNIZED if they are next to any other symbol.
For example:
Not recognized
_
Correctly recognized
_ b
_ y _
Problem is that they are not mismatched with other symbols, but instead they are ignored completely. This occurs to me when calling:
TessBaseAPI baseApi;
...
String text = baseApi.getUTF8Text();
The returned string is always null. Like if it didn't even recognize the black regions to begin with.
Anyone knows how I could fix this?
UPDATE:
To make it more clear here is my full code when initializing tess.
TessBaseAPI baseApi = new TessBaseAPI();
mainBitmap = mainBitmap.copy(Bitmap.Config.ARGB_8888, true);
baseApi.setDebug(true);
baseApi.init(MainActivity.DATA_PATH, MainActivity.lang);
baseApi.setPageSegMode(TessBaseAPI.PageSegMode.PSM_SINGLE_CHAR);
baseApi.setVariable("tessedit_char_whitelist","abcdefghijklmnopqrst");
baseApi.setImage(mainBitmap);
mainBitmap.recycle();
mainBitmap = null;
// Iterate through the results.
ResultIterator iterator = baseApi.getResultIterator();
String lastUTF8Text;
float lastConfidence;
iterator.begin();
do {
lastUTF8Text = iterator.getUTF8Text(TessBaseAPI.PageIteratorLevel.RIL_SYMBOL);
lastConfidence = iterator.confidence(TessBaseAPI.PageIteratorLevel.RIL_SYMBOL);
Log.i("string, intConfidence",lastUTF8Text+", "+lastConfidence);
} while (iterator.next(TessBaseAPI.PageIteratorLevel.RIL_SYMBOL));
My whitelist goes from a range of "a" to "t" because I made a font corresponding to the symbols I had to use and mapped them to each one of those letters.
I would try and set the page segmentation mode to single char.
TessBaseAPI.PageSegMode.PSM_SINGLE_CHAR