How to adjust layouts in xamarin.forms so that it can fit into any phone - user-interface

Hi I am working on a xamarin.forms cross platform app and I am not able to get proper UI If I check the same app on other phone there is misalignment in the buttons.Is there any code that can be used so the buttons look fine in all phones ?
Thanks

Making a responsive mobile app UI could actually be a challenge somehow. These two links however, might be helpful:
Adaptive UI with Xamarin.Forms
Tips for Building Adaptive Xamarin.Forms Apps

Related

ReactNative : How to design UI support all devices iOS and android

I am developing react native app. I wanted to know about design screens that is automatically adjust to iOS and android devices. For example we are using auto layout for iOS apps which gives consistent view for all iPhones and iPads.
I am little bit confused about designing screens for android and iPhones. I know how to design UI for Native platform that is consistent for all devices.
Yes, you can create UI for both Android and IOS devices using the same js file.
Mainly u need to have a good idea about flexbox. It is the base of creating responsive UI for compatible all devices. Follow below tutorials and get a good idea about flexbox and design responsive UI
https://facebook.github.io/react-native/docs/flexbox
https://medium.com/the-react-native-log/a-mini-course-on-react-native-flexbox-2832a1ccc6
and You can find a good example of components https://github.com/jondot/awesome-react-native here.

How can Xamarin be used to wrap a web app as if it were a native app for Android?

Say I build a super mobile friendly web application that I want in the Play Store for Android users to be able to download.
Could I use Xamarin to:
Wrap the entire mobile app as a single WebView
Register for mobile push notifications
Essentially shortlining an MVP of an android app by using an existing web app? If so, is there any well-known process or documentation that demonstrates this?
Probably the best approach for you would be using Xamarin Forms with one or more pages containing only web views.
I don't love Xamarin Forms because usually for me Xamarin Android+iOS gives a better result in similar time, but your app would be so simple that doesn't make sense to do it with Xamarin Android.
Make sure that your web app will show only what makes sense to be shown in your app, otherwise you risk to see double header/footer, useless buttons... but if the website is yours adding a few parameters to change a bit the UI won't be a problem I guess.
Have a look at this example:
https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithWebview
Another approach is the use of Razor to build your pages in html directly inside your app, but if I understood well it's not what you need:
https://developer.xamarin.com/guides/cross-platform/advanced/razor_html_templates/
Although it is technically possible to do this as the previous answer has suggested. I would recommended firstly reviewing, the relevant stores guidelines on submissions. Apple for example will not allow a submission to their store of any application that simply mirrors the functionality of a website. I suspect Google's would likely be the same.
However that said, to answer your question, Xamarin.Forms would be appropriate for a simple application like the one you are suggesting. Or if you prefer to build to a specific OS, then in iOS with Xamarin you would use the Safari View Controller that was added in it's xcode 8.1 release. Android uses something similar as does windows.
EDIT:
You can use the Web View control in Xamarins Andorid native PCL project to encapsulate your mobile friendly website within an application here is the documentation:
Xamarin Android Developer link to Android Web View
As for push notifications, yes this is perfectly possible using Xamarin.Android. and varies on implementation depending on what you want to use as the back end to handle them, I.E. Azure's notification hub etc.

Does Xamarin support to develop apps for Windows surface and how well?

I want to develop an app for Windows surface tablet and iOS mobile and iPad.
As I am a new user to Xamarin, when I created my first project,it shows 3 projects:-
hello.driod, hello.ios and hello.winPhone.
I have 3 questions based on this:-
How will I be able to write the same code and share for windows 8.1 and iOS?
and whenever I drag and drop the elements to the UI page, will the same elements be copied to both windows and iOS simultaneously or I got to add them seperately?
Currently I dont have a MAC to connect to my PC. Can I write the code and and there while testing it, connect it to a MAC or should it be connected during the whole process?
Please Help!
Using the same code depends on how your structure your app.
You can go the native route where you can share the bulk of your logic by containing it in a shared / PCL project (more on that here), but have platform specific code for your UI.
For example, if you have a cross platform app targeting iOS and Android you would still create the UI in a storyboard for iOS and AXML files for Android. Any code you want to "connect" to your UI would be specific to that platform as you would use the platform APIs. Any code that is not platform specific (i.e., not calling iOS or Android APIs) can go in your shared / PCL project.
Or you can choose Xamarin.Forms which adds a layer of abstraction by allowing you to write the UI in XAML once and have it work on all platforms. The advantage is increased code sharing as now your UI is also shared. The downside is to utilise platform specific features you'll need to implement DependencyService or custom renderers. Read more about Xamarin.Forms here.
As above, it depends. If you are going the native route, then no. If you are going with Xamarin.Forms, then you are using the same XAML code for the UI across platforms, but there is no drag and drop designer.
To build an iOS app you need to be connected to a Mac. You will also need to be connected to a Mac to use the iOS Designer.

Android Wear: custom apperance for notification

How to implement such appearance for notification card using Android Wear SDK?
Demo video — http://youtu.be/tKoQatxG0_8?t=26s
It has the same custom layout in preview and active mode. But I cannot achieve such behaviour using setDisplayIntent and related API for creating custom layouts. I checked samples of wear apps from SDK, it also has different views for preview and active mode of custom layout notifications.
Oh no!
Right now it's hidden API, so Google can make such appearance for standard apps, but other third-party developers are out of the board.
Confirmed by +Wayne Piekarski — https://plus.google.com/u/0/+BenoitBoDLubek/posts/2o4SVBhWg5z
So the answer is impossible at current moment.

JQuery mobile vs Phone Gap

I want to convert an existing website for mobile version, what will be the best choice for me.
Using JQuery Mobile on asp.net webform or asp.net mvc
Create application on phonegap for the targeted mobiles
Any Other ?
You would need to provide a lot more information about your goals and your background to answer the best solution for you.
However, I can clarify your title: PhoneGap is a complementary solution to jQuery Mobile. They provide different capabilities and work together. You can use one or both of them. Here's a picture.
PhoneGap does two major functions:
Converts JavaScript/HTML/CSS assets to a native app
Provides a set of JavaScript APIs that map to device capabilities, not otherwise accessible to a web app, like Contacts, Accelerometer, Telephony, GPS, etc
jQuery Mobile is a cross-platform user interface system. It is an extension to jQuery that provides a set of UI libraries specialized for mobile device programming including small screens and touch and swipe events.

Resources