English 中文(简体)
Converting a Delphi 5 engine control app to Android - need advice on the approach
原标题:

I have an app written in Delphi 5 that I want to convert to run on Android 2.x. The app is pretty simple; its used to upload/download configuration files to a separate microprocessor over a Modbus serial link. (It s an engine management chip for use in boosting horsepower in turbo-diesel engines). I haven t programmed since my Pascal days at uni so I am almost a complete beginner but willing to invest some time into this and I have the source code of course.

From the reading I have done so far, it appears that re-writing the app in Java seems to be the most common solution but also some suggest using Monodroid? What I would really appreciate is some definitive advice around what versions and tools I should put together to do this - eg do I install the Java SDK or do I look at Monodroid and just convert the existing code? The thing that I find most challenging is getting the right approach/environment setup - I m overwhelmed with information and choice here! Once I am sure that I have the right approach, I will then figure out the details as I go but there is nothing worse than spending hours and hours fiddling with one approach to then later learn it was wasted!

My objective here is to get the functionality of the existing code replicated as easily as possible in Android, not to replicate the look and feel perfectly and not to become an Android programming guru :)

Really appreciate any guidance on this...

Marcus

问题回答

There s one option you haven t mentioned on here. I don t know too much about it, and I think it s still under development so it might not be stable enough or full-featured enough for you yet, but have you looked into the Delphi For Android cross-compiler? If that works for you it would definitely be easier than translating everything into Java or a CLR language.

See this Stackoverflow question for a lists of other programming languages which can run on Dalvik (the Android VM):

Which programming languages can I use on Android Dalvik?

There is also the Android Native Development Kit (Android NDK) which allows developers to build Android software components with C and C++.

Even I m a Delphi fan, I believe that working with android needs Java. Android is based on Java, so you should go that way.Or, as mjustin said, use Scala. Everybody seems to be pleased by it.

Just my opinion.

best regards,

If you only plan on porting the application to Android then I d suggest just using Java, though if you plan on getting it on other platforms such as the iPhone and WP7, using Monodroid would be a good choice.

One thing that I wonder about is how will the device you are going to use communicate? Will it be over WiFi encapsulating the Modbus protocol, or will you have some device connected to it which gives you a serial connection? This might become your biggest problem as not all devices support USB host mode out of the box and might need to be flashed with other firmware.

have a look at this Discussion on the Embarcadero web site.

Also have a look at Alex Mogurenko Blog.. it shows you how to do it with the Free Pascal Compiler

You can easily port your Delphi application to Android using Lazarus/FreePascal.

Free Pascal is now able to produce code for the Java platform - so it might be feasible to create Delphi code which can be compiled to Java bytecode with FPC and then converted for the Dalvik VM.

The FPC backend for the Java Virtual Machine (JVM) generates Java byte code that conforms to the specifications of the JDK 1.5 (and later). While not all FPC language features work when targeting the JVM, most do (or will in the future) and we have done our best to introduce as few differences as possible.

This FPC JVM backend is not related to Project Cooper by RemObjects, nor does FPC now support the Oxygene language.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签