Convert Swift to Android

(William) #1

Can someone provide a screencast on how to convert swift to android because the tutorials confuse me. Thanks.

(marc hoffman) #2

we don’t currently have a screencast, but i’d be happy to assist you with any concrete questions.

(William) #3

Hi Marc
I don’t really understand how to make my swift files into java code. I want to turn my multiple files of swift to java, but I don’t really understand how to do that in Silver. Also, what do I do about my layout for my ios app that i built from Xcode? How can I add layout to silver if my Main.storyboard has no code?

(marc hoffman) #4


to be clear, Silver does not convert Swift code to Java (Language) code. it compiles Swift code for the Java platform. You’d still be writing using the Swift syntax, but you’d be coding for Android and you’re building Java (Platform) executables.

(i know rthis can get confusing, because “Java” is used both as a name for th language and for the platform).

You would write separate UI code for Android — probably using Android XML layout files, just as you would in Java.

Does that make sense?

(William) #5

Oh okay. This makes sense. But how will we use silver to submit apps to the Google Play Store?

(marc hoffman) #6

same as you would Java. zsilver compiler to an .apk file that you can submit.

(William) #7

So are you saying that when I save my file, it would already be an .apk file? I mean that If I just press the save button, would it then automatically be a .apk file on my computer or is it that when I first open a file on silver, it would already be an .apk file that you can put swift and xml code inside?

(marc hoffman) #8

if you build your Androiud project with Silver, the result will be a .apk, yes.

(William) #9

Hi Marc
In my swift code I connect to the Apple Server to display a route. I use the Map Kit and I use the MKDirections API to get route info. It uses Apple Maps to display the routes. Do you think that the android virtual device it a real android device can display it?

(William) #10

Or will Silver convert the MKDirection API into Android Map API to display map routes on Android devices?

(marc hoffman) #11

you’ll want/need to use Google’s map apis in Android, yes. Map!kt is not available there.

(William) #12

Okay. So what will I do about my Xcode project if I have UIButtons? How will my Android xml code be able to create a segue to my swift code, since in my Main.storyboard, I have created segues and added some custom classes to the view controllers.

(Alexeyporubay) #13

Hello everyone. I don`t like video tutorials about things like this. Screen shots and a little description is ideal form.

(Alex Black) #14

Maybe you have also some questions about porting iOs to Android. It requires significant design adaptation. Do not use design tools intended for iOS. There are some useful tips on this topic