How to open my Android native application with Xamarin.forms? - android

I've been developing an Android application with Android Studio and now I need to be able to open it with Xamarin.forms in Visual Studio (it's a task that my teacher gave me, and it's because a classmate has been creating the iOS version and now we will combine them into one project).
I have to say that I'm pretty much a noob and been looking a few tutorials that talk about Dependency Service and other stuff, but don't seem to quite cover what I'm looking for (or, at least, not clearly enough).
If you have a precise video that explains simply how to do this, I would be grateful if you share it with me.
I thank you for your time and wish you a great day :)

It is impossible at even now in current version of Visual Srudio .
Every file in Xamain is different with Native Android . The Java code can not be directly copyed to use in Xamarin , you should translate them to C#.
Having a look at this document: Porting Java to C# for Xamarin.Android .
There are two ways to port Java code to C#. The first way is to port the code manually. ..The second porting methodology is to try and automate the process by using a code converter...There is often a non-trivial amount of work involved with bootstrapping an automated code conversion tool, and this may prove to be a barrier to use. In many cases, it may be simpler and easier to port Java to C# by hand.

Related

business processes Framework (Xamarin or ReactJS)

maybe someone can help me. In near future i'm going to develop a business processes application like this :
https://play.google.com/store/apps/details?id=de.semture.cubetto
https://play.google.com/store/apps/details?id=com.showgen.processcraft
Now i would like to know if there are some already existing Frameworks or projects for that. I just want play arount with that subject to get a feeling how it works and what i have to do. I'm planing to make it available for Android (highest priority) and Web (Ios and windows arent so important right now).
So my first question is. Are there any Frameworks, libs, project availbe for something like that?
I've already searched for some frameworks but without no success...
And the other question would be what Tool or language should i use ?
Currently i'm working with Visual Studios 2015 Xamarin (xml & C# based language). We all know that i can make crossplattform apps with xamarin. But some minutes ago i've heard that there is a language/Framework named React.JS, that is also for android ios and web apps.
Now my second question:
which one should i work with ? Xamarin or React.Js ? Which one would better fit to my project and what are the main differences ?
I hope someone could answer that :)
Thanks in advance
This really comes down to personal preference and what you are trying to accomplish. If you are a C# developer, then Xamarin might be your best bet for android. With using ReactNative, it will be a little easier to create your web app from since it uses React. If you are trying to have a native feel for the android app, you will still have to know some core android development for both platforms. If you aren't super worried about the look, feel, and performance of it being native, then you can look into ionic which is built on top of Angular, and this you can use as a web application as well as build it for android.

C# web application to be transformed with Mono for Android

I have a c# web application and i want to build an android app using Mono for Android.
Is there any automatic way to use the existing code of my web application or i have to program everything from scratch using the Mono and the android application logic?
Thank
Stav
Hard question to answer, because it is very vague. However you should be able to take most of your Business Logic and drop it into Mono for Android without much hassle. Not really knowing how your Web App is structured it is hard to say how much of it you can reuse.
But I've made an App at work, which started as a Silverlight Web App, where practically all the model code could be reused, with one minor correction, which was to use HttpWebRequest instead of HttpClient and some minor corrections to the code to make the UI update correctly and make the updates run on the UI Thread.
The way I took to get the model code into my App, was to link all the necessary files into my project, and they mostly worked. Is there an automagic way to do this? I haven't seen one as of yet. There are some extensions to Visual Studio which can help you with linking files into your project such as Project Linker.

Porting Visual C/C++ to Android

