开发者

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 becom开发者_如何学Goe 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