Difference between revisions of "LAMW/pl"
(Copy of the en version) |
(tłumaczenie na j. polski / wstęp) |
||
Line 1: | Line 1: | ||
{{LanguageBar}} | {{LanguageBar}} | ||
− | {{Platform only|Android|Android|Android}} | + | {{Platform only|Android|Android|systemu Android}} |
− | {{Note| | + | {{Note|Ta strona pochodzi z poprzedniego samouczka HOW_TO_INSTALL_by_Dieselnutjob.pdf (dla Windows, obecnie plik wydaje się być niedostępny). Teraz jest to Wiki, możesz ją zaktualizować, jeśli jesteś pewien, że coś działa i/lub jest pomocne.}} |
− | '''LAMW''' | + | '''LAMW''' jest zestawem kreatorów Lazarusa, które uruchomisz z menu Buduj i Narzędzia. |
− | + | LAMW pomaga ustawić parametry, uporządkować biblioteki i uruchomić narzędzia wymagane do tworzenia plików APK, używanych do instalowania aplikacji na '''Androida'''. | |
− | + | Ta instalacja zawiera kilka pakietów zawierających komponenty przydatne do tworzenia programów na Androida za pomocą Lazarusa przy użyciu JNI. | |
− | == | + | == Jak zainstalować w systemie Linux == |
− | + | Zobacz [[LAMW on Linux|LAMW na Linuksie]] | |
− | == | + | == Jak zainstalować w systemie Windows == |
− | + | Działa w 64-bitowych systemach Windows 8 i 10 Home Edition. | |
− | === | + | ===Pliki do pobrania=== |
− | + | Utwórz foldery C:\lamw i C:\lamw\projects | |
− | + | Pobierz te pliki do folderu C:\lamw : | |
* [http://dl.google.com/android/android-sdk_r24.4.1-windows.zip SDK 24.4.1] | * [http://dl.google.com/android/android-sdk_r24.4.1-windows.zip SDK 24.4.1] | ||
* [http://dl.google.com/android/repository/android-ndk-r10e-windows-x86.zip NDK r10e] | * [http://dl.google.com/android/repository/android-ndk-r10e-windows-x86.zip NDK r10e] | ||
* [http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.6-bin.zip Ant 1.9.6] | * [http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.6-bin.zip Ant 1.9.6] | ||
* [http://download.oracle.com/otn-pub/java/jdk/8u65-b14/jdk-8u65-windows-i586.exe jdk-8u65-windows-i586.exe Jdk 8u65] | * [http://download.oracle.com/otn-pub/java/jdk/8u65-b14/jdk-8u65-windows-i586.exe jdk-8u65-windows-i586.exe Jdk 8u65] | ||
− | * [https://gradle.org/releases/ Gradle 4.4.1 | + | * [https://gradle.org/releases/ Gradle 4.4.1 wszystkie] |
* [https://sourceforge.net/projects/laz4android/files/laz4android1.5-50093-FPC3.1.1.7z/download Laz4Android 1.5-50093-FPC3.1.1] | * [https://sourceforge.net/projects/laz4android/files/laz4android1.5-50093-FPC3.1.1.7z/download Laz4Android 1.5-50093-FPC3.1.1] | ||
[[File:lamw_download.png]] | [[File:lamw_download.png]] | ||
− | ''' | + | '''Ważne informacje:''' |
− | + | Podane tutaj wersje obecnie działają, chociaż niektóre z nich są stare, a nawet ukryte przez ich twórcę/wydawcę. | |
− | + | Ale najnowsze stabilne wersje nie zawsze są kompatybilne z tym narzędziem (jak np. NDK). | |
− | + | Jeśli okaże się, że nowsza stabilna wersja działa dobrze, zaktualizuj Wiki. | |
− | + | Być może masz już zainstalowane zestawy na swoim komputerze. Może to prowadzić do problemów, jeśli spróbujesz je ponownie wykorzystać. Bezpieczniej jest pobierać nowe pliki w c:\lamw. Należy pamiętać, aby używać odpowiednich wersji i nie używać skrótów zainstalowanych wcześniej z innymi wersjami. | |
=== Get sources === | === Get sources === |
Revision as of 17:24, 29 October 2021
│ English (en) │ polski (pl) │ русский (ru) │
Ten artykuł odnosi się tylko do systemu Android.
Zobacz także: Przewodnik programowania wieloplatformowego
LAMW jest zestawem kreatorów Lazarusa, które uruchomisz z menu Buduj i Narzędzia.
LAMW pomaga ustawić parametry, uporządkować biblioteki i uruchomić narzędzia wymagane do tworzenia plików APK, używanych do instalowania aplikacji na Androida.
Ta instalacja zawiera kilka pakietów zawierających komponenty przydatne do tworzenia programów na Androida za pomocą Lazarusa przy użyciu JNI.
Jak zainstalować w systemie Linux
Zobacz LAMW na Linuksie
Jak zainstalować w systemie Windows
Działa w 64-bitowych systemach Windows 8 i 10 Home Edition.
Pliki do pobrania
Utwórz foldery C:\lamw i C:\lamw\projects
Pobierz te pliki do folderu C:\lamw :
- SDK 24.4.1
- NDK r10e
- Ant 1.9.6
- jdk-8u65-windows-i586.exe Jdk 8u65
- Gradle 4.4.1 wszystkie
- Laz4Android 1.5-50093-FPC3.1.1
Ważne informacje:
Podane tutaj wersje obecnie działają, chociaż niektóre z nich są stare, a nawet ukryte przez ich twórcę/wydawcę.
Ale najnowsze stabilne wersje nie zawsze są kompatybilne z tym narzędziem (jak np. NDK).
Jeśli okaże się, że nowsza stabilna wersja działa dobrze, zaktualizuj Wiki.
Być może masz już zainstalowane zestawy na swoim komputerze. Może to prowadzić do problemów, jeśli spróbujesz je ponownie wykorzystać. Bezpieczniej jest pobierać nowe pliki w c:\lamw. Należy pamiętać, aby używać odpowiednich wersji i nie używać skrótów zainstalowanych wcześniej z innymi wersjami.
Get sources
You must get LAMW sources using one of the 3 methods listed below. They contain the wizards and the 3 packages.
Checkout with a git client
We use here Git Gui, but you can use other easier tools like Tortoise GIT.
- create a folder C:\lamw\lazandroidmodulewizard
- click right on this folder
- click "GIT Gui here"
- click "Clone existing repository" and enter https://github.com/jmpessoa/lazandroidmodulewizard in the source location.
- select the folder C:\lamw\lazandroidmodulewizard
Checkout with a svn client
With Tortoise SVN
- https://github.com/jmpessoa/lazandroidmodulewizard to C:\lamw\lazandroidmodulewizard
Extract zip
An alternate method is to download this zip file in c:\lamw and to extract into the (default) folder C:\lamw\lazandroidmodulewizard
You will have to do this often, because there are often LAMW updates, and you will not have any source manager functionalities to check quickly updates or to be involved into the project.
Installations
Extract android-sdk_r24.4.1-windows.zip in c:\lamw\android-sdk-windows
Extract android-ndk-r10e-windows-x86.zip in c:\lamw\android-ndk-r10e-windows-x86
Extract apache-ant-1.9.6-bin.zip in c:\lamw\apache-ant-1.9.6
Extract laz4android1.5-50093-FPC3.1.1.7z to C:\lamw\Laz4Android
Execute jdk-8u65-windows-i586.exe . It will install the JDK to C:\Program Files (x86)\Java\jdk1.8.0_65\
Update Java development kits
run C:\lamw\android-sdk-windows\SDK Manager.exe
- deselect Android N (API 23 N Preview)
- deselect Android 6.0 (API 23)
- select Android SDK Platform-tools
- select Android SDK Build-tools
- select Extras/Android Support Library [if found...]
- select Extras/Google USB Driver
- click Install 4 packages [3 packages if Android Support Library not found]
- Accept license and click Install
- wait for downloads to finish
- Exit SDK Manager
Run C:\lamw\android-sdk-windows\SDK Manager.exe again
- deselect Android N (API 23 N Preview)
- deselect Android 6.0 (API 23)
- expand Android 4.2.2 (API 17)
- select SDK Platfrom
- select ARM EABI v7a System Image
- click Install 2 packages
- Accept license and click Install
- wait for downloads to finish
- Exit SDK manager
Build and prepare Laz4Android
Laz4Android is simply an instance of Lazarus.
From Windows, run cmd, then :
cd \lamw\Laz4Android build.bat
When finished, exit cmd mode
Create a shortcut on your desktop for C:\lamw\laz4android\startlazarus.exe
Execute it
Start IDE
Package -> Open package file (.lpk)
select C:\lamw\lazandroidmodulewizard\trunk\tfpandroidbridge_pack.lpk
Compile
Use>> Install
Do you want to rebuid Lazarus now? Yes
Laz4Android will restart
Package -> Open package file (.lpk)
select C:\lamw\lazandroidmodulewizard\trunk\lazandroidwizardpack.lpk
Compile
Use>> Install
Do you want to rebuid Lazarus now? Yes
Laz4Android will restart
Package -> Open package file (.lpk)
select C:\lamw\lazandroidmodulewizard\trunk\ide_tools\amw_ide_tools.lpk
Compile
Use>> Install
Do you want to rebuid Lazarus now? Yes
Laz4Android will restart
Path settings
In Laz4Android:
Tools -> [LAMW] Android Module Wizard -> Path settings
- Path to Java JDK: C:\Program Files (x86)\Java\jdk1.8.0_65
- Path to Ant bin: C:\lamw\apache-ant-1.9.6\bin
- Path to Android SDK: c:\lamw\android-sdk_r24.4.1-windows
- Path to Android Gradle: C:\lamw\gradle
- Path to Android NDK: C:\lamw\android-ndk-r10e
- NDK version: 10e
- Path to Simonsay's templates: C:\lamw\lazandroidmodulewizard\trunk\java
OK.
File -> Restart
Create your first project
In Laz4Android :
Project -> Close project [if necessary]
Project Wizard -> New project
Select JNI Android Module [Lamw GUI]
Click OK
- Path to Workspace [Projects Folder]: C:\lamw\projects
- New Project Name: LamwGUIProject1
- Default Package Name: org.lamw
- Include "android-support-v4.jar": no
- NDKPlatfom: 17
- MinSdkAPI: 17
- TargetSdkApi: 17
- Instruction: ARMv7a
- ARM Fpu: Soft
- Android Theme: DeviceDefault
Save unit1.pas
Click Save
Now, if you hover the mouse over any unit in uses clause, IDE will show an error message.
File -> Restart
After restart, if you hover the mouse over any unit in uses clause, IDE does not show error message anymore
Drag from Android Bridge a jButton onto form
Events OnClick, double click and add :
procedure TAndroidModule1.jButton1Click( Sender: TObject );
begin
ShowMessage('Hello World');
end;
File -> Save All
Run -> Build
Target: C:\lamw\projects\LamwGUIProject1\libs\armeabi\libcontrol.so: Success
Run -> [Lamw] Build APK and run
Building APK...: Success
if ADB is working with your phone, the APK will then be copied, installed and run automatically !
Otherwise, copy C:\lamw\projects\LamwGUIProject1\bin\LamwGUIProject1-debug.apk to some folder of the Android device, and install this file using the device file manager.
Other demos
In C:\lamw\trunk\demos\Eclipse, you will find a lot of projects to help you with the available functionalities.
You have to :
- Open the project file <project_name>/jni/controls.lpi
- Goto project options and change NDK paths according your installation
- Project, Options, LAMW Project configuration and check the Target SDK API which must be the same as installed above.
- Run, Build the project. As the "Hello World" above, it should copy, install and run the application on the Android device.
- Try it !
If you get the message "Application has stopped", it can be useful to goto Tools, [LAMW] Android Module Wizard, Upgrade Code templates
Select the directory containing examples and a project and click "OK".
Then build again, and it should work !