In my recently started internship (I'm studying computer science), I have to port a somewhat big existing Project to Android. It is a Visual C/C++ Project which in the end should run on Android using of course the NDK. The problem is that I don't know a thing about porting software, since this is not covered in my studies...
I had a few days to get to know the project I will be working with a little.
A few words about the complexity:
It is a Visual Studio solution which consists of 28 projects of which most are kind of big...
And now I need to develop a concept for porting it to Android, and this is why I'm writing this. I have absolutely no idea know where to start, also I don't know how to get to a concept for porting it. I tried searching online for some stuff or for some books covering this, but I found nothing.
Of course I know, that basically I have to remove everything that is Visual/Windows specific and replace it with appropriate Android/Linux functions or implement something new if there is nothing corresponding on Android.
But since this project is somewhat huge, I can't just try to compile it with the correct compiler and work through the error messages, this will lead to nowhere, I guess...
So now my actual question:
Is anybody experienced about this or something similar and can give some tips how to start with it? As I said, I first need a concept. Something more general about how to start and deal with porting a software project of this size is also very welcome, since I don't know nothing about it...
I think that you're approaching the whole matter in the wrong way. There are several tools that will allow you to compile C# and visual C++ and other visual languages from their respected IDEs to the android platform. For example there is mono for android . Mono is a plugin for visual studio which helps you create android projects using visual studio and .net technologies. I think you should focus your research on tools like this because changing all of the code manually is nearly impossible and too time consuming. Here is a page that will help you get started with mono for android. Good luck.
See this answer Android NDK with Visual Studio.
Personally I don't use this, but It seems to be a nice solution to your problem.
Like you, in the past, we had to port a big Visual C++ library project to Android, we proceeded in this way:
Try to compile the main library interface (by creating the relative Android.mk)
By using linking errors, you should guess other projects to be compiled and create the mks for them
Cycle until you have no more linking errors.
You didn't tell about the source code size of the project (how many thousands of lines of source code).
If the code size is big enough (e.g. at least 100 KLOC), you could consider customizing the GCC compiler (assuming a recent 4.6 or 4.7 version), perhaps using MELT (a high level domain specific language to extend GCC), or painfully coding in C a GCC plugin. This GCC customizing approach is worthwhile only for large code bases (you'll need several days to master GCC internals).
On the other hand, many well designed applications may have packaged their operating system functions inside a well defined interface and library. You might consider porting your application to Qt or some other cross-platform library.
We need more details about your project to help you more.

MonoDroid VS Java in android development?

I know C# rather well and just love Visual Studio as IDE. :) Yet now I want to start developing for android...
I found out about MonoDroid and wanted to ask if it has any downsides to it that would make Java more preferable, or should I uninstall Eclipse and dive straight into MonoDroid?
If I understand right, MonoDroid deploys/compiles native android applications and does not need any additional .net-like framework or anything?
Are there any significant limitations to what I can do with MonoDroid? For example, having the app run in the background or using some external .net libraries for image editing, etc. ?
I've been worrying about the same thing - productivity in C# instead of playing with an unfamiliar language, vs developing how the OS developers intended it to be.
Its easy to list pros vs cons -
pros (of monodroid, for C# developers)
familiar dev environment, can develop using Visual Studio
C# instead of Java
Reusable code assets - you can use a lot of code in your iphone project or Windows phone 7 project using monotouch and the WP7 SDK.
cons -
debugging could be difficult, due to lack of api documentation from Google. Will have to depend solely on monodroid documentation.
there could be a lag when it comes to latest cutting edge features - safe to assume that the monodroid team will require some time to wrap around the latest android features every time there is a new OS release
availability of libraries - I am not sure how you can use the open source libraries that would have evolved around the android platform, that could cut down on development time
Much of the documentation available is in Java: so if you run into difficulties with phone behavior when using MonoDroid you won't really find that much help or debugging information so you may want to stick with Eclipse.
There's a lot more than just a set of wrappers running under davlick, truth to be told, there is much more of a horizontal relationship between MonoDroid and Android;
When did using the same language as the OS developers become a big issue? There's lots of C++ programmers wondering how to use BSD or SVR5 and many C programmers who want to know what the heck to do on Windows++...
If you will write in c# anyway you will be have to wrap it into a Java code, so what's the point ? Also you may head with a very difficult issues while trying to understand the APIs who written for Java programming...
Here are some points that you can mull over:
Android applications are predominately written with Java. The Android SDK itself is natively written in Java.
Working in Mono may not provide all the functionality available in the Java SDK.
If you are a C# Developer you wont be able to find, in Java, some of the (cool) features available in C# (like Property Delegates etc).
Code written in .NET can be re-used for other environments - this may save a lot time that would have been spent learning a new language/environment (like Objective C), and coding in it.
.NET extends the Android development stack with it's existing libraries and API's.
I think both are good for certain reason. It will be very hard to say which one is preferable for Android development - in the end that is up to you too decide.
Also note that any release build using monodroid adds an additional 4mb to the apk filesize and increases app startup time with a few seconds.
For simple apps this can mean a 500-800% increase in filesize - whic is pretty bad in my book.

Starting Android Development: Native or cross-platform?

I am an experienced professional programmer who wants to delve into Android programming. I also wish to investigate cross-platform programming using tools like PhoneGap or Titanium.
However, I am a bit in doubt of which learning strategy is best.
One approach is to get a good feeling of the Android environment and later on explore the possibilities of the cross-platform tools.
Another approach is to jump start using say Titanium (which to me looks like the better option of the two mentioned) and then after a while look into the underlying Android building blocks. The reason why this approach seems worth considering is that although I have earned my living on programming for 20 years, I have no experience whatsoever with Java. And the feeling of getting something done has always been encouraging to me.
What do you think? Does option 2 make sense, or would it be more sensible to get an understanding of the Android environment first?
Thanks in advance,
Martin
I think that all depends on what will you develop:
If you want to develop simple interfaces (parsing XML/Json/...) with some forms and nice transitional effects, then Titanium is yours.
However, the most advanced functionalities aim the iOS platform. For example, the augmented reality module or the push notification are not supported for Android.
On the other hand, if you want to develop advanced interfaces (Games for example), then you have no choice: Android SDK is the best way (you can use Flash for Android but it doesn't support very first Android OS versions).
In all cases, you have to understand how the Android platform works.
I had a similar decision to make, although I am not an experienced programmer like you with vast experience , I had no java knowledge and I needed to write an android app for a project in grad school ,and i'd tend to agree with you on which is the better option , although reading the dev guide and grasping the basics will be a must. And like Zakaria says , it also depends on what you plan to develop.
in my case I learnt basic java first , then used the SDK for my project. Its not that big a learning curve actually , I did not find too many problems with the API.

Categories

Resources