How do I configure a Xamarin.Forms app to fill out phones with newer aspect ratios like the Samsung Galaxy S8?
Currently my Xamarin.Forms app looks like the one on the left below. What configuration do I need to change?
Initially, I thought this might have been an issue with Xamarin. However, after further research I found it to be a new configuration for Android apps in general to support the 18:9 aspect ratio.
Here is the Android Developers Blog post describing the updates:
In order to take full advantage of the larger display formats on these
devices, you should consider increasing your app's maximum supported
aspect ratio. To do so, simply declare an android.max_aspect
<meta-data> element in the app's <application> element:
<meta-data android:name="android.max_aspect" android:value="2.1" />
This resolved the issue for me. Related answer here.
Related
So, I started making this app a while ago, and it is now finished, excluding the question I wanna ask. How do I make an app suitable for all sizes? I used the following 3 tools- VS Studio, Expo, React-Native. I have built an app suitable for my screen size; But when I tested it on IOS (with different dimensions), Android (with different dimensions), everything is messy. That is understandable as I simply put numbers in margins, paddings, widths, heights, etc. How do I make this app auto-adjust to all screen sizes? Please Help. This is my first time making a React-Native app.
You should check each and every screen during the app development with React Native on each platforms (Android and iOS) because it saves your time. Also you should take care of some of the things at the start of new app development. Like responsive layout, internet connection check, portrait and landscape view, etc…
Here is the way to make an app suitable for all screen sizes and dimentions.
You can use “react-native-responsive-screen” package to use fully responsive UI elements. Below is the link of that package.
https://www.npmjs.com/package/react-native-responsive-screen
Also here is the link which will help you to understand, how to use it.
https://medium.com/react-native-training/build-responsive-react-native-views-for-any-device-and-support-orientation-change-1c8beba5bc23
You can see the example code in below link using expo.
https://snack.expo.io/#ahmedmkamal/react-native-responsive-screen
Thanks.
A while back, when we were first testing our app, the screen used to rotate when we tilted the phone. Even if the portrait formatting wasn't so great, it still responded to the orientation change.
I have no idea what happened between that point and this, but it no longer responds to orientation changes, at all. If I tilt the phone, it stays in portrait mode and does not rotate at all, the text does not align to the new orientation.
This is across all platforms, and I have the proper settings selected for each specific platform (in iOS in the info.plist, and in Android with the MainActivity decorations.)
The one thing I did do is that moved all of my screens from StackLayout-based to FlexLayout-based. But the screen SHOULD still rotate, or at least ATTEMPT to rotate, should it not? And this happens across all screens.
So ... if I may please could get some advice about what may be happening, here, that causes this behavior across all platforms?
It should be noted that we are also using Telerik libraries for many of our controls (but I don't know why it would make a difference.)
Also, it's a shared app.
Issue solved. Rotation was locked.
we have a mobile application developed using Kony. We are trying to port the same to desktop version. Everything goes well but there are small challenges wrt UI i.e., responsive UI. Since I am new to Kony please guide me if there is a way to include media queries in a Kony application or what could be trick to make the app responsive on browser.
Thanks.
Kony does not currently support media queries to say "for screens of this size use this css rules". Remember in Kony your styling is done with skinning, not CSS3. Skins do translate into css for web apps, but that's a different story.
In Kony the approach is different. You design your forms for different screen sizes based on the type of mobile device: Mobile phone, tablet, desktop, watch, etc.
If you come from a web development background like I do, you might even be expecting a grid system like in Bootstrap or Foundation. But bear in mind that the real value of responsive design is not having to worry about the resolution of the screen, except Kony already gives you this through the use of Dp units instead of pixels. So the same mobile form design will adapt to any mobile device resolution. The same tablet form will adapt to any tablet resolution and so on.
For different device types, the premise is that your desktop and mobile screens will most likely be very different, or even start alike but evolve differently over time.
So the solution is to just copy your form from the "Mobile" subtree (right-click>copy) and paste it under the "Desktop" subtree. Then you'll be able to edit them independently.
I hope this helps.
Edit:
Starting with Visualizer V8 SP2 Kony does support Responsive Design.
I'm newbie for developing mobile website. I very confused between two methods because I dont have any experience this it. Whats more better between two methods: css query when we using all of width device in css file or using jquery mobile that use php technique for differented user that use desktop or mobile [user->php?->mobile use jquery mobile/desktop use css standard]?
Many thanks for this answer
I will classify methods by their importance, from most important one to less important:
Client side detection
Using Modernizer javascript library to detect mobile / desktop environment
Server side detection
Using Modernizer Server or WURFL. Little complex then first solution but much more detailed (if you need more data about used device)
CSS media queries
Bad solution to detect desktop /mobile devices. Current mobile devices can have screen resolution equal to desktop platform
JavaScript based browser sniffing
Worst solution possible. Specially if you want to make distinction between smartphones and tablets.
To find more about this solutions, read my other article/answer with examples: https://stackoverflow.com/a/15055352/1848600
I have to post an answer in here since this comes first in search engines and accepted answer is not accurate.
There are two main concerns regarding responsive designs:
Content: Content should be restructured based on the width/height of the view port so the user can view the content without the need of constant zooming in and zooming out. This needs to happen solely based on the resolution of the view port regardless of the device. It could be a mobile device or a small window in desktop. This mainly involved the look and feel of the website and it is absolutely fine to use media queries. Even IMHO it is the best to use media queries to have the separation of concerns between your view and logic. No web designer likes to see random width or height showing up on their html elements during debug without knowing where are they coming from. Media queries will help you to resize the elements and show or hide them; however, in some situations you may need to move elements around; I usually do these using ng-if or ng-switch in angular js in combination with modernizer.
Functionality: If you need to turn on/off features based on the device functionalities, do not depend on the viewport specifications; use the vast libraries available in JS.
On a side note smartphone browsers seem to render at far lower resolution than actual device screen dimensions. Bust out a quick JS to show you your window resolution and run it on your phone.
Example: Chrome runs at 360x640px on my android screen of 1440x2560px.
How can i maintain DPI resolution calculation for various device and UI management for eg,
iPhone having action bar at top/bottom , iPad app has control bar component instead.Is it possible to maintain application in SINGLE CODE BASE.
Please suggest any alternate way to manage
Please help me.
You have a few approaches to take.
First, the Flex Framework basically boils everything down into three different DPIs. 240dpi is most phones. 160dpi is most tablets. And 320dpi is the iPhone 4. Even though the DPIs are not exactly 160, 240, or 320 the framework uses an approximation to figure out the best DPI to use.
Based on that; You can use the Application.applicationDI. Then the Flex Framework will automatically adjust things for different DPI resolutions based on that settings. So, if you design your app for 160; the app will automatically adjust when run on a screen that is 240. It works pretty well.
The second choice is to write your own layout code to handle different assets and positioning. If you use FXG elements, they are vector based and can easily scale to any device. You could consider making all your assets square; which means it will probably look good no matter what DPI you switch it to.