chubakueno
chubakueno

Reputation: 565

Android/Windows hybrid application

i'm trying to see if I can do an "hybrid" application for windows and android, as a hacking(in the good sense) project. I was wondering if I could do a program so that I can copy'n paste it from windows to android.Is that possible? I was trying to make it with .jar files because they are used in both systems, but I didn´t have success.

My first clue here is that if I could separate Windows code and Android code in different parts, and an hybrid code launcher that decides wich one should be ran, it would be possible.

Upvotes: 1

Views: 170

Answers (2)

Raghav Sood
Raghav Sood

Reputation: 82563

While both may support .jar files, they are very different platforms. One of the major differences is that Android uses the Dalvik VM, while Windows uses the Java VM. Due to this, Android cannot run raw jar files. They must first be converted into the dex bytecode version.

Additionally, both platforms support the core Java classes to a different extent, and many Java classes available on Windows are not available on Android.

Beyond that, it is possible to move the logic code (or any code that doesn't use platform specific classes) into a library project which can then be included as a jar library in both the Android and windows projects.

Upvotes: 1

ksome
ksome

Reputation: 307

You can reuse a lot of the code you are writing. If you are using a MVC (Model, View, Control) you can resuse all the code from the model an control part and only exchange the view aspect in most cases (excluding system relevant code).

That said you will of course have to create two different projects an decide while you call the compiler which .jar file you will generate. For windows or for android.

Upvotes: 1

Related Questions