I'm building an android app that generates random passwords. The passwords also contain symbols and punctuation marks for optimal variety. But Android always puts newlines after each puncuation mark because it interpreted the random characters as words. I've tried adding android:singleLine="true" but that just wraps text on one line instead of removing the newlines. Any ideas on how to fix this? This is a picture that shows what I mean:
Related
My android app name is too long for my phone to display in one line, so the last character gets moved to the next line on the home screen. I'd like to have the split occur 3 characters earlier however, as it would make more sense for the name in question.
I could introduce a whitespace at the point where I want the name to be split, however that would mean that on phones where the whole name fits one line, the whitespace would show up.
Is there a way to predetermine a splitting point for the app name, so that android splits the name at that point if necessary?
I managed to get the desired behaviour by adding a zero-width white space character () where I want the name to be split. During my tests, if the name fits one line, it gets displayed without a visible white space, while if it doesn't fit, it gets cut where I added the zero-width white space.
Edit: A soft hyphen () works too, as it adds a hyphen if the name is split.
Use at your own risk!
I need to replace \u00A0, but it doesn't work with (found out which character it is by copying it to a text to unicode converter)
string.replace("\u00A0", " ");
It also doesn't work with copying the exakt character from the log into Android Studio. I unfortunately can't paste this character here, it gets converted to a normal white space.
I also tried many other solutions which should potentially remove this character, none of them actually worked.
My intention is to compare two phone numbers (looking like this: +49 176 34535...), one with non-breaking spaces and one with normal whitespaces from the keyboard. Non-breaking spaces result of reading the phone number from a notification.
Does someone have an idea how to solve my problem?
I have some misundestanding concerning to FTS, I'd be thanksful if someone will be able to help me.
GOAL: Full text search using MATCH function.
Problem: Unable to do search by extended ASCII characters like: '#¿®£$ and etc.
Details: There are three predefined tokenizers: simple, porter and unicode61. But all of these tokenizers recognize special symbols as separators, because the documentation says:
A term is a contiguous sequence of eligible characters, where eligible characters are all alphanumeric characters and all characters with Unicode codepoint values greater than or equal to 128.
Possible solution (bad one): There is a way to specify extra symbols which should be used as separators for tokens or otherwise as a part of token.
CREATE VIRTUAL TABLE text USING FTS4(column, tokenize=unicode61 "tokenchars='$%")
After that I can find words like: that's, doll$r, 60%40 and etc, because tokenizer doesn't split tokens by '$% symbols.
But it doesn't suit me because there are a lot of extended symbols in ASCII table and it's not such a good solution to list all of them.
The main question: What is the best solution to do search by special symbols.
Thanks a lot and feel free to ask for more details if need.
Interesting problem here, wondering if anyone has come across it.
I am building an Android app that has some special characters as text (mainly Japanese characters) and our designers want some soft returns strategically placed, incase the text needs to wrap due to width limitations on smaller devices.
The problem is that since the text is essentially Japanese, there are no spaces between words.
I know we can use \u200b as a zero-width space resulting in a string like this:
abcdef\u200bghijklmnop
appearing like this when there is enough room:
abcdefghijklmnop
and like this if it needs to wrap:
abcdef
ghijklmnop
The problem is that if instead of standard English characters, we use Japanese characters it doesn't seem to work. We don't get soft line breaks at all. It instead always breaks right where it runs out of space regardless of where we put the \u200b
ヘルプヘルプ\u200bヘルプヘルプ
results in:
ヘルプヘルプヘルプヘ
ルプ
Has anyone dealt with this before or have any ideas on how to solve this?
I make arabic virtual keyboard, and I have a problem.
If you write only arabic characters - all works (written right to left). But the numbers and punctuation marks are written to the right of the previous word. Although should be written to the left of the word. For example:
You write:
word_2011 where '_' is space
Must be:
'2011_drow' (look right to left, numbers read left to right)
but is:
'_drow2011'
Now more interesting. If you write 'NOW' you get
'_drow201WON1' (must be 'WON2011_drow')
This is Android problem? Or is it possible to solve it?
This is due to the way Android mis-implements bidi (bi-directional) logic.
You will also have issues with arabic letters not displaying the mid and start letters correctly.
To work around the space problem you could try to insert a direction character between them see: http://en.wikipedia.org/wiki/Unicode_control_characters. This will work, but will get a square displayed instead of a space in some phones.