I'm using Xamarin to develop a cross-platform mobile app. To communicate with our REST-service I'd like to create a shared project between these platforms to have a service access layer. The problem is that RestSharp has different projects for different platforms. How can I create a shared project while still using the platform-specific libraries. Does that make sense?
I tried this exact thing a few months ago. I ran into problems when trying to use my "Service Library" on WP8 because of the RestSharp dependency. If I had it to do over, I would do just like the link that #user1010710 mentioned in the comment and use HttpClient.
Related
I am using flutter web and I want to use some packages that are available for the mobile in the web version of flutter. The pubspec of flutter web look a bit different from that of flutter mobile but this is not the real problem. What I am concerned about is that is it possible to add the packages availble for mobile into that of the web. If yes, what is the proper way to do so?
This is not currently possible (as of June 2019) for any package which is dependent on the mobile OS. The reason for this is that the plugins on mobile use platform channels to communicate with platform-dependent code implementations for Android and iOS written in java/kotlin for android or objc/swift for iOS.
The only way those packages would ever work on the web is if a web-specific implementation were written for them which I assume would either use an emscripten-compiled library or more likely some sort of javascript bridge to call the relevant browser APIs.
From the flutter for web readme:
flutter_web does not have a plugin system yet. Temporarily, we provide access to dart:html, dart:js, dart:svg, dart:indexed_db and other web libraries that give you access to the vast majority of browser APIs. However, expect that these libraries will be replaced by a different plugin API.
For any plugin that is 100% dart code, you should be able to just include it in your pubspec.yaml the same way you would in flutter - under dependencies.
yes you can by take source code packages from github and take codes inside lib file inside package and put it in your project and fix errors may happen inside files by change path import to:
import 'package:flutter_web/material.dart';
and some more changes may need to do it.
it will work 100% and so easy :)
where can I learn to make UWP apps using visual c++.The only resource I've found shows how to make a 'Hello World' app. This is insufficient because I want to make an app that has multiple pages and utilizes custom classes.
To develop UWP apps, the official channel is the official document: https://learn.microsoft.com/en-us/uwp/
Depending on your requirements, you need to use the appropriate APIs in your app.
For the specific API, there's specific code sample for your reference. You could get the demos from GitHub: https://github.com/Microsoft/Windows-universal-samples
If you want a complete project to learn how to develop a UWP app. There's an existing open source project MS-Calculator. It's UWP app and developed by c++ language.
question
I am wondering what the main differences are between Electron and JXcore.
background
I was thinking about how I could make a NodeJS server into an app and I came across both of these. They seem to do the same thing, except that JXcore supports mobile and Electron doesn't.
side question
If Electron doesn't support mobile then how was the slack mobile app created?
Thanks in advance!
From the JXCore site(http://jxcore.com/tech/):
JXcore is a fork on the open source Node.js project
It uses LLVM to compile javascript as opposed to V8 which NodeJS does.
In terms of what are the main differences- Electron is a framework for building native, cross platform desktop applications, where it appears JXCore is a javascript engine forked from NodeJS.
Electron is built with NodeJS, and Chromium. So to make it fair, the comparison would be better stated "How does Electron work with NodeJS vs JXcore". Since I don't have any experience with JXCore, I can't answer that question. I would venture to say the only way to know that is to fork electron and replace Node with JXCore.
Based on your background, I would assume you are thinking about making one application that works cross platform across mobile and desktop environments. To that, I would say it is possible, but you are going to have 2 different projects. There are things in Electron that you wouldn't want included in your mobile app, since they are working with completely different operating systems. You are right that electron does not support mobile (it wasn't built for that).
As far as your side question goes, there are any number of technologies that slack could have used to create their mobile app. They could have used Java , Swift, Objective-C, .NET, Ruby, or Javascript.
There are cross platform tools such as RubyMotion, NativeScript, React Native, and Xamarin that could also be used to create native mobile apps, that all compile down into the native language the mobile OS understands.
A final approach could be the use of tools such as Cordova/Phonegap which create mobile apps via a "web view". Essentially, this is like creating an app that launches a web browser to interact with your phone.
If you are looking for an example on how to build once and use everywhere, I would look at the github repo found here https://github.com/NathanWalker/angular-seed-advanced. This shows a common codebase that can be used in Electron, Web, and Mobile.
I am new to Xamarin development. And, currently I want to integrate the zendesk chat.
As per my RnD and after contacting Zendesk support center they are not supporting the xamarin yet.
Currently they have sdk for native android and ios respectively.
I need you expertize people's guidelines for the development regarding what scenario i should follow to achieve the same using xamarin.forms :
Integrate the both platforms native sdk's for xamarin in each platform and later call it from Xamarin.Forms by adding platform dependency using Device.OnPlatforms . ( I am not sure about this scenario, please suggest)
Create a jar/aar of Zendesk SDK and use it using binding library concept.( I am not sure it will be accessible into ios platform)
Kindly, suggest me the best approach for this.
Any sample reference for suggestions will be grateful.
Thanks in advance.
I think it's a mix of number 1 and number 2 (and a little extra).
You will need to create the Binding libraries for both iOS and Android. Xamarin has a good documentation of how to do this: Android/Java and IOS/Objective-C
Then you can go either with Xamarin Native (Xamarin.iOS and Xamarin.Android projects) adding the binding to each project. Or you can go with Xamarin.Forms but this will require a little more work as you will need to create an interface of the methods you want to use from the SDKs (most likely all off them) and create the implementations for each platform.
Let's say your interface is called: ISendeskSdkService you will need at least two implementations: ISendeskSdkServiceiOS and ISendeskSdkServiceDroid. These implementations will be on the Platform project and they will be calling the binding libraries you just created and added to each of these projects.
You will be developing your app on top of your interface and which implementation to use will be set on the application load when you are configuring your IoC.
Hope this gives you an idea.
i'm developing clickonce application which, potentially, i would like to distribute on Mac platform. I know i can compile .Net application wtih Mono - and it will work on Mac. But can I use clickonce as the installer then?
thanks!
I don't think Mono team has ever implemented the ClickOnce .NET APIs that make this possible. However, I think it should be kind of straightforward to implement them.
That being said, it might be wiser to just use the Mac backend for Squirrel. (Which is a project implemented by Github employees, used in their Github Windows client, that replaces/improves ClickOnce, as far as I know.)