Create a Text with a special structure - android

Is there a way to write and save a Text with a special structure ? So I want for example sth like this in my Text File :
This is a
structured
Text in
android
There should be also Tabs etc. I thought to make a Word Document but cant find a solution ...

Related

Copy the text with the font in the Android application

In some Android programs, you can copy text with a specific font and paste it in other programs, but how do they work?
like this:
𐎢𐎲𐎢
I want to show a text with its font to the user and allow him to copy it, but like the example above, I want its style to be copied as well, but only the normal text is copied.
like this: abcd
But what I want is this : 𐎷

Justifying database texts on android

I'm working on story application pjoject for android. The story text is in the database/db file. I used textView and the text is working good on the application but it's not justified. Is there a way to justify the text from database file, or link to that tutorial?
Setting text in db won't have any styling impact on text itself. You can use third-party lib to justify your text in android.
https://github.com/bluejamesbond/TextJustify-Android
In order to use it, you'll need to use their com.bluejamesbond.text.DocumentView in XML instead of traditional TextView. See the first example of the following link to get an idea about code.
https://github.com/bluejamesbond/TextJustify-Android/wiki/3-%C2%B7-Examples

what happen if do not put text files in string.xml in android?

i did not put some text in string.xml and there is a yellow alert symbol in side of Textview field. i want to know does it have problem and what happen, if do not put texts in string.xml in android?
Well, setting your text directly on your layout file can be a source of future problems and its not recommended.
Consider this scenario: You use the same string "Foo" in many layout files and then you decided to change to "Bar". If you have hardcoded that, you will need to make changes in all layout files and there might be a chance to leave some inconsistent text. But if you place it in the strings.xml file, you will have only to change in one place.
Also, if you want to add translations to your app, the Android system can handle it automatically for you if you use the strings.xml.
You might want to take a look here and here.
Nothing will happen.
string.xml used to:
localization
res/values-fr/strings.xml
res/values-ja/strings.xml
ease of editing and to save memory when reusing.
I Recommend you to put text files in string.xml
Whilst it will not cause a problem in the short term, it is not good practice and will cause you issues in the future if you decide to support multiple languages.

HTML android in android

I want to develop an editor which can make the text bold, italics and underline and create an equivalent HTML for it. I have somethhing like this in my mind:
When the user clicks on save, I should get HTML data.
For example , if user writes:Hello World
then I should get <!Doctype HTML><body>Hello <b><i>World</i></b></body></html>
What are my options here? are there any previous projects like this or do i have to make this from scratch?
You can use Character Style sub-classes of Android for the styling of your texts. Then use HTML class to get the HTML equivalent of your text. I'm currently developing one and those are the ones I used. You may also check out https://github.com/commonsguy/cwac-richedit for an example on how you could use Character Style for editing. :)

How to edit TextView Android?

I want to load a text file in Android with custom size and color just as shown in the website (download the 1.html file). This is a HTML file and I have used WebView to show the file but I want to show using TextView. If I simply copy this in Text file it deletes the custom color and the size. Is there any easy way using Java code like loop or something to make specific lines in Red color and the other in black to make it look like it's shown in HTML File?
https://sites.google.com/site/gurbaniujagar/page1
Thanks in advance
Take a look at this site here, it shows you all you need to know.
http://javatechig.com/2013/04/07/how-to-display-html-in-android-view/

Categories

Resources