Delphi for Android v0.3 Tutorial - نسخه قابل چاپ +- Parsi Coders (http://parsicoders.com) +-- انجمن: Mobile (http://parsicoders.com/forumdisplay.php?fid=56) +--- انجمن: Programming Mobile (http://parsicoders.com/forumdisplay.php?fid=57) +--- موضوع: Delphi for Android v0.3 Tutorial (/showthread.php?tid=60) |
Delphi for Android v0.3 Tutorial - Amin_Mansouri - 04-24-2011 خبر خوب برای کاربران اندریود دیگه با زبان قدرتمند دلفی میشه برنامه نوشت برای گوشیهای با سیستم عامل اندریود متن زیر به زبان انگلیسی هست و دارم متن رو ترجمه میکنم و برای اولین فروم ایرانی این مطلب رو ارائه میکنم Delphi for Android v0.3 Tutorial Delphi Prism support iPhone and Android application development using Monotouch and MonoDroid where the goal of Delphi for Android ("Delphi Droid" for short) is to allow any developer that has Delphi 5 onwards to write Android applications. Requirements: The Android SDK together with the Java SDK and Ant. Ant get used to compile the Android application since DelphiDroid generate a standard Android project (similar to how you do it using Eclipse) Download DelphiDroid_v0.3.zip from the Google Code page. Off course you need Delphi 5.0 or later. .Net framework 3.5 run-time What is in the ZIP: Within the ZIP file you will find the following directories: bin: There is where the compiler etc are located. You can set this as your SYTEM VARIABLE to call from command line. DelphiDroid/DCCDroid: C# source code of the compile. This can be compiled using MS Visual Studio.Net 2008. DelphiDroid/Framework: The "Delphi For Android" package that all Delphi applications require. DelphiDTest: The Delphi example as in Sneak Preview 2 video. Test: The actual Android projected generated by the compiler from the DelphiDTest example. Setup Android SDK etc: I'm not going to explain how to setup the Android SDK, I assume you already have knowledge on how to install the SDK, set it up etc. Setup the compiler: Within the bin folder you will find DCCDroid.exe.config file, open this using a plain text editor like Notepad: Change the AndroidSDKDirectory to the location where you installed the Android SDK. Change DelphiBinFolder to the location of the Delphi BIN folder that contains the Delphi compiler etc. Run the sample program: Open DelphiDTest and make sure it compile and run successfully in Delphi. Run the compiler with no parameters: Open the MS DOS Command prompt and run: DCCDroid.exe The output: Delphi For Android 0.0.0.3 Dev Build Copyright © 2010 by Lennie De Villiers Invalid arguments, the following arguments are required: Project Name - Name of the project Activity Name - Name of the activity Package Name - Java package name Input Source Path - Delphi source directory path Android Output Path - Android output directory path So this is very basic command line parameters, i don't need to explain how they work. You can open compile.bat file under the bin folder for an example: dccdroid.exe DelphiAndroid DelphiAndroid com.test c:\Demo\DelphiDTest c:\Demo\Test copy C:\Demo\bin\Android.Framework\*.* C:\Demo\Test\src\com\Test cd c:\Demo\Test ant debug This will compile the example program (assuming the location like c:\Demo) , copy the Android libraries and compile the program. When all is done you can run the run.bat file: cd c:\Demo\Test\bin adb shell rm /data/app/com.test.apk adb -s emulator-5554 install DelphiAndroid-debug.apk This will install the sample on the Android emulator. You can look at compile.bat and run.bat to write your own compile/run scripts. What is done: Just like I said before, there is still ALOT of work to be done. Currently only the following components are supported: TEdit TLabel TButton References: Official Website: http:\\www.delphiforandroid.com |