Embedded NativeScript on a native iOS/Android app - nativescript

I have to develop an app for iOS and Android and it has to be able to run embedded in existing apps. I would usually do this with Cordova since it takes care of the multiple platforms and it is easy to embed in an existing app by creating a Cordova WebView.
Since this app is making heavy use of animations I have been playing around with NativeScript in order to avoid the bad performance of this kind of UI running on a WebView.
The problem is that it seems that embedding a NativeScript app in a native app is not straightforward at all. I have found this https://groups.google.com/forum/m/#!msg/nativescript/4kDFcX6gtxA/vdjruLLVBQAJ Is this still true? Any suggestions or ideas on how to accomplish this?

You can check this sample for iOS:
https://github.com/NativeScript/sample-ios-embedded
We will provide soon similar for Android
[UPDATE] Here is how to use {N} in existing Android app:
https://github.com/NativeScript/sample-android-runtime-embedded-POC

Related

What is the best way for creating a web app with kotlin?

I have made an android app with kotlin and now I need a website and iOS devices. So I was thinking about migrating the app to Flutter but before doing it I asked a question and got an answer that we can create an iOS app with the existing android app with Kotlin Multiplatform Mobile By just writing code for UI and other platform required codes for iOS.
But now the question is How can I create a web app with the existing android app?
So for that, I searched and get that we can make web apps too with Ktor or Spring Boot But as I know, For that I have to write HTML and CSS for UI?
Or there is a more efficient way for this that I don't know Or the way of migrating the app to flutter would be best for a long-term plan?
With Kotlin Multiplatform, you could share the non-platform/non-UI code between Android, iOS, Web. This means that it's up to you what you use for writing the UI on iOS and web (you can use angular, react or any other framework you prefer).
For examples of how to do this:
https://github.com/bugsnag/kotlin-multiplatform-example - A Kotlin
multiplatform example app that targets Android, ReactJS, iOS
https://github.com/halcyonmobile/MultiplatformPlayground - A KMP example app that targets Android, iOS, macOS with SwiftUI on iOS

Xamarin UI Test - different element selectors for Phone / Tablet

I am looking at Xamarin UI test as a POC for a native Android and iOS app. Not used Xamarin before or C, so I am bluffing my way through at the moment. I have managed to get it running on the Android Phone version of the app, but how do I make it clever enough to look for different elements between the Phone / Tablet implementation? Going further I will be trying to make the POC cross platform so will need to take into account the platform too.
I have seen references to platform and idiom but not sure how to use them in the Tests.cs file.
Thanks.

React native vs Xamarin forms

We need to build a commercial mobile app that is supported on iOS, Android and UWP platforms. We have been looking at react native and xamarin forms to do so. What is more recommended/preferable technology to implement this?
Reasons why we wanted to use react native in first place:
1) more experience in JavaScript
2) Some of the UI designs in our mobile app includes having cross platform features which by default could be native to either IOS or android. Such as having icon badges on tab items, having toggle search box in navigation bar. On react native we found these were more easily achievable by git hub plugins but in xamarin forms you need to write custom renderers to achieve so.
Reasons why started investigating on xamarin forms: Since the app needs to run windows phones too, we stared using react native XP plugin to support that. But end prototype on windows phone wasn't very impressive in terms of performance and user experience of some of react native plugins we have used. Plus we also had to do quite a bit UI customisation in terms of specifying width/heights to make components work.
I have been develop on Xamarin a few years now. My honest opinion is that there is a lot of third party libraries and components that only has support for Android and iOS only. Maybe you you check out what third party libraries you need and work back from there.
If Windows Phones are an honest target for you going forward, unless you can limit to those capable of UWP apps (Win 10 Mobile) then scratch Xamarin from the list. Windows Phone 8 and 8.1 support is deprecated and will be dropped soon from Forms.

Buiding iOS app from Xamarin Android app

I am an iOS developer & I have to start work on Xamarin platform project for iOS. So I have some basic queries as a beginner in Xamarin. I have already initiated study from Link1 Link2
App is developed in Android On Xamarin & now I have to develop the same app for iOS(iPhone+iPad).
So my question are
Can I reuse the C# code written for Android app in iOS?
I have to redesign the UI for iOS devices? (As per my knowledge "YES" plz
confirm if I am wrong)
.Any idea or any suggestion would be great for me.
Thanks
Well, that depends.
If you had been using Xamarin.Forms you would only need to build one project which would then compile into a .apk (Android) and .ipa (iOS) distribution binary. Thus, by choosing Forms, you would only need to design and build the UI once as logic and UI is shared between all platforms.
On the other hand, you can chose to build your application using Xamarin.Android and Xamarin.iOS. In doing so, you can share the logic (e.g. ViewModels, Services, Converters) only. The rest will have to be built platform specific. So in the ladder case, you wouldn't be able to reuse the C# code which you've built for Android on iOS, as the platforms differ.
As Demitrian said earlier, using Xamarin.Forms allows you to build a single project.
If you want to use Xamarin.Android and Xamarin.iOS, which I do, you can build a solution containing an Android project and an iOS project, then add a Shared Project to your solution containing the common code, like classes, models, HTTP actions, etc. That way, you can save some programming time, while still taking advantage of each platform's specificities.

Integrate Azure Mobile Services in Xamarin.Mac

By the time I'm writing this, I'm working on a Xamarin cross-platform app (iOS,Android and Windows Phone), using Azure Mobile Services. There is interest of also developing Mac OS X version of this app.
Is there a way to use the Azure for the OS X app, because I can't find anything on the web? Please, be descriptive as possible :)
There is not currently Xamarin.Mac support in Mobile Services. If you look here (https://github.com/Azure/azure-mobile-apps-net-client/tree/master/sdk) you will see there is a Xam.iOS, Android, and Forms project.
You can add a feature request for Xam.Mac, or make an open PR that adds in a Xam.Mac project. I'd assume the main PCL component will work and its just a matter of adding the Mac specific wrappers where needed. I'm not sure how much dev work that would actually entail though to say if its feasible or not.

Resources