Xamarin.Android designer is VS bugs with the arabic language - android

I struggled a lot with this, and i'v searched a lot also but found nothing.
I am using VS 2017 to develop a Xamarin.Android app, with the minimum SDK version of Android 5.0 (API Level 21) and a target SDK version of Android 8.1 (API Level 27).
In the app, i am using the Arabic language, and i faced 2 problems :
The first one is that in the designer view, i can't get the direction of the layout to be RTL(Right to left), when i added the property : android:layoutDirection="rtl", it worked only when i run the app on my physical device, but in the designer i can't get it to be RTL, i tried even changing setting in the toolbar in the designer view here :
The second one is that the arabic text value is being show as squares as also shown in the picture above.
I have tried rebuilding but also no chance, anyone have an idea or a solution for what's happening?

Related

App interface different in Android Studio and Emulator

An Android App development beginner here. I created a simple app which converts KMs to Miles and vice versa. Issue seems to be with the interface. The interface for activity_main.xml is as below:
Interface on Android Studio compiler
But once I emulate it on an Nexus 6 API 29 emulator, it looks weird and doesn't work properly. Tried it on a Nexus 5 emulator as well, same issue. Here's a screenshot:
Nexus 6 API 29 Emulator
Moreover, when I tried installing the apk file on my Samsung Note 8, it doesn't install, even after changing the settings and allowing unknown apps to be installed. Please help.
Judging from first screenshot (red alert icons in "Component Tree" window) the issue is the fact that You did't constrained Your Views.
When using ConstraintLayout You can't just 'place' views in editor, they need to be constrained to something in order to be displayed in desired place.
For example: Your button with text "Convert miles to kms" should be constrained as follows:
left to parent left
right to parent right
top to EditText above it or to TextView "KMs".
But other views need to also be constrained to get desired behavior.
You can read about ConstraintLayout and how to use it in this tutorial from official documentation: https://developer.android.com/training/constraint-layout

How to solve massive rendering problems in Android development

I'm currently working with Xamarin for developing an android app. The structure of the app is really simple yet but a big problem appeared concerning the rendering of my main page. First, it's important to know that I'm supposed to develop for target API 23 so Android 6.0.
And every time I test my application on my Android 6.0 device via USB-debugging the design is totally messed up with my only (!) button duplicated many times and the textViews mixed up over the screen (As shown in the picture link below).
Even though I am new to Xamarin and Android (and C#) I have my settings (as I think) in perfect order. The minimum API level is 21, the target SDK version 23 (Android 6.0), my device runs version 6.0.1, the target compiling framework in properties is set to 6.0, the manifest is set up as I mentioned before and even my "Designer" window with the layouts .axml is set to v23.
I really don't know what to try next, because I want to start coding further. Would be nice if sb could help me out with that.
I have already tested the code of the app on a different API level (26 I think) and it worked perfectly fine with my Galaxy S9 in Debugger mode. Everything looked like it was designed in first place.
I also tried different AppThemes in Visual Studio but not one of the 7-8 I tried worked in any way different except for the colors.
The android app does only switch when clicking the button, texthttps://imgur.com/i0xChVniew 2 into the current date and time. I'm really sure, that my code is not the problem.
Picture: How it should look (In Xamarin)
Picture: How it looks on the phone

How to display Unicode Characters in Android TextView?

My app works before with translation from English to Korean.
See screenshot below.
I don't have to configure things like right fonts among other things.
Now it won't work and would only show Latin based characters.
I know for sure that the API I use returns the translation I need since the correct translation shows on my logcat.
But android textView doesn't display it properly since I updated all of my android studio components such as the emulator. It doesn't work properly on API 17, 18 and 19 but works on API 16 which is rather odd since if it could work on API 16, it should work on much newer versions of android too. I've also Cold Boot all my emulators to reset it, but still no changes. It also works on API 21 as show below. But definitely not on API 17-19 as I've tested. :(. Please. help. Thanks.
[Edit]: I Changed the title from "How to display Korean-Chinese-Japanese Characters in TextView?" to what it is now since supporting most languages is under encoding foreign language in Unicode it seems.
After debugging for a couple hours more searching. It seems that the current updated Android emulators for API 17-19 are buggy. Since I noticed that it doesn't display Korean Characters not only my my app, but also everywhere else like my web browser.
The reason why my app displays unicode characters in an older android versions like Android 4.1. However, it turns out it could display Japanese Characters when I tried to translate to another language that is another Unicode character. It could also properly display japanese and chinese unicode characters in my browser.
I already created a fresh Android emulator for API 17-19, but it really didn't solved the problem. Installing a new keyboard didn't do the trick either. I could't not add another language too like japanese since its not in the options. But japanese works on the emulator, so I didn't bother trying to find one for Korean.
In the end, it turns out its really an emulator (Operating System related) problem and not an android app compatibility or problem on my code. Android 4.2-4.3 (API 17-18) is both Jelly Bean anyway. Since, it works on Android 4.1 that is Jelly Bean too, problems must be in the android image updates I had update a few days ago. for Android 4.4, must be the same case then.

Design view abruptly stopped working in Android Studio

My android studio was working great, when the design view stopped working abruptly. By design view I mean the preview of the UI one designs in XML. I get a message saying
Android N requires the IDE to be running with Java 1.8 or later. Install a supported JDK
I am not sure why this happened without me doing anything. How should I resolve this error?
If you don't want to preview in Android N, you can simply lower the API preview level to API 23 or lower.
Otherwise removing old jdk versions seems to work as well.
Check out this post if you need more information.

Designing android app for multiple screen sizes

I'm designing an android app with a minimum SDK version of 8. I have currently been testing it on a emulator running an about 4 inch phone...
I recently got a Nexus 7 and ran it on that. I thought it would just enlarge the screen (button and text including) so it was basically magnified... it wasn't
I thoroughly googled it and came up with using different layout sizes (I am using Eclipse by the way) so I made a 'layout-large' folder but I got the following error and no design view of the screen layout would show
'It looks like you are using a render target where the layout library does not support the tvdpi density.
Please try either updating to the latest available version (using the SDK manager), or if no updated version is available for this specific version of Android, try using a more recent render target version.
Exception raised during rendering: Index: 2, Size: 2
Exception details are logged in Window > Show View > Error Log'
How can I solve this? I don't want to change the minimum SDK from 8
The tvdpi seems to have been implemented in Android 3.2 (meaning SDK level 13). If you want to target the Nexus 7 displays, with alternate resources, I suggest targeting large screens instead of tvdpi. You shouldn't have to change your minimum requirement of SDK level 8 as it doesn't make sense to target TV densities when aiming for Nexus 7, but maybe that's just me.
There is another similar question here on Stackoverflow with a great answer: How to create different layout for Galaxy S3 and Nexus 7?
Also visit the Android developers design guidelines and specifically Designing for Multiple Screens for more information. The Android guidlines is a very good website that I use consistently.
First thing first, there is great information at developer.android.com about programming for different screen sizes. Fragments are great for this. Did you get rid of the 'layout' folder. It sounds from your question you just renamed the layout folder. I would start by reading at a lot at the Android developer information center. Check the first link.

Categories

Resources