How to make a React-Native app suitable for all dimensions? - css

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.

Related

How can I use a Responsive design in a shiny app?

Is there a possibility to implement a responsive design for shiny apps? In the browser my app looks good and it can be used as intended. If I try to use it on a smartphone or a tablet it isn't usable without lots of scrolling.
Can I make my app responsive for different devices?
Thx and greetings
Derlu
Shiny is built upon Bootstrap which is able to factor in some device constraints such as using percentages as opposed to pixel values for width and height values of elements.
If you need further control over what is shown, I suggest either using a package like shinyMobile or by using a browser ready layout system such as flexboxes. Alternatively, you can use the flexdashboard package which is built so that "Components are intelligently re-sized to fill the browser and adapted for display on mobile devices." (from their website, although I have not personally used it to vouch for its ease of use)
If you want to really customize the experience and design two separate views for desktop and mobile, then you can refer to this post on how to distinguish device size.
I hope this helps, William

Responsive desktop app using Kony

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.

phonegap + phonejs style challenges

I'm starting to use phonegap and phonejs to write mobile hybrid applications. I've followed the tutorial http://phonejs.devexpress.com/Documentation/Tutorial/Getting_Started/Your_First_Application and the app works but both on the emulator and on the device the widgets are extremely small (see screenshot https://db.tt/ZhdrOt0R, sorry for the volume dialog on the screenshot). Like this, the app is completely unusable. I checked the various css files for font-size and other size tags but there are so bloody many places...
This leads me to a more generic question: I'd like buttons with rounded corners, different margins etc. What's the strategy to change the style? There are so many classes, is there any how to how to address this other than in a trial-and-error fashion?
Thx
Kai

What is better: CSS media queries or JQuery mobile?

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 develop adobe mobile project for iPad, iPhone and Android in Single Code Base for managing DPI calculation and UI?

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.

Resources