Design view abruptly stopped working in Android Studio - android

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.

Related

Xamarin.Android designer is VS bugs with the arabic language

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?

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

Android Studio hangs when drag/dropping UI element

I installed Android Studio 1.0 and have JDK 1.8.
I make New Project, use a 'blank activity with fragment' and set the minimum version to lollipop (5.0)
Then I go to fragment_main.xml and drag an UI element to the phone (in the example i used a button)
The moment the drag interface is visible on the phone, android studio hangs and i'm unable to do anything expect killing the process with windows taskmanager.
My mouse looks like this:
Any ideas?
Thanks.
I may have found a solution for this.
I was having the same exact issue and couldn't figure out what was going on for the life of me until:
I theorized that perhaps it was just the windows display that was frozen (the visual rendering of the Android Studio program itself) and guessed that perhaps this was using a DirectX device to do the rendering of the Android UI.
I happen to have another app running on my computer that uses a DirectX device for rendering (SimpleJungleTimer, an app I programmed with a DirectX overlay for League of Legends jungle timers). After I shut down this app Android Studio appears to be working properly (not freezing when working with the UI anymore)
Ultimately it sounds like this is a bug with Android Studio itself where they don't properly kill / reload the DirectX rendering device when it is in conflict with another app's active DirectX device (something that the android studio developers should probably fix), however until the android studio developers fix this you should be able to get around this bug by making sure any other applications that might use DirectX for rendering are shut down while coding in Android Studio so that their DirectX rendering devices don't conflict with Android Studio's DirectX device.
There are also problem with Java 8 in Mac OSX. When any drag and drop I made result in hanging the Android Studio 2.0 preview. This problem also happen to me when I use intellij 15.
You can have a look at this link: https://youtrack.jetbrains.com/issue/IDEA-146691.
I switch the JDK use in may projects to Java 7 and the drag and drop feature works. You can do the switch by choose File > Project Structure > Change in your JDK location.

Developer wants to build in version 4.0.x and 4.1

I've got a quote from a developer to build a couple of Android apps. For both the contract states: "App will be compatible with Android OS 4.0.x and 4.1".
Can anyone please tell whether this poses any problems for people wanting to run the apps on newer versions of Android's OS? Not sure if I should be worried or not.
Many thanks
Drew
Mostly, newer Android API fully support older API. That means anything that works on 4.1 should work on 4.3, 4.4, etc
Still, not everything that can run on 4.1 can run on 2.2, for example. Backwards compactibility is a huge problem sometimes
Targeting a minimum of 4.0 won't stop the apps from working on the current versions of android. The only major difference that I can think of is the default color accents being changed in 4.4 (The current highest release). This can be addressed by your developer if your desired styling overrides the defaults anyways, otherwise know that in 4.0 youll see lots of blues, but in 4.4+ youll see a more subtle grey accent.
That isn't to say that this will always be the case though. At any point the OS can take a right turn like they did with the HOLO changes that were introduced between 2.3 and 3.0, which would make your "legacy" app not function as it use to. At this point, you would either have to have the app redone, or accept the flaws in this completely hypothetical future state.
Unless the API is depecrated, they will always work on newer versions. The problem usually is older versions unable to support newer API, not the other way round.

Android dalvik problem

Please i have different platforms installed. I just wanted to know what am supposed to do. If i develop with 3.0 platform, would those with a 2.2 be able to use my app??..
The second question which is the main question is I always get this error when i create android projects..
[2011-05-16 16:32:21 - Hello World] Dx no classfiles specified
[2011-05-16 16:32:21 - Hello World] Conversion to Dalvik format failed with error 1
What do I do to it?
There are several reports out there for that error (e.g., this one. All the solutions point simply to reload the project (select it in the tree at your left, and press F5).
Regarding the first question, unless you want to support Honeycomb-only features, then set up the api level to 8 (Froyo).
Eclair, Froyo and Gingerbread are android versions 2.1, 2.2 and 2.3 respectively (also referred in the documentation as API levels 7, 8 and 9). See the table here. If you want to support just mobile phones, set your target to 2.1 or even lower. That way you will be able to target most of the phones in the market. Your app will also run in Honeycomb (3.x) devices.
Honeycomb has new features to support larger screen devices, so if that is your main target, you might consider taking advantage of those features and drop cell phone support. All will depend on what is your objective.
you should have a look at the minSdk and targetSdk features of a manifest file :
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8" />
This will help you target a android sdk version and precise what is the minimum sdk level that can run your app.
Regards,
Steff
Developing for Honeycomb or non-tablet version of Android, is different in various things. Your 2.2 application should run correctly on a tablet, but if you want to optimize the graphical interface and use all the notification and other things included only in Honeycomb, then you must use the appropriate API. Until Ice Cream Sandwich is released, we have to develope two different application for the best result.
Regarding the error you get with android projects (I suppose under eclipse?) you'll find some detail at this link, but if you follow all the instruction provided by google in the developers page, you'll be able to write and run your Hello World application.

Categories

Resources