I was thinking about different ways to convert my android app to ios app without learning and writing code in obj C from scratch. So I thought about converting it to c# and using xarmarin, create the ios version of it.
I just wanted to know what's the best tool to convert java to c#. I know there is an old post but it's 10 years old, i was just wondering if there is an easy way to do that?
I think it will be difficult. Especially for all UI specific code. There are some solutions to convert some part of your code such as model, controller or business logic.
You can use Sharpen to convert Java to C#. But, it will be difficult to use it for UI part. And even, if you achieve this, you will obtain a Xamarin application that targets Android only.
Of course, it will be easier to port your application to iOS but you will have to rewrite all UI code.
You can still try Xamarin, by porting your non UI code and creating a Xamarin Forms application (it means new UI code to develop) which can then be deployed on iOS and Android.
Related
I'm working on a project whereby we're creating an app for people to call/message one another.
We're currently developing in Androidstudio, java, but even after we've launched the app, it seems that most of our interested users are on iOS instead.
Is it possible for us to convert Java > Kotlin and use Kotlin Native for our iOS app? I mean, if it's possible we'd like to use a way that wouldn't need us to use too much Swift, since we're a bunch of undergrads who's doing this on interest and we haven't developed in Swift before.
Seems like there are certain projects that are multi-platform so far, but I'm kinda really skeptical about the possibility of us doing so, even though most of our code are written in web.
I'm sorry I'm not that well versed in programming or if this question has been asked before, I'm still kinda new to programming and everything.
I'll really appreciate it if you'd so kindly answer this question! :)
You can use Kotlin/Native for your iOS app and not write any Swift, but you still need to change all of your UI code so that it uses the iOS UI framework and not the Android framework. This conversion needs to be done manually; there's no automated tool for that.
You could try out Flutter if you want to have one code base for both Android and iOS?
I have created an android app that I would like to port to iOS and the windows platform. I know that I can create this kind of a program using C# with Xamarin because I have experimented with that sort of thing before; however, I would prefer not to have to convert all the code to C# as that would be time-consuming and ultimately would just not be a good use of my time. From descriptions I have read in the Xamarin documentation, it seems to be doable, just I am not sure how. To clarify, I would like the Java code (the Android app source code) to be used by Xamarin to create identical apps, but on iOS and the universal windows platform. Thanks in advance.
Example of what I mean:
Generate an app that should do the exact same thing on all platforms from this java code:
AlertDialog.Builder uselessAlert=new AlertDialog.Builder(this);
uselessAlert.setMessage("Pointless Button v");
uselessAlert.setPositiveButton("Ok",new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int which) {}});
uselessAlert.create().show();
Of course, that is a very useless program that can easily be converted to C#, but I am dealing with a fairly complex one.
Basically, you can't. Xamarin is a toolset that provides a C# and F# compiler for iOS and Android, as well as wrappers around the native iOS and Android SDKs. You can call into Java code by binding up a library, so you could call your existing Android Java library, but ONLY from an Android app, not from an iOS app as the APIs needed to run the Java code are specific to Android. In your code snippet above you reference AlertDialog. This is an Android API, and you can call this in C# from a Xamarin Android app, but there is no way to call this from an iOS or UWP app - the API simply doesn't exist. You would need to re-write this code for each platform.
The way Xamarin is cross-platform is because you can write your business logic - so everything that doesn't need to interact with the OS directly (i.e. not UI code) once, then reference this from an iOS, Android and UWP app.
What you would need to do first is to restructure your core business logic and re-write it in C# or F#. Then you would need to think about the UI and anything that interacts with the OS.
For your UI you then have two choices - write it using Xamarin.iOS, Xamarin.Android and UWP (so use the native SDKs to build your apps), or use Xamarin.Forms which gives you an abstraction across the native APIs allowing you to write your UI once (the compromise being you get a lowest common denominator approach, and if you want to do fancy stuff you need to interact with the native APIs directly).
TL;DR - you can't just use Xamarin to magically port your Android app, you would need to re-write it.
I want to develop an app to track people's Whatsapp last seen and other stuff, and found out that there are APIs out there to deal with it, but the thing is they are writen in python and are normally run in Linux I think
I have Java and Android knowledge but not python, and wonder if there's a way to develop the most of the app in Java and get the info I want via calls using these python APIs, but without having to install a python interpreter or similar on the device, so the final user just has to download and run the Android app as he would do with any other
I want to know if it would be very hard for someone inexperienced as me (this is the 2nd and final year of my developing grade), for it's what I have in mind for the final project, thx in advance
Instead of running it as one app, what about running the python script as separate from the original script? I believe it would bee possible, as android is in fact a UNIX based OS. Any readers could give their input on this idea an if it would work.
I am trying to port an Android application to BlackBerry 10 and make it look naitive. I have written all the QML for the app but I cannot seem to get the code to work. Do I need to translate the Java into C++ and if I do, do I have to do it manually or would an automatic one do?
Also my application has many different classes which I am not sure how to integrate with the BlackBerry layout.
I am trying to port the open source messenger Telegram, if that's any use. http://telegram.org/source/
Assuming you want to do a proper port and know C++ and Java, a full rewrite would be best. You can probably copy a lot of code from the Java source, but there's no way an automated converter or direct copy would ever work in C++.
Most of the processes in BlackBerry are the same as in Android, all you'd really need to do is rewrite all the UI code and handlers to fit the BlackBerry Native SDK
I am really new to the java & android apps development. Currently I'm doing a prototype application about the voice recognition. Which use the sphinx4 speech recognition. I'm really no idea that, is that Sphinx4 can be used on the android SDK?
Using Sphinx4.0 to build a speech recog. Android application (this shows that, it can't)
https://sourceforge.net/p/cmusphinx/discussion/sphinx4/thread/ce6ee093/ (But this said it can.)
if yes, i really no idea how to make use of the sphinx4, anyone can kindly provide the guide for me to complete the prototype?
Thanks for your kindly help.
It is possible to run Sphinx4 on android, however, you need to remove sphinx4 parts that use desktop-specific java api like java sound API. You still can have the core in place and demo should work as expected.
You need to reimplement Microphone class to use android API for sound input.
For more details see the discussion about that:
https://sourceforge.net/p/cmusphinx/mailman/message/31317160/
So it is some work and it requires coding skills. If you don't have that, use pocketsphinx instead like Opiatefuchs suggests you. It's well documented approach which requires minimum efforts.
I also tried to do some App with Pocketsphinx, not Sphinx4. I think this is really not designed for android, but maybe You could get it work. But for which reason? PocketSphinx is a good designed API for including in Android. I had mad some tutorial on my website for how to get the Pocketsphinx work, I advise to stop thinking about Sphinx4 because it would be a heavy coding thing to get it work. PocketSpinx has all You need...look at my Tutorial, this is a better way:
https://sites.google.com/site/opiatefuchs/home/pocketsphinxandroiddemo
Until now I stopped working on it, but when I got time, I will start to include Pocketsphix into an apk. But this tut only shows how to get the example demo work and set up Your runtime environment to work with Pocketsphinx.