Does RoboVM convert swing java apps? - java

I have looked and I cant find the answer. Id like to know before i begin this project, but does RoboVM convert java directly to iOS aka objC? Does this work for both Java and Android? Does this also include java Swing? Im wondering if I can convert my java game directly to iOS. Thanks,

RoboVM converts what you have in Java into bytecode that will run on iOS.
You can't run Android-specific code (anything that has "android" in the import) on iOS, so you will have to add iOS methods that do similar things. Generally you create an Interface that asks the "native client" to do something, and then the Android or iOS code handles the request for the current native client.
Java Swing should work, although I have not tried it personally.

Related

Is there any way to use Swift for iOS as well as android development?

When having a finished iOS app, coded with Swift via Xcode, is there any way to use the code and in general the project file and kind of transfer it into Java, C or C++ code which that can be used to create an android app?
Learning an additional programming language, such as Java or C, "just" so I can publish two these two stores isn't hopefully the only solution to this kind of problem.
I´d appreciate any of your past experiences and ideas related to my problem.
You could have wrote it initially in React Native for example, or using Flutter or Xamarin or whatever framework you wanted to write once and then run on both iOS and Android.
If you want an app with GUI and not a simple HelloWorld, i don't think so, as far as I am aware there is no way to do it.
There is a possibility to COMPILE a Swift code on Android, of that I am sure, but to run an app out of the box without using some additional frameworks - nope.

Using existing Java code with React Native

I'm pretty new to React Native and mobile development in general. But I have a simple Java library with junit tests and I want to do one of two things:
1) I want to convert this Java code to be used naturally with React Native for development on iOS and Android.
2) I want to use this java code to be used only with Android in a native-hybrid application.
I probably have a few gaps in my understanding of how all this works. I understand that Java is native for Android, and therefore is only used for Android development. React native bridges the cross-platform gap to decompile react native code into platform specific code.
If I wanted to use my Java code for development on iOS, does that happen through Native Modules? Is it possible to do regardless?
If it is only to be used on Android (which is fine), is using the setup described in the Native Modules section on React Native's website the way to go?
Thanks!
As far as I know, You cannot directly deploy code written by java to both Android and IOS in react-native. You can do it only for Android specific parts in react-native. If you want to use it as IOS compatible, you need to write a native module from IOS natives.
If u want to deploy your native Android module you can follow this https://hackernoon.com/first-experiences-with-react-native-bridging-an-android-native-module-for-app-authentication-501fec247b2b detailed example
If u want to create both android and IOS native modules u can follow this https://medium.com/#FizzyInTheHall/writing-a-react-native-bridge-library-bce5b90ea6d0 example

c# classLibrary.dll to be used in android studio/ android app

This is kind of a general question but anyway:
In c# I have made a class library(api) which works on windows systems. I am now looking into making an api with the same functionalityies for android. One of the functionalityes (streming data from custom bluetuth device) needs to be written in java. So (in android studio) I have written a java class to do that, compiled a .jar and tested it in Unity as a plugin. But to avoid translating a ton of c# code into java I am now wondering if it is possible to somehow import a c# api into android studio and just call it's methods from java classes( as you can do in Unity's.Monobehaviour (AndroidJavaClass.Call("functionName", object[]parameters)) or maybe as you can do wit .jar-s code in VisualStudio(IVKM.Net. IVKM.NET))? To put it as plainly as possible: I would like to convert a api.dll to api.jar.
If you can suggest another alternative solution, please do so.
Thanks.
Havent tried, but will try hinting towards C++ support in Android with Native development Kit by converting C# to C++ code, as in .net all of your code is CLI code anyways, so it should be convertible to some barely readable C++ surogate code which should compile just fine.
https://www.quora.com/Can-we-use-C++-and-Java-together-in-Android-Studio
Hope this helps!

C# to Java for android

I am creating a program for android that will act as an email client. Problem is there is a specific type of protocol that doesn't work with Java, at least I haven't been able to find a way to get it to work. So, I have downloaded xamarin and am coding the methods in c# because this protocol is native to c#. My question is can I then somehow turn this c# code into a library or module that I can call from my java android app that will handle the methods that don't work in java using the c# code?
I think your best route (being an android application) would be to consume a c# api with your java code. Other options include passing serialized objects through xml or json and trying to get j# to work with java to allow your c# to pass through IL to J# and then have that sent through to java.

Exporting my android app to iphone?

Ive made an app on Android and I want to be able to sell the app for iphone and android. I dont want to have to learn objective C. Is there any possible way I can do this?
You have a lot of options but none of them are very nice. I know of no direct converter.
To reuse the majority of your code checkout RoboVM
http://www.robovm.com/
It is used by libgdx to allow for using Java to do cross platform development.
Pretty much all your other options as far as I have seen would involve using a proprietary language or recreating your app as HTML5.
In the end you will have to write some iOS code. At least now/soon you can use Swift instead of Objective-C =)

Categories