I am very new to Android development,I like to develop a library using c# and use the library in Android device application. I got some idea to use Xamarin studio, the library generated was a dll. Am I going in a right path? Please guide me for library development.
Yes, you can create a Android library project and re-use it in multiple Xamarin Android projects.
Related
I was wondering if there is a program out there that can convert a simple app I made in Visual studio using UWP to android or iOS?
Thanks
I have to say that's impossible, currently there is not such tool or program to convert UWP to IOS or Android app directly, For developing cross-platform app within .NET, you could refer to Xamarin Forms. Xamarin.Forms is an open source cross-platform framework from Microsoft for building iOS, Android, & Windows apps with .NET from a single shared codebase.
I am now starting to learn android development.
I made a small app in visual studio using xamarin (C#) and I wanted copy it to android studio so I can also learn a new language and a new IDE.
I currently have a solution (App.sln) under that I have the main project (App.csproj) and also a class library project to hold my classes (App.Model.csproj)
In android studio, do I create a new module and call it com.app.model or do I just create a new package in the main module?
If you are currently using Xamarin Native approach, the porting from C# to Android Java should be quite straight forward because most of the API is still the same name. The difference mostly is just TitleCase in C# but camelCase in Java. Also, you will need to rename Android layout file from *.axml to *.xml.
If you are using Xamarin.Forms approach, then you will not able to port to Java easily because the API is totally different compare to native Android now. Xamarin.Forms is having its own API set that mapped back to individual native platform's API.
Checking out native Android tutorial will help you to understand better. However, why you want to go back to native when you already know about Xamarin. I came from Android native background and I didn't look back into native since I started with Xamarin.
I've found a few examples, as I in a Xamarin.Native use a Windows UWP. But that would mean that I a Xamarin.Nativ in a Windows UWP Convert.
I would like convert a finished Windows UWP application to the target Android or iOS. Is that generally supported or needs my UWP application rebuild again with Xamarin?
Links:
Adding a Universal Windows Platform (UWP) App
Getting Started with Xamarin.Forms 2.0’s Windows 10 Preview
Unfortunately asfar as I know there is no converter that allows to convert UWP app to Android app straight forward.
There are few ways to make the whole process a lot much more easier (so you can create your Android app faster).
If you wrote your UWP application and separated common code that can be used in the other applications you can also use it in Xamarin.Android app - the best way is to have PCL with the common code.
It is also important which type of Xamarin app you would like to create:
1) Xamarin Forms - common UI for each app: Windows, Android and iOS.
There is one shared code that can be used by them. Remember that Xamarin Forms apps are generally speaking the best for displaying the data and they are limited with reference to platform specific functionality.
Please see below to read more:
https://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/
2) Xamarin.Platfrom (so Xamarin.Android and Xamarin.iOS):
Here you can create native UI foreach of the project (Windows, Android and iOS) and access specific platform functionality.
With reference to the code - you can put common code in one PCL and have access to it from each project.
Please see this site - here you can find different Xamarin options to create cross-platfrom apps:
https://developer.xamarin.com/
Firstly, if you want a shared code, using Portable class library, you can use the same code for all the platforms including WPF, Android and iOS. First of all what you can do is convert the codes that is used again and again in the PCL (Portable Class Lirary). Once you get used to PCL, you can easily work on any platform you want.
As the Android, iOS are different from windows, a lot of .net framework functionality is not supported in PCL. Although, once you create the basics in PCL, you can integrate the class library in android as well as iOS.
I am trying to port my iPhone App that I coded using Xamarin to Cross-Platform (especially for Android).
I created a new native Portable App in VS2015 and managed to put all the shared code into the Portable project, leaving me with only the Views in each app.
Now I got stuck with the WebSocket. I can easily create a new WebSocketClient in my Android App, as I can in my iOS App.
If i try using System.Net.WebSockets in my portable app it's not found, and wants me to set a new iOS or Mono.Android assembly reference. Is there a way to use the WebSocket in the shared project or do I have to code it for each app on its own?
Thanks.
Edit: Thanks for the input. I tried using Websockets.PCL but had problems with binary data as my server didn't recieve the data as I expected it to. It worked fine with the WebSocketClient though.
Give this a try:
C# Websockets for all platforms using native bridges
NuGet: WebSocket Portable (PCL for Xamarin) 1.0.6.1
Answering your question: You have to provide a platform-specific implementation and a cross-platform interface for WebSocket.
You will need to add a PCL compatible socket library like WebSocket.Portable
I would like to develop an Android application using VB.Net language under VisualStudio, for this task I heard about Xamarin framework for VisualStudio, but it only seems to install Android projects for C# language.
My needs as the needs of many other programmers are very simple, just as I said I would like to start developing an Android application using VB.Net language under VisualStudio, I hope is there an existing Xamarin workaround or another alternative to accomplish this task, because it is a global demand/requisite.
What can I do?, I'm not planning a transition to C# or moving to another IDE than VisualStudio.
I think recently they added portable libraries for using VB.Net, you can have more information on the Xamarin Developer Guides (http://developer.xamarin.com/guides/cross-platform/application_fundamentals/pcl/portable_visual_basic_net/)