I developed a web service using java which request from the database Arabic data.
I'm using this web service in android using volley.
The problem is when i get the data and set it in text field it's show some weird symbols (اÙÙÙسÙ).
The collation in database is : Arabic_CI_AS
I tried many solutions but nothing works!
I would really appreciate your help
This might be related to text direction attribute for the TextView, you have to set it to "anyRtl". Not sure which version that you are working on but this is available since 17+.
This above attribute can be set in one of the following ways:
From XML: Add this line: android:textDirection="anyRtl" to your
TextView tag.
From code:
textview.setTextDirection(View.TEXT_DIRECTION_ANY_RTL);
Haven't tried it though, hope this helps.
Few Links:
https://android.stackexchange.com/questions/25359/how-to-make-an-android-device-to-display-complex-rendering-of-indic-characters
Display Arabic text in android textview
https://developer.android.com/reference/android/text/TextDirectionHeuristics
Related
I'm trying to build a simple ToDo App with Angular using two approaches:
At first I tried to develop on each file (asking code with short comments in .html, .css, .ts) and receiving as output small code snippets. Everything works as expected until now.
Second approach is trying to put a single long detailed comment in a unique file where I explain all I need in terms of component and interactions as shown in the example below*. Is there a way to obtain this code in a single session.ts file with the path attached before each code snippet so that I can move the code into the related file?
*Insufficient Comment Example to provide a clearer idea of the expected output:
I need two Angular Components: Login and Todo.
The Login Component has a form with two input fields: Username and Password.
The Login Form is implemented using ReactiveForms.
The submit button directly redirects to TodoComponent.
The TodoComponent shows a table with the ToDo List.
The List is empty at first.
The table has the following columns: Id(number), Title(string), Completed(boolean) and Actions.
The TodoComponent has a button to Add a Todo.
Etc.
Thanks in advance!
I tried to put the comment in a session.ts file but it's not working as it previously did with Java, I expected to receive a path /todo.component.ts and the related code, /todo.component.html and the related code and so on with the rest of the generated project.
I'm a newbie and in progress learning to code. Currently, I'm learning to chap Retrofit & API but have meet a problem that don't have on Google,I researched 2 days ago but cannot :(
This is my all images that i uploaded in 1 album: https://imgur.com/gallery/3fEbSEz
This is all informations related to authorization that i just registered (i think so, i followed the API docs imgur):
Client Name Client ID Client Secret
Get Images Imgur e17abdfa6dd2f71 85411f4e553fd0a5aab2740ea48abe296c8370bf
Through this link: https://api.imgur.com/models/gallery_album , I tried copy paste and replace content in {} by 3fEbSEz.
Example: https://api.imgur.com/3/gallery/album/3fEbSEz/images but as you can see, it cann't access into my album and display as json file format.
I wanna see the result like this: https://jsonplaceholder.typicode.com/photos . Yupp, like this, but ... hmm, i tried many times :((
So who can help me for this case, thanks so much for all helping!!!
This is error be returned when i tried manual link
I have an android resume building application. I want to generate a PDF of size A4 from my view. Here's how my layout looks like - At the top I have a Top App Bar, and the whole view in encapsulated in drawer. The main part which contains user's details is encapsulated in nestedScrollView, which contains multiple LinearLayout and TextView. In this screenshot below, I have populated it with mock data, but in actuality, I am fetching data from the Firebase Realtime Database and displaying it on the UI.
I tried to understand iTextPdf solution and multiple question of similar type that has been asked here, but I couldn't find something solid. Please help me out, it would be of great help.
Also, please don't close this question by giving a reason that the question doesn't contain any code. It doesn't because I don't have any. I am trying to solve this problem from scratch. I have tried to describe my problem as much as I could.
try this:
create a WebView and copy the text of your edittext in it:
webview.loadData(youredittext.gettext().tostring, "text/html", "UTF-8");
and convert webview to pdf by below function:
private void createWebPrintJob(WebView webView) {
PrintManager printManager = (PrintManager) this
.getSystemService(Context.PRINT_SERVICE);
PrintDocumentAdapter printAdapter =
webView.createPrintDocumentAdapter();
String jobName = getString(R.string.app_name) + " Print Test";
if (printManager != null) {
printManager.print(jobName, printAdapter,
new PrintAttributes.Builder().build());
}
}
after that user can select page size for example A4
There are a lot of libraries that convert layouts to PDF, but let's opt for popular one so we could find answers if we're stuck.
The libraries I listed works like so : They take screenshot of your layout as bitmap image and convert it to pdf.
- 1st solution: iTextPDF https://github.com/itext/itext7 (New Version).
check this detailed tutorial which treates also the case of taking screenshot of a scrollview https://www.codeproject.com/Articles/989236/How-to-Convert-Android-View-to-PDF-2
and this stackoverflow answer https://stackoverflow.com/a/29731275/12802591
- 2nd solution: PdfMyXML library https://github.com/HendrixString/Android-PdfMyXml just follow the steps in the documentation.
They may be other solutions, but these are the popular ones.
Let Me know if it works for you and also if you're stuck. Thank you!
I'm helping to build an app which ask you a series of questions and returns the appropriate stone (geological app). The app also has an encyclopedia and a guide.
There are link to explanations in the guide when asking questions and these work fine.
The problem occurs when I want to use the links in the guide itself.
The guide uses a Realm DB for the info and puts it in an expandable list, while the questions use a string resource.
I want to be able to use the link in the text that I put in the Realm DB, but currently it just prints it as a normal string like so
".. ali več različnih mineralnih zrn , nekatere ..."
This is the same code that works fine in the questions section.
The code I use to "try" and convert the strings to links from the DB is bellow.
convertView = layoutInflater.inflate(R.layout.kamnina_item_second, null);
TextView opis = (TextView) convertView.findViewById(R.id.opis_kamnine);
String stone_opis_string = expandableListDetail.get("OPIS_POJMA").get(0);
opis.setText(stone_opis_string);
Linkify.addLinks(opis,Linkify.ALL);
opis.setMovementMethod(LinkMovementMethod.getInstance());
You could try:
String stone_opis_string = expandableListDetail.get("OPIS_POJMA").get(0);
opis.setText(Html.fromHtml(stone_opis_string));
// Linkify.addLinks(opis,Linkify.ALL);
opis.setMovementMethod(LinkMovementMethod.getInstance());
I state that I have already read all the other questions but none is right for me.My app retrieves data from a database. If I put in the database in the app does not display the image, while the other tag html yes because i put:
Text = (TextView) this.findViewById(R.article.text);
String formattedText = db.getText();
Text.setText(Html.fromHtml(formattedText));
For images I would like something that the download so that they are always available. I tried to put ImageGetter but with the loading time of an article in the app increased a lot and very often said that Android is not responding (ANR). I also need something that resizes images depending on the display. Any ideas?
Take a look at AQuery download the latest jar add it in your project
and use it like following
AQuerymAQuery;
mAquery=new AQuery(context);
mAquery.id(ImageView).auth(handle).image(ImagePath,true,true,400,0,null,0,0.0f);