https://wiki.freepascal.org/api.php?action=feedcontributions&user=Kverde&feedformat=atom
Lazarus wiki - User contributions [en]
2024-03-29T15:40:45Z
User contributions
MediaWiki 1.35.6
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Android/ru&diff=55417
Custom Drawn Interface/Android/ru
2012-02-09T17:50:03Z
<p>Kverde: /* Configuring the Free Pascal Compiler for Android */</p>
<hr />
<div>{{Custom_Drawn_Interface/Android}}<br />
<br />
Вернуться к [[Custom Drawn Interface]]<br />
<br />
__TOC__<br />
<br />
== Архитектура ==<br />
<br />
LCL-CustomDrawn-Android utilizes a minimal Java application which communicates with our Pascal library and sends all events to it and also obeys commands from it. The communication is done via JNI as supported by Google. The controls are not native, instead they are all drawing using TRawImage+TLazIntfImage+TLazCanvas and events and the painting are clipped using LazRegions. The drawing itself is done in Pascal using jnigraphics to draw on a Bitmap Java object which is then drawn by the minimal Java activity on a SurfaceView.<br />
<br />
Our previous and short-lived attempt to write an LCL Interface for Android (LCL-Android) utilized a non-standard method of using native executables which communicated with a Java machine via Pipes. This method was abandoned because it was considered unsupported by Google. It is considered obsolete and people should use instead LCL-CustomDrawn-Android. This older interface was documented in [[Android Interface]].<br />
<br />
== Roadmap ==<br />
<br />
# <s>Build the set of [[Lazarus Custom Drawn Controls]]</s><br />
# <s>Initial bindings for the Android APIs</s><br />
# <s>Create an application to automatically generate the bindings</s><br />
# <s>Start the new widgetset</s><br />
# <s>Implement support for JNI</s><br />
# <s>Merge the Lazarus Custom Drawn Controls into the LCL and use them to implement all basic controls</s><br />
# <s>Add text support for Android</s><br />
# <s>Implement basic window client area scrolling</s><br />
# Add mobile emulator for desktop platforms<br />
# Improve the mobile scrolling<br />
# Add text support in X11<br />
# Add DPI awareness and adaptation in the LCL<br />
# Add non-native text support via pasfreetype<br />
<br />
==Использование Android SDK, эмулятора и телефона==<br />
<br />
[[Android Interface/Using the Android SDK, Emulator and Phones/ru]]<br />
<br />
==Программирование для Андроид==<br />
<br />
See [[Android Programming/ru]], also includes caracteristics of the various phones relevant for programming.<br />
<br />
==Настройка Free Pascal Compiler для Android==<br />
<br />
===Используйте готовый образ Virtual Box с FPC и Lazarus===<br />
<br />
Самый быстрый способ настройки Free Pascal и Lazarus для разработки под Андроид - просто исползовать заранее настроенный образ для виртуальной машини который уже содержит Mageia Linux 1, KDE, Lazarus 0.9.31, Subversion, Free Pascal для обоих Linux: x86-linux и arm-linux (targetting Android), Android SDK, Android NDK, Java, Ant, Gtk2, и все его разрабатываемые пакеты, GNU debugger (GDB) и все остальное необходимое для создания приложений для Андроид в Lazarus.<br />
<br />
Загрузить образ вртуальной машины: https://sourceforge.net/projects/p-tools/files/Lazarus_for_Android_VM_Image/snapshot_30_dez_2011/<br />
<br />
The virtual machine image is composed by two files: “Android Devel VM.vbox” and “Android Devel VM.hdd”. Both need to be located in the same folder and also note that the source forge download is a zipped file, so it needs to be unzipped. After unzipping the VM image has 5,2GB. To use this virtual machine one should install Virtual Box and then use it to open the .vbox file. Then one can already use this Linux virtual machine to build Android applications. The process of building an application involves first opening Lazarus and building the application in Lazarus, for example the example project available on ~/Programas/lazarus/example/androidlcl/ and then going into the Linux terminal, navigating to ~/Programas/lazarus/example/androidlcl/android and issuing the command “ant debug” which will generate the APK file in ~/Programas/ lazarus/example/androidlcl/android/bin/LCLExample-debug.apk. There are two users in the virtual machine: “root” and “pascaldev” and both of them use the password “root”.<br />
<br />
Note that the virtual machine contains the Lazarus source code from when it was created, but one can also use svn update to get the latest code. Note that this involves some risks, however, as the trunk version might ocasionally contain problems.<br />
<br />
===Как самому сделать компилятор в Windows?===<br />
<br />
'''Шаг 1''' -Установить Android SDK и NDK<br />
<br />
Загрузите с сайта Google и установите SDK и NDK для Windows.<br />
<br />
Проверьте путь к binutils в установленном NDK. Например для NDK r7 установленном в C:\Programas\android-ndk-r7\ путь будет такой: C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin<br />
<br />
Также проверьте путь к библиотекам NDK. Например, для NDK r7 установленном в C:\Programas\android-ndk-r7\ путь будут такой: C:\Programas\android-ndk-r7\platforms\android-8\arch-arm\usr<br />
<br />
'''Шаг 2''' - Скачайте FPC 2.5.1 от 19 января.<br />
Создайте каталог для хранения исзодного кода FPC и з<br />
Create a folder to store the FPC trunk source code and создайте рабочую копию ревизии 16790<br />
<br />
'''Шаг 3''' - Установите FPC 2.4.4<br />
<br />
Самый простой способ получить хороший FPC 2.4.4 это установить Lazarus 0.9.30.2. Для примера, предположим что вы установили эту версию в C:\Programas\lazarusfpc244<br />
<br />
'''Шаг 4''' - Create the build script and built it<br />
<br />
Create the output directory, for example: C:\Programas\fpcandroid\output<br />
<br />
Next create a file called build.bat in the fpc root folder, in our example C:\Programas\fpcandroid and copy to it:<br />
<br />
<pre><br />
SET PATH=C:\Programas\lazarusfpc244\fpc\2.4.4\bin\i386-win32\<br />
make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin OPT=-dFPC_ARMEL BINUTILSPREFIX=arm-linux-androideabi- INSTALL_PREFIX=C:\Programas\fpcandroid\output<br />
pause</pre><br />
<br />
Next run this batch script and you should have FPC installed into C:\Programas\fpcandroid\output<br />
<br />
'''Step 5''' - Copy some cross-binutils into the bin dir<br />
<br />
You now should have a FPC binary in C:\Programas\fpcandroid\output\bin\i386-win32<br />
<br />
Now get these 3 files:<br />
<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-as.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-ld.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-strip.exe<br />
<br />
And copy and then rename to have:<br />
<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-as.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-ld.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-strip.exe<br />
<br />
'''Step 6''' - Merge this into a Lazarus FPC setup<br />
<br />
Let's say you have the following Lazarus C:\Programas\lazarus31 with the following fpc installed inside it: C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32 and C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy C:\Programas\fpcandroid\output\units\arm-linux to C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy all .exe files from C:\Programas\fpcandroid\output\bin\i386-win32\ into C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32<br />
<br />
Now you can already build the example project androidlcltest.lpi using the Windows-Release build mode<br />
<br />
===Building the compiler yourself in Linux===<br />
<br />
See [[Setup_Cross_Compile_For_ARM]] and make sure to use the option OPT="-dFPC_ARMEL" for building the compiler.<br />
<br />
===Using the pre-compiled compiler in Linux===<br />
<br />
A pre-compiled compiler is provided for convenience for users. The following steps were tested in Mandriva Linux 2010.0 and 2010.1:<br />
<br />
'''Required Environment'''<br />
<br />
* The latest stable FPC installed in the system via the RPM / DEB / TAR package<br />
<br />
'''Step 1''' - Install the cross-binutils<br />
<br />
For Mandriva Linux the RPM package containing arm-linux-as, arm-linux-ld, etc, which are the cross-binutils can be found here: http://rpm.pbone.net/index.php3/stat/4/idpl/14252825/dir/mandriva_2010/com/cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm.html<br />
<br />
Just download the RPM package and install it using: <br />
<br />
rpm -ivh cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
In Mandriva Linux 2010.0 the dependencies won't match, as the package is for 2010.1, but one can simply ignore this problem and it works fine using --nodeps:<br />
<br />
rpm -ivh --nodeps cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
For other distributions use the corresponding package, or else read the instructions for building the cross-binutils yourself at [[Setup_Cross_Compile_For_ARM]]<br />
<br />
'''Step 2''' - Configure the cross-binutils<br />
<br />
The assembler needs a parameter to tell it which ARM ABI to use. A choice which works good is EABI-5, which is compatible with all Android devices available as of Jan 2011. To set this, we will rename the original assembler and substitute it with a shell script which passes the desired parameter. These commands will do it:<br />
<br />
su<br />
mv /usr/bin/arm-linux-as /usr/bin/arm-linux-as_org<br />
gedit /usr/bin/arm-linux-as<br />
<br />
Now paste into the editor this code:<br />
<br />
#!/bin/sh<br />
/usr/bin/arm-linux-as_org -meabi=5 $@<br />
<br />
And don't forget to then make it executable:<br />
<br />
chmod 755 /usr/bin/arm-linux-as<br />
<br />
'''Step 3''' - Install the Free Pascal Cross-Compiler<br />
<br />
At this point the pre-compiled FPC can be download from here: http://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
<br />
Then use these commands to install the pre-compiled Free Pascal cross-compiler into /usr:<br />
<br />
[felipe@localhost Programas]$ ls -l<br />
total 20664<br />
-rw-rw-r-- 1 felipe felipe 17098552 2010-10-25 08:17 fpc-2.5.1.arm-linux.tar.gz<br />
[felipe@localhost Programas]$ su<br />
Password: <br />
[root@localhost Programas]# cp fpc-2.5.1.arm-linux.tar.gz /usr/<br />
[root@localhost Programas]# cd /usr/<br />
[root@localhost usr]# tar -xvf fpc-2.5.1.arm-linux.tar.gz <br />
[root@localhost usr]# ln -s /usr/lib/fpc/2.5.1/ppcrossarm /usr/bin/ppcrossarm<br />
<br />
'''Step 4''' - Verify if your Cross-Compiler works<br />
<br />
If you made no errors in the previous steps, it should work, so try to call it like this:<br />
<br />
[felipe@localhost Programas]$ /usr/bin/ppcrossarm<br />
<br />
If this command works and fpc shows its options, then you configured the cross-compiler correctly, if not, then try to find out if your symbolic link points to a correct location with this command:<br />
<br />
[felipe@localhost Programas]$ ls -ls /usr/bin/ppc*<br />
<br />
Now we are ready to compile Android applications using the Lazarus IDE! Configuring the fpc.cfg file isn't necessary, the old compiler will automatically find the new compiler and it's object files.<br />
<br />
==Compiling the example LCL Android Application==<br />
<br />
'''Step 1 - Download the source code'''<br />
<br />
The source code of the example is located inside the Lazarus sources in lazarus/examples/androidlcl/androidlcltest.lpi<br />
<br />
'''Step 2 - Build the project using the Lazarus IDE'''<br />
<br />
Configuring Lazarus itself to use the new compiler should not normally be necessary because fpc should be able to find the symlink created, but if you have trouble in this part you can try to hard code the compiler path to use the new crosscompiler. To hardcode the compiler path in cause of trouble go to the menu "Tools->Options" and change the "Compiler Path" to "/usr/bin/ppcrossarm"<br />
<br />
But it is necessary to configure the LPI file to build the example. Open the Project Options dialog of the androidlcltest.lpi project and go to the section Paths and change the libraries path to reflect the correct paths of where your Android NDK was installed and where your jnigraphics.so, libc.so, etc, libraries are located for your target Android API level. For LCL-CustomDrawn-Android API level 8 is the best choice, because it supports Android 2.2+ like the LCL. The image bellow shows where to configure this:<br />
<br />
[[Image:Configure_androidlcl_libraries.jpg]]<br />
<br />
'''Step 3 - Build the APK'''<br />
<br />
Before going to the command line to build the APK open the file lazarus/examples/androidlcl/android/local.properties and change it to reflect your Android SDK path. The file says you should not modify it, but ignore that and modify it anyway. Here is how the file looks like:<br />
<br />
<pre><br />
# This file is automatically generated by Android Tools.<br />
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!<br />
# <br />
# This file must *NOT* be checked in Version Control Systems,<br />
# as it contains information specific to your local configuration.<br />
<br />
# location of the SDK. This is only used by Ant<br />
# For customization when using a Version Control System, please read the<br />
# header note.<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
</pre><br />
<br />
After configuring that one, go to the command line and issue these commands:<br />
<br />
cd lazarus/examples/androidlcl/android<br />
ant debug<br />
<br />
The APK will be located in lazarus/examples/androidlcl/android/bin<br />
<br />
'''Step 4 - Install the APK in your phone and run it'''<br />
<br />
You can install via ADB or by copying the file to the sdcard. You should see this:<br />
<br />
[[Image:Custom_drawn_android_test1.png]]<br />
<br />
== How to create an LCL Android Application==<br />
<br />
To create a new LCL-CustomDrawn-Android application simply copy all of the file structure and build and java files from the example project called "androidlcl". This example can be obtained from the Lazarus source tree in lazarus/examples/androidlcl<br />
<br />
Then you will need to modify the build files to change them to your new project name and your new Java package name.<br />
<br />
===Step 1 - Creating the LPI===<br />
<br />
You need a separate LPI at the moment for the Android version of the application but all the rest of the code can be shared. Create it using the template for a "Library" and then adapt the code from the example located in the lazarus source code in lazarus/examples/androidlcl<br />
<br />
You need to adapt the exported JNI method names to your Android Package Name.<br />
<br />
===Step 2 - Building the library===<br />
<br />
First of all, build the Pascal executable without debug information. This debug information is not so useful in Android and makes the executable much bigger. Open the menu Project->Project Options and set the build mode, widgetset, architecture and operating system targets, as shown in these screenshots:<br />
<br />
[[Image:Android_project_options_1.png]]<br />
<br />
[[Image:Android_project_options_2.png]]<br />
<br />
[[Image:Android_project_options_3.png]]<br />
<br />
===Step 3 - Create the Android project structure===<br />
<br />
Besides the LCL project building, such as configuring a proper LPI and having a library main project file, one also needs to add all of the android project structure. Simply copy from the example project in lazarus/examples/androidlcl and adapt it to the new project. Things to change are the path to the SDK, the package name. The package name needs to be updated in the build files, in the directory structure android/src/packagename, in the activity java source code and also in the main library pascal source in the exports section.<br />
<br />
===Building an LCL Android application with debug info===<br />
<br />
It is useful to add another Android build mode which has debug info. Use all of the same options as shown above, except for the debug information:<br />
<br />
[[Image:Android_project_options_4.png]]<br />
<br />
==Oh no! My LCL Android application doesn't work==<br />
<br />
There are various reasons why the app may not work. The most important thing to do when an app doesn't work is to open the logcat and see what the log says. This can be done by running this command line command:<br />
<br />
./adb logcat<br />
<br />
And then test one of the hipotesis in the next subsections.<br />
<br />
===The Pascal executable was compiled for a wrong architecture, operating system and/or widgetset===<br />
<br />
This is the leading cause of executables not running. Always verify that you compiled the program to the "android" widgetset, "linux" operating system and "arm" architecture. This is done by going into the menu Project->Project Options. Then set these in the dialog all options as explained in this section:<br />
<br />
[[How_to_build_an_LCL_Android_application]]<br />
<br />
To check if you library is arm-linux or not, execute the following commands:<br />
<br />
cd libs/armeabi<br />
ls -l<br />
file liblclapp.so<br />
ldd liblclapp.so<br />
<br />
If it mentions anything like 80386 or gtk, then your program was compiled for linux-x86 and gtk2, not for Android like it should.<br />
<br />
===My Pascal application crashed. How to get a stacktrace?===<br />
<br />
If a Pascal application crashes you should use the command "adb logcat" to obtain the stack<br />
<br />
===The indispensable build options===<br />
<br />
*-Xd This build option is indispensable when cross-compiling from x86-linux to Android or else FPC will try to link the application against for example /usr/lib/libc.so instead of the libc.so in the NDK, even if you specify a -Fl library path<br />
*-CpARMV6 This build option is indispensable because code generated for older ARM versions is unsupported by Android and might crash in some devices. See http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
*-dAndroid in the package LCLBase.lpk<br />
*-Parm -Tlinux for the process and target operating system<br />
*-Fl should contain the path to the NDK directory with the target link shared object, such as libc.so, liblog.so, libjni.so, etc<br />
<br />
==Free Pascal Bugs on Android Support==<br />
<br />
The following summarizes the state of Android Support in Free Pascal:<br />
<br />
*The pre-compiled snapshot for x86-linux -> Android is known to work very well and it was built on 19th January 2011: https://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
*On February this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=16981 introduced this bug: http://mantis.freepascal.org/view.php?id=18833<br />
*In the end of 2011 this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=19036 broke linking Android projects<br />
<br />
We are in contact with FPC developers to fix the situation as can be seen in: http://mantis.freepascal.org/view.php?id=20726<br />
<br />
==Development Notes==<br />
<br />
===The misterious JNI Crash===<br />
<br />
See the thread: http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
<br />
The problem was that vm^^.GetEnv would crash in HTC Wildfire, Alcatel and in the emulator with SIGILL but not in Xperia Mini, HTC Desire HD, Motorola Atrix and other smartphones.<br />
<br />
The answer was that one needs to specify -CpARMV6 when building because older instructions might fail in some devices<br />
<br />
===NDK Libraries available in Android 2.2 (API level 8)===<br />
<br />
LCL-CustomDrawn targets Android 2.2+ and in this API level the following libraries are supported by the NDK:<br />
<br />
#libc.so<br />
#libdl.so (linker)<br />
#OpenGL ES 1<br />
#OpenGL ES 2<br />
#libjnigraphics.so<br />
#liblog.so<br />
#libm.so<br />
#libz.so<br />
#libthread_db.so<br />
#libstdc++.so<br />
<br />
LCL-CustomDrawn-Android uses libjnigraphics.so and liblog.so at the moment.<br />
<br />
===Native text drawing===<br />
<br />
Native text drawing is a bit convoluted in Android and the documentation is quite bad too. Some gotchas already found:<br />
<br />
* It draws text starting on a Y coordinate which represents the baseline, which is the bottom of strings like "abc", but not the bottom of strings like "qg". See http://code.google.com/p/android/issues/detail?id=393<br />
* There is no documentation about what the size in Paint.setTextSize represents. Some people say it is pixels, but to me it looks something else because it seams to differ across devices.<br />
<br />
But there are also good things about it:<br />
<br />
* It can draw on a transparent bitmap and use alpha transparency to implement anti-aliasing and subpixel rendering. The text gets quite beaultiful.<br />
* It can draw on the ARGB 32-bits non-premultiplied format which is a pretty good one<br />
<br />
===Flood of garbage collector messages when the caret is visible===<br />
<br />
Something like this:<br />
<br />
<pre><br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 188 objects / 6664 bytes in 94ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 170 objects / 6160 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5904 bytes in 82ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5856 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5872 bytes in 80ms<br />
D/dalvikvm( 2825): GC_EXPLICIT freed 371 objects / 18480 bytes in 91ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 81ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 83ms<br />
</pre><br />
<br />
In my investigation this happens probably because the TCDEdit will request a full control invalidate on each timer tick, which currently will main a full form invalidate, so the GC needs to collect the bitmaps and other paint objects when painting that often. <br />
<br />
===Why the caret of a TEdit keeps blinking after clicking on the form===<br />
<br />
When clicking on the form the LCL focus will refuse to move from the Edit to the Form because this behavior seams to be hard coded in the LCL, although maybe we might change this for Android. So even while we set focus into the form, the LCL refuses to do that and keeps its focus in the Edit, thus we have a focus missmatch. This might eventually be fixed in the future.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Android/ru&diff=55408
Custom Drawn Interface/Android/ru
2012-02-09T11:27:24Z
<p>Kverde: /* Использование Android SDK, эмулятора и телефона */</p>
<hr />
<div>{{Custom_Drawn_Interface/Android}}<br />
<br />
Вернуться к [[Custom Drawn Interface]]<br />
<br />
__TOC__<br />
<br />
== Архитектура ==<br />
<br />
LCL-CustomDrawn-Android utilizes a minimal Java application which communicates with our Pascal library and sends all events to it and also obeys commands from it. The communication is done via JNI as supported by Google. The controls are not native, instead they are all drawing using TRawImage+TLazIntfImage+TLazCanvas and events and the painting are clipped using LazRegions. The drawing itself is done in Pascal using jnigraphics to draw on a Bitmap Java object which is then drawn by the minimal Java activity on a SurfaceView.<br />
<br />
Our previous and short-lived attempt to write an LCL Interface for Android (LCL-Android) utilized a non-standard method of using native executables which communicated with a Java machine via Pipes. This method was abandoned because it was considered unsupported by Google. It is considered obsolete and people should use instead LCL-CustomDrawn-Android. This older interface was documented in [[Android Interface]].<br />
<br />
== Roadmap ==<br />
<br />
# <s>Build the set of [[Lazarus Custom Drawn Controls]]</s><br />
# <s>Initial bindings for the Android APIs</s><br />
# <s>Create an application to automatically generate the bindings</s><br />
# <s>Start the new widgetset</s><br />
# <s>Implement support for JNI</s><br />
# <s>Merge the Lazarus Custom Drawn Controls into the LCL and use them to implement all basic controls</s><br />
# <s>Add text support for Android</s><br />
# <s>Implement basic window client area scrolling</s><br />
# Add mobile emulator for desktop platforms<br />
# Improve the mobile scrolling<br />
# Add text support in X11<br />
# Add DPI awareness and adaptation in the LCL<br />
# Add non-native text support via pasfreetype<br />
<br />
==Использование Android SDK, эмулятора и телефона==<br />
<br />
[[Android Interface/Using the Android SDK, Emulator and Phones/ru]]<br />
<br />
==Программирование для Андроид==<br />
<br />
See [[Android Programming/ru]], also includes caracteristics of the various phones relevant for programming.<br />
<br />
==Configuring the Free Pascal Compiler for Android==<br />
<br />
===Use the ready Virtual Box Image with FPC and Lazarus===<br />
<br />
The fastest way to configure Free Pascal and Lazarus for Android development is simply using a pre-configured virtual machine image which already includes Mageia Linux 1, KDE, Lazarus 0.9.31, Subversion, Free Pascal for both x86-linux and arm-linux (targetting Android), the Android SDK, the Android NDK, Java, Ant, Gtk2 and all it's development packages, the GNU debugger (GDB), subversion and everything else necessary for building Android applications with Lazarus.<br />
<br />
The download like for the virtual machine image is: https://sourceforge.net/projects/p-tools/files/Lazarus_for_Android_VM_Image/snapshot_30_dez_2011/<br />
<br />
The virtual machine image is composed by two files: “Android Devel VM.vbox” and “Android Devel VM.hdd”. Both need to be located in the same folder and also note that the source forge download is a zipped file, so it needs to be unzipped. After unzipping the VM image has 5,2GB. To use this virtual machine one should install Virtual Box and then use it to open the .vbox file. Then one can already use this Linux virtual machine to build Android applications. The process of building an application involves first opening Lazarus and building the application in Lazarus, for example the example project available on ~/Programas/lazarus/example/androidlcl/ and then going into the Linux terminal, navigating to ~/Programas/lazarus/example/androidlcl/android and issuing the command “ant debug” which will generate the APK file in ~/Programas/ lazarus/example/androidlcl/android/bin/LCLExample-debug.apk. There are two users in the virtual machine: “root” and “pascaldev” and both of them use the password “root”.<br />
<br />
Note that the virtual machine contains the Lazarus source code from when it was created, but one can also use svn update to get the latest code. Note that this involves some risks, however, as the trunk version might ocasionally contain problems.<br />
<br />
===Building the compiler yourself in Windows===<br />
<br />
'''Step 1''' - Install the Android SDK and NDK<br />
<br />
Download from Google and install both the SDK and the NDK for Windows.<br />
<br />
Check your path to the binutils installed by the NDK. For example, for NDK r7 installed in C:\Programas\android-ndk-r7\ the path is C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin<br />
<br />
Also check your path to the libraries installed by the NDK. For example, for NDK r7 installed in C:\Programas\android-ndk-r7\ the path is C:\Programas\android-ndk-r7\platforms\android-8\arch-arm\usr<br />
<br />
'''Step 2''' - Download FPC 2.5.1 from January 19th<br />
<br />
Create a folder to store the FPC trunk source code and checkout revision 16790<br />
<br />
'''Step 3''' - Install FPC 2.4.4<br />
<br />
An easy way to obtain a good FPC 2.4.4 is installing Lazarus 0.9.30.2. For example, let's say you install this Lazarus version in C:\Programas\lazarusfpc244<br />
<br />
'''Step 4''' - Create the build script and built it<br />
<br />
Create the output directory, for example: C:\Programas\fpcandroid\output<br />
<br />
Next create a file called build.bat in the fpc root folder, in our example C:\Programas\fpcandroid and copy to it:<br />
<br />
<pre><br />
SET PATH=C:\Programas\lazarusfpc244\fpc\2.4.4\bin\i386-win32\<br />
make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin OPT=-dFPC_ARMEL BINUTILSPREFIX=arm-linux-androideabi- INSTALL_PREFIX=C:\Programas\fpcandroid\output<br />
pause</pre><br />
<br />
Next run this batch script and you should have FPC installed into C:\Programas\fpcandroid\output<br />
<br />
'''Step 5''' - Copy some cross-binutils into the bin dir<br />
<br />
You now should have a FPC binary in C:\Programas\fpcandroid\output\bin\i386-win32<br />
<br />
Now get these 3 files:<br />
<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-as.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-ld.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-strip.exe<br />
<br />
And copy and then rename to have:<br />
<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-as.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-ld.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-strip.exe<br />
<br />
'''Step 6''' - Merge this into a Lazarus FPC setup<br />
<br />
Let's say you have the following Lazarus C:\Programas\lazarus31 with the following fpc installed inside it: C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32 and C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy C:\Programas\fpcandroid\output\units\arm-linux to C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy all .exe files from C:\Programas\fpcandroid\output\bin\i386-win32\ into C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32<br />
<br />
Now you can already build the example project androidlcltest.lpi using the Windows-Release build mode<br />
<br />
===Building the compiler yourself in Linux===<br />
<br />
See [[Setup_Cross_Compile_For_ARM]] and make sure to use the option OPT="-dFPC_ARMEL" for building the compiler.<br />
<br />
===Using the pre-compiled compiler in Linux===<br />
<br />
A pre-compiled compiler is provided for convenience for users. The following steps were tested in Mandriva Linux 2010.0 and 2010.1:<br />
<br />
'''Required Environment'''<br />
<br />
* The latest stable FPC installed in the system via the RPM / DEB / TAR package<br />
<br />
'''Step 1''' - Install the cross-binutils<br />
<br />
For Mandriva Linux the RPM package containing arm-linux-as, arm-linux-ld, etc, which are the cross-binutils can be found here: http://rpm.pbone.net/index.php3/stat/4/idpl/14252825/dir/mandriva_2010/com/cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm.html<br />
<br />
Just download the RPM package and install it using: <br />
<br />
rpm -ivh cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
In Mandriva Linux 2010.0 the dependencies won't match, as the package is for 2010.1, but one can simply ignore this problem and it works fine using --nodeps:<br />
<br />
rpm -ivh --nodeps cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
For other distributions use the corresponding package, or else read the instructions for building the cross-binutils yourself at [[Setup_Cross_Compile_For_ARM]]<br />
<br />
'''Step 2''' - Configure the cross-binutils<br />
<br />
The assembler needs a parameter to tell it which ARM ABI to use. A choice which works good is EABI-5, which is compatible with all Android devices available as of Jan 2011. To set this, we will rename the original assembler and substitute it with a shell script which passes the desired parameter. These commands will do it:<br />
<br />
su<br />
mv /usr/bin/arm-linux-as /usr/bin/arm-linux-as_org<br />
gedit /usr/bin/arm-linux-as<br />
<br />
Now paste into the editor this code:<br />
<br />
#!/bin/sh<br />
/usr/bin/arm-linux-as_org -meabi=5 $@<br />
<br />
And don't forget to then make it executable:<br />
<br />
chmod 755 /usr/bin/arm-linux-as<br />
<br />
'''Step 3''' - Install the Free Pascal Cross-Compiler<br />
<br />
At this point the pre-compiled FPC can be download from here: http://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
<br />
Then use these commands to install the pre-compiled Free Pascal cross-compiler into /usr:<br />
<br />
[felipe@localhost Programas]$ ls -l<br />
total 20664<br />
-rw-rw-r-- 1 felipe felipe 17098552 2010-10-25 08:17 fpc-2.5.1.arm-linux.tar.gz<br />
[felipe@localhost Programas]$ su<br />
Password: <br />
[root@localhost Programas]# cp fpc-2.5.1.arm-linux.tar.gz /usr/<br />
[root@localhost Programas]# cd /usr/<br />
[root@localhost usr]# tar -xvf fpc-2.5.1.arm-linux.tar.gz <br />
[root@localhost usr]# ln -s /usr/lib/fpc/2.5.1/ppcrossarm /usr/bin/ppcrossarm<br />
<br />
'''Step 4''' - Verify if your Cross-Compiler works<br />
<br />
If you made no errors in the previous steps, it should work, so try to call it like this:<br />
<br />
[felipe@localhost Programas]$ /usr/bin/ppcrossarm<br />
<br />
If this command works and fpc shows its options, then you configured the cross-compiler correctly, if not, then try to find out if your symbolic link points to a correct location with this command:<br />
<br />
[felipe@localhost Programas]$ ls -ls /usr/bin/ppc*<br />
<br />
Now we are ready to compile Android applications using the Lazarus IDE! Configuring the fpc.cfg file isn't necessary, the old compiler will automatically find the new compiler and it's object files.<br />
<br />
==Compiling the example LCL Android Application==<br />
<br />
'''Step 1 - Download the source code'''<br />
<br />
The source code of the example is located inside the Lazarus sources in lazarus/examples/androidlcl/androidlcltest.lpi<br />
<br />
'''Step 2 - Build the project using the Lazarus IDE'''<br />
<br />
Configuring Lazarus itself to use the new compiler should not normally be necessary because fpc should be able to find the symlink created, but if you have trouble in this part you can try to hard code the compiler path to use the new crosscompiler. To hardcode the compiler path in cause of trouble go to the menu "Tools->Options" and change the "Compiler Path" to "/usr/bin/ppcrossarm"<br />
<br />
But it is necessary to configure the LPI file to build the example. Open the Project Options dialog of the androidlcltest.lpi project and go to the section Paths and change the libraries path to reflect the correct paths of where your Android NDK was installed and where your jnigraphics.so, libc.so, etc, libraries are located for your target Android API level. For LCL-CustomDrawn-Android API level 8 is the best choice, because it supports Android 2.2+ like the LCL. The image bellow shows where to configure this:<br />
<br />
[[Image:Configure_androidlcl_libraries.jpg]]<br />
<br />
'''Step 3 - Build the APK'''<br />
<br />
Before going to the command line to build the APK open the file lazarus/examples/androidlcl/android/local.properties and change it to reflect your Android SDK path. The file says you should not modify it, but ignore that and modify it anyway. Here is how the file looks like:<br />
<br />
<pre><br />
# This file is automatically generated by Android Tools.<br />
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!<br />
# <br />
# This file must *NOT* be checked in Version Control Systems,<br />
# as it contains information specific to your local configuration.<br />
<br />
# location of the SDK. This is only used by Ant<br />
# For customization when using a Version Control System, please read the<br />
# header note.<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
</pre><br />
<br />
After configuring that one, go to the command line and issue these commands:<br />
<br />
cd lazarus/examples/androidlcl/android<br />
ant debug<br />
<br />
The APK will be located in lazarus/examples/androidlcl/android/bin<br />
<br />
'''Step 4 - Install the APK in your phone and run it'''<br />
<br />
You can install via ADB or by copying the file to the sdcard. You should see this:<br />
<br />
[[Image:Custom_drawn_android_test1.png]]<br />
<br />
== How to create an LCL Android Application==<br />
<br />
To create a new LCL-CustomDrawn-Android application simply copy all of the file structure and build and java files from the example project called "androidlcl". This example can be obtained from the Lazarus source tree in lazarus/examples/androidlcl<br />
<br />
Then you will need to modify the build files to change them to your new project name and your new Java package name.<br />
<br />
===Step 1 - Creating the LPI===<br />
<br />
You need a separate LPI at the moment for the Android version of the application but all the rest of the code can be shared. Create it using the template for a "Library" and then adapt the code from the example located in the lazarus source code in lazarus/examples/androidlcl<br />
<br />
You need to adapt the exported JNI method names to your Android Package Name.<br />
<br />
===Step 2 - Building the library===<br />
<br />
First of all, build the Pascal executable without debug information. This debug information is not so useful in Android and makes the executable much bigger. Open the menu Project->Project Options and set the build mode, widgetset, architecture and operating system targets, as shown in these screenshots:<br />
<br />
[[Image:Android_project_options_1.png]]<br />
<br />
[[Image:Android_project_options_2.png]]<br />
<br />
[[Image:Android_project_options_3.png]]<br />
<br />
===Step 3 - Create the Android project structure===<br />
<br />
Besides the LCL project building, such as configuring a proper LPI and having a library main project file, one also needs to add all of the android project structure. Simply copy from the example project in lazarus/examples/androidlcl and adapt it to the new project. Things to change are the path to the SDK, the package name. The package name needs to be updated in the build files, in the directory structure android/src/packagename, in the activity java source code and also in the main library pascal source in the exports section.<br />
<br />
===Building an LCL Android application with debug info===<br />
<br />
It is useful to add another Android build mode which has debug info. Use all of the same options as shown above, except for the debug information:<br />
<br />
[[Image:Android_project_options_4.png]]<br />
<br />
==Oh no! My LCL Android application doesn't work==<br />
<br />
There are various reasons why the app may not work. The most important thing to do when an app doesn't work is to open the logcat and see what the log says. This can be done by running this command line command:<br />
<br />
./adb logcat<br />
<br />
And then test one of the hipotesis in the next subsections.<br />
<br />
===The Pascal executable was compiled for a wrong architecture, operating system and/or widgetset===<br />
<br />
This is the leading cause of executables not running. Always verify that you compiled the program to the "android" widgetset, "linux" operating system and "arm" architecture. This is done by going into the menu Project->Project Options. Then set these in the dialog all options as explained in this section:<br />
<br />
[[How_to_build_an_LCL_Android_application]]<br />
<br />
To check if you library is arm-linux or not, execute the following commands:<br />
<br />
cd libs/armeabi<br />
ls -l<br />
file liblclapp.so<br />
ldd liblclapp.so<br />
<br />
If it mentions anything like 80386 or gtk, then your program was compiled for linux-x86 and gtk2, not for Android like it should.<br />
<br />
===My Pascal application crashed. How to get a stacktrace?===<br />
<br />
If a Pascal application crashes you should use the command "adb logcat" to obtain the stack<br />
<br />
===The indispensable build options===<br />
<br />
*-Xd This build option is indispensable when cross-compiling from x86-linux to Android or else FPC will try to link the application against for example /usr/lib/libc.so instead of the libc.so in the NDK, even if you specify a -Fl library path<br />
*-CpARMV6 This build option is indispensable because code generated for older ARM versions is unsupported by Android and might crash in some devices. See http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
*-dAndroid in the package LCLBase.lpk<br />
*-Parm -Tlinux for the process and target operating system<br />
*-Fl should contain the path to the NDK directory with the target link shared object, such as libc.so, liblog.so, libjni.so, etc<br />
<br />
==Free Pascal Bugs on Android Support==<br />
<br />
The following summarizes the state of Android Support in Free Pascal:<br />
<br />
*The pre-compiled snapshot for x86-linux -> Android is known to work very well and it was built on 19th January 2011: https://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
*On February this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=16981 introduced this bug: http://mantis.freepascal.org/view.php?id=18833<br />
*In the end of 2011 this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=19036 broke linking Android projects<br />
<br />
We are in contact with FPC developers to fix the situation as can be seen in: http://mantis.freepascal.org/view.php?id=20726<br />
<br />
==Development Notes==<br />
<br />
===The misterious JNI Crash===<br />
<br />
See the thread: http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
<br />
The problem was that vm^^.GetEnv would crash in HTC Wildfire, Alcatel and in the emulator with SIGILL but not in Xperia Mini, HTC Desire HD, Motorola Atrix and other smartphones.<br />
<br />
The answer was that one needs to specify -CpARMV6 when building because older instructions might fail in some devices<br />
<br />
===NDK Libraries available in Android 2.2 (API level 8)===<br />
<br />
LCL-CustomDrawn targets Android 2.2+ and in this API level the following libraries are supported by the NDK:<br />
<br />
#libc.so<br />
#libdl.so (linker)<br />
#OpenGL ES 1<br />
#OpenGL ES 2<br />
#libjnigraphics.so<br />
#liblog.so<br />
#libm.so<br />
#libz.so<br />
#libthread_db.so<br />
#libstdc++.so<br />
<br />
LCL-CustomDrawn-Android uses libjnigraphics.so and liblog.so at the moment.<br />
<br />
===Native text drawing===<br />
<br />
Native text drawing is a bit convoluted in Android and the documentation is quite bad too. Some gotchas already found:<br />
<br />
* It draws text starting on a Y coordinate which represents the baseline, which is the bottom of strings like "abc", but not the bottom of strings like "qg". See http://code.google.com/p/android/issues/detail?id=393<br />
* There is no documentation about what the size in Paint.setTextSize represents. Some people say it is pixels, but to me it looks something else because it seams to differ across devices.<br />
<br />
But there are also good things about it:<br />
<br />
* It can draw on a transparent bitmap and use alpha transparency to implement anti-aliasing and subpixel rendering. The text gets quite beaultiful.<br />
* It can draw on the ARGB 32-bits non-premultiplied format which is a pretty good one<br />
<br />
===Flood of garbage collector messages when the caret is visible===<br />
<br />
Something like this:<br />
<br />
<pre><br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 188 objects / 6664 bytes in 94ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 170 objects / 6160 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5904 bytes in 82ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5856 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5872 bytes in 80ms<br />
D/dalvikvm( 2825): GC_EXPLICIT freed 371 objects / 18480 bytes in 91ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 81ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 83ms<br />
</pre><br />
<br />
In my investigation this happens probably because the TCDEdit will request a full control invalidate on each timer tick, which currently will main a full form invalidate, so the GC needs to collect the bitmaps and other paint objects when painting that often. <br />
<br />
===Why the caret of a TEdit keeps blinking after clicking on the form===<br />
<br />
When clicking on the form the LCL focus will refuse to move from the Edit to the Form because this behavior seams to be hard coded in the LCL, although maybe we might change this for Android. So even while we set focus into the form, the LCL refuses to do that and keeps its focus in the Edit, thus we have a focus missmatch. This might eventually be fixed in the future.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Android/ru&diff=55407
Custom Drawn Interface/Android/ru
2012-02-09T11:24:27Z
<p>Kverde: </p>
<hr />
<div>{{Custom_Drawn_Interface/Android}}<br />
<br />
Вернуться к [[Custom Drawn Interface]]<br />
<br />
__TOC__<br />
<br />
== Архитектура ==<br />
<br />
LCL-CustomDrawn-Android utilizes a minimal Java application which communicates with our Pascal library and sends all events to it and also obeys commands from it. The communication is done via JNI as supported by Google. The controls are not native, instead they are all drawing using TRawImage+TLazIntfImage+TLazCanvas and events and the painting are clipped using LazRegions. The drawing itself is done in Pascal using jnigraphics to draw on a Bitmap Java object which is then drawn by the minimal Java activity on a SurfaceView.<br />
<br />
Our previous and short-lived attempt to write an LCL Interface for Android (LCL-Android) utilized a non-standard method of using native executables which communicated with a Java machine via Pipes. This method was abandoned because it was considered unsupported by Google. It is considered obsolete and people should use instead LCL-CustomDrawn-Android. This older interface was documented in [[Android Interface]].<br />
<br />
== Roadmap ==<br />
<br />
# <s>Build the set of [[Lazarus Custom Drawn Controls]]</s><br />
# <s>Initial bindings for the Android APIs</s><br />
# <s>Create an application to automatically generate the bindings</s><br />
# <s>Start the new widgetset</s><br />
# <s>Implement support for JNI</s><br />
# <s>Merge the Lazarus Custom Drawn Controls into the LCL and use them to implement all basic controls</s><br />
# <s>Add text support for Android</s><br />
# <s>Implement basic window client area scrolling</s><br />
# Add mobile emulator for desktop platforms<br />
# Improve the mobile scrolling<br />
# Add text support in X11<br />
# Add DPI awareness and adaptation in the LCL<br />
# Add non-native text support via pasfreetype<br />
<br />
==Использование Android SDK, эмулятора и телефона==<br />
<br />
[[Custom Drawn Interface/Using the Android SDK, Emulator and Phones/ru]]<br />
<br />
==Программирование для Андроид==<br />
<br />
See [[Android Programming/ru]], also includes caracteristics of the various phones relevant for programming.<br />
<br />
==Configuring the Free Pascal Compiler for Android==<br />
<br />
===Use the ready Virtual Box Image with FPC and Lazarus===<br />
<br />
The fastest way to configure Free Pascal and Lazarus for Android development is simply using a pre-configured virtual machine image which already includes Mageia Linux 1, KDE, Lazarus 0.9.31, Subversion, Free Pascal for both x86-linux and arm-linux (targetting Android), the Android SDK, the Android NDK, Java, Ant, Gtk2 and all it's development packages, the GNU debugger (GDB), subversion and everything else necessary for building Android applications with Lazarus.<br />
<br />
The download like for the virtual machine image is: https://sourceforge.net/projects/p-tools/files/Lazarus_for_Android_VM_Image/snapshot_30_dez_2011/<br />
<br />
The virtual machine image is composed by two files: “Android Devel VM.vbox” and “Android Devel VM.hdd”. Both need to be located in the same folder and also note that the source forge download is a zipped file, so it needs to be unzipped. After unzipping the VM image has 5,2GB. To use this virtual machine one should install Virtual Box and then use it to open the .vbox file. Then one can already use this Linux virtual machine to build Android applications. The process of building an application involves first opening Lazarus and building the application in Lazarus, for example the example project available on ~/Programas/lazarus/example/androidlcl/ and then going into the Linux terminal, navigating to ~/Programas/lazarus/example/androidlcl/android and issuing the command “ant debug” which will generate the APK file in ~/Programas/ lazarus/example/androidlcl/android/bin/LCLExample-debug.apk. There are two users in the virtual machine: “root” and “pascaldev” and both of them use the password “root”.<br />
<br />
Note that the virtual machine contains the Lazarus source code from when it was created, but one can also use svn update to get the latest code. Note that this involves some risks, however, as the trunk version might ocasionally contain problems.<br />
<br />
===Building the compiler yourself in Windows===<br />
<br />
'''Step 1''' - Install the Android SDK and NDK<br />
<br />
Download from Google and install both the SDK and the NDK for Windows.<br />
<br />
Check your path to the binutils installed by the NDK. For example, for NDK r7 installed in C:\Programas\android-ndk-r7\ the path is C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin<br />
<br />
Also check your path to the libraries installed by the NDK. For example, for NDK r7 installed in C:\Programas\android-ndk-r7\ the path is C:\Programas\android-ndk-r7\platforms\android-8\arch-arm\usr<br />
<br />
'''Step 2''' - Download FPC 2.5.1 from January 19th<br />
<br />
Create a folder to store the FPC trunk source code and checkout revision 16790<br />
<br />
'''Step 3''' - Install FPC 2.4.4<br />
<br />
An easy way to obtain a good FPC 2.4.4 is installing Lazarus 0.9.30.2. For example, let's say you install this Lazarus version in C:\Programas\lazarusfpc244<br />
<br />
'''Step 4''' - Create the build script and built it<br />
<br />
Create the output directory, for example: C:\Programas\fpcandroid\output<br />
<br />
Next create a file called build.bat in the fpc root folder, in our example C:\Programas\fpcandroid and copy to it:<br />
<br />
<pre><br />
SET PATH=C:\Programas\lazarusfpc244\fpc\2.4.4\bin\i386-win32\<br />
make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin OPT=-dFPC_ARMEL BINUTILSPREFIX=arm-linux-androideabi- INSTALL_PREFIX=C:\Programas\fpcandroid\output<br />
pause</pre><br />
<br />
Next run this batch script and you should have FPC installed into C:\Programas\fpcandroid\output<br />
<br />
'''Step 5''' - Copy some cross-binutils into the bin dir<br />
<br />
You now should have a FPC binary in C:\Programas\fpcandroid\output\bin\i386-win32<br />
<br />
Now get these 3 files:<br />
<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-as.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-ld.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-strip.exe<br />
<br />
And copy and then rename to have:<br />
<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-as.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-ld.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-strip.exe<br />
<br />
'''Step 6''' - Merge this into a Lazarus FPC setup<br />
<br />
Let's say you have the following Lazarus C:\Programas\lazarus31 with the following fpc installed inside it: C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32 and C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy C:\Programas\fpcandroid\output\units\arm-linux to C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy all .exe files from C:\Programas\fpcandroid\output\bin\i386-win32\ into C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32<br />
<br />
Now you can already build the example project androidlcltest.lpi using the Windows-Release build mode<br />
<br />
===Building the compiler yourself in Linux===<br />
<br />
See [[Setup_Cross_Compile_For_ARM]] and make sure to use the option OPT="-dFPC_ARMEL" for building the compiler.<br />
<br />
===Using the pre-compiled compiler in Linux===<br />
<br />
A pre-compiled compiler is provided for convenience for users. The following steps were tested in Mandriva Linux 2010.0 and 2010.1:<br />
<br />
'''Required Environment'''<br />
<br />
* The latest stable FPC installed in the system via the RPM / DEB / TAR package<br />
<br />
'''Step 1''' - Install the cross-binutils<br />
<br />
For Mandriva Linux the RPM package containing arm-linux-as, arm-linux-ld, etc, which are the cross-binutils can be found here: http://rpm.pbone.net/index.php3/stat/4/idpl/14252825/dir/mandriva_2010/com/cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm.html<br />
<br />
Just download the RPM package and install it using: <br />
<br />
rpm -ivh cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
In Mandriva Linux 2010.0 the dependencies won't match, as the package is for 2010.1, but one can simply ignore this problem and it works fine using --nodeps:<br />
<br />
rpm -ivh --nodeps cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
For other distributions use the corresponding package, or else read the instructions for building the cross-binutils yourself at [[Setup_Cross_Compile_For_ARM]]<br />
<br />
'''Step 2''' - Configure the cross-binutils<br />
<br />
The assembler needs a parameter to tell it which ARM ABI to use. A choice which works good is EABI-5, which is compatible with all Android devices available as of Jan 2011. To set this, we will rename the original assembler and substitute it with a shell script which passes the desired parameter. These commands will do it:<br />
<br />
su<br />
mv /usr/bin/arm-linux-as /usr/bin/arm-linux-as_org<br />
gedit /usr/bin/arm-linux-as<br />
<br />
Now paste into the editor this code:<br />
<br />
#!/bin/sh<br />
/usr/bin/arm-linux-as_org -meabi=5 $@<br />
<br />
And don't forget to then make it executable:<br />
<br />
chmod 755 /usr/bin/arm-linux-as<br />
<br />
'''Step 3''' - Install the Free Pascal Cross-Compiler<br />
<br />
At this point the pre-compiled FPC can be download from here: http://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
<br />
Then use these commands to install the pre-compiled Free Pascal cross-compiler into /usr:<br />
<br />
[felipe@localhost Programas]$ ls -l<br />
total 20664<br />
-rw-rw-r-- 1 felipe felipe 17098552 2010-10-25 08:17 fpc-2.5.1.arm-linux.tar.gz<br />
[felipe@localhost Programas]$ su<br />
Password: <br />
[root@localhost Programas]# cp fpc-2.5.1.arm-linux.tar.gz /usr/<br />
[root@localhost Programas]# cd /usr/<br />
[root@localhost usr]# tar -xvf fpc-2.5.1.arm-linux.tar.gz <br />
[root@localhost usr]# ln -s /usr/lib/fpc/2.5.1/ppcrossarm /usr/bin/ppcrossarm<br />
<br />
'''Step 4''' - Verify if your Cross-Compiler works<br />
<br />
If you made no errors in the previous steps, it should work, so try to call it like this:<br />
<br />
[felipe@localhost Programas]$ /usr/bin/ppcrossarm<br />
<br />
If this command works and fpc shows its options, then you configured the cross-compiler correctly, if not, then try to find out if your symbolic link points to a correct location with this command:<br />
<br />
[felipe@localhost Programas]$ ls -ls /usr/bin/ppc*<br />
<br />
Now we are ready to compile Android applications using the Lazarus IDE! Configuring the fpc.cfg file isn't necessary, the old compiler will automatically find the new compiler and it's object files.<br />
<br />
==Compiling the example LCL Android Application==<br />
<br />
'''Step 1 - Download the source code'''<br />
<br />
The source code of the example is located inside the Lazarus sources in lazarus/examples/androidlcl/androidlcltest.lpi<br />
<br />
'''Step 2 - Build the project using the Lazarus IDE'''<br />
<br />
Configuring Lazarus itself to use the new compiler should not normally be necessary because fpc should be able to find the symlink created, but if you have trouble in this part you can try to hard code the compiler path to use the new crosscompiler. To hardcode the compiler path in cause of trouble go to the menu "Tools->Options" and change the "Compiler Path" to "/usr/bin/ppcrossarm"<br />
<br />
But it is necessary to configure the LPI file to build the example. Open the Project Options dialog of the androidlcltest.lpi project and go to the section Paths and change the libraries path to reflect the correct paths of where your Android NDK was installed and where your jnigraphics.so, libc.so, etc, libraries are located for your target Android API level. For LCL-CustomDrawn-Android API level 8 is the best choice, because it supports Android 2.2+ like the LCL. The image bellow shows where to configure this:<br />
<br />
[[Image:Configure_androidlcl_libraries.jpg]]<br />
<br />
'''Step 3 - Build the APK'''<br />
<br />
Before going to the command line to build the APK open the file lazarus/examples/androidlcl/android/local.properties and change it to reflect your Android SDK path. The file says you should not modify it, but ignore that and modify it anyway. Here is how the file looks like:<br />
<br />
<pre><br />
# This file is automatically generated by Android Tools.<br />
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!<br />
# <br />
# This file must *NOT* be checked in Version Control Systems,<br />
# as it contains information specific to your local configuration.<br />
<br />
# location of the SDK. This is only used by Ant<br />
# For customization when using a Version Control System, please read the<br />
# header note.<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
</pre><br />
<br />
After configuring that one, go to the command line and issue these commands:<br />
<br />
cd lazarus/examples/androidlcl/android<br />
ant debug<br />
<br />
The APK will be located in lazarus/examples/androidlcl/android/bin<br />
<br />
'''Step 4 - Install the APK in your phone and run it'''<br />
<br />
You can install via ADB or by copying the file to the sdcard. You should see this:<br />
<br />
[[Image:Custom_drawn_android_test1.png]]<br />
<br />
== How to create an LCL Android Application==<br />
<br />
To create a new LCL-CustomDrawn-Android application simply copy all of the file structure and build and java files from the example project called "androidlcl". This example can be obtained from the Lazarus source tree in lazarus/examples/androidlcl<br />
<br />
Then you will need to modify the build files to change them to your new project name and your new Java package name.<br />
<br />
===Step 1 - Creating the LPI===<br />
<br />
You need a separate LPI at the moment for the Android version of the application but all the rest of the code can be shared. Create it using the template for a "Library" and then adapt the code from the example located in the lazarus source code in lazarus/examples/androidlcl<br />
<br />
You need to adapt the exported JNI method names to your Android Package Name.<br />
<br />
===Step 2 - Building the library===<br />
<br />
First of all, build the Pascal executable without debug information. This debug information is not so useful in Android and makes the executable much bigger. Open the menu Project->Project Options and set the build mode, widgetset, architecture and operating system targets, as shown in these screenshots:<br />
<br />
[[Image:Android_project_options_1.png]]<br />
<br />
[[Image:Android_project_options_2.png]]<br />
<br />
[[Image:Android_project_options_3.png]]<br />
<br />
===Step 3 - Create the Android project structure===<br />
<br />
Besides the LCL project building, such as configuring a proper LPI and having a library main project file, one also needs to add all of the android project structure. Simply copy from the example project in lazarus/examples/androidlcl and adapt it to the new project. Things to change are the path to the SDK, the package name. The package name needs to be updated in the build files, in the directory structure android/src/packagename, in the activity java source code and also in the main library pascal source in the exports section.<br />
<br />
===Building an LCL Android application with debug info===<br />
<br />
It is useful to add another Android build mode which has debug info. Use all of the same options as shown above, except for the debug information:<br />
<br />
[[Image:Android_project_options_4.png]]<br />
<br />
==Oh no! My LCL Android application doesn't work==<br />
<br />
There are various reasons why the app may not work. The most important thing to do when an app doesn't work is to open the logcat and see what the log says. This can be done by running this command line command:<br />
<br />
./adb logcat<br />
<br />
And then test one of the hipotesis in the next subsections.<br />
<br />
===The Pascal executable was compiled for a wrong architecture, operating system and/or widgetset===<br />
<br />
This is the leading cause of executables not running. Always verify that you compiled the program to the "android" widgetset, "linux" operating system and "arm" architecture. This is done by going into the menu Project->Project Options. Then set these in the dialog all options as explained in this section:<br />
<br />
[[How_to_build_an_LCL_Android_application]]<br />
<br />
To check if you library is arm-linux or not, execute the following commands:<br />
<br />
cd libs/armeabi<br />
ls -l<br />
file liblclapp.so<br />
ldd liblclapp.so<br />
<br />
If it mentions anything like 80386 or gtk, then your program was compiled for linux-x86 and gtk2, not for Android like it should.<br />
<br />
===My Pascal application crashed. How to get a stacktrace?===<br />
<br />
If a Pascal application crashes you should use the command "adb logcat" to obtain the stack<br />
<br />
===The indispensable build options===<br />
<br />
*-Xd This build option is indispensable when cross-compiling from x86-linux to Android or else FPC will try to link the application against for example /usr/lib/libc.so instead of the libc.so in the NDK, even if you specify a -Fl library path<br />
*-CpARMV6 This build option is indispensable because code generated for older ARM versions is unsupported by Android and might crash in some devices. See http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
*-dAndroid in the package LCLBase.lpk<br />
*-Parm -Tlinux for the process and target operating system<br />
*-Fl should contain the path to the NDK directory with the target link shared object, such as libc.so, liblog.so, libjni.so, etc<br />
<br />
==Free Pascal Bugs on Android Support==<br />
<br />
The following summarizes the state of Android Support in Free Pascal:<br />
<br />
*The pre-compiled snapshot for x86-linux -> Android is known to work very well and it was built on 19th January 2011: https://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
*On February this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=16981 introduced this bug: http://mantis.freepascal.org/view.php?id=18833<br />
*In the end of 2011 this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=19036 broke linking Android projects<br />
<br />
We are in contact with FPC developers to fix the situation as can be seen in: http://mantis.freepascal.org/view.php?id=20726<br />
<br />
==Development Notes==<br />
<br />
===The misterious JNI Crash===<br />
<br />
See the thread: http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
<br />
The problem was that vm^^.GetEnv would crash in HTC Wildfire, Alcatel and in the emulator with SIGILL but not in Xperia Mini, HTC Desire HD, Motorola Atrix and other smartphones.<br />
<br />
The answer was that one needs to specify -CpARMV6 when building because older instructions might fail in some devices<br />
<br />
===NDK Libraries available in Android 2.2 (API level 8)===<br />
<br />
LCL-CustomDrawn targets Android 2.2+ and in this API level the following libraries are supported by the NDK:<br />
<br />
#libc.so<br />
#libdl.so (linker)<br />
#OpenGL ES 1<br />
#OpenGL ES 2<br />
#libjnigraphics.so<br />
#liblog.so<br />
#libm.so<br />
#libz.so<br />
#libthread_db.so<br />
#libstdc++.so<br />
<br />
LCL-CustomDrawn-Android uses libjnigraphics.so and liblog.so at the moment.<br />
<br />
===Native text drawing===<br />
<br />
Native text drawing is a bit convoluted in Android and the documentation is quite bad too. Some gotchas already found:<br />
<br />
* It draws text starting on a Y coordinate which represents the baseline, which is the bottom of strings like "abc", but not the bottom of strings like "qg". See http://code.google.com/p/android/issues/detail?id=393<br />
* There is no documentation about what the size in Paint.setTextSize represents. Some people say it is pixels, but to me it looks something else because it seams to differ across devices.<br />
<br />
But there are also good things about it:<br />
<br />
* It can draw on a transparent bitmap and use alpha transparency to implement anti-aliasing and subpixel rendering. The text gets quite beaultiful.<br />
* It can draw on the ARGB 32-bits non-premultiplied format which is a pretty good one<br />
<br />
===Flood of garbage collector messages when the caret is visible===<br />
<br />
Something like this:<br />
<br />
<pre><br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 188 objects / 6664 bytes in 94ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 170 objects / 6160 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5904 bytes in 82ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5856 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5872 bytes in 80ms<br />
D/dalvikvm( 2825): GC_EXPLICIT freed 371 objects / 18480 bytes in 91ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 81ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 83ms<br />
</pre><br />
<br />
In my investigation this happens probably because the TCDEdit will request a full control invalidate on each timer tick, which currently will main a full form invalidate, so the GC needs to collect the bitmaps and other paint objects when painting that often. <br />
<br />
===Why the caret of a TEdit keeps blinking after clicking on the form===<br />
<br />
When clicking on the form the LCL focus will refuse to move from the Edit to the Form because this behavior seams to be hard coded in the LCL, although maybe we might change this for Android. So even while we set focus into the form, the LCL refuses to do that and keeps its focus in the Edit, thus we have a focus missmatch. This might eventually be fixed in the future.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Android/ru&diff=55404
Custom Drawn Interface/Android/ru
2012-02-09T10:31:15Z
<p>Kverde: New page: {{Custom_Drawn_Interface/Android}} Go back to Custom Drawn Interface __TOC__ == Architecture== LCL-CustomDrawn-Android utilizes a minimal Java application which communicates with o...</p>
<hr />
<div>{{Custom_Drawn_Interface/Android}}<br />
<br />
Go back to [[Custom Drawn Interface]]<br />
<br />
__TOC__<br />
<br />
== Architecture==<br />
<br />
LCL-CustomDrawn-Android utilizes a minimal Java application which communicates with our Pascal library and sends all events to it and also obeys commands from it. The communication is done via JNI as supported by Google. The controls are not native, instead they are all drawing using TRawImage+TLazIntfImage+TLazCanvas and events and the painting are clipped using LazRegions. The drawing itself is done in Pascal using jnigraphics to draw on a Bitmap Java object which is then drawn by the minimal Java activity on a SurfaceView.<br />
<br />
Our previous and short-lived attempt to write an LCL Interface for Android (LCL-Android) utilized a non-standard method of using native executables which communicated with a Java machine via Pipes. This method was abandoned because it was considered unsupported by Google. It is considered obsolete and people should use instead LCL-CustomDrawn-Android. This older interface was documented in [[Android Interface]].<br />
<br />
== Roadmap ==<br />
<br />
# <s>Build the set of [[Lazarus Custom Drawn Controls]]</s><br />
# <s>Initial bindings for the Android APIs</s><br />
# <s>Create an application to automatically generate the bindings</s><br />
# <s>Start the new widgetset</s><br />
# <s>Implement support for JNI</s><br />
# <s>Merge the Lazarus Custom Drawn Controls into the LCL and use them to implement all basic controls</s><br />
# <s>Add text support for Android</s><br />
# <s>Implement basic window client area scrolling</s><br />
# Add mobile emulator for desktop platforms<br />
# Improve the mobile scrolling<br />
# Add text support in X11<br />
# Add DPI awareness and adaptation in the LCL<br />
# Add non-native text support via pasfreetype<br />
<br />
==Using the Android SDK, Emulator and Phones==<br />
<br />
[[Custom Drawn Interface/Using the Android SDK, Emulator and Phones]]<br />
<br />
==Android Programming==<br />
<br />
See [[Android Programming]], also includes caracteristics of the various phones relevant for programming.<br />
<br />
==Configuring the Free Pascal Compiler for Android==<br />
<br />
===Use the ready Virtual Box Image with FPC and Lazarus===<br />
<br />
The fastest way to configure Free Pascal and Lazarus for Android development is simply using a pre-configured virtual machine image which already includes Mageia Linux 1, KDE, Lazarus 0.9.31, Subversion, Free Pascal for both x86-linux and arm-linux (targetting Android), the Android SDK, the Android NDK, Java, Ant, Gtk2 and all it's development packages, the GNU debugger (GDB), subversion and everything else necessary for building Android applications with Lazarus.<br />
<br />
The download like for the virtual machine image is: https://sourceforge.net/projects/p-tools/files/Lazarus_for_Android_VM_Image/snapshot_30_dez_2011/<br />
<br />
The virtual machine image is composed by two files: “Android Devel VM.vbox” and “Android Devel VM.hdd”. Both need to be located in the same folder and also note that the source forge download is a zipped file, so it needs to be unzipped. After unzipping the VM image has 5,2GB. To use this virtual machine one should install Virtual Box and then use it to open the .vbox file. Then one can already use this Linux virtual machine to build Android applications. The process of building an application involves first opening Lazarus and building the application in Lazarus, for example the example project available on ~/Programas/lazarus/example/androidlcl/ and then going into the Linux terminal, navigating to ~/Programas/lazarus/example/androidlcl/android and issuing the command “ant debug” which will generate the APK file in ~/Programas/ lazarus/example/androidlcl/android/bin/LCLExample-debug.apk. There are two users in the virtual machine: “root” and “pascaldev” and both of them use the password “root”.<br />
<br />
Note that the virtual machine contains the Lazarus source code from when it was created, but one can also use svn update to get the latest code. Note that this involves some risks, however, as the trunk version might ocasionally contain problems.<br />
<br />
===Building the compiler yourself in Windows===<br />
<br />
'''Step 1''' - Install the Android SDK and NDK<br />
<br />
Download from Google and install both the SDK and the NDK for Windows.<br />
<br />
Check your path to the binutils installed by the NDK. For example, for NDK r7 installed in C:\Programas\android-ndk-r7\ the path is C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin<br />
<br />
Also check your path to the libraries installed by the NDK. For example, for NDK r7 installed in C:\Programas\android-ndk-r7\ the path is C:\Programas\android-ndk-r7\platforms\android-8\arch-arm\usr<br />
<br />
'''Step 2''' - Download FPC 2.5.1 from January 19th<br />
<br />
Create a folder to store the FPC trunk source code and checkout revision 16790<br />
<br />
'''Step 3''' - Install FPC 2.4.4<br />
<br />
An easy way to obtain a good FPC 2.4.4 is installing Lazarus 0.9.30.2. For example, let's say you install this Lazarus version in C:\Programas\lazarusfpc244<br />
<br />
'''Step 4''' - Create the build script and built it<br />
<br />
Create the output directory, for example: C:\Programas\fpcandroid\output<br />
<br />
Next create a file called build.bat in the fpc root folder, in our example C:\Programas\fpcandroid and copy to it:<br />
<br />
<pre><br />
SET PATH=C:\Programas\lazarusfpc244\fpc\2.4.4\bin\i386-win32\<br />
make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin OPT=-dFPC_ARMEL BINUTILSPREFIX=arm-linux-androideabi- INSTALL_PREFIX=C:\Programas\fpcandroid\output<br />
pause</pre><br />
<br />
Next run this batch script and you should have FPC installed into C:\Programas\fpcandroid\output<br />
<br />
'''Step 5''' - Copy some cross-binutils into the bin dir<br />
<br />
You now should have a FPC binary in C:\Programas\fpcandroid\output\bin\i386-win32<br />
<br />
Now get these 3 files:<br />
<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-as.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-ld.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-strip.exe<br />
<br />
And copy and then rename to have:<br />
<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-as.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-ld.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-strip.exe<br />
<br />
'''Step 6''' - Merge this into a Lazarus FPC setup<br />
<br />
Let's say you have the following Lazarus C:\Programas\lazarus31 with the following fpc installed inside it: C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32 and C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy C:\Programas\fpcandroid\output\units\arm-linux to C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy all .exe files from C:\Programas\fpcandroid\output\bin\i386-win32\ into C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32<br />
<br />
Now you can already build the example project androidlcltest.lpi using the Windows-Release build mode<br />
<br />
===Building the compiler yourself in Linux===<br />
<br />
See [[Setup_Cross_Compile_For_ARM]] and make sure to use the option OPT="-dFPC_ARMEL" for building the compiler.<br />
<br />
===Using the pre-compiled compiler in Linux===<br />
<br />
A pre-compiled compiler is provided for convenience for users. The following steps were tested in Mandriva Linux 2010.0 and 2010.1:<br />
<br />
'''Required Environment'''<br />
<br />
* The latest stable FPC installed in the system via the RPM / DEB / TAR package<br />
<br />
'''Step 1''' - Install the cross-binutils<br />
<br />
For Mandriva Linux the RPM package containing arm-linux-as, arm-linux-ld, etc, which are the cross-binutils can be found here: http://rpm.pbone.net/index.php3/stat/4/idpl/14252825/dir/mandriva_2010/com/cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm.html<br />
<br />
Just download the RPM package and install it using: <br />
<br />
rpm -ivh cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
In Mandriva Linux 2010.0 the dependencies won't match, as the package is for 2010.1, but one can simply ignore this problem and it works fine using --nodeps:<br />
<br />
rpm -ivh --nodeps cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
For other distributions use the corresponding package, or else read the instructions for building the cross-binutils yourself at [[Setup_Cross_Compile_For_ARM]]<br />
<br />
'''Step 2''' - Configure the cross-binutils<br />
<br />
The assembler needs a parameter to tell it which ARM ABI to use. A choice which works good is EABI-5, which is compatible with all Android devices available as of Jan 2011. To set this, we will rename the original assembler and substitute it with a shell script which passes the desired parameter. These commands will do it:<br />
<br />
su<br />
mv /usr/bin/arm-linux-as /usr/bin/arm-linux-as_org<br />
gedit /usr/bin/arm-linux-as<br />
<br />
Now paste into the editor this code:<br />
<br />
#!/bin/sh<br />
/usr/bin/arm-linux-as_org -meabi=5 $@<br />
<br />
And don't forget to then make it executable:<br />
<br />
chmod 755 /usr/bin/arm-linux-as<br />
<br />
'''Step 3''' - Install the Free Pascal Cross-Compiler<br />
<br />
At this point the pre-compiled FPC can be download from here: http://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
<br />
Then use these commands to install the pre-compiled Free Pascal cross-compiler into /usr:<br />
<br />
[felipe@localhost Programas]$ ls -l<br />
total 20664<br />
-rw-rw-r-- 1 felipe felipe 17098552 2010-10-25 08:17 fpc-2.5.1.arm-linux.tar.gz<br />
[felipe@localhost Programas]$ su<br />
Password: <br />
[root@localhost Programas]# cp fpc-2.5.1.arm-linux.tar.gz /usr/<br />
[root@localhost Programas]# cd /usr/<br />
[root@localhost usr]# tar -xvf fpc-2.5.1.arm-linux.tar.gz <br />
[root@localhost usr]# ln -s /usr/lib/fpc/2.5.1/ppcrossarm /usr/bin/ppcrossarm<br />
<br />
'''Step 4''' - Verify if your Cross-Compiler works<br />
<br />
If you made no errors in the previous steps, it should work, so try to call it like this:<br />
<br />
[felipe@localhost Programas]$ /usr/bin/ppcrossarm<br />
<br />
If this command works and fpc shows its options, then you configured the cross-compiler correctly, if not, then try to find out if your symbolic link points to a correct location with this command:<br />
<br />
[felipe@localhost Programas]$ ls -ls /usr/bin/ppc*<br />
<br />
Now we are ready to compile Android applications using the Lazarus IDE! Configuring the fpc.cfg file isn't necessary, the old compiler will automatically find the new compiler and it's object files.<br />
<br />
==Compiling the example LCL Android Application==<br />
<br />
'''Step 1 - Download the source code'''<br />
<br />
The source code of the example is located inside the Lazarus sources in lazarus/examples/androidlcl/androidlcltest.lpi<br />
<br />
'''Step 2 - Build the project using the Lazarus IDE'''<br />
<br />
Configuring Lazarus itself to use the new compiler should not normally be necessary because fpc should be able to find the symlink created, but if you have trouble in this part you can try to hard code the compiler path to use the new crosscompiler. To hardcode the compiler path in cause of trouble go to the menu "Tools->Options" and change the "Compiler Path" to "/usr/bin/ppcrossarm"<br />
<br />
But it is necessary to configure the LPI file to build the example. Open the Project Options dialog of the androidlcltest.lpi project and go to the section Paths and change the libraries path to reflect the correct paths of where your Android NDK was installed and where your jnigraphics.so, libc.so, etc, libraries are located for your target Android API level. For LCL-CustomDrawn-Android API level 8 is the best choice, because it supports Android 2.2+ like the LCL. The image bellow shows where to configure this:<br />
<br />
[[Image:Configure_androidlcl_libraries.jpg]]<br />
<br />
'''Step 3 - Build the APK'''<br />
<br />
Before going to the command line to build the APK open the file lazarus/examples/androidlcl/android/local.properties and change it to reflect your Android SDK path. The file says you should not modify it, but ignore that and modify it anyway. Here is how the file looks like:<br />
<br />
<pre><br />
# This file is automatically generated by Android Tools.<br />
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!<br />
# <br />
# This file must *NOT* be checked in Version Control Systems,<br />
# as it contains information specific to your local configuration.<br />
<br />
# location of the SDK. This is only used by Ant<br />
# For customization when using a Version Control System, please read the<br />
# header note.<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
</pre><br />
<br />
After configuring that one, go to the command line and issue these commands:<br />
<br />
cd lazarus/examples/androidlcl/android<br />
ant debug<br />
<br />
The APK will be located in lazarus/examples/androidlcl/android/bin<br />
<br />
'''Step 4 - Install the APK in your phone and run it'''<br />
<br />
You can install via ADB or by copying the file to the sdcard. You should see this:<br />
<br />
[[Image:Custom_drawn_android_test1.png]]<br />
<br />
== How to create an LCL Android Application==<br />
<br />
To create a new LCL-CustomDrawn-Android application simply copy all of the file structure and build and java files from the example project called "androidlcl". This example can be obtained from the Lazarus source tree in lazarus/examples/androidlcl<br />
<br />
Then you will need to modify the build files to change them to your new project name and your new Java package name.<br />
<br />
===Step 1 - Creating the LPI===<br />
<br />
You need a separate LPI at the moment for the Android version of the application but all the rest of the code can be shared. Create it using the template for a "Library" and then adapt the code from the example located in the lazarus source code in lazarus/examples/androidlcl<br />
<br />
You need to adapt the exported JNI method names to your Android Package Name.<br />
<br />
===Step 2 - Building the library===<br />
<br />
First of all, build the Pascal executable without debug information. This debug information is not so useful in Android and makes the executable much bigger. Open the menu Project->Project Options and set the build mode, widgetset, architecture and operating system targets, as shown in these screenshots:<br />
<br />
[[Image:Android_project_options_1.png]]<br />
<br />
[[Image:Android_project_options_2.png]]<br />
<br />
[[Image:Android_project_options_3.png]]<br />
<br />
===Step 3 - Create the Android project structure===<br />
<br />
Besides the LCL project building, such as configuring a proper LPI and having a library main project file, one also needs to add all of the android project structure. Simply copy from the example project in lazarus/examples/androidlcl and adapt it to the new project. Things to change are the path to the SDK, the package name. The package name needs to be updated in the build files, in the directory structure android/src/packagename, in the activity java source code and also in the main library pascal source in the exports section.<br />
<br />
===Building an LCL Android application with debug info===<br />
<br />
It is useful to add another Android build mode which has debug info. Use all of the same options as shown above, except for the debug information:<br />
<br />
[[Image:Android_project_options_4.png]]<br />
<br />
==Oh no! My LCL Android application doesn't work==<br />
<br />
There are various reasons why the app may not work. The most important thing to do when an app doesn't work is to open the logcat and see what the log says. This can be done by running this command line command:<br />
<br />
./adb logcat<br />
<br />
And then test one of the hipotesis in the next subsections.<br />
<br />
===The Pascal executable was compiled for a wrong architecture, operating system and/or widgetset===<br />
<br />
This is the leading cause of executables not running. Always verify that you compiled the program to the "android" widgetset, "linux" operating system and "arm" architecture. This is done by going into the menu Project->Project Options. Then set these in the dialog all options as explained in this section:<br />
<br />
[[How_to_build_an_LCL_Android_application]]<br />
<br />
To check if you library is arm-linux or not, execute the following commands:<br />
<br />
cd libs/armeabi<br />
ls -l<br />
file liblclapp.so<br />
ldd liblclapp.so<br />
<br />
If it mentions anything like 80386 or gtk, then your program was compiled for linux-x86 and gtk2, not for Android like it should.<br />
<br />
===My Pascal application crashed. How to get a stacktrace?===<br />
<br />
If a Pascal application crashes you should use the command "adb logcat" to obtain the stack<br />
<br />
===The indispensable build options===<br />
<br />
*-Xd This build option is indispensable when cross-compiling from x86-linux to Android or else FPC will try to link the application against for example /usr/lib/libc.so instead of the libc.so in the NDK, even if you specify a -Fl library path<br />
*-CpARMV6 This build option is indispensable because code generated for older ARM versions is unsupported by Android and might crash in some devices. See http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
*-dAndroid in the package LCLBase.lpk<br />
*-Parm -Tlinux for the process and target operating system<br />
*-Fl should contain the path to the NDK directory with the target link shared object, such as libc.so, liblog.so, libjni.so, etc<br />
<br />
==Free Pascal Bugs on Android Support==<br />
<br />
The following summarizes the state of Android Support in Free Pascal:<br />
<br />
*The pre-compiled snapshot for x86-linux -> Android is known to work very well and it was built on 19th January 2011: https://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
*On February this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=16981 introduced this bug: http://mantis.freepascal.org/view.php?id=18833<br />
*In the end of 2011 this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=19036 broke linking Android projects<br />
<br />
We are in contact with FPC developers to fix the situation as can be seen in: http://mantis.freepascal.org/view.php?id=20726<br />
<br />
==Development Notes==<br />
<br />
===The misterious JNI Crash===<br />
<br />
See the thread: http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
<br />
The problem was that vm^^.GetEnv would crash in HTC Wildfire, Alcatel and in the emulator with SIGILL but not in Xperia Mini, HTC Desire HD, Motorola Atrix and other smartphones.<br />
<br />
The answer was that one needs to specify -CpARMV6 when building because older instructions might fail in some devices<br />
<br />
===NDK Libraries available in Android 2.2 (API level 8)===<br />
<br />
LCL-CustomDrawn targets Android 2.2+ and in this API level the following libraries are supported by the NDK:<br />
<br />
#libc.so<br />
#libdl.so (linker)<br />
#OpenGL ES 1<br />
#OpenGL ES 2<br />
#libjnigraphics.so<br />
#liblog.so<br />
#libm.so<br />
#libz.so<br />
#libthread_db.so<br />
#libstdc++.so<br />
<br />
LCL-CustomDrawn-Android uses libjnigraphics.so and liblog.so at the moment.<br />
<br />
===Native text drawing===<br />
<br />
Native text drawing is a bit convoluted in Android and the documentation is quite bad too. Some gotchas already found:<br />
<br />
* It draws text starting on a Y coordinate which represents the baseline, which is the bottom of strings like "abc", but not the bottom of strings like "qg". See http://code.google.com/p/android/issues/detail?id=393<br />
* There is no documentation about what the size in Paint.setTextSize represents. Some people say it is pixels, but to me it looks something else because it seams to differ across devices.<br />
<br />
But there are also good things about it:<br />
<br />
* It can draw on a transparent bitmap and use alpha transparency to implement anti-aliasing and subpixel rendering. The text gets quite beaultiful.<br />
* It can draw on the ARGB 32-bits non-premultiplied format which is a pretty good one<br />
<br />
===Flood of garbage collector messages when the caret is visible===<br />
<br />
Something like this:<br />
<br />
<pre><br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 188 objects / 6664 bytes in 94ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 170 objects / 6160 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5904 bytes in 82ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5856 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5872 bytes in 80ms<br />
D/dalvikvm( 2825): GC_EXPLICIT freed 371 objects / 18480 bytes in 91ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 81ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 83ms<br />
</pre><br />
<br />
In my investigation this happens probably because the TCDEdit will request a full control invalidate on each timer tick, which currently will main a full form invalidate, so the GC needs to collect the bitmaps and other paint objects when painting that often. <br />
<br />
===Why the caret of a TEdit keeps blinking after clicking on the form===<br />
<br />
When clicking on the form the LCL focus will refuse to move from the Edit to the Form because this behavior seams to be hard coded in the LCL, although maybe we might change this for Android. So even while we set focus into the form, the LCL refuses to do that and keeps its focus in the Edit, thus we have a focus missmatch. This might eventually be fixed in the future.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Template:Custom_Drawn_Interface/Android&diff=55403
Template:Custom Drawn Interface/Android
2012-02-09T10:21:26Z
<p>Kverde: New page: <small> '''English (en)''' '''Русский (ru)''' </small></p>
<hr />
<div><small><br />
[[Custom_Drawn_Interface/Android|'''English (en)''']]<br />
[[Custom_Drawn_Interface/Android/ru|'''Русский (ru)''']]<br />
</small></div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Android&diff=55402
Custom Drawn Interface/Android
2012-02-09T10:20:14Z
<p>Kverde: </p>
<hr />
<div>{{Custom_Drawn_Interface/Android}}<br />
<br />
Go back to [[Custom Drawn Interface]]<br />
<br />
__TOC__<br />
<br />
== Architecture==<br />
<br />
LCL-CustomDrawn-Android utilizes a minimal Java application which communicates with our Pascal library and sends all events to it and also obeys commands from it. The communication is done via JNI as supported by Google. The controls are not native, instead they are all drawing using TRawImage+TLazIntfImage+TLazCanvas and events and the painting are clipped using LazRegions. The drawing itself is done in Pascal using jnigraphics to draw on a Bitmap Java object which is then drawn by the minimal Java activity on a SurfaceView.<br />
<br />
Our previous and short-lived attempt to write an LCL Interface for Android (LCL-Android) utilized a non-standard method of using native executables which communicated with a Java machine via Pipes. This method was abandoned because it was considered unsupported by Google. It is considered obsolete and people should use instead LCL-CustomDrawn-Android. This older interface was documented in [[Android Interface]].<br />
<br />
== Roadmap ==<br />
<br />
# <s>Build the set of [[Lazarus Custom Drawn Controls]]</s><br />
# <s>Initial bindings for the Android APIs</s><br />
# <s>Create an application to automatically generate the bindings</s><br />
# <s>Start the new widgetset</s><br />
# <s>Implement support for JNI</s><br />
# <s>Merge the Lazarus Custom Drawn Controls into the LCL and use them to implement all basic controls</s><br />
# <s>Add text support for Android</s><br />
# <s>Implement basic window client area scrolling</s><br />
# Add mobile emulator for desktop platforms<br />
# Improve the mobile scrolling<br />
# Add text support in X11<br />
# Add DPI awareness and adaptation in the LCL<br />
# Add non-native text support via pasfreetype<br />
<br />
==Using the Android SDK, Emulator and Phones==<br />
<br />
[[Custom Drawn Interface/Using the Android SDK, Emulator and Phones]]<br />
<br />
==Android Programming==<br />
<br />
See [[Android Programming]], also includes caracteristics of the various phones relevant for programming.<br />
<br />
==Configuring the Free Pascal Compiler for Android==<br />
<br />
===Use the ready Virtual Box Image with FPC and Lazarus===<br />
<br />
The fastest way to configure Free Pascal and Lazarus for Android development is simply using a pre-configured virtual machine image which already includes Mageia Linux 1, KDE, Lazarus 0.9.31, Subversion, Free Pascal for both x86-linux and arm-linux (targetting Android), the Android SDK, the Android NDK, Java, Ant, Gtk2 and all it's development packages, the GNU debugger (GDB), subversion and everything else necessary for building Android applications with Lazarus.<br />
<br />
The download like for the virtual machine image is: https://sourceforge.net/projects/p-tools/files/Lazarus_for_Android_VM_Image/snapshot_30_dez_2011/<br />
<br />
The virtual machine image is composed by two files: “Android Devel VM.vbox” and “Android Devel VM.hdd”. Both need to be located in the same folder and also note that the source forge download is a zipped file, so it needs to be unzipped. After unzipping the VM image has 5,2GB. To use this virtual machine one should install Virtual Box and then use it to open the .vbox file. Then one can already use this Linux virtual machine to build Android applications. The process of building an application involves first opening Lazarus and building the application in Lazarus, for example the example project available on ~/Programas/lazarus/example/androidlcl/ and then going into the Linux terminal, navigating to ~/Programas/lazarus/example/androidlcl/android and issuing the command “ant debug” which will generate the APK file in ~/Programas/ lazarus/example/androidlcl/android/bin/LCLExample-debug.apk. There are two users in the virtual machine: “root” and “pascaldev” and both of them use the password “root”.<br />
<br />
Note that the virtual machine contains the Lazarus source code from when it was created, but one can also use svn update to get the latest code. Note that this involves some risks, however, as the trunk version might ocasionally contain problems.<br />
<br />
===Building the compiler yourself in Windows===<br />
<br />
'''Step 1''' - Install the Android SDK and NDK<br />
<br />
Download from Google and install both the SDK and the NDK for Windows.<br />
<br />
Check your path to the binutils installed by the NDK. For example, for NDK r7 installed in C:\Programas\android-ndk-r7\ the path is C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin<br />
<br />
Also check your path to the libraries installed by the NDK. For example, for NDK r7 installed in C:\Programas\android-ndk-r7\ the path is C:\Programas\android-ndk-r7\platforms\android-8\arch-arm\usr<br />
<br />
'''Step 2''' - Download FPC 2.5.1 from January 19th<br />
<br />
Create a folder to store the FPC trunk source code and checkout revision 16790<br />
<br />
'''Step 3''' - Install FPC 2.4.4<br />
<br />
An easy way to obtain a good FPC 2.4.4 is installing Lazarus 0.9.30.2. For example, let's say you install this Lazarus version in C:\Programas\lazarusfpc244<br />
<br />
'''Step 4''' - Create the build script and built it<br />
<br />
Create the output directory, for example: C:\Programas\fpcandroid\output<br />
<br />
Next create a file called build.bat in the fpc root folder, in our example C:\Programas\fpcandroid and copy to it:<br />
<br />
<pre><br />
SET PATH=C:\Programas\lazarusfpc244\fpc\2.4.4\bin\i386-win32\<br />
make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin OPT=-dFPC_ARMEL BINUTILSPREFIX=arm-linux-androideabi- INSTALL_PREFIX=C:\Programas\fpcandroid\output<br />
pause</pre><br />
<br />
Next run this batch script and you should have FPC installed into C:\Programas\fpcandroid\output<br />
<br />
'''Step 5''' - Copy some cross-binutils into the bin dir<br />
<br />
You now should have a FPC binary in C:\Programas\fpcandroid\output\bin\i386-win32<br />
<br />
Now get these 3 files:<br />
<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-as.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-ld.exe<br />
C:\Programas\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-strip.exe<br />
<br />
And copy and then rename to have:<br />
<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-as.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-ld.exe<br />
C:\Programas\fpcandroid\output\bin\i386-win32\arm-linux-strip.exe<br />
<br />
'''Step 6''' - Merge this into a Lazarus FPC setup<br />
<br />
Let's say you have the following Lazarus C:\Programas\lazarus31 with the following fpc installed inside it: C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32 and C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy C:\Programas\fpcandroid\output\units\arm-linux to C:\Programas\lazarus31\fpc\2.5.1\units\<br />
<br />
Now copy all .exe files from C:\Programas\fpcandroid\output\bin\i386-win32\ into C:\Programas\lazarus31\fpc\2.5.1\bin\i386-win32<br />
<br />
Now you can already build the example project androidlcltest.lpi using the Windows-Release build mode<br />
<br />
===Building the compiler yourself in Linux===<br />
<br />
See [[Setup_Cross_Compile_For_ARM]] and make sure to use the option OPT="-dFPC_ARMEL" for building the compiler.<br />
<br />
===Using the pre-compiled compiler in Linux===<br />
<br />
A pre-compiled compiler is provided for convenience for users. The following steps were tested in Mandriva Linux 2010.0 and 2010.1:<br />
<br />
'''Required Environment'''<br />
<br />
* The latest stable FPC installed in the system via the RPM / DEB / TAR package<br />
<br />
'''Step 1''' - Install the cross-binutils<br />
<br />
For Mandriva Linux the RPM package containing arm-linux-as, arm-linux-ld, etc, which are the cross-binutils can be found here: http://rpm.pbone.net/index.php3/stat/4/idpl/14252825/dir/mandriva_2010/com/cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm.html<br />
<br />
Just download the RPM package and install it using: <br />
<br />
rpm -ivh cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
In Mandriva Linux 2010.0 the dependencies won't match, as the package is for 2010.1, but one can simply ignore this problem and it works fine using --nodeps:<br />
<br />
rpm -ivh --nodeps cross-arm-binutils-2.20.51.0.4-2mnb2.i586.rpm <br />
<br />
For other distributions use the corresponding package, or else read the instructions for building the cross-binutils yourself at [[Setup_Cross_Compile_For_ARM]]<br />
<br />
'''Step 2''' - Configure the cross-binutils<br />
<br />
The assembler needs a parameter to tell it which ARM ABI to use. A choice which works good is EABI-5, which is compatible with all Android devices available as of Jan 2011. To set this, we will rename the original assembler and substitute it with a shell script which passes the desired parameter. These commands will do it:<br />
<br />
su<br />
mv /usr/bin/arm-linux-as /usr/bin/arm-linux-as_org<br />
gedit /usr/bin/arm-linux-as<br />
<br />
Now paste into the editor this code:<br />
<br />
#!/bin/sh<br />
/usr/bin/arm-linux-as_org -meabi=5 $@<br />
<br />
And don't forget to then make it executable:<br />
<br />
chmod 755 /usr/bin/arm-linux-as<br />
<br />
'''Step 3''' - Install the Free Pascal Cross-Compiler<br />
<br />
At this point the pre-compiled FPC can be download from here: http://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
<br />
Then use these commands to install the pre-compiled Free Pascal cross-compiler into /usr:<br />
<br />
[felipe@localhost Programas]$ ls -l<br />
total 20664<br />
-rw-rw-r-- 1 felipe felipe 17098552 2010-10-25 08:17 fpc-2.5.1.arm-linux.tar.gz<br />
[felipe@localhost Programas]$ su<br />
Password: <br />
[root@localhost Programas]# cp fpc-2.5.1.arm-linux.tar.gz /usr/<br />
[root@localhost Programas]# cd /usr/<br />
[root@localhost usr]# tar -xvf fpc-2.5.1.arm-linux.tar.gz <br />
[root@localhost usr]# ln -s /usr/lib/fpc/2.5.1/ppcrossarm /usr/bin/ppcrossarm<br />
<br />
'''Step 4''' - Verify if your Cross-Compiler works<br />
<br />
If you made no errors in the previous steps, it should work, so try to call it like this:<br />
<br />
[felipe@localhost Programas]$ /usr/bin/ppcrossarm<br />
<br />
If this command works and fpc shows its options, then you configured the cross-compiler correctly, if not, then try to find out if your symbolic link points to a correct location with this command:<br />
<br />
[felipe@localhost Programas]$ ls -ls /usr/bin/ppc*<br />
<br />
Now we are ready to compile Android applications using the Lazarus IDE! Configuring the fpc.cfg file isn't necessary, the old compiler will automatically find the new compiler and it's object files.<br />
<br />
==Compiling the example LCL Android Application==<br />
<br />
'''Step 1 - Download the source code'''<br />
<br />
The source code of the example is located inside the Lazarus sources in lazarus/examples/androidlcl/androidlcltest.lpi<br />
<br />
'''Step 2 - Build the project using the Lazarus IDE'''<br />
<br />
Configuring Lazarus itself to use the new compiler should not normally be necessary because fpc should be able to find the symlink created, but if you have trouble in this part you can try to hard code the compiler path to use the new crosscompiler. To hardcode the compiler path in cause of trouble go to the menu "Tools->Options" and change the "Compiler Path" to "/usr/bin/ppcrossarm"<br />
<br />
But it is necessary to configure the LPI file to build the example. Open the Project Options dialog of the androidlcltest.lpi project and go to the section Paths and change the libraries path to reflect the correct paths of where your Android NDK was installed and where your jnigraphics.so, libc.so, etc, libraries are located for your target Android API level. For LCL-CustomDrawn-Android API level 8 is the best choice, because it supports Android 2.2+ like the LCL. The image bellow shows where to configure this:<br />
<br />
[[Image:Configure_androidlcl_libraries.jpg]]<br />
<br />
'''Step 3 - Build the APK'''<br />
<br />
Before going to the command line to build the APK open the file lazarus/examples/androidlcl/android/local.properties and change it to reflect your Android SDK path. The file says you should not modify it, but ignore that and modify it anyway. Here is how the file looks like:<br />
<br />
<pre><br />
# This file is automatically generated by Android Tools.<br />
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!<br />
# <br />
# This file must *NOT* be checked in Version Control Systems,<br />
# as it contains information specific to your local configuration.<br />
<br />
# location of the SDK. This is only used by Ant<br />
# For customization when using a Version Control System, please read the<br />
# header note.<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
</pre><br />
<br />
After configuring that one, go to the command line and issue these commands:<br />
<br />
cd lazarus/examples/androidlcl/android<br />
ant debug<br />
<br />
The APK will be located in lazarus/examples/androidlcl/android/bin<br />
<br />
'''Step 4 - Install the APK in your phone and run it'''<br />
<br />
You can install via ADB or by copying the file to the sdcard. You should see this:<br />
<br />
[[Image:Custom_drawn_android_test1.png]]<br />
<br />
== How to create an LCL Android Application==<br />
<br />
To create a new LCL-CustomDrawn-Android application simply copy all of the file structure and build and java files from the example project called "androidlcl". This example can be obtained from the Lazarus source tree in lazarus/examples/androidlcl<br />
<br />
Then you will need to modify the build files to change them to your new project name and your new Java package name.<br />
<br />
===Step 1 - Creating the LPI===<br />
<br />
You need a separate LPI at the moment for the Android version of the application but all the rest of the code can be shared. Create it using the template for a "Library" and then adapt the code from the example located in the lazarus source code in lazarus/examples/androidlcl<br />
<br />
You need to adapt the exported JNI method names to your Android Package Name.<br />
<br />
===Step 2 - Building the library===<br />
<br />
First of all, build the Pascal executable without debug information. This debug information is not so useful in Android and makes the executable much bigger. Open the menu Project->Project Options and set the build mode, widgetset, architecture and operating system targets, as shown in these screenshots:<br />
<br />
[[Image:Android_project_options_1.png]]<br />
<br />
[[Image:Android_project_options_2.png]]<br />
<br />
[[Image:Android_project_options_3.png]]<br />
<br />
===Step 3 - Create the Android project structure===<br />
<br />
Besides the LCL project building, such as configuring a proper LPI and having a library main project file, one also needs to add all of the android project structure. Simply copy from the example project in lazarus/examples/androidlcl and adapt it to the new project. Things to change are the path to the SDK, the package name. The package name needs to be updated in the build files, in the directory structure android/src/packagename, in the activity java source code and also in the main library pascal source in the exports section.<br />
<br />
===Building an LCL Android application with debug info===<br />
<br />
It is useful to add another Android build mode which has debug info. Use all of the same options as shown above, except for the debug information:<br />
<br />
[[Image:Android_project_options_4.png]]<br />
<br />
==Oh no! My LCL Android application doesn't work==<br />
<br />
There are various reasons why the app may not work. The most important thing to do when an app doesn't work is to open the logcat and see what the log says. This can be done by running this command line command:<br />
<br />
./adb logcat<br />
<br />
And then test one of the hipotesis in the next subsections.<br />
<br />
===The Pascal executable was compiled for a wrong architecture, operating system and/or widgetset===<br />
<br />
This is the leading cause of executables not running. Always verify that you compiled the program to the "android" widgetset, "linux" operating system and "arm" architecture. This is done by going into the menu Project->Project Options. Then set these in the dialog all options as explained in this section:<br />
<br />
[[How_to_build_an_LCL_Android_application]]<br />
<br />
To check if you library is arm-linux or not, execute the following commands:<br />
<br />
cd libs/armeabi<br />
ls -l<br />
file liblclapp.so<br />
ldd liblclapp.so<br />
<br />
If it mentions anything like 80386 or gtk, then your program was compiled for linux-x86 and gtk2, not for Android like it should.<br />
<br />
===My Pascal application crashed. How to get a stacktrace?===<br />
<br />
If a Pascal application crashes you should use the command "adb logcat" to obtain the stack<br />
<br />
===The indispensable build options===<br />
<br />
*-Xd This build option is indispensable when cross-compiling from x86-linux to Android or else FPC will try to link the application against for example /usr/lib/libc.so instead of the libc.so in the NDK, even if you specify a -Fl library path<br />
*-CpARMV6 This build option is indispensable because code generated for older ARM versions is unsupported by Android and might crash in some devices. See http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
*-dAndroid in the package LCLBase.lpk<br />
*-Parm -Tlinux for the process and target operating system<br />
*-Fl should contain the path to the NDK directory with the target link shared object, such as libc.so, liblog.so, libjni.so, etc<br />
<br />
==Free Pascal Bugs on Android Support==<br />
<br />
The following summarizes the state of Android Support in Free Pascal:<br />
<br />
*The pre-compiled snapshot for x86-linux -> Android is known to work very well and it was built on 19th January 2011: https://sourceforge.net/projects/p-tools/files/Free%20Pascal%20for%20ARM/<br />
*On February this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=16981 introduced this bug: http://mantis.freepascal.org/view.php?id=18833<br />
*In the end of 2011 this revision http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&revision=19036 broke linking Android projects<br />
<br />
We are in contact with FPC developers to fix the situation as can be seen in: http://mantis.freepascal.org/view.php?id=20726<br />
<br />
==Development Notes==<br />
<br />
===The misterious JNI Crash===<br />
<br />
See the thread: http://groups.google.com/group/android-ndk/browse_thread/thread/ba542483f062a828<br />
<br />
The problem was that vm^^.GetEnv would crash in HTC Wildfire, Alcatel and in the emulator with SIGILL but not in Xperia Mini, HTC Desire HD, Motorola Atrix and other smartphones.<br />
<br />
The answer was that one needs to specify -CpARMV6 when building because older instructions might fail in some devices<br />
<br />
===NDK Libraries available in Android 2.2 (API level 8)===<br />
<br />
LCL-CustomDrawn targets Android 2.2+ and in this API level the following libraries are supported by the NDK:<br />
<br />
#libc.so<br />
#libdl.so (linker)<br />
#OpenGL ES 1<br />
#OpenGL ES 2<br />
#libjnigraphics.so<br />
#liblog.so<br />
#libm.so<br />
#libz.so<br />
#libthread_db.so<br />
#libstdc++.so<br />
<br />
LCL-CustomDrawn-Android uses libjnigraphics.so and liblog.so at the moment.<br />
<br />
===Native text drawing===<br />
<br />
Native text drawing is a bit convoluted in Android and the documentation is quite bad too. Some gotchas already found:<br />
<br />
* It draws text starting on a Y coordinate which represents the baseline, which is the bottom of strings like "abc", but not the bottom of strings like "qg". See http://code.google.com/p/android/issues/detail?id=393<br />
* There is no documentation about what the size in Paint.setTextSize represents. Some people say it is pixels, but to me it looks something else because it seams to differ across devices.<br />
<br />
But there are also good things about it:<br />
<br />
* It can draw on a transparent bitmap and use alpha transparency to implement anti-aliasing and subpixel rendering. The text gets quite beaultiful.<br />
* It can draw on the ARGB 32-bits non-premultiplied format which is a pretty good one<br />
<br />
===Flood of garbage collector messages when the caret is visible===<br />
<br />
Something like this:<br />
<br />
<pre><br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 188 objects / 6664 bytes in 94ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 170 objects / 6160 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5904 bytes in 82ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5856 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5872 bytes in 80ms<br />
D/dalvikvm( 2825): GC_EXPLICIT freed 371 objects / 18480 bytes in 91ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5896 bytes in 81ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 78ms<br />
D/dalvikvm( 6364): GC_EXTERNAL_ALLOC freed 162 objects / 5920 bytes in 83ms<br />
</pre><br />
<br />
In my investigation this happens probably because the TCDEdit will request a full control invalidate on each timer tick, which currently will main a full form invalidate, so the GC needs to collect the bitmaps and other paint objects when painting that often. <br />
<br />
===Why the caret of a TEdit keeps blinking after clicking on the form===<br />
<br />
When clicking on the form the LCL focus will refuse to move from the Edit to the Form because this behavior seams to be hard coded in the LCL, although maybe we might change this for Android. So even while we set focus into the form, the LCL refuses to do that and keeps its focus in the Edit, thus we have a focus missmatch. This might eventually be fixed in the future.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Android_Programming/ru&diff=55401
Android Programming/ru
2012-02-09T10:13:49Z
<p>Kverde: /* Как... */</p>
<hr />
<div>{{Android programming}}<br />
<br />
Смотрите также [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
Общие знания о программировании под Андроид могут очень помочь в разработке интерфейса Lazarus для Андроид.<br />
<br />
==Как...==<br />
<br />
===Построить NDK (Android Native Development Kit) OpenGL ===<br />
<br />
Просто выполните следующие действия:<br />
<br />
'''Шаг 1''' - Скачайте и установите Android NDK, Android SDK и Ant. Боьше информации тут: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones/ru]]<br />
<br />
'''Шаг 2''' - Установите pre-compiled FPC cross-compiler. Инстрцкции здесь: [[Android_Interface#Using_the_pre-compiled_compiler]]<br />
<br />
'''Шаг 3''' - Загрузите последнюю версию lazarus-ccr sourceforge code:<br />
<br />
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr lazarus-ccr<br />
<br />
или если вы думаете что это слишком много, вы можете скачать только каталог lazarus-ccr/bindings/android-ndk<br />
<br />
'''Шаг 4''' - Постройте Pascal Library<br />
<br />
Откройте проект lazarus-ccr/bindings/android-ndk/examples/opengltest/opengltest.lpi<br />
<br />
Откройте пункт меню Project->Project Options->Paths и где написано "Libraries -Fl" вы должны увидеть следующее значение:<br />
<br />
/home/felipe/Programas/android-ndk-r5/platforms/android-9/arch-arm/usr/lib<br />
<br />
Change it to the correct path in your system which points to the NDK and to the library folder for your minimal required Android API Level <br />
<br />
Теперь постройте проект используя Лазарус.<br />
<br />
'''Шаг 5''' - Настройка среды сборки<br />
<br />
Откройте файл opengltest/local.properties и в строке:<br />
<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
<br />
Измените этот путь на местоположение SDK<br />
<br />
'''Шаг 6''' - Постройка APK<br />
<br />
Откройте консоль и введите следущие команды:<br />
<br />
cd lazarus-ccr/bindings/ndk/examples/opengltest/android<br />
ant debug<br />
<br />
Файл APK будет помещен в opengltest/android/bin/<br />
<br />
'''Шаг 7''' - Установка APK<br />
<br />
Если на этом шаге вы получите сообщение об ошибке прав доступа читайте: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones#Recognition_of_devices_under_Linux]]<br />
<br />
Команда чтобы установить APK на телефоне:<br />
<br />
cd opengltest/android<br />
~/Programas/android-sdk-linux/platform-tools/adb install bin/OpenGLNDKTest-debug.apk <br />
2395 KB/s (107299 bytes in 0.043s)<br />
pkg: /data/local/tmp/OpenGLNDKTest-debug.apk<br />
Success<br />
<br />
Если вы получили сообщение об ошибке, что APK уже установлен, вы можете установить с помощью следующей команды:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb uninstall com.pascal.opengltest<br />
<br />
And then you can run adb logcat to see what the log says while you start it in the phone via its newly added icon:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb logcat<br />
<br />
===Чтение параметров экрана===<br />
<br />
First fill a TDisplayMetrics with the correct info:<br />
<br />
<delphi><br />
uses androidutil;<br />
<br />
var<br />
MyDisplayMetrics: TDisplayMetrics;<br />
Str: string;<br />
//<br />
lHeight, lWidth: Integer;<br />
xdpi, ydpi, lScreenSize: Single;<br />
begin<br />
// ..<br />
// Objects<br />
<br />
MyDisplayMetrics := TDisplayMetrics.Create;<br />
Activity.getWindowManager().getDefaultDisplay().getMetrics(MyDisplayMetrics);<br />
</delphi><br />
<br />
And then you can read it from the TDisplayMetrics:<br />
<br />
<delphi><br />
lHeight := MyDisplayMetrics.heightPixels();<br />
lWidth := MyDisplayMetrics.widthPixels();<br />
xdpi := MyDisplayMetrics.xdpi();<br />
ydpi := MyDisplayMetrics.ydpi();<br />
lScreenSize := sqrt(sqr(lHeight / ydpi) + sqr(lWidth / xdpi));<br />
ldensity := MyDisplayMetrics.density();<br />
ldensityDpi := MyDisplayMetrics.densityDpi();<br />
scaledDensity := MyDisplayMetrics.scaledDensity();<br />
</delphi><br />
<br />
Note that lots of devices lie about the xdpi and ydpi, so don't trust the lScreenSize calculated above. Smartphones might report even 10 inches of screen size, while the correct is around 4.<br />
<br />
==Подробная информация об устройствах с Андроид==<br />
<br />
Так как существует много устройств на Android, это может быть полезно для отслеживания информации о них. Смотрите также в википедии Comparison of Android Devices [http://en.wikipedia.org/wiki/Comparison_of_Android_devices] и подробную информацию о процессорах в [https://wiki.mozilla.org/Mobile/Platforms/Android#System_Requirements].<br />
<br />
===Смартфоны===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Производитель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Модель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Процессор'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Версия Андроид'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Комментарий'''<br />
|---<br />
|HTC||Wildfire||HTC Wildfire||armv6||2.1=>2.2||Да||-<br />
|---<br />
|Sony Erricson||Xperia X10||X10i||armv7||1.6=>2.1||Нет||-<br />
|}<br />
<br />
===Tablets===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Производитель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Модель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Процессор'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Версия Андроид'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Комментарий'''<br />
|---<br />
|Toshiba||Folio 100 Tablet||TOSHIBA_FOLIO_AND_A||armv7||2.2||Yes||-<br />
|}<br />
<br />
===List of devices ordered by processor compatibility (ARMv6 vs ARMv7)===<br />
<br />
'''List of ARMv7 devices:'''<br />
<br />
*Advent Vega (P10AN01) <br />
*Dell Streak, Streak 7 <br />
*HTC Desire <br />
*HTC Desire Z (T-Mobile G2) <br />
*HTC Desire HD <br />
*HTC Droid Incredible <br />
*HTC EVO 4G, EVO Shift 4G <br />
*HTC Glacier (T-Mobile myTouch 4G) <br />
*HTC Inspire 4G <br />
*HTC Nexus One <br />
*HTC Thunderbolt 4G <br />
*Huawei Ideos S7 <br />
*LG Optimus Z <br />
*Motorola Atrix 4G <br />
*Motorola Bravo <br />
*Motorola Cliq 2 - untested <br />
*Motorola Defy <br />
*Motorola Droid 2, Droid 2 Global <br />
*Motorola Droid Pro (Motorola PRO) <br />
*Motorola Droid X <br />
*Motorola Xoom <br />
*POV Mobii Tegra Tablet <br />
*Samsung Continuum (i400) <br />
*Samsung Galaxy S (i9000, Captivate, Fascinate, Vibrant, Epic 4G) <br />
*Samsung Galaxy Tab <br />
*Sharp IS03 <br />
*Sony Ericsson Xperia X10 <br />
*Toshiba AS100 <br />
*Viewsonic gTablet <br />
*Acer Liquid E<br />
*Acer Liquid (Liquid A1)<br />
*Archos 101 Internet Tablet<br />
*Motorola Charm<br />
*Motorola Droid (Milestone)<br />
*Samsung Galaxy S 4G<br />
*Samsung Nexus S<br />
<br />
'''List of ARMv6 processors:'''<br />
<br />
*Android SDK emulator <br />
*Asus Garmin nuvifone A50 (T-Mobile Garminfone) <br />
*Augen GENTouch 78 Tablet <br />
*Coby Kyros Internet Tablet (MID7015) <br />
*Geeksphone One, Geeksphone Zero <br />
*HTC Aria <br />
*HTC ChaCha <br />
*HTC Dream (T-Mobile G1, Android Dev Phone 1) <br />
*HTC Droid Eris <br />
*HTC Espresso (T-Mobile myTouch 3G Slide) <br />
*HTC Hero (T-Mobile G2 Touch) <br />
*HTC Legend <br />
*HTC Magic (T-Mobile myTouch 3G, T-Mobile G1 Touch) <br />
*HTC Salsa <br />
*HTC Tattoo <br />
*HTC Wildfire <br />
*Huawei Ascend <br />
*Huawei Ideos U8150-B (T-Mobile Comet) <br />
*Huawei U8110 (T-Mobile Pulse Mini) <br />
*Huawei U8230 <br />
*LG Ally (Apex) (LG VS740) <br />
*LG GW620 (Eve, InTouch Max, LinkMe) <br />
*LG Optimus, Optimus M, Optimus T, Optimus S, Optimus V <br />
*LG Vortex <br />
*LG P500<br />
*MAG iMiTO iM7 <br />
*vMAG iMiTO iM7S <br />
*Motorola Backflip <br />
*Motorola Citrus <br />
*Motorola Cliq (MB200) <br />
*Motorola Dext <br />
*Motorola Devour <br />
*Motorola i1 <br />
*Motorola Spice XT300 <br />
*Motorola Quench XT5 XT502 <br />
*Pandigital Novel <br />
*Samsung GT-S5570 Galaxy Mini <br />
*Samsung i5500 Galaxy 5 (Corby) <br />
*Samsung i5700 Galaxy Portal (Spica) <br />
*Samsung i5800 Galaxy 3 <br />
*Samsung i7500 Galaxy <br />
*Samsung Intercept <br />
*Samsung M900 Moment <br />
*Samsung S5830 Galaxy Ace <br />
*Samsung Transform <br />
*Sanyo ZIO M6000 <br />
*Sony Ericsson Xperia X8 <br />
*Sony Ericsson Xperia X10 Mini <br />
*Sony Ericsson Xperia X10 Mini Pro <br />
*Superpad 10.2" Tablet PC <br />
*Viewsonic ViewPad 7 Tablet <br />
*Velocity Micro T103 Cruz tablet <br />
*Vodafone 845 <br />
*ZTE Blade<br />
<br />
===Playing Sounds and Videos in the Phones===<br />
<br />
Each phone comes with different codecs installed, which will mean that the native Media Player will be able to play different formats in different phones. Bellow is a table showing which formats play in the native Media Player of each phone:<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Telephone'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''webm - VP8'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''m4v - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''ogv - Theora'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mp4 - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mov - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''avi - RLE'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mpg - MPEG-1'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''wmv - WM9'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''3gp - MPEG-4'''<br />
|----<br />
|Emulator||1.6||x||x||x||x||x||x||x||x||OK<br />
|----<br />
|Emulator||2.1||x||x||x||x||x||x||x||x||OK<br />
|----<br />
|Nexus One||2.2||x||OK||x||OK||x||x||x||x||OK<br />
|----<br />
|HTC Desire||1.6||x||OK||x||OK||x||x||x||OK||OK<br />
|----<br />
|Toshiba Folio 100||2.2||x||OK||x||OK||x||x||x||OK||OK<br />
|----<br />
|Xperia X10||2.1||x||OK||x||x||x||x||x||OK||OK<br />
|----<br />
|Xperia X8||2.2||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|HTC Wildfire||2.1||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|HTC Desire HD||2.2||x||OK||x||OK||x||x||x||x||OK<br />
|----<br />
|Galaxy Tab||2.2||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|myPhone A210||1.6||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|Motorola Milestone||2.1||x||OK||x||x||x||x||x||OK||?<br />
|----<br />
|Milestone 2||2.2||x||OK||x||x||x||x||x||sound-only||OK<br />
|}<br />
<br />
==Creating a new Java Android Application==<br />
<br />
This info can be useful for helping implement LCL-CustomDrawn-Android<br />
<br />
Generic instructions here: http://developer.android.com/guide/developing/other-ide.html<br />
<br />
===Showing / Hiding the virtual keyboard===<br />
<br />
See here: http://android-codes-examples.blogspot.com/2011/11/show-or-hide-soft-keyboard-on-opening.html<br />
<br />
To show it:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);<br />
<br />
and for hiding the keyboard:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);<br />
<br />
==References==<br />
<br />
* http://developer.android.com/guide/developing/other-ide.html</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Using_the_Android_SDK,_Emulator_and_Phones/ru&diff=55400
Custom Drawn Interface/Using the Android SDK, Emulator and Phones/ru
2012-02-09T10:09:21Z
<p>Kverde: /* Построка(Building) образа эмулятора с поддержкой карты памяти */</p>
<hr />
<div>{{Android Interface/Using the Android SDK, Emulator and Phones}}<br />
<br />
Go back to [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
==Использование Android SDK==<br />
<br />
Загрузка и установка Android SDK очень простая. Нужно всего лишь перейти по ссылке: http://developer.android.com/sdk/index.html<br />
<br />
===Как настроить Ant===<br />
<br />
При использовании 'ant debug' для построения проекта Андроид может быть получено много ошибок о неудовлетворенных зависимостях. В Linux это может быть решено установкой пакетов которые име.т эти зависимости, это будет менятся от дистрибутива к дистрибутиву.<br />
<br />
====Настройка Ant в Mandriva Linux====<br />
<br />
Эти ошибки:<br />
<br />
/usr/bin/build-classpath: error: Could not find jaxp_parser_impl Java extension for this JVM<br />
/usr/bin/build-classpath: error: Could not find xml-commons-apis Java extension for this JVM<br />
<br />
Могут быть исправленны, соответственно, с:<br />
<br />
urpmi xerces-j2<br />
urpmi xml-commons-jaxp<br />
<br />
====Обшие ошибки Ant====<br />
<br />
Эта ошибка:<br />
<br />
/home/felipe/Programas/lazarus-ccr/examples/androidlcl/android/build.xml:46: taskdef class com.android.ant.SetupTask cannot be found<br />
<br />
Означает что нужно установить корректные пути к SDK в вашем файле проекта. <br />
<br />
===Recognition of devices under Linux===<br />
<br />
Unlike in Windows, where one needs to install a new set of drivers for nearly every phone, in Linux the Android devices are recognized as generic Android devices (regardless of being a phone, a tablet or a notebook) and they are ready to be used without installing additional drivers. One issue, however, that often appears is that devices are not fully recognized automatically and one receives the error message "?????? no permissions". In this case the command adb devices will look like this:<br />
<br />
<pre><br />
[felipe@localhost ~]$ cd Programas/android-sdk-linux_x86/tools/<br />
[felipe@localhost tools]$ ./adb devices<br />
List of devices attached <br />
???????????? no permissions<br />
</pre><br />
<br />
To solve this issue one can proceed with the following steps:<br />
<br />
'''Step 1''' - First read the tag of the device using lsusb run as root (or sudo):<br />
<br />
<pre><br />
[root@localhost Programas]# lsusb<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 001 Device 003: ID 04e8:681c Samsung Electronics Co., Ltd <br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
</pre><br />
<br />
The tag in this case is '''04e8'''<br />
<br />
'''Step 2''' - Now, still as root, edit the file /etc/udev/rules.d/51-android.rules <br />
<br />
If the file doesn't exist yet, then create it. Add the following line to the file:<br />
<br />
<pre><br />
SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="04e8", SYMLINK+="android_adb", MODE="0666"<br />
</pre><br />
<br />
Change the ID to correspond to the id of your device.<br />
<br />
'''Step 3''' - Restart the linux usb service (udev)<br />
<br />
In Ubuntu this can be done with: sudo services udev restart<br />
<br />
In Mandriva udev doesn't appear as a service, so the only way to get things working for me was restarting the computer.<br />
<br />
After doing this, the device should be fully recognized and "adb devices" as well as "adb logcat" should work.<br />
<br />
<pre><br />
[felipe@localhost tools]$ ./adb devices<br />
* daemon not running. starting it now on port 5037 *<br />
* daemon started successfully *<br />
List of devices attached <br />
1000c31696b6 device<br />
</pre><br />
<br />
== Использование эмулятора ==<br />
<br />
=== Установка эмулятора ===<br />
<br />
=== Построка(Building) образа эмулятора с поддержкой карты памяти ===<br />
<br />
Шаг 1: Запустите приложение C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Шаг 2: Создайте новый образ, нажмите кнопку New как на изображении ниже.<br />
<br />
[[Image:Android_new_image.PNG]]<br />
<br />
Шаг 3: Установите название и параметры образа, размер карты памяти и поддрержку аппаратного обеспечения как на рисунке ниже.<br />
<br />
[[Image:Android_new_image_dialog.PNG]]<br />
<br />
=== Запуск образа эмулятора ===<br />
<br />
Шаг 1: Запустите приложение C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Шаг 2: Выберите образ<br />
<br />
Шаг 3: Нажмите на кнопку "start", как на изображении ниже.<br />
<br />
[[Image:Android_run_image.PNG]]<br />
<br />
=== Копирование файлов на эмулятор ===<br />
<br />
Вы можете использовать скрипт похожий на этот для копирования файлов с вашего жоского диска на эмулятор. <br />
<br />
You can use a script similar to this one to copy files from your hard-drive to the emulator. Обратите внимание, что образ должен быть запущен и что он должен поддерживать карты памяти.<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb push C:\Mypath\Somefile.extension /sdcard<br />
pause<br />
</pre><br />
<br />
=== Установка приложений в эмуляторе ===<br />
<br />
Приложения для Андроид должны быть упакованы в файловом фомате .apk. Больше информации о том как создать .apk файл, который вы можете установить на эмуляторе/телефоне, смотрите Android Asset Packaging Tool (aapt). После упаковки файла, он может быть установлен в эмуляторе используя следуюзий вызов adb:<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb install C:\Mypath\MyApp.apk<br />
pause<br />
</pre><br />
<br />
==Использование телефона==<br />
<br />
Установка драйверов, получение надежного способа передачи исполняемых файлов и отладка ПО на разных телефонах с Андроид можеть быть проблеммой сама по себе. <br />
<br />
===Устанока файлового менеджера===<br />
<br />
Удивительно, Андроид телефоны поставляются без файлового менеджера. Однако, очень просто загрузить один из Android Market. Я предлагаю следующие инструкции:<br />
<br />
1. Подключите телефон к WiFi или Мобильной сети.<br />
<br />
2. Нажмите на иконку "Market" на рабочем столе Андроид. Будет необходимо войти в аккаунт Google для доступа к нему.<br />
<br />
3. Нажмите на кнопку поиска и введите "oi".<br />
<br />
4. Найдите и установите "OI File Manager" (бесплатную версию).<br />
<br />
===Samsung Galaxy S===<br />
<br />
The first thing to do when using Samsung Galaxy S is not believing the Samsung instructions. They will say that one should install Kies, their horribly crappy PC suite which is 130MB large and fails to install because the first thing that it does is failing to connect to a server in Korea to download even more files. Instead of doing this, following these instructions:<br />
<br />
1. Go in the phone menu Settings -> About Phone -> USB settings. Change from "KIES" to "Mass storage"<br />
<br />
2. Download and install 19 MB of Samsung USB drivers from: http://drivers.softpedia.com/dyn-postdownload.php?p=96692&t=4&i=1<br />
<br />
3. Connect the cable of the phone<br />
<br />
4. Drag the top menu of the phone down and mount the sdcard</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Using_the_Android_SDK,_Emulator_and_Phones/ru&diff=55399
Custom Drawn Interface/Using the Android SDK, Emulator and Phones/ru
2012-02-09T10:08:28Z
<p>Kverde: /* Using the Emulator */</p>
<hr />
<div>{{Android Interface/Using the Android SDK, Emulator and Phones}}<br />
<br />
Go back to [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
==Использование Android SDK==<br />
<br />
Загрузка и установка Android SDK очень простая. Нужно всего лишь перейти по ссылке: http://developer.android.com/sdk/index.html<br />
<br />
===Как настроить Ant===<br />
<br />
При использовании 'ant debug' для построения проекта Андроид может быть получено много ошибок о неудовлетворенных зависимостях. В Linux это может быть решено установкой пакетов которые име.т эти зависимости, это будет менятся от дистрибутива к дистрибутиву.<br />
<br />
====Настройка Ant в Mandriva Linux====<br />
<br />
Эти ошибки:<br />
<br />
/usr/bin/build-classpath: error: Could not find jaxp_parser_impl Java extension for this JVM<br />
/usr/bin/build-classpath: error: Could not find xml-commons-apis Java extension for this JVM<br />
<br />
Могут быть исправленны, соответственно, с:<br />
<br />
urpmi xerces-j2<br />
urpmi xml-commons-jaxp<br />
<br />
====Обшие ошибки Ant====<br />
<br />
Эта ошибка:<br />
<br />
/home/felipe/Programas/lazarus-ccr/examples/androidlcl/android/build.xml:46: taskdef class com.android.ant.SetupTask cannot be found<br />
<br />
Означает что нужно установить корректные пути к SDK в вашем файле проекта. <br />
<br />
===Recognition of devices under Linux===<br />
<br />
Unlike in Windows, where one needs to install a new set of drivers for nearly every phone, in Linux the Android devices are recognized as generic Android devices (regardless of being a phone, a tablet or a notebook) and they are ready to be used without installing additional drivers. One issue, however, that often appears is that devices are not fully recognized automatically and one receives the error message "?????? no permissions". In this case the command adb devices will look like this:<br />
<br />
<pre><br />
[felipe@localhost ~]$ cd Programas/android-sdk-linux_x86/tools/<br />
[felipe@localhost tools]$ ./adb devices<br />
List of devices attached <br />
???????????? no permissions<br />
</pre><br />
<br />
To solve this issue one can proceed with the following steps:<br />
<br />
'''Step 1''' - First read the tag of the device using lsusb run as root (or sudo):<br />
<br />
<pre><br />
[root@localhost Programas]# lsusb<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 001 Device 003: ID 04e8:681c Samsung Electronics Co., Ltd <br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
</pre><br />
<br />
The tag in this case is '''04e8'''<br />
<br />
'''Step 2''' - Now, still as root, edit the file /etc/udev/rules.d/51-android.rules <br />
<br />
If the file doesn't exist yet, then create it. Add the following line to the file:<br />
<br />
<pre><br />
SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="04e8", SYMLINK+="android_adb", MODE="0666"<br />
</pre><br />
<br />
Change the ID to correspond to the id of your device.<br />
<br />
'''Step 3''' - Restart the linux usb service (udev)<br />
<br />
In Ubuntu this can be done with: sudo services udev restart<br />
<br />
In Mandriva udev doesn't appear as a service, so the only way to get things working for me was restarting the computer.<br />
<br />
After doing this, the device should be fully recognized and "adb devices" as well as "adb logcat" should work.<br />
<br />
<pre><br />
[felipe@localhost tools]$ ./adb devices<br />
* daemon not running. starting it now on port 5037 *<br />
* daemon started successfully *<br />
List of devices attached <br />
1000c31696b6 device<br />
</pre><br />
<br />
== Использование эмулятора ==<br />
<br />
=== Установка эмулятора ===<br />
<br />
=== Построка(Building) образа эмулятора с поддержкой карты памяти ===<br />
<br />
Шаг 1: Запустите приложение C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Шаг 2: Создайте новый образ, нажмите кнопку New как на изображении ниже.<br />
<br />
[[Image:Android_new_image.PNG]]<br />
<br />
Шаг 3: Установите название и параметры образа, размер карты памяти и поддрержку аппаратного обеспечения как на рисунке ниже.<br />
[[Image:Android_new_image_dialog.PNG]]<br />
<br />
=== Запуск образа эмулятора ===<br />
<br />
Шаг 1: Запустите приложение C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Шаг 2: Выберите образ<br />
<br />
Шаг 3: Нажмите на кнопку "start", как на изображении ниже.<br />
<br />
[[Image:Android_run_image.PNG]]<br />
<br />
=== Копирование файлов на эмулятор ===<br />
<br />
Вы можете использовать скрипт похожий на этот для копирования файлов с вашего жоского диска на эмулятор. <br />
<br />
You can use a script similar to this one to copy files from your hard-drive to the emulator. Обратите внимание, что образ должен быть запущен и что он должен поддерживать карты памяти.<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb push C:\Mypath\Somefile.extension /sdcard<br />
pause<br />
</pre><br />
<br />
=== Установка приложений в эмуляторе ===<br />
<br />
Приложения для Андроид должны быть упакованы в файловом фомате .apk. Больше информации о том как создать .apk файл, который вы можете установить на эмуляторе/телефоне, смотрите Android Asset Packaging Tool (aapt). После упаковки файла, он может быть установлен в эмуляторе используя следуюзий вызов adb:<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb install C:\Mypath\MyApp.apk<br />
pause<br />
</pre><br />
<br />
==Использование телефона==<br />
<br />
Установка драйверов, получение надежного способа передачи исполняемых файлов и отладка ПО на разных телефонах с Андроид можеть быть проблеммой сама по себе. <br />
<br />
===Устанока файлового менеджера===<br />
<br />
Удивительно, Андроид телефоны поставляются без файлового менеджера. Однако, очень просто загрузить один из Android Market. Я предлагаю следующие инструкции:<br />
<br />
1. Подключите телефон к WiFi или Мобильной сети.<br />
<br />
2. Нажмите на иконку "Market" на рабочем столе Андроид. Будет необходимо войти в аккаунт Google для доступа к нему.<br />
<br />
3. Нажмите на кнопку поиска и введите "oi".<br />
<br />
4. Найдите и установите "OI File Manager" (бесплатную версию).<br />
<br />
===Samsung Galaxy S===<br />
<br />
The first thing to do when using Samsung Galaxy S is not believing the Samsung instructions. They will say that one should install Kies, their horribly crappy PC suite which is 130MB large and fails to install because the first thing that it does is failing to connect to a server in Korea to download even more files. Instead of doing this, following these instructions:<br />
<br />
1. Go in the phone menu Settings -> About Phone -> USB settings. Change from "KIES" to "Mass storage"<br />
<br />
2. Download and install 19 MB of Samsung USB drivers from: http://drivers.softpedia.com/dyn-postdownload.php?p=96692&t=4&i=1<br />
<br />
3. Connect the cable of the phone<br />
<br />
4. Drag the top menu of the phone down and mount the sdcard</div>
Kverde
https://wiki.freepascal.org/index.php?title=SynEdit/ru&diff=55371
SynEdit/ru
2012-02-08T04:01:05Z
<p>Kverde: /* Закладки */</p>
<hr />
<div>{{SynEdit}}<br />
<br />
= Общее =<br />
<br />
SynEdit находящийся в Lazarus основан на SynEdit 1.0.3 [[http://synedit.sourceforge.net/]], и была адаптированна и расширенна довольно сильно. Например поддержка UTF-8 и свертывание кода были добавлены.<br />
<br />
Пакет содержащий исходник компонента называется TSynEdit, некоторые syntax highlighters и другие компоненты используют исходник редактора.<br />
<br />
Он лицензирован под теми же условиями что и оригинал SynEdit (MPL или GPL)<br />
<br />
= Synedit 2.0.5 port =<br />
<br />
Альтернативный порт текущей версии оригинального SynEdit :<br />
<br />
http://wiki.lazarus.freepascal.org/SynEdit/port<br />
<br />
code: <br />
https://github.com/rnapoles/<br />
<br />
= SynEdit в IDE =<br />
<br />
SynEdit в Лазарус является встроенным пакетом, потому что его использует IDE. Вот почему нет файлов .lpk.<br />
Компонент может быть найден в палитре компонентов на странице 'SynEdit'.<br />
<br />
= Использование SynEdit=<br />
<br />
== Подсветка ==<br />
<br />
* Используйте существующую подсветку или загрузите другую из [http://bugs.freepascal.org/view.php?id=18248 Подсветка для SynEdit]<br />
* Используйте настраеваимую подсветку (SynAnySyn или SynPositionSyn) (Смотрите прмеры того как использовать)<br />
* Напишите свою собственную [[SynEdit_Highlighter]]<br />
<br />
== (Авто-)завершение==<br />
<br />
Существует 2 плагина для SynEdit, для завершения:<br />
* TSynCompletion (используется в IDE)<br />
* TSynAutoComplete <br />
<br />
Примечание: TSynAutoComplete (из палитры компонентов) <b>не</b> имеет выпадающего списка.<br />
<br />
Смотрите примеры как использовать их обоих.<br />
<br />
== Изменение текста из кода ==<br />
<br />
Текст может быть получен через SynEdit.Lines. изменение текста через свойство Lines не работает с undo/redo. <br />
<br />
Используйте TextBetweenPoints и TextBetweenPointsEx для изменения текста, если вы хотите чтобы undo/redo работали.<br />
<br />
== Закладки ==<br />
<br />
Пожалуйста обратитесь к следующей теме на форуме: http://forum.lazarus.freepascal.org/index.php/topic,14948.msg79794.html<br />
<br />
= Примеры =<br />
<br />
<b>Примеры можно найти в каталоге lazarus/examples/synedit</b><br />
<br />
== Как добавить поддержку Copy, Paste, Cut, Undo, Redo и др. ==<br />
<br />
Эти возможности могут быть реализованны использованием комманд SynEdit.<br />
<br />
<delphi>uses<br />
...<br />
SynEdit, SynEditKeyCmds;<br />
<br />
procedure TfrmPrincipal.HandleCodigoKeyDown(Sender: TObject; var Key: Word;<br />
Shift: TShiftState);<br />
begin<br />
if (Shift = [ssCtrl]) then<br />
begin<br />
case Key of<br />
VK_C: synCodigo.CommandProcessor(TSynEditorCommand(ecCopy), ' ', nil);<br />
VK_V: synCodigo.CommandProcessor(TSynEditorCommand(ecPaste), ' ', nil);<br />
VK_X: synCodigo.CommandProcessor(TSynEditorCommand(ecCut), ' ', nil);<br />
end;<br />
end;<br />
end;</delphi><br />
<br />
= Дальнейшее развитие, обсуждение =<br />
<br />
* RTL (right-to-left): started by Mazen<br />
* automatic monospace font selection: At the moment SynEdit starts with a font 'courier'. But it would be better, if SynEdit would start with a monospace font (meaning: every character has the same width). At the moment the LCL TFont does not provide such a property. At the moment the user has to choose the right font.<br />
* automatic UTF-8 font selection: Same as above monospace, but also with an UTF-8 font, so that for example umlaute are shown correctly. At the moment the user has to choose the right font.<br />
* Dead keys. Most keyboards support typing two or more keys to create one special character (like accented or umlaut characters).<br />
* [[Redesign of the SynEdit component]]. The primary goal is more reliable display and navigation in the text. A more modular approach also allows for better integration of extensions, and for specialized controls, for use outside of Lazarus.<br />
<br />
=Смотрите также=<br />
<br />
* [[SynEdit Highlighter]]<br />
<br />
[[Category:Components]]</div>
Kverde
https://wiki.freepascal.org/index.php?title=Talk:SynEdit/ru&diff=55370
Talk:SynEdit/ru
2012-02-08T03:57:17Z
<p>Kverde: </p>
<hr />
<div>Машинный перевод? --[[User:Mr.Smart|Mr.Smart]] 17:56, 7 February 2012 (CET)<br />
<br />
Как смог, гуглтранслейт, конечно, помогал. --[[User:Kverde|Kverde]] 04:57, 8 February 2012 (CET)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Talk:SynEdit/ru&diff=55369
Talk:SynEdit/ru
2012-02-08T03:56:28Z
<p>Kverde: </p>
<hr />
<div>Машинный перевод? --[[User:Mr.Smart|Mr.Smart]] 17:56, 7 February 2012 (CET)<br />
<br />
Как смог, гуглтранслейт, конечно, помогал.</div>
Kverde
https://wiki.freepascal.org/index.php?title=SynEdit/ru&diff=55368
SynEdit/ru
2012-02-08T03:54:05Z
<p>Kverde: /* Общее */</p>
<hr />
<div>{{SynEdit}}<br />
<br />
= Общее =<br />
<br />
SynEdit находящийся в Lazarus основан на SynEdit 1.0.3 [[http://synedit.sourceforge.net/]], и была адаптированна и расширенна довольно сильно. Например поддержка UTF-8 и свертывание кода были добавлены.<br />
<br />
Пакет содержащий исходник компонента называется TSynEdit, некоторые syntax highlighters и другие компоненты используют исходник редактора.<br />
<br />
Он лицензирован под теми же условиями что и оригинал SynEdit (MPL или GPL)<br />
<br />
= Synedit 2.0.5 port =<br />
<br />
Альтернативный порт текущей версии оригинального SynEdit :<br />
<br />
http://wiki.lazarus.freepascal.org/SynEdit/port<br />
<br />
code: <br />
https://github.com/rnapoles/<br />
<br />
= SynEdit в IDE =<br />
<br />
SynEdit в Лазарус является встроенным пакетом, потому что его использует IDE. Вот почему нет файлов .lpk.<br />
Компонент может быть найден в палитре компонентов на странице 'SynEdit'.<br />
<br />
= Использование SynEdit=<br />
<br />
== Подсветка ==<br />
<br />
* Используйте существующую подсветку или загрузите другую из [http://bugs.freepascal.org/view.php?id=18248 Подсветка для SynEdit]<br />
* Используйте настраеваимую подсветку (SynAnySyn или SynPositionSyn) (Смотрите прмеры того как использовать)<br />
* Напишите свою собственную [[SynEdit_Highlighter]]<br />
<br />
== (Авто-)завершение==<br />
<br />
Существует 2 плагина для SynEdit, для завершения:<br />
* TSynCompletion (используется в IDE)<br />
* TSynAutoComplete <br />
<br />
Примечание: TSynAutoComplete (из палитры компонентов) <b>не</b> имеет выпадающего списка.<br />
<br />
Смотрите примеры как использовать их обоих.<br />
<br />
== Изменение текста из кода ==<br />
<br />
Текст может быть получен через SynEdit.Lines. изменение текста через свойство Lines не работает с undo/redo. <br />
<br />
Используйте TextBetweenPoints и TextBetweenPointsEx для изменения текста, если вы хотите чтобы undo/redo работали.<br />
<br />
== Закладки ==<br />
<br />
Пожалуйста обратитесь к следуюзей теме на форуме: http://forum.lazarus.freepascal.org/index.php/topic,14948.msg79794.html<br />
<br />
= Примеры =<br />
<br />
<b>Примеры можно найти в каталоге lazarus/examples/synedit</b><br />
<br />
== Как добавить поддержку Copy, Paste, Cut, Undo, Redo и др. ==<br />
<br />
Эти возможности могут быть реализованны использованием комманд SynEdit.<br />
<br />
<delphi>uses<br />
...<br />
SynEdit, SynEditKeyCmds;<br />
<br />
procedure TfrmPrincipal.HandleCodigoKeyDown(Sender: TObject; var Key: Word;<br />
Shift: TShiftState);<br />
begin<br />
if (Shift = [ssCtrl]) then<br />
begin<br />
case Key of<br />
VK_C: synCodigo.CommandProcessor(TSynEditorCommand(ecCopy), ' ', nil);<br />
VK_V: synCodigo.CommandProcessor(TSynEditorCommand(ecPaste), ' ', nil);<br />
VK_X: synCodigo.CommandProcessor(TSynEditorCommand(ecCut), ' ', nil);<br />
end;<br />
end;<br />
end;</delphi><br />
<br />
= Дальнейшее развитие, обсуждение =<br />
<br />
* RTL (right-to-left): started by Mazen<br />
* automatic monospace font selection: At the moment SynEdit starts with a font 'courier'. But it would be better, if SynEdit would start with a monospace font (meaning: every character has the same width). At the moment the LCL TFont does not provide such a property. At the moment the user has to choose the right font.<br />
* automatic UTF-8 font selection: Same as above monospace, but also with an UTF-8 font, so that for example umlaute are shown correctly. At the moment the user has to choose the right font.<br />
* Dead keys. Most keyboards support typing two or more keys to create one special character (like accented or umlaut characters).<br />
* [[Redesign of the SynEdit component]]. The primary goal is more reliable display and navigation in the text. A more modular approach also allows for better integration of extensions, and for specialized controls, for use outside of Lazarus.<br />
<br />
=Смотрите также=<br />
<br />
* [[SynEdit Highlighter]]<br />
<br />
[[Category:Components]]</div>
Kverde
https://wiki.freepascal.org/index.php?title=SynEdit/ru&diff=55357
SynEdit/ru
2012-02-07T11:04:15Z
<p>Kverde: </p>
<hr />
<div>{{SynEdit}}<br />
<br />
= Общее =<br />
<br />
SynEdit находящийся в Lazarus основан на SynEdit 1.0.3 [[http://synedit.sourceforge.net/]], и была адаптированна и расширенна довольно сильно. Например поддержка UTF-8 и свертывание кода были добавленны.<br />
<br />
Пакет содержащий исходник компонента называется TSynEdit, некоторые syntax highlighters и другие компоненты используют исходник редактора.<br />
<br />
Он лиицензирован под темиже условиями что и оригинал SynEdit (MPL или GPL)<br />
<br />
= Synedit 2.0.5 port =<br />
<br />
Альтернативный порт текущей версии оригинального SynEdit :<br />
<br />
http://wiki.lazarus.freepascal.org/SynEdit/port<br />
<br />
code: <br />
https://github.com/rnapoles/<br />
<br />
= SynEdit в IDE =<br />
<br />
SynEdit в Лазарус является встроенным пакетом, потому что его использует IDE. Вот почему нет файлов .lpk.<br />
Компонент может быть найден в палитре компонентов на странице 'SynEdit'.<br />
<br />
= Использование SynEdit=<br />
<br />
== Подсветка ==<br />
<br />
* Используйте существующую подсветку или загрузите другую из [http://bugs.freepascal.org/view.php?id=18248 Подсветка для SynEdit]<br />
* Используйте настраеваимую подсветку (SynAnySyn или SynPositionSyn) (Смотрите прмеры того как использовать)<br />
* Напишите свою собственную [[SynEdit_Highlighter]]<br />
<br />
== (Авто-)завершение==<br />
<br />
Существует 2 плагина для SynEdit, для завершения:<br />
* TSynCompletion (используется в IDE)<br />
* TSynAutoComplete <br />
<br />
Примечание: TSynAutoComplete (из палитры компонентов) <b>не</b> имеет выпадающего списка.<br />
<br />
Смотрите примеры как использовать их обоих.<br />
<br />
== Изменение текста из кода ==<br />
<br />
Текст может быть получен через SynEdit.Lines. изменение текста через свойство Lines не работает с undo/redo. <br />
<br />
Используйте TextBetweenPoints и TextBetweenPointsEx для изменения текста, если вы хотите чтобы undo/redo работали.<br />
<br />
== Закладки ==<br />
<br />
Пожалуйста обратитесь к следуюзей теме на форуме: http://forum.lazarus.freepascal.org/index.php/topic,14948.msg79794.html<br />
<br />
= Примеры =<br />
<br />
<b>Примеры можно найти в каталоге lazarus/examples/synedit</b><br />
<br />
== Как добавить поддержку Copy, Paste, Cut, Undo, Redo и др. ==<br />
<br />
Эти возможности могут быть реализованны использованием комманд SynEdit.<br />
<br />
<delphi>uses<br />
...<br />
SynEdit, SynEditKeyCmds;<br />
<br />
procedure TfrmPrincipal.HandleCodigoKeyDown(Sender: TObject; var Key: Word;<br />
Shift: TShiftState);<br />
begin<br />
if (Shift = [ssCtrl]) then<br />
begin<br />
case Key of<br />
VK_C: synCodigo.CommandProcessor(TSynEditorCommand(ecCopy), ' ', nil);<br />
VK_V: synCodigo.CommandProcessor(TSynEditorCommand(ecPaste), ' ', nil);<br />
VK_X: synCodigo.CommandProcessor(TSynEditorCommand(ecCut), ' ', nil);<br />
end;<br />
end;<br />
end;</delphi><br />
<br />
= Дальнейшее развитие, обсуждение =<br />
<br />
* RTL (right-to-left): started by Mazen<br />
* automatic monospace font selection: At the moment SynEdit starts with a font 'courier'. But it would be better, if SynEdit would start with a monospace font (meaning: every character has the same width). At the moment the LCL TFont does not provide such a property. At the moment the user has to choose the right font.<br />
* automatic UTF-8 font selection: Same as above monospace, but also with an UTF-8 font, so that for example umlaute are shown correctly. At the moment the user has to choose the right font.<br />
* Dead keys. Most keyboards support typing two or more keys to create one special character (like accented or umlaut characters).<br />
* [[Redesign of the SynEdit component]]. The primary goal is more reliable display and navigation in the text. A more modular approach also allows for better integration of extensions, and for specialized controls, for use outside of Lazarus.<br />
<br />
=Смотрите также=<br />
<br />
* [[SynEdit Highlighter]]<br />
<br />
[[Category:Components]]</div>
Kverde
https://wiki.freepascal.org/index.php?title=SynEdit/ru&diff=55356
SynEdit/ru
2012-02-07T10:34:40Z
<p>Kverde: New page: {{SynEdit}} = General = The SynEdit contained in Lazarus is based on on SynEdit 1.0.3 http://synedit.sourceforge.net/, and was adapted and extended quite a lot. For example UTF-8 sup...</p>
<hr />
<div>{{SynEdit}}<br />
<br />
= General =<br />
<br />
The SynEdit contained in Lazarus is based on on SynEdit 1.0.3 [[http://synedit.sourceforge.net/]], and was adapted and extended quite a lot. For example UTF-8 support and code folding were added.<br />
<br />
The package contains a source editor component named TSynEdit, several syntax highlighters and other components used for surce editing.<br />
<br />
It is licensed under the same terms as the original SynEdit (MPL or GPL)<br />
<br />
= Synedit 2.0.5 port =<br />
<br />
An alternate port of the current version of the original SynEdit :<br />
<br />
http://wiki.lazarus.freepascal.org/SynEdit/port<br />
<br />
code: <br />
https://github.com/rnapoles/<br />
<br />
= SynEdit in the IDE =<br />
<br />
The SynEdit in lazarus is a built-in package, because the IDE uses it itself. That's why there is no .lpk file.<br />
The components can be found on the component palette on the 'SynEdit' page.<br />
<br />
= Using SynEdit=<br />
<br />
== Highlighting ==<br />
<br />
* Use an existing Highlighter or Download more from [http://bugs.freepascal.org/view.php?id=18248 Highlighter for SynEdit]<br />
* Use a customizable Highlighter (SynAnySyn or SynPositionSyn) (See Examples for how to use)<br />
* Write your own [[SynEdit_Highlighter]]<br />
<br />
== (Auto-)Completion ==<br />
<br />
There are 2 completion plugins for SynEdit:<br />
* TSynCompletion (the one used by the IDE)<br />
* TSynAutoComplete <br />
<br />
Note: TSynAutoComplete (from the component palette) is <b>not</b> does not have a drop-down.<br />
<br />
See examples for how to use both.<br />
<br />
== Change text from Code ==<br />
<br />
Text can be accessed via SynEdit.Lines. Changing text via the Lines property does not work with undo/redo <br />
<br />
Use TextBetweenPoints and TextBetweenPointsEx to change text, if you want undo/redo do work.<br />
<br />
== BookMarks ==<br />
<br />
Please see the following topic in the forum: http://forum.lazarus.freepascal.org/index.php/topic,14948.msg79794.html<br />
<br />
= Examples =<br />
<br />
<b>Examples can be found in the folder lazarus/examples/synedit</b><br />
<br />
== How to add support to Copy, Paste, Cut, Undo, Redo, etc ==<br />
<br />
These features can be implemented by using SynEdit commands.<br />
<br />
<delphi>uses<br />
...<br />
SynEdit, SynEditKeyCmds;<br />
<br />
procedure TfrmPrincipal.HandleCodigoKeyDown(Sender: TObject; var Key: Word;<br />
Shift: TShiftState);<br />
begin<br />
if (Shift = [ssCtrl]) then<br />
begin<br />
case Key of<br />
VK_C: synCodigo.CommandProcessor(TSynEditorCommand(ecCopy), ' ', nil);<br />
VK_V: synCodigo.CommandProcessor(TSynEditorCommand(ecPaste), ' ', nil);<br />
VK_X: synCodigo.CommandProcessor(TSynEditorCommand(ecCut), ' ', nil);<br />
end;<br />
end;<br />
end;</delphi><br />
<br />
= Further development, discussions =<br />
<br />
* RTL (right-to-left): started by Mazen<br />
* automatic monospace font selection: At the moment SynEdit starts with a font 'courier'. But it would be better, if SynEdit would start with a monospace font (meaning: every character has the same width). At the moment the LCL TFont does not provide such a property. At the moment the user has to choose the right font.<br />
* automatic UTF-8 font selection: Same as above monospace, but also with an UTF-8 font, so that for example umlaute are shown correctly. At the moment the user has to choose the right font.<br />
* Dead keys. Most keyboards support typing two or more keys to create one special character (like accented or umlaut characters).<br />
* [[Redesign of the SynEdit component]]. The primary goal is more reliable display and navigation in the text. A more modular approach also allows for better integration of extensions, and for specialized controls, for use outside of Lazarus.<br />
<br />
=See also=<br />
<br />
* [[SynEdit Highlighter]]<br />
<br />
[[Category:Components]]</div>
Kverde
https://wiki.freepascal.org/index.php?title=Template:SynEdit&diff=55355
Template:SynEdit
2012-02-07T10:33:54Z
<p>Kverde: </p>
<hr />
<div><small><br />
[[SynEdit/de|'''Deutsch (de)''']]<br />
[[SynEdit |'''English (en)''']]<br />
[[SynEdit/es|'''Español (es)''']]<br />
[[SynEdit/fr|'''Français (fr)''']]<br />
[[SynEdit/ja|'''Japanese (ja)''']]<br />
[[SynEdit/ru|'''Russian (ru)''']]<br />
</small></div>
Kverde
https://wiki.freepascal.org/index.php?title=Help:Editing/ru&diff=55353
Help:Editing/ru
2012-02-07T09:25:20Z
<p>Kverde: /* Using Mozilla Firefox */</p>
<hr />
<div>{{Template:Help:Editing}}<br />
<br />
Редактировать страницы wiki очень просто. Просто нажмите кнопку "'''Edit'''" ("'''Править'''") расположенную в верхней части меню справа. Это привдет вас на страницу с текствым полем содержашим редактируемый текст этой страницы. ''''Если вы хотите поэксперементировать, пожалуйста, сделайте это в нашей [[Sand Box|песочнице]], а не сдесь. Вы можете открыть [[Sand Box|песочницу]] в отдельном окне или вкладке чтобы иметь возможность видеть одновременно этот текст и вашы тесты в песочнице.'''''<br />
<br />
Type away, write a short [[Wikipedia:Edit summary|edit summary]] on the small field below the edit-box. You may use shorthand to describe your changes, as described in the [[Wikipedia:Edit summary legend|legend]], and when you've finished, press [[Wikipedia:Show preview|preview]] to see how your changes will look. Then press "Save". Depending on your system, pressing "Enter" while the edit box is not active (when there is no typing cursor in it) may have the same effect as pressing the "Save" button. Also, please do not vandalise the information on {{ns:4}}.<br />
<br />
Вы также можете нажать на кнопку "'''Обсуждение'''" (или ссылку "'''Обсудить эту страницу'''") чтобы уведить соответствующую [[Wikipedia:Talk page|страницу разговора]] которая содержит коментарии об этой странице от других польхователей Википедии. Нажмите кнопку "'''+'''" (или "'''Редактировать эту страницу'''") чтобы добавить комментарий.<br />
<br />
==Вики-разметка==<br />
В левой колонке таблицы снизу вы можете видеть какие эффекты возможны. В правой колонке, вы можете видеть как эти эффекты можно получить. Другими словами, чтобы сделать текст как в левой колонке, напечатайте его в формате который вы видите в правой колонке.<br />
<br />
Вы можете оставить эту страницу в отдельном окне браузера для справки. Если вы хотите попробовать эти веши бех опасности причинить вред, вы можете попробоватьсделать это '''в [[Sand_Box|песочнице]]'''.<br />
<br />
----<br />
<!--<br />
:'''The rest of this page is deprecated but will be updated periodically.''' <br />
:'''Please direct edits to the [[meta:MediaWiki User's Guide: Editing overview|Meta-Wikimedia version of this page]]'''<br />
<br />
--><br />
=== Разделы, параграфы, списки и линии ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! Как это выглядит<br />
! Что введено<br />
|- valign="top"<br />
|<br />
Начинайте свои [[Wikipedia:Manual of Style (headings)|разделы]] следующим образом:<br />
<br />
<!-- The following code messes up the table of contents<br />
and makes the section edit links much less useful,<br />
so please do not use it.<br />
== Новый раздел ==<br />
=== Подраздел ===<br />
==== Под-подраздел ====<br />
--><br />
<!-- The following should look almost the same, using<br />
HTML headings markup instead of wiki headings.<br />
However, it messes up the section edit links,<br />
so please do not use it.<br />
<h2>New section</h2><br />
<h3>Subsection</h3><br />
<h4>Sub-subsection</h4><br />
--><br />
<!-- The following just uses bolding and font changes,<br />
so it should be safe. However, it might not<br />
look exactly right, especially when people<br />
use non-standard CSS stylesheets.<br />
--><br />
'''<font style="font-size:120%">Новый раздел</font>'''<br />
<br />
'''<font style="font-size:110%">Подраздел</font>'''<br />
<br />
'''<font style="font-size:100%">Под-подраздел</font>'''<br />
<br />
* Начинайте с заголовка второго уровня (<tt><nowiki>==</nowiki></tt>); не используйте заголовок первого уровня (=).<br />
* Не пропускайте уровень (например заголовок второго уровня, а после него четвертого).<br />
* [[#Placement_of_the_Table_of_Contents_.28TOC.29|Содержание]] будет автоматически добавленно к статье которая содержит четыре или более разделов.<br />
|<br />
<pre><nowiki><br />
== Новый раздел ==<br />
<br />
=== Подраздел ===<br />
<br />
==== Под-подраздел ====<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Одиночные переводы строк<br />
вообще не оказываеют эффект на макет.<br />
Они могут использоватся для раздений <br />
предложений в одном абзаце.<br />
Некоторые редакторы считают что это облегчает редактирование<br />
и улучшает функцию ''diff'' <br />
(используется внутри для сравнения разныех версий страницы).<br />
<br />
Но пустая строка <br />
начинает новый параграф.<br />
<br />
* Когра вы используете список пустая строка влияет на шаблон ([[#lists|смотрите ниже]]).<br />
|<br />
<pre><nowiki><br />
Одиночные переводы строк<br />
вообще не оказываеют эффект на макет.<br />
Они могут использоватся для раздений <br />
предложений в одном абзаце.<br />
Некоторые редакторы считают что это облегчает редактирование<br />
и улучшает функцию ''diff'' <br />
(используется внутри для сравнения разныех версий страницы).<br />
<br />
Но пустая строка <br />
начинает новый параграф.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Вы можете разоравть строку<br><br />
не начиная новый параграф.<br />
<br />
* Пожалуйста не используйте это слишком часто.<br />
* Закрывайте разметку в одной строке, не делайте так: начало [[ссылки]] или ''курсива'' или '''жирного''' на одной строке, а окончание на следующей.<br />
|<br />
<pre><nowiki><br />
Вы можете разоравть строку<br><br />
не начиная новый параграф.<br />
</nowiki></pre><br />
|- id="lists" valign="top"<br />
|<br />
* Списки легко сделать:<br />
** Начинайте каждую линию со звездочки.<br />
*** Количество звезд означает уровень вложенности.<br />
**** Новая строка в списке<br />
означает конец списка.<br />
<br />
* An empty line starts a new list.<br />
|<br />
<pre><nowiki><br />
* Списки легко сделать:<br />
** Начинайте каждую линию со звездочки.<br />
*** Количество звезд означает уровень вложенности.<br />
**** Новая строка в списке<br />
означает конец списка.<br />
<br />
* Пустая строка начинает новый список<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
# Нумерованные списки тоже хороши<br />
## очень организованные<br />
## легко следовать<br />
### ещё проще<br />
|<br />
<pre><nowiki><br />
# Нумерованные списки тоже хороши<br />
## очень организованные<br />
## легко следовать<br />
### ещё проще<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Вы также можете делать смешанные списки<br />
*# и вкладывать их<br />
*#* как здесь<br />
|<br />
<pre><nowiki><br />
* Вы также можете делать смешанные списки<br />
*# и вкладывать их<br />
*#* как здесь<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
; Списко определений : список состоящий из определений<br />
; элемент: определение элемента (термина)<br />
; другой элемент<br />
: другое определение элемента<br />
<br />
* Один элемент в троке; перевод строки может находится перед двоиточием, а использование пробела перед двоиточием упрощает разбор.<br />
|<br />
<pre><nowiki><br />
; Списко определений : список состоящий из определений<br />
; элемент: определение элемента (термина)<br />
; другой элемент<br />
: другое определение элемента<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
: Двоиточее создает отступ строки или параграфа.<br />
Ручной перевод строки начинает новый параграф.<br />
<br />
* Это в первую очередь для отображения материала, но также может быть использовано для обсуждения на [[Wikipedia:Talk page|странице обсуждений]].<br />
|<br />
<pre><nowiki><br />
: Двоиточее создает отступ строки или параграфа.<br />
Ручной перевод строки начинает новый параграф.<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
IF строка начинается с пробела THEN<br />
она будет отформатированна <br />
спецальным образом;<br />
Со шрифтом фиксированной ширины;<br />
Без переноса строк;<br />
ENDIF<br />
<br />
*Это полезно для:<br />
** вВставки форматированного текста;<br />
** описания алгоритмов;<br />
** исходного кода программ;<br />
** [[ASCII art]];<br />
** химических структур;<br />
* '''WARNING''': Если вы это используете, вы заставите всю страниу быть широкой и менее читаемой, оссобенно для людей которые используют меньшее разрешение. Никогда не начинайте обычные строки с пробела.<br />
|<br />
<pre><nowiki><br />
IF строка начинается с пробела THEN<br />
она будет отформатированна <br />
спецальным образом;<br />
Со шрифтом фиксированной ширины;<br />
Без переноса строк;<br />
ENDIF<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<center>Центрированный текст.</center><br />
<br />
* Обратите внимание на американское написание "center" (не "centre").<br />
|<br />
<pre><nowiki><br />
<center>Центрированный текст.</center><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Горизонтальная разделительна линия:<br />
это над ней<br />
----<br />
а это под ней.<br />
<br />
* Полезно в основном для разделения потоков на стрницах обсуждений.<br />
* Также используется для устранения неоднозначности в статьях не создавая отдельную страницу.<br />
|<br />
<pre><nowiki><br />
Горизонтальная разделительна линия:<br />
это над ней<br />
----<br />
а это под ней.<br />
</nowiki></pre><br />
|}<br />
<br />
=== Links and URLs ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
London has [[public transport]].<br />
<br />
* A link to another Wikipedia article.<br />
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).<br />
* Thus the link above is to the [[URL]] http://www.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also [[Wikipedia:Canonicalization]].<br />
|<br />
<pre><nowiki><br />
London has [[public transport]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
<br />
* Same target, different name.<br />
* This is a [[piped link]].<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
<br />
* Endings are blended into the link.<br />
* Preferred style is to use this instead of a piped link, if possible.<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
See the [[Wikipedia:Manual of Style]].<br />
<br />
* A link to another [[Wikipedia:namespace|namespace]].<br />
|<br />
<pre><nowiki><br />
See the [[Wikipedia:Manual of Style]].<br />
</nowiki></pre><br />
|- id="link-to-section" valign="top"<br />
|<br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
<br />
* The part after the number sign (#) must match a section heading on the page, or an identifier created in some other way. Matches must be exact in terms of spelling, case and punctuation. Links to non-existent sections aren't broken; they are treated as links to the top of the page.<br />
* Identifiers may be created by attaching an <code>id="..."></code> attribute to almost any HTML element.<br />
|<br />
<pre><nowiki><br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|kingdom]].<br />
<br />
Automatically hide namespace:<br />
[[Wikipedia:Village Pump|Village Pump]]. <br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|Manual of Style]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
<br />
* The server fills in the part after the pipe character (|) when you save the page. The next time you open the edit box you will see the expanded piped link. When [[Wikipedia:Show preview|preview]]ing your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to links to sections within the same page ([[#link-to-section|see previous entry]]).<br />
|<br />
<pre><nowiki><br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|]].<br />
<br />
Automatically hide namespace: <br />
[[Wikipedia:Village Pump|]].<br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[The weather in London]] is a page<br />
that doesn't exist yet.<br />
<br />
* You can create it by clicking on the link (but please don't do so with this particular link).<br />
* To create a new page: <br />
*# Create a link to it on some other (related) page.<br />
*# Save that page.<br />
*# Click on the link you just made. The new page will open for editing.<br />
* For more information, see [[Wikipedia:How to start a page|How to start a page]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].<br />
* Please do not create a new article without linking to it from at least one other article.<br />
|<br />
<pre><nowiki><br />
[[The weather in London]] is a page <br />
that doesn't exist yet.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[Wikipedia:How to edit a page]] is this page.<br />
<br />
* [[Self link]]s appear as bold text when the article is viewed.<br />
* Do not use this technique to make the article name bold in the first paragraph; see the [[Wikipedia:Manual of Style#Article names|Manual of Style]].<br />
|<br />
<pre><nowiki><br />
[[Wikipedia:How to edit a page]] is this page.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: [[User:Brockert|Ben Brockert]]<br />
or four to add user name plus date/time:<br />
: [[User:Brockert|Ben Brockert]] 00:18, Nov 19, 2004 (UTC)<br />
Five tildes gives the date/time alone:<br />
: 00:18, Nov 19, 2004 (UTC)<br />
<br />
* The first two both provide a link to your [[Wikipedia:user page|user page]].<br />
|<br />
<pre><nowiki><br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: ~~~<br />
or four for user name plus date/time:<br />
: ~~~~<br />
Five tildes gives the date/time alone:<br />
: ~~~~~<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[USA]]").<br />
* Note that, while it is possible to link to a section, it is not possible to redirect to a section. For example, "<nowiki>#REDIRECT [[United States#History]]</nowiki>" will redirect to the [[United States]] page, but not to any particular section on it. This feature '''will not''' be implemented in the future, so such redirects should not be used.<br />
|<br />
<pre><nowiki><br />
#REDIRECT [[United States]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Link to a page on the same subject in another language by using a link of the form: <nowiki>[[language code:Title]]</nowiki>.<br />
* It does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
* Please see [[Wikipedia:Interlanguage links]] and the [[Wikipedia:Complete list of language wikis available|list of languages and codes]].<br />
|<br />
<pre><nowiki><br />
[[fr:Wikipédia:Aide]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
<br />
|<br />
<pre><nowiki><br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
|<br />
<pre><nowiki><br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To put an article in a [[Wikipedia:Category]], place a link like the one to the right anywhere in the article. As with interlanguage links, it does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
|<br />
<pre><nowiki><br />
[[Category:Character sets]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To ''link'' to a [[Wikipedia:Category]] page without putting the article into the category, use an initial colon (:) in the link.<br />
|<br />
<pre><nowiki><br />
[[:Category:Character sets]]<br />
</nowiki></pre><br />
|- id="link-external" valign="top"<br />
|<br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/ (bad style)<br />
# Unnamed link: [http://www.nupedia.com/] (bad style)<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
<br />
:See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts.<br />
<br />
* Square brackets indicate an external link. Note the use of a ''space'' (not a pipe) to separate the URL from the link text in the "named" version.<br />
* In the [[URL]], all symbols must be among:<br/>'''A-Z a-z 0-9 . _ \ / ~ % - + &amp; # ? ! = ( ) @ \x80-\xFF'''<br />
* If a URL contains a character not in this list, it should be encoded by using a percent sign (%) followed by the [[hexadecimal|hex]] code of the character, which can be found in the table of [[ASCII#ASCII printable characters|ASCII printable characters]]. For example, the caret character (^) would be encoded in a URL as '''%5E'''.<br />
* See [[Wikipedia:External links]] for style issues.<br />
|<br />
<pre><nowiki><br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/<br />
# Unnamed link: [http://www.nupedia.com/]<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|Hello]]<br />
<br />
* All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello<br />
* Note that interwiki links use the ''internal'' link style.<br />
* See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts; if the site you want to link to isn't on the list, use an external link ([[#link-external|see above]]).<br />
* See also [[Wikipedia:How to link to Wikimedia projects]].<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|fr:Bonjour]]<br />
<br />
* All of these forms lead to the URL http://fr.wiktionary.org/wiki/Bonjour<br />
|<br />
<pre><nowiki><br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|]]<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
<br />
* Link to books using their [[Wikipedia:ISBN|ISBN]] numbers. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors.<br />
* ISBN links do not need any extra markup, provided you use one of the indicated formats.<br />
|<br />
<pre><nowiki><br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
<br />
* Link dates in one of the above formats, so that everyone can set their own display order. If [[Special:Userlogin|logged in]], you can use [[Special:Preferences]] to change your own date display setting.<br />
* All of the above dates will appear as "[[20 July|20 July]] [[1969|1969]]" if you set your date display preference to "15 January 2001", but as "[[20 July|July 20]], [[1969|1969]]" if you set it to "January 15, 2001".<br />
|<br />
<pre><nowiki><br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[media:Sg_mrob.ogg|Sound]]<br />
<br />
*To include links to non-image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].<br />
<br />
Some uploaded sounds are listed at [[Wikipedia:Sound]].<br />
|<br />
<pre><nowiki><br />
[[media:Sg_mrob.ogg|Sound]]<br />
</nowiki></pre><br />
|}<br />
<br />
=== Images ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
| A picture: [[Image:Wiki.png]]<br />
<br />
or, with alternative text:<br />
[[Image:Wiki.png|jigsaw globe]]<br />
<br />
or, floating to the right side of the page and with a caption:<br />
[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
[[Image:Wiki.png|right|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
* Only images that have been uploaded to Wikipedia can be used. To upload images, use the [[Special:Upload|upload page]]. You can find the uploaded image on the [[Special:Imagelist|image list]].<br />
* See the [[Wikipedia:Image use policy|image use policy]], [[Wikipedia:Image markup|extended image markup/syntax]] (also possibly [[Wikipedia:Image markup with HTML|image HTML markup]]) for more hints.<br />
* Alternative text, used when the image isn't loaded, in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternate text for images|Alternate text for images]] for help on choosing it.<br />
* The frame tag automatically floats the image right.<br />
| <pre><nowiki><br />
A picture: [[Image:Wiki.png]]</nowiki><br />
<br />
or, with alternative text:<br />
<nowiki>[[Image:Wiki.png|jigsaw globe]]</nowiki><br />
<br />
or, floating to the right side of the page and with a caption:<br />
<nowiki>[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]</nowiki><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
<nowiki>[[Image:Wiki.png|right|Wikipedia Encyclopedia]]</nowiki></pre><br />
|-<br />
|<br />
Clicking on an uploaded image displays a description page, which you can also link directly to: [[:Image:Wiki.png]]<br />
| <pre><nowiki><br />
<br />
[[:Image:Wiki.png]]<br />
</nowiki></pre><br />
|-<br />
|<br />
To include links to images shown as links instead of drawn on the page, use a "media" link.<br />
<br />
<br/>[[media:Tornado.jpg|Image of a Tornado]]<br />
|<br />
<pre><br />
<nowiki><br />
<br />
[[media:Tornado.jpg|Image of a Tornado]]<br />
<br />
</nowiki></pre><br />
|}<br />
<br />
=== Character formatting ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|- valign="top"<br />
! What it looks like<br />
! What you type<br />
|- id="emph" valign="top"<br />
|<br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
* These are double and triple apostrophes (single-quote marks), not double-quote marks.<br />
|<br />
<pre><nowiki><br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<math>\sin x + \ln y</math><br><br />
sin''x'' + ln''y''<br />
<!-- no space between roman "sin" and italic "x" --><br />
<br />
<math>\mathbf{x} = 0</math><br><br />
'''x''' = 0<br />
<br />
Ordinary text should use [[#emph|wiki markup for emphasis]], and should not use <code>&lt;i&gt;</code> or <code>&lt;b&gt;</code>. However, mathematical formulas often use italics, and sometimes use bold, for reasons unrelated to emphasis. Complex formulas should use [[m:Help:Formula|<code>&lt;math&gt;</code> markup]], and simple formulas may use <code>&lt;math&gt;</code>; or <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>; or <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code>. According to [[Wikipedia:WikiProject Mathematics#Italicization and bolding|WikiProject Mathematics]], wiki markup is preferred over HTML markup like <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>.<br />
|<br />
<pre><nowiki><br />
<math>\sin x + \ln y</math><br />
sin''x'' + ln''y''<br />
<br />
<math>\mathbf{x} = 0</math><br />
'''x''' = 0<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
<br />
* For semantic reasons, using <code>&lt;code&gt;</code> where applicable is preferable to using <code>&lt;tt&gt;</code>.<br />
|<br />
<pre><nowiki><br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can use <small>small text</small> for captions.<br />
|<br />
<pre><nowiki><br />
You can use <small>small text</small> for captions.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
<br />
* When editing regular Wikipedia articles, just make your changes and don't mark them up in any special way.<br />
* When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.<br />
|<br />
<pre><nowiki><br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Diacritical marks:'''<br />
<br/><br />
è é ê ë ì í<br />
<br />
À Á Â Ã Ä Å <br/><br />
Æ Ç È É Ê Ë <br/><br />
Ì Í<br />
Î Ï Ñ Ò <br/><br />
Ó Ô Õ<br />
Ö Ø Ù <br/><br />
Ú Û Ü ß<br />
à á <br/><br />
â ã ä å æ<br />
ç <br/><br />
è é ê ë ì í<br/><br />
î ï ñ ò ó ô <br/><br />
&oelig; õ<br />
ö ø ù ú <br/><br />
û ü ÿ<br />
<br />
* See [[meta:Help:Special characters|special characters]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
è é ê ë ì í<br />
<br />
&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; <br />
&amp;AElig; &amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml; <br />
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde; &amp;Ograve; <br />
&amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;Ugrave; <br />
&amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;szlig; &amp;agrave; &amp;aacute; <br />
&amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil; <br />
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml; &amp;igrave; &amp;iacute;<br />
&amp;icirc; &amp;iuml; &amp;ntilde; &amp;ograve; &amp;oacute; &amp;ocirc; <br />
&amp;oelig; &amp;otilde; &amp;ouml; &amp;oslash; &amp;ugrave; &amp;uacute; <br />
&amp;ucirc; &amp;uuml; &amp;yuml;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Punctuation:'''<br />
<br/><br />
¿ ¡ § ¶<br/><br />
&dagger; &Dagger; &bull; &ndash; &mdash;<br/><br />
&lsaquo; &rsaquo; « »<br/><br />
&lsquo; &rsquo; &ldquo; &rdquo;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;<br />
&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;<br />
&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;<br />
&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commercial symbols:'''<br />
<br/><br />
&trade; © ® ¢ &euro; ¥<br/><br />
£ ¤<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;trade; &amp;copy; &amp;reg; &amp;cent; &amp;euro; &amp;yen; <br />
&amp;pound; &amp;curren;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Subscripts:'''<br />
<br/><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
<br />
'''Superscripts:'''<br />
<br/><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&sup1; x&sup2; x&sup3;<br />
*The latter method of superscripting can't be used in the most general context, but is preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.<br />
<br />
&epsilon;<sub>0</sub> =<br />
8.85 &times; 10<sup>&minus;12</sup><br />
C&sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&sup2;]]<br />
|<br />
<br/><br />
<pre><nowiki><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
</nowiki></pre><br />
<br />
<pre><nowiki><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&amp;sup1; x&amp;sup2; x&amp;sup3;<br />
<br />
&amp;epsilon;<sub>0</sub> =<br />
8.85 &amp;times; 10<sup>&amp;minus;12</sup><br />
C&amp;sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&amp;sup2;]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Greek characters:'''<br />
<br/><br />
&alpha; &beta; &gamma; &delta; &epsilon; &zeta;<br/><br />
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu;<br/><br />
&xi; &omicron; &pi; &rho; &sigma; &sigmaf;<br/><br />
&tau; &upsilon; &phi; &chi; &psi; &omega;<br/><br />
&Gamma; &Delta; &Theta; &Lambda; &Xi; &Pi;<br/><br />
&Sigma; &Phi; &Psi; &Omega;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; <br />
&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu; <br />
&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;<br />
&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;<br />
&amp;Gamma; &amp;Delta; &amp;Theta; &amp;Lambda; &amp;Xi; &amp;Pi; <br />
&amp;Sigma; &amp;Phi; &amp;Psi; &amp;Omega;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Math characters:'''<br />
<br/><br />
&int; &sum; &prod; &radic; &minus; &plusmn; &infin;<br/><br />
&asymp; &prop; &equiv; &ne; &le; &ge; &rarr;<br/><br />
&times; &middot; &divide; &part; &prime; &Prime;<br/><br />
&nabla; &permil; &deg; &there4; &alefsym; &oslash;<br/><br />
&isin; &notin; &cap; &cup; &sub; &sup; &sube; &supe;<br/><br />
&not; &and; &or; &exist; &forall; &rArr; &hArr;<br/><br />
&rarr; &harr;<br/><br />
* See also [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;int; &amp;sum; &amp;prod; &amp;radic; &amp;minus; &amp;plusmn; &amp;infin;<br />
&amp;asymp; &amp;prop; &amp;equiv; &amp;ne; &amp;le; &amp;ge; &amp;rarr;<br />
&amp;times; &amp;middot; &amp;divide; &amp;part; &amp;prime; &amp;Prime;<br />
&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym; &amp;oslash;<br />
&amp;isin; &amp;notin; &amp;cap; &amp;cup; &amp;sub; &amp;sup; &amp;sube; &amp;supe;<br />
&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall; &amp;rArr; &amp;hArr;<br />
&amp;rarr; &amp;harr;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Spacing in simple math formulas:'''<br />
<br/><br />
Obviously, ''x''&sup2;&nbsp;&ge;&nbsp;0 is true.<br />
*To space things out without allowing line breaks to interrupt the formula, use non-breaking spaces: <tt>&amp;nbsp;</tt>.<br />
|<br />
<br/><br />
<pre><nowiki><br />
Obviously, ''x''&amp;sup2;&amp;nbsp;&amp;ge;&amp;nbsp;0 is true.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Complicated formulas:'''<br />
<br/><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
* See [[m:Help:Formula]] for how to use <tt>&lt;math></tt>.<br />
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.<br />
|<br />
<br/><br />
<pre><nowiki><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Suppressing interpretation of markup:'''<br />
<br/><br />
<nowiki>Link &rarr; (''to'') the [[Wikipedia FAQ]]</nowiki><br />
* Used to show literal data that would otherwise have special meaning.<br />
* Escape all wiki markup, including that which looks like HTML tags.<br />
* Does not escape HTML character references.<br />
* To escape HTML character references such as <tt>&amp;rarr;</tt> use <tt>&amp;amp;rarr;</tt><br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;nowiki>Link &amp;rarr; (''to'') <br />
the [[Wikipedia FAQ]]&lt;/nowiki><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commenting page source:'''<br />
<br/><br />
''not shown when viewing page''<br />
* Used to leave comments in a page for future editors.<br />
* Note that most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;!-- comment here --><br />
</nowiki></pre><br />
|}<br />
''(see also: [[Chess symbols in Unicode]])''<br />
<br />
=== Tables ===<br />
==== Placement of the Table of Contents (TOC) ====<br />
At the current status of the wiki markup language, having at least four headers on a page triggers the TOC to appear in front of the first header (or after introductory sections). Putting <nowiki>__TOC__</nowiki> anywhere forces the TOC to appear at that point (instead of just before the first header). Putting <nowiki>__NOTOC__</nowiki> anywhere forces the TOC to disappear. See also [[Wikipedia:Section#Compact_TOC|compact TOC]] for alphabet and year headings.<br />
<br />
==== Keeping headings out of the Table of Contents ====<br />
<br />
If you want some subheadings to not appear in the Table of Contents, then make the following replacements.<br />
<br />
Replace <nowiki> == Header 2 == with <h2> Header 2 </h2> </nowiki><br />
<br />
Replace <nowiki> === Header 3 === with <h3> Header 3 </h3> </nowiki><br />
<br />
And so forth.<br />
<br />
For example, notice that the following header has the same font as the other subheaders to this "Tables" section, but the following header does not appear in the Table of Contents for this page.<br />
<br />
<h4> This header has the h4 font, but is NOT in the Table of Contents </h4><br />
<br />
This effect is obtained by the following line of code.<br />
<br />
<nowiki><h4> This header has the h4 font, but is NOT in the Table of Contents </h4></nowiki><br />
<br />
<br />
==== Tables ====<br />
There are two ways to build tables: <br />
*in special Wiki-markup (see [[m:Help:Table]])<br />
*with the usual HTML elements: &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; or &lt;th&gt;.<br />
<br />
For the latter, and a discussion on when tables are appropriate, see [[Wikipedia:How to use tables]].<br />
<br />
=== Variables ===<br />
<br />
''(See also [[m:Help:Variable]])''<br />
{|<br />
|-<br />
! Code<br />
! Effect<br />
|-<br />
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAME}}</nowiki><br />
| {{CURRENTMONTHNAME}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki><br />
| {{CURRENTMONTHNAMEGEN}}<br />
|-<br />
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}<br />
|-<br />
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}<br />
|-<br />
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}<br />
|-<br />
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}<br />
|-<br />
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br />
| {{NUMBEROFARTICLES}}<br />
|-<br />
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}<br />
|-<br />
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}<br />
|-<br />
| <nowiki>{{localurl:pagename}}</nowiki><br />
| {{localurl:pagename}}<br />
|-<br />
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki><br />
| {{localurl:Wikipedia:Sandbox|action=edit}}<br />
|-<br />
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}<br />
|-<br />
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}<br />
|-<br />
| <nowiki>{{ns:2}}</nowiki> || {{ns:2}}<br />
|-<br />
| <nowiki>{{ns:3}}</nowiki> || {{ns:3}}<br />
|-<br />
| <nowiki>{{ns:4}}</nowiki> || {{ns:4}}<br />
|-<br />
| <nowiki>{{ns:5}}</nowiki> || {{ns:5}}<br />
|-<br />
| <nowiki>{{ns:6}}</nowiki> || {{ns:6}}<br />
|-<br />
| <nowiki>{{ns:7}}</nowiki> || {{ns:7}}<br />
|-<br />
| <nowiki>{{ns:8}}</nowiki> || {{ns:8}}<br />
|-<br />
| <nowiki>{{ns:9}}</nowiki> || {{ns:9}}<br />
|-<br />
| <nowiki>{{ns:10}}</nowiki> || {{ns:10}}<br />
|-<br />
| <nowiki>{{ns:11}}</nowiki> || {{ns:11}}<br />
|-<br />
| <nowiki>{{ns:12}}</nowiki> || {{ns:12}}<br />
|-<br />
| <nowiki>{{ns:13}}</nowiki> || {{ns:13}}<br />
|-<br />
| <nowiki>{{ns:14}}</nowiki> || {{ns:14}}<br />
|-<br />
| <nowiki>{{ns:15}}</nowiki> || {{ns:15}}<br />
|-<br />
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}<br />
|}<br />
<br />
'''NUMBEROFARTICLES''' is the number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.<br />
<br />
=== Templates ===<br />
<br />
The [[Wikipedia:MediaWiki|MediaWiki]] software used by Wikipedia has limited support for template inclusion. This means standardized text chunks (such as boilerplate text) can be inserted into articles. For example, typing <nowiki>{{stub}}</nowiki> will appear as "''This article is a [[Wikipedia:The perfect stub article|stub]]. You can help Wikipedia by [[Wikipedia:Find or fix a stub|expanding it]].''" when the page is saved. See [[Wikipedia:Template messages]] for the complete list. Other commonly used ones are: <nowiki>{{disambig}}</nowiki> for disambiguation pages, <nowiki>{{spoiler}}</nowiki> for spoiler warnings and <nowiki>{{sectstub}}</nowiki> like an article stub but for a section. The are many subject-specific stubs e.g.: <nowiki> {{Geo-stub}}, {{Hist-stub}} and {{Linux-stub}}</nowiki>. For a complete list of stubs see [[Wikipedia:Template messages/Stubs]].<br />
<br />
=== Hiding the edit links ===<br />
<br />
Insert '''<nowiki>__NOEDITSECTION__</nowiki>''' into the document to suppress the edit links that appear next to every section header.<br />
<br />
== See also ==<br />
*[[m:Help:Formula]]<br />
*[[m:Help:Editing|Mediawiki user's guide to editing]]<br />
*[[Wikipedia:MediaWiki]].<br />
*[[HTML element]].<br />
*[[Wikipedia:Protection policy]]</div>
Kverde
https://wiki.freepascal.org/index.php?title=Help:Editing/ru&diff=55352
Help:Editing/ru
2012-02-07T09:14:43Z
<p>Kverde: /* Разделы, параграфы, списки и линии */</p>
<hr />
<div>{{Template:Help:Editing}}<br />
<br />
Редактировать страницы wiki очень просто. Просто нажмите кнопку "'''Edit'''" ("'''Править'''") расположенную в верхней части меню справа. Это привдет вас на страницу с текствым полем содержашим редактируемый текст этой страницы. ''''Если вы хотите поэксперементировать, пожалуйста, сделайте это в нашей [[Sand Box|песочнице]], а не сдесь. Вы можете открыть [[Sand Box|песочницу]] в отдельном окне или вкладке чтобы иметь возможность видеть одновременно этот текст и вашы тесты в песочнице.'''''<br />
<br />
Type away, write a short [[Wikipedia:Edit summary|edit summary]] on the small field below the edit-box. You may use shorthand to describe your changes, as described in the [[Wikipedia:Edit summary legend|legend]], and when you've finished, press [[Wikipedia:Show preview|preview]] to see how your changes will look. Then press "Save". Depending on your system, pressing "Enter" while the edit box is not active (when there is no typing cursor in it) may have the same effect as pressing the "Save" button. Also, please do not vandalise the information on {{ns:4}}.<br />
<br />
Вы также можете нажать на кнопку "'''Обсуждение'''" (или ссылку "'''Обсудить эту страницу'''") чтобы уведить соответствующую [[Wikipedia:Talk page|страницу разговора]] которая содержит коментарии об этой странице от других польхователей Википедии. Нажмите кнопку "'''+'''" (или "'''Редактировать эту страницу'''") чтобы добавить комментарий.<br />
<br />
==Вики-разметка==<br />
В левой колонке таблицы снизу вы можете видеть какие эффекты возможны. В правой колонке, вы можете видеть как эти эффекты можно получить. Другими словами, чтобы сделать текст как в левой колонке, напечатайте его в формате который вы видите в правой колонке.<br />
<br />
Вы можете оставить эту страницу в отдельном окне браузера для справки. Если вы хотите попробовать эти веши бех опасности причинить вред, вы можете попробоватьсделать это '''в [[Sand_Box|песочнице]]'''.<br />
<br />
----<br />
<!--<br />
:'''The rest of this page is deprecated but will be updated periodically.''' <br />
:'''Please direct edits to the [[meta:MediaWiki User's Guide: Editing overview|Meta-Wikimedia version of this page]]'''<br />
<br />
--><br />
=== Разделы, параграфы, списки и линии ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! Как это выглядит<br />
! Что введено<br />
|- valign="top"<br />
|<br />
Начинайте свои [[Wikipedia:Manual of Style (headings)|разделы]] следующим образом:<br />
<br />
<!-- The following code messes up the table of contents<br />
and makes the section edit links much less useful,<br />
so please do not use it.<br />
== Новый раздел ==<br />
=== Подраздел ===<br />
==== Под-подраздел ====<br />
--><br />
<!-- The following should look almost the same, using<br />
HTML headings markup instead of wiki headings.<br />
However, it messes up the section edit links,<br />
so please do not use it.<br />
<h2>New section</h2><br />
<h3>Subsection</h3><br />
<h4>Sub-subsection</h4><br />
--><br />
<!-- The following just uses bolding and font changes,<br />
so it should be safe. However, it might not<br />
look exactly right, especially when people<br />
use non-standard CSS stylesheets.<br />
--><br />
'''<font style="font-size:120%">Новый раздел</font>'''<br />
<br />
'''<font style="font-size:110%">Подраздел</font>'''<br />
<br />
'''<font style="font-size:100%">Под-подраздел</font>'''<br />
<br />
* Начинайте с заголовка второго уровня (<tt><nowiki>==</nowiki></tt>); не используйте заголовок первого уровня (=).<br />
* Не пропускайте уровень (например заголовок второго уровня, а после него четвертого).<br />
* [[#Placement_of_the_Table_of_Contents_.28TOC.29|Содержание]] будет автоматически добавленно к статье которая содержит четыре или более разделов.<br />
|<br />
<pre><nowiki><br />
== Новый раздел ==<br />
<br />
=== Подраздел ===<br />
<br />
==== Под-подраздел ====<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Одиночные переводы строк<br />
вообще не оказываеют эффект на макет.<br />
Они могут использоватся для раздений <br />
предложений в одном абзаце.<br />
Некоторые редакторы считают что это облегчает редактирование<br />
и улучшает функцию ''diff'' <br />
(используется внутри для сравнения разныех версий страницы).<br />
<br />
Но пустая строка <br />
начинает новый параграф.<br />
<br />
* Когра вы используете список пустая строка влияет на шаблон ([[#lists|смотрите ниже]]).<br />
|<br />
<pre><nowiki><br />
Одиночные переводы строк<br />
вообще не оказываеют эффект на макет.<br />
Они могут использоватся для раздений <br />
предложений в одном абзаце.<br />
Некоторые редакторы считают что это облегчает редактирование<br />
и улучшает функцию ''diff'' <br />
(используется внутри для сравнения разныех версий страницы).<br />
<br />
Но пустая строка <br />
начинает новый параграф.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Вы можете разоравть строку<br><br />
не начиная новый параграф.<br />
<br />
* Пожалуйста не используйте это слишком часто.<br />
* Закрывайте разметку в одной строке, не делайте так: начало [[ссылки]] или ''курсива'' или '''жирного''' на одной строке, а окончание на следующей.<br />
|<br />
<pre><nowiki><br />
Вы можете разоравть строку<br><br />
не начиная новый параграф.<br />
</nowiki></pre><br />
|- id="lists" valign="top"<br />
|<br />
* Списки легко сделать:<br />
** Начинайте каждую линию со звездочки.<br />
*** Количество звезд означает уровень вложенности.<br />
**** Новая строка в списке<br />
означает конец списка.<br />
<br />
* An empty line starts a new list.<br />
|<br />
<pre><nowiki><br />
* Списки легко сделать:<br />
** Начинайте каждую линию со звездочки.<br />
*** Количество звезд означает уровень вложенности.<br />
**** Новая строка в списке<br />
означает конец списка.<br />
<br />
* Пустая строка начинает новый список<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
# Нумерованные списки тоже хороши<br />
## очень организованные<br />
## легко следовать<br />
### ещё проще<br />
|<br />
<pre><nowiki><br />
# Нумерованные списки тоже хороши<br />
## очень организованные<br />
## легко следовать<br />
### ещё проще<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Вы также можете делать смешанные списки<br />
*# и вкладывать их<br />
*#* как здесь<br />
|<br />
<pre><nowiki><br />
* Вы также можете делать смешанные списки<br />
*# и вкладывать их<br />
*#* как здесь<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
; Списко определений : список состоящий из определений<br />
; элемент: определение элемента (термина)<br />
; другой элемент<br />
: другое определение элемента<br />
<br />
* Один элемент в троке; перевод строки может находится перед двоиточием, а использование пробела перед двоиточием упрощает разбор.<br />
|<br />
<pre><nowiki><br />
; Списко определений : список состоящий из определений<br />
; элемент: определение элемента (термина)<br />
; другой элемент<br />
: другое определение элемента<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
: Двоиточее создает отступ строки или параграфа.<br />
Ручной перевод строки начинает новый параграф.<br />
<br />
* Это в первую очередь для отображения материала, но также может быть использовано для обсуждения на [[Wikipedia:Talk page|странице обсуждений]].<br />
|<br />
<pre><nowiki><br />
: Двоиточее создает отступ строки или параграфа.<br />
Ручной перевод строки начинает новый параграф.<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
IF строка начинается с пробела THEN<br />
она будет отформатированна <br />
спецальным образом;<br />
Со шрифтом фиксированной ширины;<br />
Без переноса строк;<br />
ENDIF<br />
<br />
*Это полезно для:<br />
** вВставки форматированного текста;<br />
** описания алгоритмов;<br />
** исходного кода программ;<br />
** [[ASCII art]];<br />
** химических структур;<br />
* '''WARNING''': Если вы это используете, вы заставите всю страниу быть широкой и менее читаемой, оссобенно для людей которые используют меньшее разрешение. Никогда не начинайте обычные строки с пробела.<br />
|<br />
<pre><nowiki><br />
IF строка начинается с пробела THEN<br />
она будет отформатированна <br />
спецальным образом;<br />
Со шрифтом фиксированной ширины;<br />
Без переноса строк;<br />
ENDIF<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<center>Центрированный текст.</center><br />
<br />
* Обратите внимание на американское написание "center" (не "centre").<br />
|<br />
<pre><nowiki><br />
<center>Центрированный текст.</center><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Горизонтальная разделительна линия:<br />
это над ней<br />
----<br />
а это под ней.<br />
<br />
* Полезно в основном для разделения потоков на стрницах обсуждений.<br />
* Также используется для устранения неоднозначности в статьях не создавая отдельную страницу.<br />
|<br />
<pre><nowiki><br />
Горизонтальная разделительна линия:<br />
это над ней<br />
----<br />
а это под ней.<br />
</nowiki></pre><br />
|}<br />
<br />
=== Links and URLs ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
London has [[public transport]].<br />
<br />
* A link to another Wikipedia article.<br />
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).<br />
* Thus the link above is to the [[URL]] http://www.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also [[Wikipedia:Canonicalization]].<br />
|<br />
<pre><nowiki><br />
London has [[public transport]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
<br />
* Same target, different name.<br />
* This is a [[piped link]].<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
<br />
* Endings are blended into the link.<br />
* Preferred style is to use this instead of a piped link, if possible.<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
See the [[Wikipedia:Manual of Style]].<br />
<br />
* A link to another [[Wikipedia:namespace|namespace]].<br />
|<br />
<pre><nowiki><br />
See the [[Wikipedia:Manual of Style]].<br />
</nowiki></pre><br />
|- id="link-to-section" valign="top"<br />
|<br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
<br />
* The part after the number sign (#) must match a section heading on the page, or an identifier created in some other way. Matches must be exact in terms of spelling, case and punctuation. Links to non-existent sections aren't broken; they are treated as links to the top of the page.<br />
* Identifiers may be created by attaching an <code>id="..."></code> attribute to almost any HTML element.<br />
|<br />
<pre><nowiki><br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|kingdom]].<br />
<br />
Automatically hide namespace:<br />
[[Wikipedia:Village Pump|Village Pump]]. <br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|Manual of Style]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
<br />
* The server fills in the part after the pipe character (|) when you save the page. The next time you open the edit box you will see the expanded piped link. When [[Wikipedia:Show preview|preview]]ing your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to links to sections within the same page ([[#link-to-section|see previous entry]]).<br />
|<br />
<pre><nowiki><br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|]].<br />
<br />
Automatically hide namespace: <br />
[[Wikipedia:Village Pump|]].<br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[The weather in London]] is a page<br />
that doesn't exist yet.<br />
<br />
* You can create it by clicking on the link (but please don't do so with this particular link).<br />
* To create a new page: <br />
*# Create a link to it on some other (related) page.<br />
*# Save that page.<br />
*# Click on the link you just made. The new page will open for editing.<br />
* For more information, see [[Wikipedia:How to start a page|How to start a page]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].<br />
* Please do not create a new article without linking to it from at least one other article.<br />
|<br />
<pre><nowiki><br />
[[The weather in London]] is a page <br />
that doesn't exist yet.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[Wikipedia:How to edit a page]] is this page.<br />
<br />
* [[Self link]]s appear as bold text when the article is viewed.<br />
* Do not use this technique to make the article name bold in the first paragraph; see the [[Wikipedia:Manual of Style#Article names|Manual of Style]].<br />
|<br />
<pre><nowiki><br />
[[Wikipedia:How to edit a page]] is this page.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: [[User:Brockert|Ben Brockert]]<br />
or four to add user name plus date/time:<br />
: [[User:Brockert|Ben Brockert]] 00:18, Nov 19, 2004 (UTC)<br />
Five tildes gives the date/time alone:<br />
: 00:18, Nov 19, 2004 (UTC)<br />
<br />
* The first two both provide a link to your [[Wikipedia:user page|user page]].<br />
|<br />
<pre><nowiki><br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: ~~~<br />
or four for user name plus date/time:<br />
: ~~~~<br />
Five tildes gives the date/time alone:<br />
: ~~~~~<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[USA]]").<br />
* Note that, while it is possible to link to a section, it is not possible to redirect to a section. For example, "<nowiki>#REDIRECT [[United States#History]]</nowiki>" will redirect to the [[United States]] page, but not to any particular section on it. This feature '''will not''' be implemented in the future, so such redirects should not be used.<br />
|<br />
<pre><nowiki><br />
#REDIRECT [[United States]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Link to a page on the same subject in another language by using a link of the form: <nowiki>[[language code:Title]]</nowiki>.<br />
* It does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
* Please see [[Wikipedia:Interlanguage links]] and the [[Wikipedia:Complete list of language wikis available|list of languages and codes]].<br />
|<br />
<pre><nowiki><br />
[[fr:Wikipédia:Aide]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
<br />
|<br />
<pre><nowiki><br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
|<br />
<pre><nowiki><br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To put an article in a [[Wikipedia:Category]], place a link like the one to the right anywhere in the article. As with interlanguage links, it does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
|<br />
<pre><nowiki><br />
[[Category:Character sets]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To ''link'' to a [[Wikipedia:Category]] page without putting the article into the category, use an initial colon (:) in the link.<br />
|<br />
<pre><nowiki><br />
[[:Category:Character sets]]<br />
</nowiki></pre><br />
|- id="link-external" valign="top"<br />
|<br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/ (bad style)<br />
# Unnamed link: [http://www.nupedia.com/] (bad style)<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
<br />
:See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts.<br />
<br />
* Square brackets indicate an external link. Note the use of a ''space'' (not a pipe) to separate the URL from the link text in the "named" version.<br />
* In the [[URL]], all symbols must be among:<br/>'''A-Z a-z 0-9 . _ \ / ~ % - + &amp; # ? ! = ( ) @ \x80-\xFF'''<br />
* If a URL contains a character not in this list, it should be encoded by using a percent sign (%) followed by the [[hexadecimal|hex]] code of the character, which can be found in the table of [[ASCII#ASCII printable characters|ASCII printable characters]]. For example, the caret character (^) would be encoded in a URL as '''%5E'''.<br />
* See [[Wikipedia:External links]] for style issues.<br />
|<br />
<pre><nowiki><br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/<br />
# Unnamed link: [http://www.nupedia.com/]<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|Hello]]<br />
<br />
* All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello<br />
* Note that interwiki links use the ''internal'' link style.<br />
* See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts; if the site you want to link to isn't on the list, use an external link ([[#link-external|see above]]).<br />
* See also [[Wikipedia:How to link to Wikimedia projects]].<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|fr:Bonjour]]<br />
<br />
* All of these forms lead to the URL http://fr.wiktionary.org/wiki/Bonjour<br />
|<br />
<pre><nowiki><br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|]]<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
<br />
* Link to books using their [[Wikipedia:ISBN|ISBN]] numbers. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors.<br />
* ISBN links do not need any extra markup, provided you use one of the indicated formats.<br />
|<br />
<pre><nowiki><br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
<br />
* Link dates in one of the above formats, so that everyone can set their own display order. If [[Special:Userlogin|logged in]], you can use [[Special:Preferences]] to change your own date display setting.<br />
* All of the above dates will appear as "[[20 July|20 July]] [[1969|1969]]" if you set your date display preference to "15 January 2001", but as "[[20 July|July 20]], [[1969|1969]]" if you set it to "January 15, 2001".<br />
|<br />
<pre><nowiki><br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[media:Sg_mrob.ogg|Sound]]<br />
<br />
*To include links to non-image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].<br />
<br />
Some uploaded sounds are listed at [[Wikipedia:Sound]].<br />
|<br />
<pre><nowiki><br />
[[media:Sg_mrob.ogg|Sound]]<br />
</nowiki></pre><br />
|}<br />
<br />
=== Images ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
| A picture: [[Image:Wiki.png]]<br />
<br />
or, with alternative text:<br />
[[Image:Wiki.png|jigsaw globe]]<br />
<br />
or, floating to the right side of the page and with a caption:<br />
[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
[[Image:Wiki.png|right|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
* Only images that have been uploaded to Wikipedia can be used. To upload images, use the [[Special:Upload|upload page]]. You can find the uploaded image on the [[Special:Imagelist|image list]].<br />
* See the [[Wikipedia:Image use policy|image use policy]], [[Wikipedia:Image markup|extended image markup/syntax]] (also possibly [[Wikipedia:Image markup with HTML|image HTML markup]]) for more hints.<br />
* Alternative text, used when the image isn't loaded, in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternate text for images|Alternate text for images]] for help on choosing it.<br />
* The frame tag automatically floats the image right.<br />
| <pre><nowiki><br />
A picture: [[Image:Wiki.png]]</nowiki><br />
<br />
or, with alternative text:<br />
<nowiki>[[Image:Wiki.png|jigsaw globe]]</nowiki><br />
<br />
or, floating to the right side of the page and with a caption:<br />
<nowiki>[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]</nowiki><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
<nowiki>[[Image:Wiki.png|right|Wikipedia Encyclopedia]]</nowiki></pre><br />
|-<br />
|<br />
Clicking on an uploaded image displays a description page, which you can also link directly to: [[:Image:Wiki.png]]<br />
| <pre><nowiki><br />
<br />
[[:Image:Wiki.png]]<br />
</nowiki></pre><br />
|-<br />
|<br />
To include links to images shown as links instead of drawn on the page, use a "media" link.<br />
<br />
<br/>[[media:Tornado.jpg|Image of a Tornado]]<br />
|<br />
<pre><br />
<nowiki><br />
<br />
[[media:Tornado.jpg|Image of a Tornado]]<br />
<br />
</nowiki></pre><br />
|}<br />
<br />
=== Character formatting ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|- valign="top"<br />
! What it looks like<br />
! What you type<br />
|- id="emph" valign="top"<br />
|<br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
* These are double and triple apostrophes (single-quote marks), not double-quote marks.<br />
|<br />
<pre><nowiki><br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<math>\sin x + \ln y</math><br><br />
sin''x'' + ln''y''<br />
<!-- no space between roman "sin" and italic "x" --><br />
<br />
<math>\mathbf{x} = 0</math><br><br />
'''x''' = 0<br />
<br />
Ordinary text should use [[#emph|wiki markup for emphasis]], and should not use <code>&lt;i&gt;</code> or <code>&lt;b&gt;</code>. However, mathematical formulas often use italics, and sometimes use bold, for reasons unrelated to emphasis. Complex formulas should use [[m:Help:Formula|<code>&lt;math&gt;</code> markup]], and simple formulas may use <code>&lt;math&gt;</code>; or <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>; or <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code>. According to [[Wikipedia:WikiProject Mathematics#Italicization and bolding|WikiProject Mathematics]], wiki markup is preferred over HTML markup like <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>.<br />
|<br />
<pre><nowiki><br />
<math>\sin x + \ln y</math><br />
sin''x'' + ln''y''<br />
<br />
<math>\mathbf{x} = 0</math><br />
'''x''' = 0<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
<br />
* For semantic reasons, using <code>&lt;code&gt;</code> where applicable is preferable to using <code>&lt;tt&gt;</code>.<br />
|<br />
<pre><nowiki><br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can use <small>small text</small> for captions.<br />
|<br />
<pre><nowiki><br />
You can use <small>small text</small> for captions.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
<br />
* When editing regular Wikipedia articles, just make your changes and don't mark them up in any special way.<br />
* When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.<br />
|<br />
<pre><nowiki><br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Diacritical marks:'''<br />
<br/><br />
è é ê ë ì í<br />
<br />
À Á Â Ã Ä Å <br/><br />
Æ Ç È É Ê Ë <br/><br />
Ì Í<br />
Î Ï Ñ Ò <br/><br />
Ó Ô Õ<br />
Ö Ø Ù <br/><br />
Ú Û Ü ß<br />
à á <br/><br />
â ã ä å æ<br />
ç <br/><br />
è é ê ë ì í<br/><br />
î ï ñ ò ó ô <br/><br />
&oelig; õ<br />
ö ø ù ú <br/><br />
û ü ÿ<br />
<br />
* See [[meta:Help:Special characters|special characters]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
è é ê ë ì í<br />
<br />
&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; <br />
&amp;AElig; &amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml; <br />
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde; &amp;Ograve; <br />
&amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;Ugrave; <br />
&amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;szlig; &amp;agrave; &amp;aacute; <br />
&amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil; <br />
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml; &amp;igrave; &amp;iacute;<br />
&amp;icirc; &amp;iuml; &amp;ntilde; &amp;ograve; &amp;oacute; &amp;ocirc; <br />
&amp;oelig; &amp;otilde; &amp;ouml; &amp;oslash; &amp;ugrave; &amp;uacute; <br />
&amp;ucirc; &amp;uuml; &amp;yuml;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Punctuation:'''<br />
<br/><br />
¿ ¡ § ¶<br/><br />
&dagger; &Dagger; &bull; &ndash; &mdash;<br/><br />
&lsaquo; &rsaquo; « »<br/><br />
&lsquo; &rsquo; &ldquo; &rdquo;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;<br />
&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;<br />
&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;<br />
&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commercial symbols:'''<br />
<br/><br />
&trade; © ® ¢ &euro; ¥<br/><br />
£ ¤<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;trade; &amp;copy; &amp;reg; &amp;cent; &amp;euro; &amp;yen; <br />
&amp;pound; &amp;curren;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Subscripts:'''<br />
<br/><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
<br />
'''Superscripts:'''<br />
<br/><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&sup1; x&sup2; x&sup3;<br />
*The latter method of superscripting can't be used in the most general context, but is preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.<br />
<br />
&epsilon;<sub>0</sub> =<br />
8.85 &times; 10<sup>&minus;12</sup><br />
C&sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&sup2;]]<br />
|<br />
<br/><br />
<pre><nowiki><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
</nowiki></pre><br />
<br />
<pre><nowiki><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&amp;sup1; x&amp;sup2; x&amp;sup3;<br />
<br />
&amp;epsilon;<sub>0</sub> =<br />
8.85 &amp;times; 10<sup>&amp;minus;12</sup><br />
C&amp;sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&amp;sup2;]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Greek characters:'''<br />
<br/><br />
&alpha; &beta; &gamma; &delta; &epsilon; &zeta;<br/><br />
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu;<br/><br />
&xi; &omicron; &pi; &rho; &sigma; &sigmaf;<br/><br />
&tau; &upsilon; &phi; &chi; &psi; &omega;<br/><br />
&Gamma; &Delta; &Theta; &Lambda; &Xi; &Pi;<br/><br />
&Sigma; &Phi; &Psi; &Omega;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; <br />
&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu; <br />
&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;<br />
&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;<br />
&amp;Gamma; &amp;Delta; &amp;Theta; &amp;Lambda; &amp;Xi; &amp;Pi; <br />
&amp;Sigma; &amp;Phi; &amp;Psi; &amp;Omega;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Math characters:'''<br />
<br/><br />
&int; &sum; &prod; &radic; &minus; &plusmn; &infin;<br/><br />
&asymp; &prop; &equiv; &ne; &le; &ge; &rarr;<br/><br />
&times; &middot; &divide; &part; &prime; &Prime;<br/><br />
&nabla; &permil; &deg; &there4; &alefsym; &oslash;<br/><br />
&isin; &notin; &cap; &cup; &sub; &sup; &sube; &supe;<br/><br />
&not; &and; &or; &exist; &forall; &rArr; &hArr;<br/><br />
&rarr; &harr;<br/><br />
* See also [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;int; &amp;sum; &amp;prod; &amp;radic; &amp;minus; &amp;plusmn; &amp;infin;<br />
&amp;asymp; &amp;prop; &amp;equiv; &amp;ne; &amp;le; &amp;ge; &amp;rarr;<br />
&amp;times; &amp;middot; &amp;divide; &amp;part; &amp;prime; &amp;Prime;<br />
&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym; &amp;oslash;<br />
&amp;isin; &amp;notin; &amp;cap; &amp;cup; &amp;sub; &amp;sup; &amp;sube; &amp;supe;<br />
&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall; &amp;rArr; &amp;hArr;<br />
&amp;rarr; &amp;harr;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Spacing in simple math formulas:'''<br />
<br/><br />
Obviously, ''x''&sup2;&nbsp;&ge;&nbsp;0 is true.<br />
*To space things out without allowing line breaks to interrupt the formula, use non-breaking spaces: <tt>&amp;nbsp;</tt>.<br />
|<br />
<br/><br />
<pre><nowiki><br />
Obviously, ''x''&amp;sup2;&amp;nbsp;&amp;ge;&amp;nbsp;0 is true.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Complicated formulas:'''<br />
<br/><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
* See [[m:Help:Formula]] for how to use <tt>&lt;math></tt>.<br />
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.<br />
|<br />
<br/><br />
<pre><nowiki><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Suppressing interpretation of markup:'''<br />
<br/><br />
<nowiki>Link &rarr; (''to'') the [[Wikipedia FAQ]]</nowiki><br />
* Used to show literal data that would otherwise have special meaning.<br />
* Escape all wiki markup, including that which looks like HTML tags.<br />
* Does not escape HTML character references.<br />
* To escape HTML character references such as <tt>&amp;rarr;</tt> use <tt>&amp;amp;rarr;</tt><br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;nowiki>Link &amp;rarr; (''to'') <br />
the [[Wikipedia FAQ]]&lt;/nowiki><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commenting page source:'''<br />
<br/><br />
''not shown when viewing page''<br />
* Used to leave comments in a page for future editors.<br />
* Note that most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;!-- comment here --><br />
</nowiki></pre><br />
|}<br />
''(see also: [[Chess symbols in Unicode]])''<br />
<br />
=== Tables ===<br />
==== Placement of the Table of Contents (TOC) ====<br />
At the current status of the wiki markup language, having at least four headers on a page triggers the TOC to appear in front of the first header (or after introductory sections). Putting <nowiki>__TOC__</nowiki> anywhere forces the TOC to appear at that point (instead of just before the first header). Putting <nowiki>__NOTOC__</nowiki> anywhere forces the TOC to disappear. See also [[Wikipedia:Section#Compact_TOC|compact TOC]] for alphabet and year headings.<br />
<br />
==== Keeping headings out of the Table of Contents ====<br />
<br />
If you want some subheadings to not appear in the Table of Contents, then make the following replacements.<br />
<br />
Replace <nowiki> == Header 2 == with <h2> Header 2 </h2> </nowiki><br />
<br />
Replace <nowiki> === Header 3 === with <h3> Header 3 </h3> </nowiki><br />
<br />
And so forth.<br />
<br />
For example, notice that the following header has the same font as the other subheaders to this "Tables" section, but the following header does not appear in the Table of Contents for this page.<br />
<br />
<h4> This header has the h4 font, but is NOT in the Table of Contents </h4><br />
<br />
This effect is obtained by the following line of code.<br />
<br />
<nowiki><h4> This header has the h4 font, but is NOT in the Table of Contents </h4></nowiki><br />
<br />
<br />
==== Tables ====<br />
There are two ways to build tables: <br />
*in special Wiki-markup (see [[m:Help:Table]])<br />
*with the usual HTML elements: &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; or &lt;th&gt;.<br />
<br />
For the latter, and a discussion on when tables are appropriate, see [[Wikipedia:How to use tables]].<br />
<br />
=== Variables ===<br />
<br />
''(See also [[m:Help:Variable]])''<br />
{|<br />
|-<br />
! Code<br />
! Effect<br />
|-<br />
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAME}}</nowiki><br />
| {{CURRENTMONTHNAME}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki><br />
| {{CURRENTMONTHNAMEGEN}}<br />
|-<br />
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}<br />
|-<br />
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}<br />
|-<br />
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}<br />
|-<br />
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}<br />
|-<br />
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br />
| {{NUMBEROFARTICLES}}<br />
|-<br />
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}<br />
|-<br />
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}<br />
|-<br />
| <nowiki>{{localurl:pagename}}</nowiki><br />
| {{localurl:pagename}}<br />
|-<br />
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki><br />
| {{localurl:Wikipedia:Sandbox|action=edit}}<br />
|-<br />
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}<br />
|-<br />
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}<br />
|-<br />
| <nowiki>{{ns:2}}</nowiki> || {{ns:2}}<br />
|-<br />
| <nowiki>{{ns:3}}</nowiki> || {{ns:3}}<br />
|-<br />
| <nowiki>{{ns:4}}</nowiki> || {{ns:4}}<br />
|-<br />
| <nowiki>{{ns:5}}</nowiki> || {{ns:5}}<br />
|-<br />
| <nowiki>{{ns:6}}</nowiki> || {{ns:6}}<br />
|-<br />
| <nowiki>{{ns:7}}</nowiki> || {{ns:7}}<br />
|-<br />
| <nowiki>{{ns:8}}</nowiki> || {{ns:8}}<br />
|-<br />
| <nowiki>{{ns:9}}</nowiki> || {{ns:9}}<br />
|-<br />
| <nowiki>{{ns:10}}</nowiki> || {{ns:10}}<br />
|-<br />
| <nowiki>{{ns:11}}</nowiki> || {{ns:11}}<br />
|-<br />
| <nowiki>{{ns:12}}</nowiki> || {{ns:12}}<br />
|-<br />
| <nowiki>{{ns:13}}</nowiki> || {{ns:13}}<br />
|-<br />
| <nowiki>{{ns:14}}</nowiki> || {{ns:14}}<br />
|-<br />
| <nowiki>{{ns:15}}</nowiki> || {{ns:15}}<br />
|-<br />
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}<br />
|}<br />
<br />
'''NUMBEROFARTICLES''' is the number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.<br />
<br />
=== Templates ===<br />
<br />
The [[Wikipedia:MediaWiki|MediaWiki]] software used by Wikipedia has limited support for template inclusion. This means standardized text chunks (such as boilerplate text) can be inserted into articles. For example, typing <nowiki>{{stub}}</nowiki> will appear as "''This article is a [[Wikipedia:The perfect stub article|stub]]. You can help Wikipedia by [[Wikipedia:Find or fix a stub|expanding it]].''" when the page is saved. See [[Wikipedia:Template messages]] for the complete list. Other commonly used ones are: <nowiki>{{disambig}}</nowiki> for disambiguation pages, <nowiki>{{spoiler}}</nowiki> for spoiler warnings and <nowiki>{{sectstub}}</nowiki> like an article stub but for a section. The are many subject-specific stubs e.g.: <nowiki> {{Geo-stub}}, {{Hist-stub}} and {{Linux-stub}}</nowiki>. For a complete list of stubs see [[Wikipedia:Template messages/Stubs]].<br />
<br />
=== Hiding the edit links ===<br />
<br />
Insert '''<nowiki>__NOEDITSECTION__</nowiki>''' into the document to suppress the edit links that appear next to every section header.<br />
<br />
== See also ==<br />
*[[m:Help:Formula]]<br />
*[[m:Help:Editing|Mediawiki user's guide to editing]]<br />
*[[Wikipedia:MediaWiki]].<br />
*[[HTML element]].<br />
*[[Wikipedia:Protection policy]]<br />
<br />
== Using Mozilla Firefox ==<br />
<br />
There is an [https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&numpg=10&id=351 extension] available for Firefox, which may help you to edit a wiki page. This extension can be used for all wikis based on MediaWiki (e.g. for the wikipedia). If you use version 1.5 of Firefox, you will need the developer [http://wikipedia.mozdev.org version] of the extension. Update: The extension doesn't support Firefox 2.0 (not yet).<br />
<br />
If you have installed the extension a new toolbar will appear. This toolbar contains some icons to<br />
*format the text (e.g. bold)<br />
*insert a structure item (e.g. headlines)<br />
*insert a link (internal or external)<br />
*insert a picture<br />
The toolbar can be helpful escpecially for newbies, because it's not necessary to know the (complete) wiki syntax.<br />
<br />
If you want to change the settings for the toolbar, you have to go to the tools menu of Firefox. Then you must click on the settings button of the extension. On the view tab for example you can set, that the toolbar only appears, if the URL contains the word 'wiki'.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Using_the_Android_SDK,_Emulator_and_Phones/ru&diff=55350
Custom Drawn Interface/Using the Android SDK, Emulator and Phones/ru
2012-02-07T04:50:24Z
<p>Kverde: /* Using the phones */</p>
<hr />
<div>{{Android Interface/Using the Android SDK, Emulator and Phones}}<br />
<br />
Go back to [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
==Использование Android SDK==<br />
<br />
Загрузка и установка Android SDK очень простая. Нужно всего лишь перейти по ссылке: http://developer.android.com/sdk/index.html<br />
<br />
===Как настроить Ant===<br />
<br />
При использовании 'ant debug' для построения проекта Андроид может быть получено много ошибок о неудовлетворенных зависимостях. В Linux это может быть решено установкой пакетов которые име.т эти зависимости, это будет менятся от дистрибутива к дистрибутиву.<br />
<br />
====Настройка Ant в Mandriva Linux====<br />
<br />
Эти ошибки:<br />
<br />
/usr/bin/build-classpath: error: Could not find jaxp_parser_impl Java extension for this JVM<br />
/usr/bin/build-classpath: error: Could not find xml-commons-apis Java extension for this JVM<br />
<br />
Могут быть исправленны, соответственно, с:<br />
<br />
urpmi xerces-j2<br />
urpmi xml-commons-jaxp<br />
<br />
====Обшие ошибки Ant====<br />
<br />
Эта ошибка:<br />
<br />
/home/felipe/Programas/lazarus-ccr/examples/androidlcl/android/build.xml:46: taskdef class com.android.ant.SetupTask cannot be found<br />
<br />
Означает что нужно установить корректные пути к SDK в вашем файле проекта. <br />
<br />
===Recognition of devices under Linux===<br />
<br />
Unlike in Windows, where one needs to install a new set of drivers for nearly every phone, in Linux the Android devices are recognized as generic Android devices (regardless of being a phone, a tablet or a notebook) and they are ready to be used without installing additional drivers. One issue, however, that often appears is that devices are not fully recognized automatically and one receives the error message "?????? no permissions". In this case the command adb devices will look like this:<br />
<br />
<pre><br />
[felipe@localhost ~]$ cd Programas/android-sdk-linux_x86/tools/<br />
[felipe@localhost tools]$ ./adb devices<br />
List of devices attached <br />
???????????? no permissions<br />
</pre><br />
<br />
To solve this issue one can proceed with the following steps:<br />
<br />
'''Step 1''' - First read the tag of the device using lsusb run as root (or sudo):<br />
<br />
<pre><br />
[root@localhost Programas]# lsusb<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 001 Device 003: ID 04e8:681c Samsung Electronics Co., Ltd <br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
</pre><br />
<br />
The tag in this case is '''04e8'''<br />
<br />
'''Step 2''' - Now, still as root, edit the file /etc/udev/rules.d/51-android.rules <br />
<br />
If the file doesn't exist yet, then create it. Add the following line to the file:<br />
<br />
<pre><br />
SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="04e8", SYMLINK+="android_adb", MODE="0666"<br />
</pre><br />
<br />
Change the ID to correspond to the id of your device.<br />
<br />
'''Step 3''' - Restart the linux usb service (udev)<br />
<br />
In Ubuntu this can be done with: sudo services udev restart<br />
<br />
In Mandriva udev doesn't appear as a service, so the only way to get things working for me was restarting the computer.<br />
<br />
After doing this, the device should be fully recognized and "adb devices" as well as "adb logcat" should work.<br />
<br />
<pre><br />
[felipe@localhost tools]$ ./adb devices<br />
* daemon not running. starting it now on port 5037 *<br />
* daemon started successfully *<br />
List of devices attached <br />
1000c31696b6 device<br />
</pre><br />
<br />
== Using the Emulator ==<br />
<br />
=== Installing the Emulator ===<br />
<br />
=== Building an emulator image with sdcard support ===<br />
<br />
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Step 2: Create a new image, by clicking the New button as in the image bellow.<br />
<br />
[[Image:Android_new_image.PNG]]<br />
<br />
Step 3: Set the name and properties of the image, the size of the SDCard and add hardware support for the sdcard, as seen on the image bellow.<br />
<br />
[[Image:Android_new_image_dialog.PNG]]<br />
<br />
=== Running an emulator image ===<br />
<br />
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Step 2: Select the image<br />
<br />
Step 3: Click on the "start" button, as seen bellow.<br />
<br />
[[Image:Android_run_image.PNG]]<br />
<br />
=== Copying files to the emulator ===<br />
<br />
You can use a script similar to this one to copy files from your hard-drive to the emulator. Notice that the image must be running and that it must have sdcard support built inside itself.<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb push C:\Mypath\Somefile.extension /sdcard<br />
pause<br />
</pre><br />
<br />
=== Installing applications in the emulator ===<br />
<br />
Android apps should be packaged in the Android .apk file format. For more information about how to create an .apk file that you can install on an emulator/device instance, see Android Asset Packaging Tool (aapt). After packing a file, it can be installed in the emulator by using the following adb call:<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb install C:\Mypath\MyApp.apk<br />
pause<br />
</pre><br />
<br />
==Использование телефона==<br />
<br />
Установка драйверов, получение надежного способа передачи исполняемых файлов и отладка ПО на разных телефонах с Андроид можеть быть проблеммой сама по себе. <br />
<br />
===Устанока файлового менеджера===<br />
<br />
Удивительно, Андроид телефоны поставляются без файлового менеджера. Однако, очень просто загрузить один из Android Market. Я предлагаю следующие инструкции:<br />
<br />
1. Подключите телефон к WiFi или Мобильной сети.<br />
<br />
2. Нажмите на иконку "Market" на рабочем столе Андроид. Будет необходимо войти в аккаунт Google для доступа к нему.<br />
<br />
3. Нажмите на кнопку поиска и введите "oi".<br />
<br />
4. Найдите и установите "OI File Manager" (бесплатную версию).<br />
<br />
===Samsung Galaxy S===<br />
<br />
The first thing to do when using Samsung Galaxy S is not believing the Samsung instructions. They will say that one should install Kies, their horribly crappy PC suite which is 130MB large and fails to install because the first thing that it does is failing to connect to a server in Korea to download even more files. Instead of doing this, following these instructions:<br />
<br />
1. Go in the phone menu Settings -> About Phone -> USB settings. Change from "KIES" to "Mass storage"<br />
<br />
2. Download and install 19 MB of Samsung USB drivers from: http://drivers.softpedia.com/dyn-postdownload.php?p=96692&t=4&i=1<br />
<br />
3. Connect the cable of the phone<br />
<br />
4. Drag the top menu of the phone down and mount the sdcard</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Using_the_Android_SDK,_Emulator_and_Phones/ru&diff=55349
Custom Drawn Interface/Using the Android SDK, Emulator and Phones/ru
2012-02-07T04:31:56Z
<p>Kverde: /* Using the Android SDK */</p>
<hr />
<div>{{Android Interface/Using the Android SDK, Emulator and Phones}}<br />
<br />
Go back to [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
==Использование Android SDK==<br />
<br />
Загрузка и установка Android SDK очень простая. Нужно всего лишь перейти по ссылке: http://developer.android.com/sdk/index.html<br />
<br />
===Как настроить Ant===<br />
<br />
При использовании 'ant debug' для построения проекта Андроид может быть получено много ошибок о неудовлетворенных зависимостях. В Linux это может быть решено установкой пакетов которые име.т эти зависимости, это будет менятся от дистрибутива к дистрибутиву.<br />
<br />
====Настройка Ant в Mandriva Linux====<br />
<br />
Эти ошибки:<br />
<br />
/usr/bin/build-classpath: error: Could not find jaxp_parser_impl Java extension for this JVM<br />
/usr/bin/build-classpath: error: Could not find xml-commons-apis Java extension for this JVM<br />
<br />
Могут быть исправленны, соответственно, с:<br />
<br />
urpmi xerces-j2<br />
urpmi xml-commons-jaxp<br />
<br />
====Обшие ошибки Ant====<br />
<br />
Эта ошибка:<br />
<br />
/home/felipe/Programas/lazarus-ccr/examples/androidlcl/android/build.xml:46: taskdef class com.android.ant.SetupTask cannot be found<br />
<br />
Означает что нужно установить корректные пути к SDK в вашем файле проекта. <br />
<br />
===Recognition of devices under Linux===<br />
<br />
Unlike in Windows, where one needs to install a new set of drivers for nearly every phone, in Linux the Android devices are recognized as generic Android devices (regardless of being a phone, a tablet or a notebook) and they are ready to be used without installing additional drivers. One issue, however, that often appears is that devices are not fully recognized automatically and one receives the error message "?????? no permissions". In this case the command adb devices will look like this:<br />
<br />
<pre><br />
[felipe@localhost ~]$ cd Programas/android-sdk-linux_x86/tools/<br />
[felipe@localhost tools]$ ./adb devices<br />
List of devices attached <br />
???????????? no permissions<br />
</pre><br />
<br />
To solve this issue one can proceed with the following steps:<br />
<br />
'''Step 1''' - First read the tag of the device using lsusb run as root (or sudo):<br />
<br />
<pre><br />
[root@localhost Programas]# lsusb<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 001 Device 003: ID 04e8:681c Samsung Electronics Co., Ltd <br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
</pre><br />
<br />
The tag in this case is '''04e8'''<br />
<br />
'''Step 2''' - Now, still as root, edit the file /etc/udev/rules.d/51-android.rules <br />
<br />
If the file doesn't exist yet, then create it. Add the following line to the file:<br />
<br />
<pre><br />
SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="04e8", SYMLINK+="android_adb", MODE="0666"<br />
</pre><br />
<br />
Change the ID to correspond to the id of your device.<br />
<br />
'''Step 3''' - Restart the linux usb service (udev)<br />
<br />
In Ubuntu this can be done with: sudo services udev restart<br />
<br />
In Mandriva udev doesn't appear as a service, so the only way to get things working for me was restarting the computer.<br />
<br />
After doing this, the device should be fully recognized and "adb devices" as well as "adb logcat" should work.<br />
<br />
<pre><br />
[felipe@localhost tools]$ ./adb devices<br />
* daemon not running. starting it now on port 5037 *<br />
* daemon started successfully *<br />
List of devices attached <br />
1000c31696b6 device<br />
</pre><br />
<br />
== Using the Emulator ==<br />
<br />
=== Installing the Emulator ===<br />
<br />
=== Building an emulator image with sdcard support ===<br />
<br />
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Step 2: Create a new image, by clicking the New button as in the image bellow.<br />
<br />
[[Image:Android_new_image.PNG]]<br />
<br />
Step 3: Set the name and properties of the image, the size of the SDCard and add hardware support for the sdcard, as seen on the image bellow.<br />
<br />
[[Image:Android_new_image_dialog.PNG]]<br />
<br />
=== Running an emulator image ===<br />
<br />
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Step 2: Select the image<br />
<br />
Step 3: Click on the "start" button, as seen bellow.<br />
<br />
[[Image:Android_run_image.PNG]]<br />
<br />
=== Copying files to the emulator ===<br />
<br />
You can use a script similar to this one to copy files from your hard-drive to the emulator. Notice that the image must be running and that it must have sdcard support built inside itself.<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb push C:\Mypath\Somefile.extension /sdcard<br />
pause<br />
</pre><br />
<br />
=== Installing applications in the emulator ===<br />
<br />
Android apps should be packaged in the Android .apk file format. For more information about how to create an .apk file that you can install on an emulator/device instance, see Android Asset Packaging Tool (aapt). After packing a file, it can be installed in the emulator by using the following adb call:<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb install C:\Mypath\MyApp.apk<br />
pause<br />
</pre><br />
<br />
==Using the phones==<br />
<br />
Installing the drivers and getting a reliable way to transfer executables and debug software with all the different Android phone can be a challenge in itself.<br />
<br />
===Installing a File Manager===<br />
<br />
Astonishingly, Android phones don't come with a file manager o.O One can however simply download one from the Android Market. I suggest the following instructions:<br />
<br />
1. Connect the phone to a WiFi or Mobile network<br />
<br />
2. Click in the "Market" icon in one of the Android desktops. It will be necessary to log into a Google Account to access it.<br />
<br />
3. Click the search button and type "oi"<br />
<br />
4. Locate and install the "OI File Manager" which is Free<br />
<br />
===Samsung Galaxy S===<br />
<br />
The first thing to do when using Samsung Galaxy S is not believing the Samsung instructions. They will say that one should install Kies, their horribly crappy PC suite which is 130MB large and fails to install because the first thing that it does is failing to connect to a server in Korea to download even more files. Instead of doing this, following these instructions:<br />
<br />
1. Go in the phone menu Settings -> About Phone -> USB settings. Change from "KIES" to "Mass storage"<br />
<br />
2. Download and install 19 MB of Samsung USB drivers from: http://drivers.softpedia.com/dyn-postdownload.php?p=96692&t=4&i=1<br />
<br />
3. Connect the cable of the phone<br />
<br />
4. Drag the top menu of the phone down and mount the sdcard</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Using_the_Android_SDK,_Emulator_and_Phones/ru&diff=55348
Custom Drawn Interface/Using the Android SDK, Emulator and Phones/ru
2012-02-07T04:19:04Z
<p>Kverde: New page: {{Android Interface/Using the Android SDK, Emulator and Phones}} Go back to Custom Drawn Interface/Android __TOC__ ==Using the Android SDK== Downloading and installing the Android ...</p>
<hr />
<div>{{Android Interface/Using the Android SDK, Emulator and Phones}}<br />
<br />
Go back to [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
==Using the Android SDK==<br />
<br />
Downloading and installing the Android SDK is easy. One just needs to following this link: http://developer.android.com/sdk/index.html<br />
<br />
===How to configure Ant===<br />
<br />
When issuing 'ant debug' to build and Android project one might receive a lot of errors about missing dependencies. In Linux those can be solved by installing packages which have these dependencies, and that will change from distribution to distribution.<br />
<br />
====Configuring Ant in Mandriva Linux====<br />
<br />
These errors:<br />
<br />
/usr/bin/build-classpath: error: Could not find jaxp_parser_impl Java extension for this JVM<br />
/usr/bin/build-classpath: error: Could not find xml-commons-apis Java extension for this JVM<br />
<br />
Can be fixed, respectively, with:<br />
<br />
urpmi xerces-j2<br />
urpmi xml-commons-jaxp<br />
<br />
====Generic Ant errors====<br />
<br />
This error:<br />
<br />
/home/felipe/Programas/lazarus-ccr/examples/androidlcl/android/build.xml:46: taskdef class com.android.ant.SetupTask cannot be found<br />
<br />
Means that you need to update the Paths in your project files to correctly point to the SDK.<br />
<br />
===Recognition of devices under Linux===<br />
<br />
Unlike in Windows, where one needs to install a new set of drivers for nearly every phone, in Linux the Android devices are recognized as generic Android devices (regardless of being a phone, a tablet or a notebook) and they are ready to be used without installing additional drivers. One issue, however, that often appears is that devices are not fully recognized automatically and one receives the error message "?????? no permissions". In this case the command adb devices will look like this:<br />
<br />
<pre><br />
[felipe@localhost ~]$ cd Programas/android-sdk-linux_x86/tools/<br />
[felipe@localhost tools]$ ./adb devices<br />
List of devices attached <br />
???????????? no permissions<br />
</pre><br />
<br />
To solve this issue one can proceed with the following steps:<br />
<br />
'''Step 1''' - First read the tag of the device using lsusb run as root (or sudo):<br />
<br />
<pre><br />
[root@localhost Programas]# lsusb<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 001 Device 003: ID 04e8:681c Samsung Electronics Co., Ltd <br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
</pre><br />
<br />
The tag in this case is '''04e8'''<br />
<br />
'''Step 2''' - Now, still as root, edit the file /etc/udev/rules.d/51-android.rules <br />
<br />
If the file doesn't exist yet, then create it. Add the following line to the file:<br />
<br />
<pre><br />
SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="04e8", SYMLINK+="android_adb", MODE="0666"<br />
</pre><br />
<br />
Change the ID to correspond to the id of your device.<br />
<br />
'''Step 3''' - Restart the linux usb service (udev)<br />
<br />
In Ubuntu this can be done with: sudo services udev restart<br />
<br />
In Mandriva udev doesn't appear as a service, so the only way to get things working for me was restarting the computer.<br />
<br />
After doing this, the device should be fully recognized and "adb devices" as well as "adb logcat" should work.<br />
<br />
<pre><br />
[felipe@localhost tools]$ ./adb devices<br />
* daemon not running. starting it now on port 5037 *<br />
* daemon started successfully *<br />
List of devices attached <br />
1000c31696b6 device<br />
</pre><br />
<br />
== Using the Emulator ==<br />
<br />
=== Installing the Emulator ===<br />
<br />
=== Building an emulator image with sdcard support ===<br />
<br />
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Step 2: Create a new image, by clicking the New button as in the image bellow.<br />
<br />
[[Image:Android_new_image.PNG]]<br />
<br />
Step 3: Set the name and properties of the image, the size of the SDCard and add hardware support for the sdcard, as seen on the image bellow.<br />
<br />
[[Image:Android_new_image_dialog.PNG]]<br />
<br />
=== Running an emulator image ===<br />
<br />
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Step 2: Select the image<br />
<br />
Step 3: Click on the "start" button, as seen bellow.<br />
<br />
[[Image:Android_run_image.PNG]]<br />
<br />
=== Copying files to the emulator ===<br />
<br />
You can use a script similar to this one to copy files from your hard-drive to the emulator. Notice that the image must be running and that it must have sdcard support built inside itself.<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb push C:\Mypath\Somefile.extension /sdcard<br />
pause<br />
</pre><br />
<br />
=== Installing applications in the emulator ===<br />
<br />
Android apps should be packaged in the Android .apk file format. For more information about how to create an .apk file that you can install on an emulator/device instance, see Android Asset Packaging Tool (aapt). After packing a file, it can be installed in the emulator by using the following adb call:<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb install C:\Mypath\MyApp.apk<br />
pause<br />
</pre><br />
<br />
==Using the phones==<br />
<br />
Installing the drivers and getting a reliable way to transfer executables and debug software with all the different Android phone can be a challenge in itself.<br />
<br />
===Installing a File Manager===<br />
<br />
Astonishingly, Android phones don't come with a file manager o.O One can however simply download one from the Android Market. I suggest the following instructions:<br />
<br />
1. Connect the phone to a WiFi or Mobile network<br />
<br />
2. Click in the "Market" icon in one of the Android desktops. It will be necessary to log into a Google Account to access it.<br />
<br />
3. Click the search button and type "oi"<br />
<br />
4. Locate and install the "OI File Manager" which is Free<br />
<br />
===Samsung Galaxy S===<br />
<br />
The first thing to do when using Samsung Galaxy S is not believing the Samsung instructions. They will say that one should install Kies, their horribly crappy PC suite which is 130MB large and fails to install because the first thing that it does is failing to connect to a server in Korea to download even more files. Instead of doing this, following these instructions:<br />
<br />
1. Go in the phone menu Settings -> About Phone -> USB settings. Change from "KIES" to "Mass storage"<br />
<br />
2. Download and install 19 MB of Samsung USB drivers from: http://drivers.softpedia.com/dyn-postdownload.php?p=96692&t=4&i=1<br />
<br />
3. Connect the cable of the phone<br />
<br />
4. Drag the top menu of the phone down and mount the sdcard</div>
Kverde
https://wiki.freepascal.org/index.php?title=Template:Android_Interface/Using_the_Android_SDK,_Emulator_and_Phones&diff=55347
Template:Android Interface/Using the Android SDK, Emulator and Phones
2012-02-07T04:18:32Z
<p>Kverde: New page: <small> '''English (en)''' | '''Русский (ru)''' ...</p>
<hr />
<div><small><br />
[[Android Interface/Using the Android SDK, Emulator and Phones|'''English (en)''']] |<br />
[[Android Interface/Using the Android SDK, Emulator and Phones/ru|'''Русский (ru)''']]<br />
</small></div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/Using_the_Android_SDK,_Emulator_and_Phones&diff=55346
Custom Drawn Interface/Using the Android SDK, Emulator and Phones
2012-02-07T04:17:58Z
<p>Kverde: </p>
<hr />
<div>{{Android Interface/Using the Android SDK, Emulator and Phones}}<br />
<br />
Go back to [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
==Using the Android SDK==<br />
<br />
Downloading and installing the Android SDK is easy. One just needs to following this link: http://developer.android.com/sdk/index.html<br />
<br />
===How to configure Ant===<br />
<br />
When issuing 'ant debug' to build and Android project one might receive a lot of errors about missing dependencies. In Linux those can be solved by installing packages which have these dependencies, and that will change from distribution to distribution.<br />
<br />
====Configuring Ant in Mandriva Linux====<br />
<br />
These errors:<br />
<br />
/usr/bin/build-classpath: error: Could not find jaxp_parser_impl Java extension for this JVM<br />
/usr/bin/build-classpath: error: Could not find xml-commons-apis Java extension for this JVM<br />
<br />
Can be fixed, respectively, with:<br />
<br />
urpmi xerces-j2<br />
urpmi xml-commons-jaxp<br />
<br />
====Generic Ant errors====<br />
<br />
This error:<br />
<br />
/home/felipe/Programas/lazarus-ccr/examples/androidlcl/android/build.xml:46: taskdef class com.android.ant.SetupTask cannot be found<br />
<br />
Means that you need to update the Paths in your project files to correctly point to the SDK.<br />
<br />
===Recognition of devices under Linux===<br />
<br />
Unlike in Windows, where one needs to install a new set of drivers for nearly every phone, in Linux the Android devices are recognized as generic Android devices (regardless of being a phone, a tablet or a notebook) and they are ready to be used without installing additional drivers. One issue, however, that often appears is that devices are not fully recognized automatically and one receives the error message "?????? no permissions". In this case the command adb devices will look like this:<br />
<br />
<pre><br />
[felipe@localhost ~]$ cd Programas/android-sdk-linux_x86/tools/<br />
[felipe@localhost tools]$ ./adb devices<br />
List of devices attached <br />
???????????? no permissions<br />
</pre><br />
<br />
To solve this issue one can proceed with the following steps:<br />
<br />
'''Step 1''' - First read the tag of the device using lsusb run as root (or sudo):<br />
<br />
<pre><br />
[root@localhost Programas]# lsusb<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 001 Device 003: ID 04e8:681c Samsung Electronics Co., Ltd <br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
</pre><br />
<br />
The tag in this case is '''04e8'''<br />
<br />
'''Step 2''' - Now, still as root, edit the file /etc/udev/rules.d/51-android.rules <br />
<br />
If the file doesn't exist yet, then create it. Add the following line to the file:<br />
<br />
<pre><br />
SUBSYSTEM=="usb|usb_device", SYSFS{idVendor}=="04e8", SYMLINK+="android_adb", MODE="0666"<br />
</pre><br />
<br />
Change the ID to correspond to the id of your device.<br />
<br />
'''Step 3''' - Restart the linux usb service (udev)<br />
<br />
In Ubuntu this can be done with: sudo services udev restart<br />
<br />
In Mandriva udev doesn't appear as a service, so the only way to get things working for me was restarting the computer.<br />
<br />
After doing this, the device should be fully recognized and "adb devices" as well as "adb logcat" should work.<br />
<br />
<pre><br />
[felipe@localhost tools]$ ./adb devices<br />
* daemon not running. starting it now on port 5037 *<br />
* daemon started successfully *<br />
List of devices attached <br />
1000c31696b6 device<br />
</pre><br />
<br />
== Using the Emulator ==<br />
<br />
=== Installing the Emulator ===<br />
<br />
=== Building an emulator image with sdcard support ===<br />
<br />
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Step 2: Create a new image, by clicking the New button as in the image bellow.<br />
<br />
[[Image:Android_new_image.PNG]]<br />
<br />
Step 3: Set the name and properties of the image, the size of the SDCard and add hardware support for the sdcard, as seen on the image bellow.<br />
<br />
[[Image:Android_new_image_dialog.PNG]]<br />
<br />
=== Running an emulator image ===<br />
<br />
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat<br />
<br />
Step 2: Select the image<br />
<br />
Step 3: Click on the "start" button, as seen bellow.<br />
<br />
[[Image:Android_run_image.PNG]]<br />
<br />
=== Copying files to the emulator ===<br />
<br />
You can use a script similar to this one to copy files from your hard-drive to the emulator. Notice that the image must be running and that it must have sdcard support built inside itself.<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb push C:\Mypath\Somefile.extension /sdcard<br />
pause<br />
</pre><br />
<br />
=== Installing applications in the emulator ===<br />
<br />
Android apps should be packaged in the Android .apk file format. For more information about how to create an .apk file that you can install on an emulator/device instance, see Android Asset Packaging Tool (aapt). After packing a file, it can be installed in the emulator by using the following adb call:<br />
<br />
<pre><br />
c:<br />
cd "Program Files"<br />
cd android-sdk-windows<br />
cd tools<br />
adb install C:\Mypath\MyApp.apk<br />
pause<br />
</pre><br />
<br />
==Using the phones==<br />
<br />
Installing the drivers and getting a reliable way to transfer executables and debug software with all the different Android phone can be a challenge in itself.<br />
<br />
===Installing a File Manager===<br />
<br />
Astonishingly, Android phones don't come with a file manager o.O One can however simply download one from the Android Market. I suggest the following instructions:<br />
<br />
1. Connect the phone to a WiFi or Mobile network<br />
<br />
2. Click in the "Market" icon in one of the Android desktops. It will be necessary to log into a Google Account to access it.<br />
<br />
3. Click the search button and type "oi"<br />
<br />
4. Locate and install the "OI File Manager" which is Free<br />
<br />
===Samsung Galaxy S===<br />
<br />
The first thing to do when using Samsung Galaxy S is not believing the Samsung instructions. They will say that one should install Kies, their horribly crappy PC suite which is 130MB large and fails to install because the first thing that it does is failing to connect to a server in Korea to download even more files. Instead of doing this, following these instructions:<br />
<br />
1. Go in the phone menu Settings -> About Phone -> USB settings. Change from "KIES" to "Mass storage"<br />
<br />
2. Download and install 19 MB of Samsung USB drivers from: http://drivers.softpedia.com/dyn-postdownload.php?p=96692&t=4&i=1<br />
<br />
3. Connect the cable of the phone<br />
<br />
4. Drag the top menu of the phone down and mount the sdcard</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55345
Custom Drawn Interface/ru
2012-02-07T04:00:53Z
<p>Kverde: /* The LCL-CustomDrawn Backends */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Движки для X11, Android и Windows и частично рабочий для Cocoa, другие могут быть добавлены в будущем<br />
*Отрисовка сделана полностью внутри Lazarus, не используя родных(native) библиотек, за исключением отрисовки текста. Это гарантирует одинаковое изображение на всех платформах и единый уровень поддерживаемых функций<br />
*Только одно родное(native) окно используется для каждой формы, в backend для Андроид на данный момент это одно native-окно для всего приложения<br />
*Используются the Lazarus Custom Drawn Controls для реализации стандартных элементов управления LCL<br />
*Испольуются его графический движок для частей LCL: TLazIntfImage, TRawImage, lazcanvas и lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==Движки для LCL-CustomDrawn==<br />
LCL-CustomDrawn нуждается в движках для реализации основной части виджетов. Каждый backend должен реализовать следующие минимальные части: <br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
Этот движок работает. Смотрите эту страницу [[Custom Drawn Interface/Android]]<br />
<br />
Также смотрите [[Android Programming/ru]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
Этот движок работает. Смотрите [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
Этот движок работает.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
Этот движок работает.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
Этот движок планируется, но еще не начат.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Отрисовка шрифтов==<br />
<br />
Когда определение CD_UseNativeText установленно, LCL-CustomDrawn будет использовать родной(native) для платформы способ отрисовки текста, как это предусмотренно движком. Если оно не активно, тогда будет использоватся [[PasFreeType]] для отрисовки текста. Определение автоматически активно для некоторых движков, если это удобно для их использования.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Оконные визуальные элементы управления==<br />
<br />
Все оконные визуальные элементы управления (TButton, TPageControl, и др.) будут основыватся на [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55344
Custom Drawn Interface/ru
2012-02-07T03:58:39Z
<p>Kverde: /* Введение */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Движки для X11, Android и Windows и частично рабочий для Cocoa, другие могут быть добавлены в будущем<br />
*Отрисовка сделана полностью внутри Lazarus, не используя родных(native) библиотек, за исключением отрисовки текста. Это гарантирует одинаковое изображение на всех платформах и единый уровень поддерживаемых функций<br />
*Только одно родное(native) окно используется для каждой формы, в backend для Андроид на данный момент это одно native-окно для всего приложения<br />
*Используются the Lazarus Custom Drawn Controls для реализации стандартных элементов управления LCL<br />
*Испольуются его графический движок для частей LCL: TLazIntfImage, TRawImage, lazcanvas и lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn нуждается в backend'ах для реализации основной части виджетов. Каждый backend должен реализовать следующие минимальные части: <br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
Этот backend работает. Смотрите эту страницу [[Custom Drawn Interface/Android]]<br />
<br />
Также смотрите [[Android Programming/ru]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Отрисовка шрифтов==<br />
<br />
Когда определение CD_UseNativeText установленно, LCL-CustomDrawn будет использовать родной(native) для платформы способ отрисовки текста, как это предусмотренно движком. Если оно не активно, тогда будет использоватся [[PasFreeType]] для отрисовки текста. Определение автоматически активно для некоторых движков, если это удобно для их использования.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Оконные визуальные элементы управления==<br />
<br />
Все оконные визуальные элементы управления (TButton, TPageControl, и др.) будут основыватся на [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55343
Custom Drawn Interface/ru
2012-02-07T03:57:05Z
<p>Kverde: /* Отрисовка шрифтов */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Backends для X11, Android и Windows и частично рабочий для Cocoa, другие могут быть добавлены в будущем<br />
*Отрисовка сделана полностью внутри Lazarus, не используя родных(native) библиотек, за исключением отрисовки текста. Это гарантирует одинаковое изображение на всех платформах и единый уровень поддерживаемых функций<br />
*Только одно родное(native) окно используется для каждой формы, в backend для Андроид на данный момент это одно native-окно для всего приложения<br />
*Используются the Lazarus Custom Drawn Controls для реализации стандартных элементов управления LCL<br />
*Испольуются его графический движок для частей LCL: TLazIntfImage, TRawImage, lazcanvas и lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn нуждается в backend'ах для реализации основной части виджетов. Каждый backend должен реализовать следующие минимальные части: <br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
Этот backend работает. Смотрите эту страницу [[Custom Drawn Interface/Android]]<br />
<br />
Также смотрите [[Android Programming/ru]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Отрисовка шрифтов==<br />
<br />
Когда определение CD_UseNativeText установленно, LCL-CustomDrawn будет использовать родной(native) для платформы способ отрисовки текста, как это предусмотренно движком. Если оно не активно, тогда будет использоватся [[PasFreeType]] для отрисовки текста. Определение автоматически активно для некоторых движков, если это удобно для их использования.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Оконные визуальные элементы управления==<br />
<br />
Все оконные визуальные элементы управления (TButton, TPageControl, и др.) будут основыватся на [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55342
Custom Drawn Interface/ru
2012-02-07T03:55:56Z
<p>Kverde: /* Font rendering */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Backends для X11, Android и Windows и частично рабочий для Cocoa, другие могут быть добавлены в будущем<br />
*Отрисовка сделана полностью внутри Lazarus, не используя родных(native) библиотек, за исключением отрисовки текста. Это гарантирует одинаковое изображение на всех платформах и единый уровень поддерживаемых функций<br />
*Только одно родное(native) окно используется для каждой формы, в backend для Андроид на данный момент это одно native-окно для всего приложения<br />
*Используются the Lazarus Custom Drawn Controls для реализации стандартных элементов управления LCL<br />
*Испольуются его графический движок для частей LCL: TLazIntfImage, TRawImage, lazcanvas и lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn нуждается в backend'ах для реализации основной части виджетов. Каждый backend должен реализовать следующие минимальные части: <br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
Этот backend работает. Смотрите эту страницу [[Custom Drawn Interface/Android]]<br />
<br />
Также смотрите [[Android Programming/ru]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Отрисовка шрифтов==<br />
<br />
Когда определение CD_UseNativeText установленно, LCL-CustomDrawn будет использовать родной(native) для платформы способ отрисовки текста, как это предусмотренно движком. Если оно не активно, [[PasFreeType]] тогда будет использоватся для отрисовки текста. Определение автоматически активно для некоторых движков, если это удобно для их использования.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Оконные визуальные элементы управления==<br />
<br />
Все оконные визуальные элементы управления (TButton, TPageControl, и др.) будут основыватся на [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55341
Custom Drawn Interface/ru
2012-02-07T03:49:00Z
<p>Kverde: /* Введение */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Backends для X11, Android и Windows и частично рабочий для Cocoa, другие могут быть добавлены в будущем<br />
*Отрисовка сделана полностью внутри Lazarus, не используя родных(native) библиотек, за исключением отрисовки текста. Это гарантирует одинаковое изображение на всех платформах и единый уровень поддерживаемых функций<br />
*Только одно родное(native) окно используется для каждой формы, в backend для Андроид на данный момент это одно native-окно для всего приложения<br />
*Используются the Lazarus Custom Drawn Controls для реализации стандартных элементов управления LCL<br />
*Испольуются его графический движок для частей LCL: TLazIntfImage, TRawImage, lazcanvas и lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn нуждается в backend'ах для реализации основной части виджетов. Каждый backend должен реализовать следующие минимальные части: <br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
Этот backend работает. Смотрите эту страницу [[Custom Drawn Interface/Android]]<br />
<br />
Также смотрите [[Android Programming/ru]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Font rendering==<br />
<br />
When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use [[PasFreeType]] to render the text. The define is automatically activated for some backends if convenient when using them.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Оконные визуальные элементы управления==<br />
<br />
Все оконные визуальные элементы управления (TButton, TPageControl, и др.) будут основыватся на [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55340
Custom Drawn Interface/ru
2012-02-07T03:35:09Z
<p>Kverde: /* The LCL-CustomDrawn Backends */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Backends for X11, Android and Windows and a partially working one for Cocoa, more can be added in the future<br />
*Painting is done completely inside Lazarus without any interference from the native libraries except for text drawing. This assures a complete perfection of the executed drawings in all platforms and a uniform level of supported features<br />
*Only 1 native window is utilized for each form, in the Android backend at the moment this is 1 native window for the entire application<br />
*Utilizes the Lazarus Custom Drawn Controls for implementing the LCL standard controls<br />
*Utilizes as it's painting engine the lcl parts: TLazIntfImage, TRawImage, lazcanvas and lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn нуждается в backend'ах для реализации основной части виджетов. Каждый backend должен реализовать следующие минимальные части: <br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
Этот backend работает. Смотрите эту страницу [[Custom Drawn Interface/Android]]<br />
<br />
Также смотрите [[Android Programming/ru]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Font rendering==<br />
<br />
When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use [[PasFreeType]] to render the text. The define is automatically activated for some backends if convenient when using them.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Оконные визуальные элементы управления==<br />
<br />
Все оконные визуальные элементы управления (TButton, TPageControl, и др.) будут основыватся на [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55339
Custom Drawn Interface/ru
2012-02-07T03:29:17Z
<p>Kverde: /* LCL-CustomDrawn-Android */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Backends for X11, Android and Windows and a partially working one for Cocoa, more can be added in the future<br />
*Painting is done completely inside Lazarus without any interference from the native libraries except for text drawing. This assures a complete perfection of the executed drawings in all platforms and a uniform level of supported features<br />
*Only 1 native window is utilized for each form, in the Android backend at the moment this is 1 native window for the entire application<br />
*Utilizes the Lazarus Custom Drawn Controls for implementing the LCL standard controls<br />
*Utilizes as it's painting engine the lcl parts: TLazIntfImage, TRawImage, lazcanvas and lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn needs backends to implement the most basic parts of the widgetset. Each backend should implement the following minimal parts:<br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
Этот backend работает. Смотрите эту страницу [[Custom Drawn Interface/Android]]<br />
<br />
Также смотрите [[Android Programming/ru]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Font rendering==<br />
<br />
When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use [[PasFreeType]] to render the text. The define is automatically activated for some backends if convenient when using them.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Оконные визуальные элементы управления==<br />
<br />
Все оконные визуальные элементы управления (TButton, TPageControl, и др.) будут основыватся на [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55338
Custom Drawn Interface/ru
2012-02-07T03:15:12Z
<p>Kverde: /* Windowed visual controls */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Backends for X11, Android and Windows and a partially working one for Cocoa, more can be added in the future<br />
*Painting is done completely inside Lazarus without any interference from the native libraries except for text drawing. This assures a complete perfection of the executed drawings in all platforms and a uniform level of supported features<br />
*Only 1 native window is utilized for each form, in the Android backend at the moment this is 1 native window for the entire application<br />
*Utilizes the Lazarus Custom Drawn Controls for implementing the LCL standard controls<br />
*Utilizes as it's painting engine the lcl parts: TLazIntfImage, TRawImage, lazcanvas and lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn needs backends to implement the most basic parts of the widgetset. Each backend should implement the following minimal parts:<br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
This backend is working. See this page [[Custom Drawn Interface/Android]]<br />
<br />
And also [[Android Programming]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Font rendering==<br />
<br />
When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use [[PasFreeType]] to render the text. The define is automatically activated for some backends if convenient when using them.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Оконные визуальные элементы управления==<br />
<br />
Все оконные визуальные элементы управления (TButton, TPageControl, и др.) будут основыватся на [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55337
Custom Drawn Interface/ru
2012-02-06T16:36:02Z
<p>Kverde: /* Инструкция */</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Введение==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Backends for X11, Android and Windows and a partially working one for Cocoa, more can be added in the future<br />
*Painting is done completely inside Lazarus without any interference from the native libraries except for text drawing. This assures a complete perfection of the executed drawings in all platforms and a uniform level of supported features<br />
*Only 1 native window is utilized for each form, in the Android backend at the moment this is 1 native window for the entire application<br />
*Utilizes the Lazarus Custom Drawn Controls for implementing the LCL standard controls<br />
*Utilizes as it's painting engine the lcl parts: TLazIntfImage, TRawImage, lazcanvas and lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn needs backends to implement the most basic parts of the widgetset. Each backend should implement the following minimal parts:<br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
This backend is working. See this page [[Custom Drawn Interface/Android]]<br />
<br />
And also [[Android Programming]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Font rendering==<br />
<br />
When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use [[PasFreeType]] to render the text. The define is automatically activated for some backends if convenient when using them.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Windowed visual controls==<br />
<br />
All Windowed visual controls (TButton, TPageControl, etc) will be based in the [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface/ru&diff=55336
Custom Drawn Interface/ru
2012-02-06T16:33:37Z
<p>Kverde: New page: {{Custom_Drawn_Interface}} __TOC__ {{Other Interfaces}} ==Инструкция== LCL-CustomDrawn-Android имеет следующие оссобенности: *Backends for X11, Android ...</p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Инструкция==<br />
LCL-CustomDrawn-Android имеет следующие оссобенности:<br />
*Backends for X11, Android and Windows and a partially working one for Cocoa, more can be added in the future<br />
*Painting is done completely inside Lazarus without any interference from the native libraries except for text drawing. This assures a complete perfection of the executed drawings in all platforms and a uniform level of supported features<br />
*Only 1 native window is utilized for each form, in the Android backend at the moment this is 1 native window for the entire application<br />
*Utilizes the Lazarus Custom Drawn Controls for implementing the LCL standard controls<br />
*Utilizes as it's painting engine the lcl parts: TLazIntfImage, TRawImage, lazcanvas and lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn needs backends to implement the most basic parts of the widgetset. Each backend should implement the following minimal parts:<br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
This backend is working. See this page [[Custom Drawn Interface/Android]]<br />
<br />
And also [[Android Programming]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Font rendering==<br />
<br />
When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use [[PasFreeType]] to render the text. The define is automatically activated for some backends if convenient when using them.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Windowed visual controls==<br />
<br />
All Windowed visual controls (TButton, TPageControl, etc) will be based in the [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface&diff=55335
Custom Drawn Interface
2012-02-06T16:31:23Z
<p>Kverde: </p>
<hr />
<div>{{Custom_Drawn_Interface}}<br />
__TOC__<br />
{{Other Interfaces}}<br />
==Introduction==<br />
LCL-CustomDrawn-Android has the following features:<br />
*Backends for X11, Android and Windows and a partially working one for Cocoa, more can be added in the future<br />
*Painting is done completely inside Lazarus without any interference from the native libraries except for text drawing. This assures a complete perfection of the executed drawings in all platforms and a uniform level of supported features<br />
*Only 1 native window is utilized for each form, in the Android backend at the moment this is 1 native window for the entire application<br />
*Utilizes the Lazarus Custom Drawn Controls for implementing the LCL standard controls<br />
*Utilizes as it's painting engine the lcl parts: TLazIntfImage, TRawImage, lazcanvas and lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn needs backends to implement the most basic parts of the widgetset. Each backend should implement the following minimal parts:<br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
This backend is working. See this page [[Custom Drawn Interface/Android]]<br />
<br />
And also [[Android Programming]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Font rendering==<br />
<br />
When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use [[PasFreeType]] to render the text. The define is automatically activated for some backends if convenient when using them.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Windowed visual controls==<br />
<br />
All Windowed visual controls (TButton, TPageControl, etc) will be based in the [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Template:Custom_Drawn_Interface&diff=55334
Template:Custom Drawn Interface
2012-02-06T16:30:54Z
<p>Kverde: New page: <small> '''English (en)''' | '''Русский (ru)''' | </small></p>
<hr />
<div><small><br />
[[Custom Drawn Interface|'''English (en)''']] |<br />
[[Custom Drawn Interface/ru|'''Русский (ru)''']] |<br />
</small></div>
Kverde
https://wiki.freepascal.org/index.php?title=Custom_Drawn_Interface&diff=55333
Custom Drawn Interface
2012-02-06T16:29:26Z
<p>Kverde: </p>
<hr />
<div>__TOC__<br />
{{Custom_Drawn_Interface}}<br />
{{Other Interfaces}}<br />
==Introduction==<br />
LCL-CustomDrawn-Android has the following features:<br />
*Backends for X11, Android and Windows and a partially working one for Cocoa, more can be added in the future<br />
*Painting is done completely inside Lazarus without any interference from the native libraries except for text drawing. This assures a complete perfection of the executed drawings in all platforms and a uniform level of supported features<br />
*Only 1 native window is utilized for each form, in the Android backend at the moment this is 1 native window for the entire application<br />
*Utilizes the Lazarus Custom Drawn Controls for implementing the LCL standard controls<br />
*Utilizes as it's painting engine the lcl parts: TLazIntfImage, TRawImage, lazcanvas and lazregions<br />
<br />
==FAQ==<br />
<br />
===Comparison of LCL-CustomDrawn and LCL-fpGUI===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Item'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-fpGUI'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''LCL-CustomDrawn'''<br />
|--<br />
|Native handles||fpGUI uses 1 native window for each control||LCL-CustomDrawn uses 1 native window for each form in X11, Cocoa and Windows and 1 native surface for all forms in Android<br />
|--<br />
|Canvas implementation||fpGUI uses native Canvas routines from the platform||LCL-CustomDrawn has a define to choose between native and non-native (via PasFreeType) text metrics/rendering and everything else from canvas drawing is implemented by TRawImage+TLazIntfImage+TLazCanvas. Being non-native means a faster and more reliable result.<br />
|--<br />
|Supported platforms||Windows, Windows CE and Linux (via X11)||Windows, Cocoa (Mac OS X), X11 (Linux) and Android<br />
|--<br />
|Level of indirection||fpGUI acts as an intermediary between the LCL and the platform||There are no intermediaries, the LCL talks directly to each platform<br />
|--<br />
|Adaptation for platforms without native sub-windows||fpGUI would need extensive changes to work in platforms which do not have native sub-controls, for example Android, linux framebuffer, OpenGL||LCL-CustomDrawn is designed from the start to work on very limited platforms, for example the Linux Framebuffer, an Android SurfaceView or OpenGL<br />
|--<br />
|LCL Adaptation||fpGUI is a separate unrelated framework. It's controls and Canvas APIs do not necessary match what is required by the LCL||LCL-CustomDrawn is designed to perfectly implement all features from the LCL and perfectly paint it's Canvas drawing routines like LCL-Win32, LCL-Gtk2 and LCL-Qt do<br />
|--<br />
|How to port the LCL to a new platform using this widgetset?||First you need to port fpGUI and then verify if LCL-fpgui keeps working||You can port LCL-CustomDrawn directly to new platforms by implementing a new backend which contains support for form, application and and other parts<br />
|}<br />
<br />
More comments on why developing LCL-CustomDrawn instead of LCL-fpGUI: Just to start with, it is the correct architecture. There is no need for an intermediary API which complicates the architecture and makes debugging and porting harder. We can do everything directly without it and greatly simplify our code. Also, by eating our own dog food we ensure that our platform is more strongly tested and has a higher quality. Each feature in LCL-CustomDrawn is implemented using other more basic features. For example TButton, TPageControl and all other visual controls are implemented with TCanvas, so it guarantees that our Canvas drawing is in excellent shape. Drawing in LCL-CustomDrawn is executed via LCL classes: TRawImage, TLazIntfImage and TLazCanvas. If there is an intermediary API then porting the LCL means first porting the intermediary API and debugging it and then debug the combined package. LCL porters should not need to learn unrelated frameworks to port the LCL.<br />
<br />
On top of that, LCL-CustomDrawn is designed from the start to be portable to even the most spartan and problematic of platforms. It requires from the platform only a raster surface in any pixel format and also input events. From that onwards we can implement everything else non-natively. There are non-native implementations of Forms, WinControls, standard controls, TCanvas drawing, dialogs and even text can be provided if necessary. Each backend can select its mix of non-native / native elements, although they should never attempt to implement TWinControl natively. fpGUI on the other hand would need a large rewrite to be able to support this level of portability.<br />
<br />
==The LCL-CustomDrawn Backends==<br />
LCL-CustomDrawn needs backends to implement the most basic parts of the widgetset. Each backend should implement the following minimal parts:<br />
<br />
* TWidgetSet.Run, ProcessMessages, etc<br />
* TForm<br />
* TWinControl with all events<br />
* TTrayIcon<br />
<br />
===LCL-CustomDrawn-Android===<br />
<br />
This backend is working. See this page [[Custom Drawn Interface/Android]]<br />
<br />
And also [[Android Programming]]<br />
<br />
===LCL-CustomDrawn-X11===<br />
<br />
This backend is working. See [[Custom Drawn Interface/X11]]<br />
<br />
===LCL-CustomDrawn-Cocoa===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-Windows===<br />
<br />
This backend is working.<br />
<br />
===LCL-CustomDrawn-iPhone===<br />
<br />
This is planned, but not yet started.<br />
<br />
==Canvas==<br />
<br />
TCanvas will be fully non-native in this widgetset and based on [[Developing_with_Graphics#Working_with_TLazIntfImage.2C_TRawImage_and_TLazCanvas|LazCanvas]]. All drawings to visual controls and on the OnPaint event of controls of the form are naturally double-buffered because the entire drawing of the form is first performed on an off-screen buffer and then copied in 1 operation to the form native canvas. In reality there is only 1 TLazCanvas for the entire form, but sub-controls will think they are on a separate canvas because the property BaseWindowOrg sets an internal start position of the canvas and also because all drawings will be clipped to reflect the size and shape of the sub-control.<br />
<br />
==Font rendering==<br />
<br />
When the define CD_UseNativeText is activated, LCL-CustomDrawn will use the native text rendering of the platform as provided by the backend. If it isn't activated, then it will use [[PasFreeType]] to render the text. The define is automatically activated for some backends if convenient when using them.<br />
<br />
==Message and Common Dialogs==<br />
<br />
Message and Common Dialogs might be native if this is considered very convenient for the backend. If not, they will be non-native. At the moment the Android backend has native message boxes.<br />
<br />
==Windowed visual controls==<br />
<br />
All Windowed visual controls (TButton, TPageControl, etc) will be based in the [[Lazarus Custom Drawn Controls]]<br />
<br />
==Conditional defines accepted by LCL-CustomDrawn==<br />
<br />
Here are defines which affect the functionality offered by this interface:<br />
<br />
*CD_UseNativeText - Activates using native text instead of PasFreeType. This define will be automatically set if convenient for a particular backend<br />
<br />
And here debug information defines:<br />
<br />
*VerboseCDPaintProfiler - Adds profiling information to indicate how fast the paint event is processed<br />
*VerboseCDWinAPI - Extended verbose information for LCLIntf calls, except those which are covered by one of these defines instead:<br />
**VerboseCDText - Verbose info for text winapi calls<br />
**VerboseCDDrawing - Verbose info for Canvas and drawing operations<br />
**VerboseCDBitmap - Verbose info for Bitmap and rawimage creation and handling<br />
*VerboseCDForms - Extended verbose information for TWSCustomForm methods and about the non-native form from customdrawnproc (when utilized)<br />
*VerboseCDEvents - Extended verbose information for native events (for example mouse click, key input, etc). This excludes the paint event<br />
*VerboseCDPaintEvent - Debug info for the paint event<br />
*VerboseCDApplication - Verbose info for App routines from the Widgetset object<br />
*VerboseCDMessages - Verbose info for messages from the operating system (Paint, keyboard, mouse)</div>
Kverde
https://wiki.freepascal.org/index.php?title=Help:Editing/ru&diff=55332
Help:Editing/ru
2012-02-06T16:24:28Z
<p>Kverde: /* Sections, paragraphs, lists and lines */</p>
<hr />
<div>{{Template:Help:Editing}}<br />
<br />
Редактировать страницы wiki очень просто. Просто нажмите кнопку "'''Edit'''" ("'''Править'''") расположенную в верхней части меню справа. Это привдет вас на страницу с текствым полем содержашим редактируемый текст этой страницы. ''''Если вы хотите поэксперементировать, пожалуйста, сделайте это в нашей [[Sand Box|песочнице]], а не сдесь. Вы можете открыть [[Sand Box|песочницу]] в отдельном окне или вкладке чтобы иметь возможность видеть одновременно этот текст и вашы тесты в песочнице.'''''<br />
<br />
Type away, write a short [[Wikipedia:Edit summary|edit summary]] on the small field below the edit-box. You may use shorthand to describe your changes, as described in the [[Wikipedia:Edit summary legend|legend]], and when you've finished, press [[Wikipedia:Show preview|preview]] to see how your changes will look. Then press "Save". Depending on your system, pressing "Enter" while the edit box is not active (when there is no typing cursor in it) may have the same effect as pressing the "Save" button. Also, please do not vandalise the information on {{ns:4}}.<br />
<br />
Вы также можете нажать на кнопку "'''Обсуждение'''" (или ссылку "'''Обсудить эту страницу'''") чтобы уведить соответствующую [[Wikipedia:Talk page|страницу разговора]] которая содержит коментарии об этой странице от других польхователей Википедии. Нажмите кнопку "'''+'''" (или "'''Редактировать эту страницу'''") чтобы добавить комментарий.<br />
<br />
==Вики-разметка==<br />
В левой колонке таблицы снизу вы можете видеть какие эффекты возможны. В правой колонке, вы можете видеть как эти эффекты можно получить. Другими словами, чтобы сделать текст как в левой колонке, напечатайте его в формате который вы видите в правой колонке.<br />
<br />
Вы можете оставить эту страницу в отдельном окне браузера для справки. Если вы хотите попробовать эти веши бех опасности причинить вред, вы можете попробоватьсделать это '''в [[Sand_Box|песочнице]]'''.<br />
<br />
----<br />
<!--<br />
:'''The rest of this page is deprecated but will be updated periodically.''' <br />
:'''Please direct edits to the [[meta:MediaWiki User's Guide: Editing overview|Meta-Wikimedia version of this page]]'''<br />
<br />
--><br />
=== Разделы, параграфы, списки и линии ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! Как это выглядит<br />
! Что введено<br />
|- valign="top"<br />
|<br />
Start your [[Wikipedia:Manual of Style (headings)|sections]] as follows:<br />
<br />
<!-- The following code messes up the table of contents<br />
and makes the section edit links much less useful,<br />
so please do not use it.<br />
== Новый раздел ==<br />
=== Подраздел ===<br />
==== Под-подраздел ====<br />
--><br />
<!-- The following should look almost the same, using<br />
HTML headings markup instead of wiki headings.<br />
However, it messes up the section edit links,<br />
so please do not use it.<br />
<h2>New section</h2><br />
<h3>Subsection</h3><br />
<h4>Sub-subsection</h4><br />
--><br />
<!-- The following just uses bolding and font changes,<br />
so it should be safe. However, it might not<br />
look exactly right, especially when people<br />
use non-standard CSS stylesheets.<br />
--><br />
'''<font style="font-size:120%">Новый раздел</font>'''<br />
<br />
'''<font style="font-size:110%">Подраздел</font>'''<br />
<br />
'''<font style="font-size:100%">Под-подраздел</font>'''<br />
<br />
* Начинайте с заголовка второго уровня (<tt><nowiki>==</nowiki></tt>); не используйте заголовок первого уровня (=).<br />
* Не пропускайте уровень (например заголовок второго уровня, а после него четвертого).<br />
* [[#Placement_of_the_Table_of_Contents_.28TOC.29|Содержание]] будет автоматически добавленно к статье которая содержит четыре или более разделов.<br />
|<br />
<pre><nowiki><br />
== Новый раздел ==<br />
<br />
=== Подраздел ===<br />
<br />
==== Под-подраздел ====<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Одиночные переводы строк<br />
вообще не оказываеют эффект на макет.<br />
Они могут использоватся для раздений <br />
предложений в одном абзаце.<br />
Некоторые редакторы считают что это облегчает редактирование<br />
и улучшает функцию ''diff'' <br />
(используется внутри для сравнения разныех версий страницы).<br />
<br />
Но пустая строка <br />
начинает новый параграф.<br />
<br />
* Когра вы используете список пустая строка влияет на шаблон ([[#lists|смотрите ниже]]).<br />
|<br />
<pre><nowiki><br />
Одиночные переводы строк<br />
вообще не оказываеют эффект на макет.<br />
Они могут использоватся для раздений <br />
предложений в одном абзаце.<br />
Некоторые редакторы считают что это облегчает редактирование<br />
и улучшает функцию ''diff'' <br />
(используется внутри для сравнения разныех версий страницы).<br />
<br />
Но пустая строка <br />
начинает новый параграф.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can break lines<br><br />
without starting a new paragraph.<br />
<br />
* Please use this sparingly.<br />
* Close markup between lines, don't start a [[link]] or ''italics'' or '''bold''' on one line and close it on the next.<br />
|<br />
<pre><nowiki><br />
You can break lines<br><br />
without starting a new paragraph.<br />
</nowiki></pre><br />
|- id="lists" valign="top"<br />
|<br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
|<br />
<pre><nowiki><br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
|<br />
<pre><nowiki><br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
|<br />
<pre><nowiki><br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
<br />
* One item per line; a newline can appear before the colon, but using a space before the colon improves parsing.<br />
|<br />
<pre><nowiki><br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
<br />
* This is primarily for displayed material, but is also used for discussion on [[Wikipedia:Talk page|Talk page]]s.<br />
|<br />
<pre><nowiki><br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
<br />
*This is useful for:<br />
** pasting preformatted text;<br />
** algorithm descriptions;<br />
** program source code;<br />
** [[ASCII art]];<br />
** chemical structures;<br />
* '''WARNING''': If you make it wide, you [[page widening|force the whole page to be wide]] and hence less readable, especially for people who use lower resolutions. Never start ordinary lines with spaces.<br />
|<br />
<pre><nowiki><br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<center>Centered text.</center><br />
<br />
* Note the American spelling of "center" (not "centre").<br />
|<br />
<pre><nowiki><br />
<center>Centered text.</center><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
<br />
* Mainly useful for separating threads on Talk pages.<br />
* Also used to [[Wikipedia:Disambiguation|disambiguate]] within an article without creating a separate page.<br />
|<br />
<pre><nowiki><br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
</nowiki></pre><br />
|}<br />
<br />
=== Links and URLs ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
London has [[public transport]].<br />
<br />
* A link to another Wikipedia article.<br />
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).<br />
* Thus the link above is to the [[URL]] http://www.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also [[Wikipedia:Canonicalization]].<br />
|<br />
<pre><nowiki><br />
London has [[public transport]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
<br />
* Same target, different name.<br />
* This is a [[piped link]].<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
<br />
* Endings are blended into the link.<br />
* Preferred style is to use this instead of a piped link, if possible.<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
See the [[Wikipedia:Manual of Style]].<br />
<br />
* A link to another [[Wikipedia:namespace|namespace]].<br />
|<br />
<pre><nowiki><br />
See the [[Wikipedia:Manual of Style]].<br />
</nowiki></pre><br />
|- id="link-to-section" valign="top"<br />
|<br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
<br />
* The part after the number sign (#) must match a section heading on the page, or an identifier created in some other way. Matches must be exact in terms of spelling, case and punctuation. Links to non-existent sections aren't broken; they are treated as links to the top of the page.<br />
* Identifiers may be created by attaching an <code>id="..."></code> attribute to almost any HTML element.<br />
|<br />
<pre><nowiki><br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|kingdom]].<br />
<br />
Automatically hide namespace:<br />
[[Wikipedia:Village Pump|Village Pump]]. <br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|Manual of Style]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
<br />
* The server fills in the part after the pipe character (|) when you save the page. The next time you open the edit box you will see the expanded piped link. When [[Wikipedia:Show preview|preview]]ing your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to links to sections within the same page ([[#link-to-section|see previous entry]]).<br />
|<br />
<pre><nowiki><br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|]].<br />
<br />
Automatically hide namespace: <br />
[[Wikipedia:Village Pump|]].<br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[The weather in London]] is a page<br />
that doesn't exist yet.<br />
<br />
* You can create it by clicking on the link (but please don't do so with this particular link).<br />
* To create a new page: <br />
*# Create a link to it on some other (related) page.<br />
*# Save that page.<br />
*# Click on the link you just made. The new page will open for editing.<br />
* For more information, see [[Wikipedia:How to start a page|How to start a page]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].<br />
* Please do not create a new article without linking to it from at least one other article.<br />
|<br />
<pre><nowiki><br />
[[The weather in London]] is a page <br />
that doesn't exist yet.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[Wikipedia:How to edit a page]] is this page.<br />
<br />
* [[Self link]]s appear as bold text when the article is viewed.<br />
* Do not use this technique to make the article name bold in the first paragraph; see the [[Wikipedia:Manual of Style#Article names|Manual of Style]].<br />
|<br />
<pre><nowiki><br />
[[Wikipedia:How to edit a page]] is this page.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: [[User:Brockert|Ben Brockert]]<br />
or four to add user name plus date/time:<br />
: [[User:Brockert|Ben Brockert]] 00:18, Nov 19, 2004 (UTC)<br />
Five tildes gives the date/time alone:<br />
: 00:18, Nov 19, 2004 (UTC)<br />
<br />
* The first two both provide a link to your [[Wikipedia:user page|user page]].<br />
|<br />
<pre><nowiki><br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: ~~~<br />
or four for user name plus date/time:<br />
: ~~~~<br />
Five tildes gives the date/time alone:<br />
: ~~~~~<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[USA]]").<br />
* Note that, while it is possible to link to a section, it is not possible to redirect to a section. For example, "<nowiki>#REDIRECT [[United States#History]]</nowiki>" will redirect to the [[United States]] page, but not to any particular section on it. This feature '''will not''' be implemented in the future, so such redirects should not be used.<br />
|<br />
<pre><nowiki><br />
#REDIRECT [[United States]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Link to a page on the same subject in another language by using a link of the form: <nowiki>[[language code:Title]]</nowiki>.<br />
* It does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
* Please see [[Wikipedia:Interlanguage links]] and the [[Wikipedia:Complete list of language wikis available|list of languages and codes]].<br />
|<br />
<pre><nowiki><br />
[[fr:Wikipédia:Aide]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
<br />
|<br />
<pre><nowiki><br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
|<br />
<pre><nowiki><br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To put an article in a [[Wikipedia:Category]], place a link like the one to the right anywhere in the article. As with interlanguage links, it does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
|<br />
<pre><nowiki><br />
[[Category:Character sets]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To ''link'' to a [[Wikipedia:Category]] page without putting the article into the category, use an initial colon (:) in the link.<br />
|<br />
<pre><nowiki><br />
[[:Category:Character sets]]<br />
</nowiki></pre><br />
|- id="link-external" valign="top"<br />
|<br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/ (bad style)<br />
# Unnamed link: [http://www.nupedia.com/] (bad style)<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
<br />
:See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts.<br />
<br />
* Square brackets indicate an external link. Note the use of a ''space'' (not a pipe) to separate the URL from the link text in the "named" version.<br />
* In the [[URL]], all symbols must be among:<br/>'''A-Z a-z 0-9 . _ \ / ~ % - + &amp; # ? ! = ( ) @ \x80-\xFF'''<br />
* If a URL contains a character not in this list, it should be encoded by using a percent sign (%) followed by the [[hexadecimal|hex]] code of the character, which can be found in the table of [[ASCII#ASCII printable characters|ASCII printable characters]]. For example, the caret character (^) would be encoded in a URL as '''%5E'''.<br />
* See [[Wikipedia:External links]] for style issues.<br />
|<br />
<pre><nowiki><br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/<br />
# Unnamed link: [http://www.nupedia.com/]<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|Hello]]<br />
<br />
* All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello<br />
* Note that interwiki links use the ''internal'' link style.<br />
* See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts; if the site you want to link to isn't on the list, use an external link ([[#link-external|see above]]).<br />
* See also [[Wikipedia:How to link to Wikimedia projects]].<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|fr:Bonjour]]<br />
<br />
* All of these forms lead to the URL http://fr.wiktionary.org/wiki/Bonjour<br />
|<br />
<pre><nowiki><br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|]]<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
<br />
* Link to books using their [[Wikipedia:ISBN|ISBN]] numbers. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors.<br />
* ISBN links do not need any extra markup, provided you use one of the indicated formats.<br />
|<br />
<pre><nowiki><br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
<br />
* Link dates in one of the above formats, so that everyone can set their own display order. If [[Special:Userlogin|logged in]], you can use [[Special:Preferences]] to change your own date display setting.<br />
* All of the above dates will appear as "[[20 July|20 July]] [[1969|1969]]" if you set your date display preference to "15 January 2001", but as "[[20 July|July 20]], [[1969|1969]]" if you set it to "January 15, 2001".<br />
|<br />
<pre><nowiki><br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[media:Sg_mrob.ogg|Sound]]<br />
<br />
*To include links to non-image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].<br />
<br />
Some uploaded sounds are listed at [[Wikipedia:Sound]].<br />
|<br />
<pre><nowiki><br />
[[media:Sg_mrob.ogg|Sound]]<br />
</nowiki></pre><br />
|}<br />
<br />
=== Images ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
| A picture: [[Image:Wiki.png]]<br />
<br />
or, with alternative text:<br />
[[Image:Wiki.png|jigsaw globe]]<br />
<br />
or, floating to the right side of the page and with a caption:<br />
[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
[[Image:Wiki.png|right|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
* Only images that have been uploaded to Wikipedia can be used. To upload images, use the [[Special:Upload|upload page]]. You can find the uploaded image on the [[Special:Imagelist|image list]].<br />
* See the [[Wikipedia:Image use policy|image use policy]], [[Wikipedia:Image markup|extended image markup/syntax]] (also possibly [[Wikipedia:Image markup with HTML|image HTML markup]]) for more hints.<br />
* Alternative text, used when the image isn't loaded, in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternate text for images|Alternate text for images]] for help on choosing it.<br />
* The frame tag automatically floats the image right.<br />
| <pre><nowiki><br />
A picture: [[Image:Wiki.png]]</nowiki><br />
<br />
or, with alternative text:<br />
<nowiki>[[Image:Wiki.png|jigsaw globe]]</nowiki><br />
<br />
or, floating to the right side of the page and with a caption:<br />
<nowiki>[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]</nowiki><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
<nowiki>[[Image:Wiki.png|right|Wikipedia Encyclopedia]]</nowiki></pre><br />
|-<br />
|<br />
Clicking on an uploaded image displays a description page, which you can also link directly to: [[:Image:Wiki.png]]<br />
| <pre><nowiki><br />
<br />
[[:Image:Wiki.png]]<br />
</nowiki></pre><br />
|-<br />
|<br />
To include links to images shown as links instead of drawn on the page, use a "media" link.<br />
<br />
<br/>[[media:Tornado.jpg|Image of a Tornado]]<br />
|<br />
<pre><br />
<nowiki><br />
<br />
[[media:Tornado.jpg|Image of a Tornado]]<br />
<br />
</nowiki></pre><br />
|}<br />
<br />
=== Character formatting ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|- valign="top"<br />
! What it looks like<br />
! What you type<br />
|- id="emph" valign="top"<br />
|<br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
* These are double and triple apostrophes (single-quote marks), not double-quote marks.<br />
|<br />
<pre><nowiki><br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<math>\sin x + \ln y</math><br><br />
sin''x'' + ln''y''<br />
<!-- no space between roman "sin" and italic "x" --><br />
<br />
<math>\mathbf{x} = 0</math><br><br />
'''x''' = 0<br />
<br />
Ordinary text should use [[#emph|wiki markup for emphasis]], and should not use <code>&lt;i&gt;</code> or <code>&lt;b&gt;</code>. However, mathematical formulas often use italics, and sometimes use bold, for reasons unrelated to emphasis. Complex formulas should use [[m:Help:Formula|<code>&lt;math&gt;</code> markup]], and simple formulas may use <code>&lt;math&gt;</code>; or <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>; or <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code>. According to [[Wikipedia:WikiProject Mathematics#Italicization and bolding|WikiProject Mathematics]], wiki markup is preferred over HTML markup like <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>.<br />
|<br />
<pre><nowiki><br />
<math>\sin x + \ln y</math><br />
sin''x'' + ln''y''<br />
<br />
<math>\mathbf{x} = 0</math><br />
'''x''' = 0<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
<br />
* For semantic reasons, using <code>&lt;code&gt;</code> where applicable is preferable to using <code>&lt;tt&gt;</code>.<br />
|<br />
<pre><nowiki><br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can use <small>small text</small> for captions.<br />
|<br />
<pre><nowiki><br />
You can use <small>small text</small> for captions.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
<br />
* When editing regular Wikipedia articles, just make your changes and don't mark them up in any special way.<br />
* When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.<br />
|<br />
<pre><nowiki><br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Diacritical marks:'''<br />
<br/><br />
è é ê ë ì í<br />
<br />
À Á Â Ã Ä Å <br/><br />
Æ Ç È É Ê Ë <br/><br />
Ì Í<br />
Î Ï Ñ Ò <br/><br />
Ó Ô Õ<br />
Ö Ø Ù <br/><br />
Ú Û Ü ß<br />
à á <br/><br />
â ã ä å æ<br />
ç <br/><br />
è é ê ë ì í<br/><br />
î ï ñ ò ó ô <br/><br />
&oelig; õ<br />
ö ø ù ú <br/><br />
û ü ÿ<br />
<br />
* See [[meta:Help:Special characters|special characters]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
è é ê ë ì í<br />
<br />
&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; <br />
&amp;AElig; &amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml; <br />
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde; &amp;Ograve; <br />
&amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;Ugrave; <br />
&amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;szlig; &amp;agrave; &amp;aacute; <br />
&amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil; <br />
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml; &amp;igrave; &amp;iacute;<br />
&amp;icirc; &amp;iuml; &amp;ntilde; &amp;ograve; &amp;oacute; &amp;ocirc; <br />
&amp;oelig; &amp;otilde; &amp;ouml; &amp;oslash; &amp;ugrave; &amp;uacute; <br />
&amp;ucirc; &amp;uuml; &amp;yuml;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Punctuation:'''<br />
<br/><br />
¿ ¡ § ¶<br/><br />
&dagger; &Dagger; &bull; &ndash; &mdash;<br/><br />
&lsaquo; &rsaquo; « »<br/><br />
&lsquo; &rsquo; &ldquo; &rdquo;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;<br />
&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;<br />
&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;<br />
&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commercial symbols:'''<br />
<br/><br />
&trade; © ® ¢ &euro; ¥<br/><br />
£ ¤<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;trade; &amp;copy; &amp;reg; &amp;cent; &amp;euro; &amp;yen; <br />
&amp;pound; &amp;curren;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Subscripts:'''<br />
<br/><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
<br />
'''Superscripts:'''<br />
<br/><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&sup1; x&sup2; x&sup3;<br />
*The latter method of superscripting can't be used in the most general context, but is preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.<br />
<br />
&epsilon;<sub>0</sub> =<br />
8.85 &times; 10<sup>&minus;12</sup><br />
C&sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&sup2;]]<br />
|<br />
<br/><br />
<pre><nowiki><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
</nowiki></pre><br />
<br />
<pre><nowiki><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&amp;sup1; x&amp;sup2; x&amp;sup3;<br />
<br />
&amp;epsilon;<sub>0</sub> =<br />
8.85 &amp;times; 10<sup>&amp;minus;12</sup><br />
C&amp;sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&amp;sup2;]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Greek characters:'''<br />
<br/><br />
&alpha; &beta; &gamma; &delta; &epsilon; &zeta;<br/><br />
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu;<br/><br />
&xi; &omicron; &pi; &rho; &sigma; &sigmaf;<br/><br />
&tau; &upsilon; &phi; &chi; &psi; &omega;<br/><br />
&Gamma; &Delta; &Theta; &Lambda; &Xi; &Pi;<br/><br />
&Sigma; &Phi; &Psi; &Omega;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; <br />
&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu; <br />
&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;<br />
&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;<br />
&amp;Gamma; &amp;Delta; &amp;Theta; &amp;Lambda; &amp;Xi; &amp;Pi; <br />
&amp;Sigma; &amp;Phi; &amp;Psi; &amp;Omega;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Math characters:'''<br />
<br/><br />
&int; &sum; &prod; &radic; &minus; &plusmn; &infin;<br/><br />
&asymp; &prop; &equiv; &ne; &le; &ge; &rarr;<br/><br />
&times; &middot; &divide; &part; &prime; &Prime;<br/><br />
&nabla; &permil; &deg; &there4; &alefsym; &oslash;<br/><br />
&isin; &notin; &cap; &cup; &sub; &sup; &sube; &supe;<br/><br />
&not; &and; &or; &exist; &forall; &rArr; &hArr;<br/><br />
&rarr; &harr;<br/><br />
* See also [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;int; &amp;sum; &amp;prod; &amp;radic; &amp;minus; &amp;plusmn; &amp;infin;<br />
&amp;asymp; &amp;prop; &amp;equiv; &amp;ne; &amp;le; &amp;ge; &amp;rarr;<br />
&amp;times; &amp;middot; &amp;divide; &amp;part; &amp;prime; &amp;Prime;<br />
&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym; &amp;oslash;<br />
&amp;isin; &amp;notin; &amp;cap; &amp;cup; &amp;sub; &amp;sup; &amp;sube; &amp;supe;<br />
&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall; &amp;rArr; &amp;hArr;<br />
&amp;rarr; &amp;harr;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Spacing in simple math formulas:'''<br />
<br/><br />
Obviously, ''x''&sup2;&nbsp;&ge;&nbsp;0 is true.<br />
*To space things out without allowing line breaks to interrupt the formula, use non-breaking spaces: <tt>&amp;nbsp;</tt>.<br />
|<br />
<br/><br />
<pre><nowiki><br />
Obviously, ''x''&amp;sup2;&amp;nbsp;&amp;ge;&amp;nbsp;0 is true.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Complicated formulas:'''<br />
<br/><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
* See [[m:Help:Formula]] for how to use <tt>&lt;math></tt>.<br />
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.<br />
|<br />
<br/><br />
<pre><nowiki><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Suppressing interpretation of markup:'''<br />
<br/><br />
<nowiki>Link &rarr; (''to'') the [[Wikipedia FAQ]]</nowiki><br />
* Used to show literal data that would otherwise have special meaning.<br />
* Escape all wiki markup, including that which looks like HTML tags.<br />
* Does not escape HTML character references.<br />
* To escape HTML character references such as <tt>&amp;rarr;</tt> use <tt>&amp;amp;rarr;</tt><br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;nowiki>Link &amp;rarr; (''to'') <br />
the [[Wikipedia FAQ]]&lt;/nowiki><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commenting page source:'''<br />
<br/><br />
''not shown when viewing page''<br />
* Used to leave comments in a page for future editors.<br />
* Note that most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;!-- comment here --><br />
</nowiki></pre><br />
|}<br />
''(see also: [[Chess symbols in Unicode]])''<br />
<br />
=== Tables ===<br />
==== Placement of the Table of Contents (TOC) ====<br />
At the current status of the wiki markup language, having at least four headers on a page triggers the TOC to appear in front of the first header (or after introductory sections). Putting <nowiki>__TOC__</nowiki> anywhere forces the TOC to appear at that point (instead of just before the first header). Putting <nowiki>__NOTOC__</nowiki> anywhere forces the TOC to disappear. See also [[Wikipedia:Section#Compact_TOC|compact TOC]] for alphabet and year headings.<br />
<br />
==== Keeping headings out of the Table of Contents ====<br />
<br />
If you want some subheadings to not appear in the Table of Contents, then make the following replacements.<br />
<br />
Replace <nowiki> == Header 2 == with <h2> Header 2 </h2> </nowiki><br />
<br />
Replace <nowiki> === Header 3 === with <h3> Header 3 </h3> </nowiki><br />
<br />
And so forth.<br />
<br />
For example, notice that the following header has the same font as the other subheaders to this "Tables" section, but the following header does not appear in the Table of Contents for this page.<br />
<br />
<h4> This header has the h4 font, but is NOT in the Table of Contents </h4><br />
<br />
This effect is obtained by the following line of code.<br />
<br />
<nowiki><h4> This header has the h4 font, but is NOT in the Table of Contents </h4></nowiki><br />
<br />
<br />
==== Tables ====<br />
There are two ways to build tables: <br />
*in special Wiki-markup (see [[m:Help:Table]])<br />
*with the usual HTML elements: &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; or &lt;th&gt;.<br />
<br />
For the latter, and a discussion on when tables are appropriate, see [[Wikipedia:How to use tables]].<br />
<br />
=== Variables ===<br />
<br />
''(See also [[m:Help:Variable]])''<br />
{|<br />
|-<br />
! Code<br />
! Effect<br />
|-<br />
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAME}}</nowiki><br />
| {{CURRENTMONTHNAME}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki><br />
| {{CURRENTMONTHNAMEGEN}}<br />
|-<br />
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}<br />
|-<br />
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}<br />
|-<br />
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}<br />
|-<br />
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}<br />
|-<br />
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br />
| {{NUMBEROFARTICLES}}<br />
|-<br />
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}<br />
|-<br />
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}<br />
|-<br />
| <nowiki>{{localurl:pagename}}</nowiki><br />
| {{localurl:pagename}}<br />
|-<br />
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki><br />
| {{localurl:Wikipedia:Sandbox|action=edit}}<br />
|-<br />
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}<br />
|-<br />
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}<br />
|-<br />
| <nowiki>{{ns:2}}</nowiki> || {{ns:2}}<br />
|-<br />
| <nowiki>{{ns:3}}</nowiki> || {{ns:3}}<br />
|-<br />
| <nowiki>{{ns:4}}</nowiki> || {{ns:4}}<br />
|-<br />
| <nowiki>{{ns:5}}</nowiki> || {{ns:5}}<br />
|-<br />
| <nowiki>{{ns:6}}</nowiki> || {{ns:6}}<br />
|-<br />
| <nowiki>{{ns:7}}</nowiki> || {{ns:7}}<br />
|-<br />
| <nowiki>{{ns:8}}</nowiki> || {{ns:8}}<br />
|-<br />
| <nowiki>{{ns:9}}</nowiki> || {{ns:9}}<br />
|-<br />
| <nowiki>{{ns:10}}</nowiki> || {{ns:10}}<br />
|-<br />
| <nowiki>{{ns:11}}</nowiki> || {{ns:11}}<br />
|-<br />
| <nowiki>{{ns:12}}</nowiki> || {{ns:12}}<br />
|-<br />
| <nowiki>{{ns:13}}</nowiki> || {{ns:13}}<br />
|-<br />
| <nowiki>{{ns:14}}</nowiki> || {{ns:14}}<br />
|-<br />
| <nowiki>{{ns:15}}</nowiki> || {{ns:15}}<br />
|-<br />
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}<br />
|}<br />
<br />
'''NUMBEROFARTICLES''' is the number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.<br />
<br />
=== Templates ===<br />
<br />
The [[Wikipedia:MediaWiki|MediaWiki]] software used by Wikipedia has limited support for template inclusion. This means standardized text chunks (such as boilerplate text) can be inserted into articles. For example, typing <nowiki>{{stub}}</nowiki> will appear as "''This article is a [[Wikipedia:The perfect stub article|stub]]. You can help Wikipedia by [[Wikipedia:Find or fix a stub|expanding it]].''" when the page is saved. See [[Wikipedia:Template messages]] for the complete list. Other commonly used ones are: <nowiki>{{disambig}}</nowiki> for disambiguation pages, <nowiki>{{spoiler}}</nowiki> for spoiler warnings and <nowiki>{{sectstub}}</nowiki> like an article stub but for a section. The are many subject-specific stubs e.g.: <nowiki> {{Geo-stub}}, {{Hist-stub}} and {{Linux-stub}}</nowiki>. For a complete list of stubs see [[Wikipedia:Template messages/Stubs]].<br />
<br />
=== Hiding the edit links ===<br />
<br />
Insert '''<nowiki>__NOEDITSECTION__</nowiki>''' into the document to suppress the edit links that appear next to every section header.<br />
<br />
== See also ==<br />
*[[m:Help:Formula]]<br />
*[[m:Help:Editing|Mediawiki user's guide to editing]]<br />
*[[Wikipedia:MediaWiki]].<br />
*[[HTML element]].<br />
*[[Wikipedia:Protection policy]]<br />
<br />
== Using Mozilla Firefox ==<br />
<br />
There is an [https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&numpg=10&id=351 extension] available for Firefox, which may help you to edit a wiki page. This extension can be used for all wikis based on MediaWiki (e.g. for the wikipedia). If you use version 1.5 of Firefox, you will need the developer [http://wikipedia.mozdev.org version] of the extension. Update: The extension doesn't support Firefox 2.0 (not yet).<br />
<br />
If you have installed the extension a new toolbar will appear. This toolbar contains some icons to<br />
*format the text (e.g. bold)<br />
*insert a structure item (e.g. headlines)<br />
*insert a link (internal or external)<br />
*insert a picture<br />
The toolbar can be helpful escpecially for newbies, because it's not necessary to know the (complete) wiki syntax.<br />
<br />
If you want to change the settings for the toolbar, you have to go to the tools menu of Firefox. Then you must click on the settings button of the extension. On the view tab for example you can set, that the toolbar only appears, if the URL contains the word 'wiki'.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Help:Editing/ru&diff=55331
Help:Editing/ru
2012-02-06T16:06:46Z
<p>Kverde: </p>
<hr />
<div>{{Template:Help:Editing}}<br />
<br />
Редактировать страницы wiki очень просто. Просто нажмите кнопку "'''Edit'''" ("'''Править'''") расположенную в верхней части меню справа. Это привдет вас на страницу с текствым полем содержашим редактируемый текст этой страницы. ''''Если вы хотите поэксперементировать, пожалуйста, сделайте это в нашей [[Sand Box|песочнице]], а не сдесь. Вы можете открыть [[Sand Box|песочницу]] в отдельном окне или вкладке чтобы иметь возможность видеть одновременно этот текст и вашы тесты в песочнице.'''''<br />
<br />
Type away, write a short [[Wikipedia:Edit summary|edit summary]] on the small field below the edit-box. You may use shorthand to describe your changes, as described in the [[Wikipedia:Edit summary legend|legend]], and when you've finished, press [[Wikipedia:Show preview|preview]] to see how your changes will look. Then press "Save". Depending on your system, pressing "Enter" while the edit box is not active (when there is no typing cursor in it) may have the same effect as pressing the "Save" button. Also, please do not vandalise the information on {{ns:4}}.<br />
<br />
Вы также можете нажать на кнопку "'''Обсуждение'''" (или ссылку "'''Обсудить эту страницу'''") чтобы уведить соответствующую [[Wikipedia:Talk page|страницу разговора]] которая содержит коментарии об этой странице от других польхователей Википедии. Нажмите кнопку "'''+'''" (или "'''Редактировать эту страницу'''") чтобы добавить комментарий.<br />
<br />
==Вики-разметка==<br />
В левой колонке таблицы снизу вы можете видеть какие эффекты возможны. В правой колонке, вы можете видеть как эти эффекты можно получить. Другими словами, чтобы сделать текст как в левой колонке, напечатайте его в формате который вы видите в правой колонке.<br />
<br />
Вы можете оставить эту страницу в отдельном окне браузера для справки. Если вы хотите попробовать эти веши бех опасности причинить вред, вы можете попробоватьсделать это '''в [[Sand_Box|песочнице]]'''.<br />
<br />
----<br />
<!--<br />
:'''The rest of this page is deprecated but will be updated periodically.''' <br />
:'''Please direct edits to the [[meta:MediaWiki User's Guide: Editing overview|Meta-Wikimedia version of this page]]'''<br />
<br />
--><br />
=== Sections, paragraphs, lists and lines ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
Start your [[Wikipedia:Manual of Style (headings)|sections]] as follows:<br />
<br />
<!-- The following code messes up the table of contents<br />
and makes the section edit links much less useful,<br />
so please do not use it.<br />
== New section ==<br />
=== Subsection ===<br />
==== Sub-subsection ====<br />
--><br />
<!-- The following should look almost the same, using<br />
HTML headings markup instead of wiki headings.<br />
However, it messes up the section edit links,<br />
so please do not use it.<br />
<h2>New section</h2><br />
<h3>Subsection</h3><br />
<h4>Sub-subsection</h4><br />
--><br />
<!-- The following just uses bolding and font changes,<br />
so it should be safe. However, it might not<br />
look exactly right, especially when people<br />
use non-standard CSS stylesheets.<br />
--><br />
'''<font style="font-size:120%">New section</font>'''<br />
<br />
'''<font style="font-size:110%">Subsection</font>'''<br />
<br />
'''<font style="font-size:100%">Sub-subsection</font>'''<br />
<br />
* Start with a second-level heading (<tt><nowiki>==</nowiki></tt>); do not use first-level headings (=).<br />
* Do not skip levels (e.g., second-level followed by fourth-level).<br />
* A [[#Placement_of_the_Table_of_Contents_.28TOC.29|Table of Contents]] will automatically be added to an article that has four or more sections. <br />
|<br />
<pre><nowiki><br />
== New section ==<br />
<br />
=== Subsection ===<br />
<br />
==== Sub-subsection ====<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A single [[newline]]<br />
generally has no effect on the layout.<br />
These can be used to separate<br />
sentences within a paragraph.<br />
Some editors find that this aids editing<br />
and improves the function ''diff'' <br />
(used internally to compare<br />
different versions of a page).<br />
<br />
But an empty line<br />
starts a new paragraph.<br />
<br />
* When used in a list, a newline ''does'' affect the layout ([[#lists|see below]]).<br />
|<br />
<pre><nowiki><br />
A single [[newline]]<br />
generally has no effect on the layout. <br />
These can be used to separate<br />
sentences within a paragraph.<br />
Some editors find that this aids editing<br />
and improves the function ''diff'' <br />
(used internally to compare<br />
different versions of a page).<br />
<br />
But an empty line<br />
starts a new paragraph.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can break lines<br><br />
without starting a new paragraph.<br />
<br />
* Please use this sparingly.<br />
* Close markup between lines, don't start a [[link]] or ''italics'' or '''bold''' on one line and close it on the next.<br />
|<br />
<pre><nowiki><br />
You can break lines<br><br />
without starting a new paragraph.<br />
</nowiki></pre><br />
|- id="lists" valign="top"<br />
|<br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
|<br />
<pre><nowiki><br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
|<br />
<pre><nowiki><br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
|<br />
<pre><nowiki><br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
<br />
* One item per line; a newline can appear before the colon, but using a space before the colon improves parsing.<br />
|<br />
<pre><nowiki><br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
<br />
* This is primarily for displayed material, but is also used for discussion on [[Wikipedia:Talk page|Talk page]]s.<br />
|<br />
<pre><nowiki><br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
<br />
*This is useful for:<br />
** pasting preformatted text;<br />
** algorithm descriptions;<br />
** program source code;<br />
** [[ASCII art]];<br />
** chemical structures;<br />
* '''WARNING''': If you make it wide, you [[page widening|force the whole page to be wide]] and hence less readable, especially for people who use lower resolutions. Never start ordinary lines with spaces.<br />
|<br />
<pre><nowiki><br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<center>Centered text.</center><br />
<br />
* Note the American spelling of "center" (not "centre").<br />
|<br />
<pre><nowiki><br />
<center>Centered text.</center><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
<br />
* Mainly useful for separating threads on Talk pages.<br />
* Also used to [[Wikipedia:Disambiguation|disambiguate]] within an article without creating a separate page.<br />
|<br />
<pre><nowiki><br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
</nowiki></pre><br />
|}<br />
<br />
=== Links and URLs ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
London has [[public transport]].<br />
<br />
* A link to another Wikipedia article.<br />
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).<br />
* Thus the link above is to the [[URL]] http://www.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also [[Wikipedia:Canonicalization]].<br />
|<br />
<pre><nowiki><br />
London has [[public transport]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
<br />
* Same target, different name.<br />
* This is a [[piped link]].<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
<br />
* Endings are blended into the link.<br />
* Preferred style is to use this instead of a piped link, if possible.<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
See the [[Wikipedia:Manual of Style]].<br />
<br />
* A link to another [[Wikipedia:namespace|namespace]].<br />
|<br />
<pre><nowiki><br />
See the [[Wikipedia:Manual of Style]].<br />
</nowiki></pre><br />
|- id="link-to-section" valign="top"<br />
|<br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
<br />
* The part after the number sign (#) must match a section heading on the page, or an identifier created in some other way. Matches must be exact in terms of spelling, case and punctuation. Links to non-existent sections aren't broken; they are treated as links to the top of the page.<br />
* Identifiers may be created by attaching an <code>id="..."></code> attribute to almost any HTML element.<br />
|<br />
<pre><nowiki><br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|kingdom]].<br />
<br />
Automatically hide namespace:<br />
[[Wikipedia:Village Pump|Village Pump]]. <br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|Manual of Style]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
<br />
* The server fills in the part after the pipe character (|) when you save the page. The next time you open the edit box you will see the expanded piped link. When [[Wikipedia:Show preview|preview]]ing your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to links to sections within the same page ([[#link-to-section|see previous entry]]).<br />
|<br />
<pre><nowiki><br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|]].<br />
<br />
Automatically hide namespace: <br />
[[Wikipedia:Village Pump|]].<br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[The weather in London]] is a page<br />
that doesn't exist yet.<br />
<br />
* You can create it by clicking on the link (but please don't do so with this particular link).<br />
* To create a new page: <br />
*# Create a link to it on some other (related) page.<br />
*# Save that page.<br />
*# Click on the link you just made. The new page will open for editing.<br />
* For more information, see [[Wikipedia:How to start a page|How to start a page]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].<br />
* Please do not create a new article without linking to it from at least one other article.<br />
|<br />
<pre><nowiki><br />
[[The weather in London]] is a page <br />
that doesn't exist yet.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[Wikipedia:How to edit a page]] is this page.<br />
<br />
* [[Self link]]s appear as bold text when the article is viewed.<br />
* Do not use this technique to make the article name bold in the first paragraph; see the [[Wikipedia:Manual of Style#Article names|Manual of Style]].<br />
|<br />
<pre><nowiki><br />
[[Wikipedia:How to edit a page]] is this page.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: [[User:Brockert|Ben Brockert]]<br />
or four to add user name plus date/time:<br />
: [[User:Brockert|Ben Brockert]] 00:18, Nov 19, 2004 (UTC)<br />
Five tildes gives the date/time alone:<br />
: 00:18, Nov 19, 2004 (UTC)<br />
<br />
* The first two both provide a link to your [[Wikipedia:user page|user page]].<br />
|<br />
<pre><nowiki><br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: ~~~<br />
or four for user name plus date/time:<br />
: ~~~~<br />
Five tildes gives the date/time alone:<br />
: ~~~~~<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[USA]]").<br />
* Note that, while it is possible to link to a section, it is not possible to redirect to a section. For example, "<nowiki>#REDIRECT [[United States#History]]</nowiki>" will redirect to the [[United States]] page, but not to any particular section on it. This feature '''will not''' be implemented in the future, so such redirects should not be used.<br />
|<br />
<pre><nowiki><br />
#REDIRECT [[United States]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Link to a page on the same subject in another language by using a link of the form: <nowiki>[[language code:Title]]</nowiki>.<br />
* It does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
* Please see [[Wikipedia:Interlanguage links]] and the [[Wikipedia:Complete list of language wikis available|list of languages and codes]].<br />
|<br />
<pre><nowiki><br />
[[fr:Wikipédia:Aide]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
<br />
|<br />
<pre><nowiki><br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
|<br />
<pre><nowiki><br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To put an article in a [[Wikipedia:Category]], place a link like the one to the right anywhere in the article. As with interlanguage links, it does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
|<br />
<pre><nowiki><br />
[[Category:Character sets]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To ''link'' to a [[Wikipedia:Category]] page without putting the article into the category, use an initial colon (:) in the link.<br />
|<br />
<pre><nowiki><br />
[[:Category:Character sets]]<br />
</nowiki></pre><br />
|- id="link-external" valign="top"<br />
|<br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/ (bad style)<br />
# Unnamed link: [http://www.nupedia.com/] (bad style)<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
<br />
:See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts.<br />
<br />
* Square brackets indicate an external link. Note the use of a ''space'' (not a pipe) to separate the URL from the link text in the "named" version.<br />
* In the [[URL]], all symbols must be among:<br/>'''A-Z a-z 0-9 . _ \ / ~ % - + &amp; # ? ! = ( ) @ \x80-\xFF'''<br />
* If a URL contains a character not in this list, it should be encoded by using a percent sign (%) followed by the [[hexadecimal|hex]] code of the character, which can be found in the table of [[ASCII#ASCII printable characters|ASCII printable characters]]. For example, the caret character (^) would be encoded in a URL as '''%5E'''.<br />
* See [[Wikipedia:External links]] for style issues.<br />
|<br />
<pre><nowiki><br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/<br />
# Unnamed link: [http://www.nupedia.com/]<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|Hello]]<br />
<br />
* All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello<br />
* Note that interwiki links use the ''internal'' link style.<br />
* See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts; if the site you want to link to isn't on the list, use an external link ([[#link-external|see above]]).<br />
* See also [[Wikipedia:How to link to Wikimedia projects]].<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|fr:Bonjour]]<br />
<br />
* All of these forms lead to the URL http://fr.wiktionary.org/wiki/Bonjour<br />
|<br />
<pre><nowiki><br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|]]<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
<br />
* Link to books using their [[Wikipedia:ISBN|ISBN]] numbers. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors.<br />
* ISBN links do not need any extra markup, provided you use one of the indicated formats.<br />
|<br />
<pre><nowiki><br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
<br />
* Link dates in one of the above formats, so that everyone can set their own display order. If [[Special:Userlogin|logged in]], you can use [[Special:Preferences]] to change your own date display setting.<br />
* All of the above dates will appear as "[[20 July|20 July]] [[1969|1969]]" if you set your date display preference to "15 January 2001", but as "[[20 July|July 20]], [[1969|1969]]" if you set it to "January 15, 2001".<br />
|<br />
<pre><nowiki><br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[media:Sg_mrob.ogg|Sound]]<br />
<br />
*To include links to non-image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].<br />
<br />
Some uploaded sounds are listed at [[Wikipedia:Sound]].<br />
|<br />
<pre><nowiki><br />
[[media:Sg_mrob.ogg|Sound]]<br />
</nowiki></pre><br />
|}<br />
<br />
=== Images ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
| A picture: [[Image:Wiki.png]]<br />
<br />
or, with alternative text:<br />
[[Image:Wiki.png|jigsaw globe]]<br />
<br />
or, floating to the right side of the page and with a caption:<br />
[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
[[Image:Wiki.png|right|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
* Only images that have been uploaded to Wikipedia can be used. To upload images, use the [[Special:Upload|upload page]]. You can find the uploaded image on the [[Special:Imagelist|image list]].<br />
* See the [[Wikipedia:Image use policy|image use policy]], [[Wikipedia:Image markup|extended image markup/syntax]] (also possibly [[Wikipedia:Image markup with HTML|image HTML markup]]) for more hints.<br />
* Alternative text, used when the image isn't loaded, in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternate text for images|Alternate text for images]] for help on choosing it.<br />
* The frame tag automatically floats the image right.<br />
| <pre><nowiki><br />
A picture: [[Image:Wiki.png]]</nowiki><br />
<br />
or, with alternative text:<br />
<nowiki>[[Image:Wiki.png|jigsaw globe]]</nowiki><br />
<br />
or, floating to the right side of the page and with a caption:<br />
<nowiki>[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]</nowiki><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
<nowiki>[[Image:Wiki.png|right|Wikipedia Encyclopedia]]</nowiki></pre><br />
|-<br />
|<br />
Clicking on an uploaded image displays a description page, which you can also link directly to: [[:Image:Wiki.png]]<br />
| <pre><nowiki><br />
<br />
[[:Image:Wiki.png]]<br />
</nowiki></pre><br />
|-<br />
|<br />
To include links to images shown as links instead of drawn on the page, use a "media" link.<br />
<br />
<br/>[[media:Tornado.jpg|Image of a Tornado]]<br />
|<br />
<pre><br />
<nowiki><br />
<br />
[[media:Tornado.jpg|Image of a Tornado]]<br />
<br />
</nowiki></pre><br />
|}<br />
<br />
=== Character formatting ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|- valign="top"<br />
! What it looks like<br />
! What you type<br />
|- id="emph" valign="top"<br />
|<br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
* These are double and triple apostrophes (single-quote marks), not double-quote marks.<br />
|<br />
<pre><nowiki><br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<math>\sin x + \ln y</math><br><br />
sin''x'' + ln''y''<br />
<!-- no space between roman "sin" and italic "x" --><br />
<br />
<math>\mathbf{x} = 0</math><br><br />
'''x''' = 0<br />
<br />
Ordinary text should use [[#emph|wiki markup for emphasis]], and should not use <code>&lt;i&gt;</code> or <code>&lt;b&gt;</code>. However, mathematical formulas often use italics, and sometimes use bold, for reasons unrelated to emphasis. Complex formulas should use [[m:Help:Formula|<code>&lt;math&gt;</code> markup]], and simple formulas may use <code>&lt;math&gt;</code>; or <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>; or <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code>. According to [[Wikipedia:WikiProject Mathematics#Italicization and bolding|WikiProject Mathematics]], wiki markup is preferred over HTML markup like <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>.<br />
|<br />
<pre><nowiki><br />
<math>\sin x + \ln y</math><br />
sin''x'' + ln''y''<br />
<br />
<math>\mathbf{x} = 0</math><br />
'''x''' = 0<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
<br />
* For semantic reasons, using <code>&lt;code&gt;</code> where applicable is preferable to using <code>&lt;tt&gt;</code>.<br />
|<br />
<pre><nowiki><br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can use <small>small text</small> for captions.<br />
|<br />
<pre><nowiki><br />
You can use <small>small text</small> for captions.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
<br />
* When editing regular Wikipedia articles, just make your changes and don't mark them up in any special way.<br />
* When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.<br />
|<br />
<pre><nowiki><br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Diacritical marks:'''<br />
<br/><br />
è é ê ë ì í<br />
<br />
À Á Â Ã Ä Å <br/><br />
Æ Ç È É Ê Ë <br/><br />
Ì Í<br />
Î Ï Ñ Ò <br/><br />
Ó Ô Õ<br />
Ö Ø Ù <br/><br />
Ú Û Ü ß<br />
à á <br/><br />
â ã ä å æ<br />
ç <br/><br />
è é ê ë ì í<br/><br />
î ï ñ ò ó ô <br/><br />
&oelig; õ<br />
ö ø ù ú <br/><br />
û ü ÿ<br />
<br />
* See [[meta:Help:Special characters|special characters]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
è é ê ë ì í<br />
<br />
&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; <br />
&amp;AElig; &amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml; <br />
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde; &amp;Ograve; <br />
&amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;Ugrave; <br />
&amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;szlig; &amp;agrave; &amp;aacute; <br />
&amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil; <br />
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml; &amp;igrave; &amp;iacute;<br />
&amp;icirc; &amp;iuml; &amp;ntilde; &amp;ograve; &amp;oacute; &amp;ocirc; <br />
&amp;oelig; &amp;otilde; &amp;ouml; &amp;oslash; &amp;ugrave; &amp;uacute; <br />
&amp;ucirc; &amp;uuml; &amp;yuml;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Punctuation:'''<br />
<br/><br />
¿ ¡ § ¶<br/><br />
&dagger; &Dagger; &bull; &ndash; &mdash;<br/><br />
&lsaquo; &rsaquo; « »<br/><br />
&lsquo; &rsquo; &ldquo; &rdquo;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;<br />
&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;<br />
&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;<br />
&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commercial symbols:'''<br />
<br/><br />
&trade; © ® ¢ &euro; ¥<br/><br />
£ ¤<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;trade; &amp;copy; &amp;reg; &amp;cent; &amp;euro; &amp;yen; <br />
&amp;pound; &amp;curren;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Subscripts:'''<br />
<br/><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
<br />
'''Superscripts:'''<br />
<br/><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&sup1; x&sup2; x&sup3;<br />
*The latter method of superscripting can't be used in the most general context, but is preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.<br />
<br />
&epsilon;<sub>0</sub> =<br />
8.85 &times; 10<sup>&minus;12</sup><br />
C&sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&sup2;]]<br />
|<br />
<br/><br />
<pre><nowiki><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
</nowiki></pre><br />
<br />
<pre><nowiki><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&amp;sup1; x&amp;sup2; x&amp;sup3;<br />
<br />
&amp;epsilon;<sub>0</sub> =<br />
8.85 &amp;times; 10<sup>&amp;minus;12</sup><br />
C&amp;sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&amp;sup2;]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Greek characters:'''<br />
<br/><br />
&alpha; &beta; &gamma; &delta; &epsilon; &zeta;<br/><br />
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu;<br/><br />
&xi; &omicron; &pi; &rho; &sigma; &sigmaf;<br/><br />
&tau; &upsilon; &phi; &chi; &psi; &omega;<br/><br />
&Gamma; &Delta; &Theta; &Lambda; &Xi; &Pi;<br/><br />
&Sigma; &Phi; &Psi; &Omega;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; <br />
&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu; <br />
&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;<br />
&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;<br />
&amp;Gamma; &amp;Delta; &amp;Theta; &amp;Lambda; &amp;Xi; &amp;Pi; <br />
&amp;Sigma; &amp;Phi; &amp;Psi; &amp;Omega;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Math characters:'''<br />
<br/><br />
&int; &sum; &prod; &radic; &minus; &plusmn; &infin;<br/><br />
&asymp; &prop; &equiv; &ne; &le; &ge; &rarr;<br/><br />
&times; &middot; &divide; &part; &prime; &Prime;<br/><br />
&nabla; &permil; &deg; &there4; &alefsym; &oslash;<br/><br />
&isin; &notin; &cap; &cup; &sub; &sup; &sube; &supe;<br/><br />
&not; &and; &or; &exist; &forall; &rArr; &hArr;<br/><br />
&rarr; &harr;<br/><br />
* See also [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;int; &amp;sum; &amp;prod; &amp;radic; &amp;minus; &amp;plusmn; &amp;infin;<br />
&amp;asymp; &amp;prop; &amp;equiv; &amp;ne; &amp;le; &amp;ge; &amp;rarr;<br />
&amp;times; &amp;middot; &amp;divide; &amp;part; &amp;prime; &amp;Prime;<br />
&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym; &amp;oslash;<br />
&amp;isin; &amp;notin; &amp;cap; &amp;cup; &amp;sub; &amp;sup; &amp;sube; &amp;supe;<br />
&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall; &amp;rArr; &amp;hArr;<br />
&amp;rarr; &amp;harr;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Spacing in simple math formulas:'''<br />
<br/><br />
Obviously, ''x''&sup2;&nbsp;&ge;&nbsp;0 is true.<br />
*To space things out without allowing line breaks to interrupt the formula, use non-breaking spaces: <tt>&amp;nbsp;</tt>.<br />
|<br />
<br/><br />
<pre><nowiki><br />
Obviously, ''x''&amp;sup2;&amp;nbsp;&amp;ge;&amp;nbsp;0 is true.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Complicated formulas:'''<br />
<br/><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
* See [[m:Help:Formula]] for how to use <tt>&lt;math></tt>.<br />
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.<br />
|<br />
<br/><br />
<pre><nowiki><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Suppressing interpretation of markup:'''<br />
<br/><br />
<nowiki>Link &rarr; (''to'') the [[Wikipedia FAQ]]</nowiki><br />
* Used to show literal data that would otherwise have special meaning.<br />
* Escape all wiki markup, including that which looks like HTML tags.<br />
* Does not escape HTML character references.<br />
* To escape HTML character references such as <tt>&amp;rarr;</tt> use <tt>&amp;amp;rarr;</tt><br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;nowiki>Link &amp;rarr; (''to'') <br />
the [[Wikipedia FAQ]]&lt;/nowiki><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commenting page source:'''<br />
<br/><br />
''not shown when viewing page''<br />
* Used to leave comments in a page for future editors.<br />
* Note that most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;!-- comment here --><br />
</nowiki></pre><br />
|}<br />
''(see also: [[Chess symbols in Unicode]])''<br />
<br />
=== Tables ===<br />
==== Placement of the Table of Contents (TOC) ====<br />
At the current status of the wiki markup language, having at least four headers on a page triggers the TOC to appear in front of the first header (or after introductory sections). Putting <nowiki>__TOC__</nowiki> anywhere forces the TOC to appear at that point (instead of just before the first header). Putting <nowiki>__NOTOC__</nowiki> anywhere forces the TOC to disappear. See also [[Wikipedia:Section#Compact_TOC|compact TOC]] for alphabet and year headings.<br />
<br />
==== Keeping headings out of the Table of Contents ====<br />
<br />
If you want some subheadings to not appear in the Table of Contents, then make the following replacements.<br />
<br />
Replace <nowiki> == Header 2 == with <h2> Header 2 </h2> </nowiki><br />
<br />
Replace <nowiki> === Header 3 === with <h3> Header 3 </h3> </nowiki><br />
<br />
And so forth.<br />
<br />
For example, notice that the following header has the same font as the other subheaders to this "Tables" section, but the following header does not appear in the Table of Contents for this page.<br />
<br />
<h4> This header has the h4 font, but is NOT in the Table of Contents </h4><br />
<br />
This effect is obtained by the following line of code.<br />
<br />
<nowiki><h4> This header has the h4 font, but is NOT in the Table of Contents </h4></nowiki><br />
<br />
<br />
==== Tables ====<br />
There are two ways to build tables: <br />
*in special Wiki-markup (see [[m:Help:Table]])<br />
*with the usual HTML elements: &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; or &lt;th&gt;.<br />
<br />
For the latter, and a discussion on when tables are appropriate, see [[Wikipedia:How to use tables]].<br />
<br />
=== Variables ===<br />
<br />
''(See also [[m:Help:Variable]])''<br />
{|<br />
|-<br />
! Code<br />
! Effect<br />
|-<br />
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAME}}</nowiki><br />
| {{CURRENTMONTHNAME}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki><br />
| {{CURRENTMONTHNAMEGEN}}<br />
|-<br />
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}<br />
|-<br />
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}<br />
|-<br />
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}<br />
|-<br />
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}<br />
|-<br />
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br />
| {{NUMBEROFARTICLES}}<br />
|-<br />
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}<br />
|-<br />
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}<br />
|-<br />
| <nowiki>{{localurl:pagename}}</nowiki><br />
| {{localurl:pagename}}<br />
|-<br />
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki><br />
| {{localurl:Wikipedia:Sandbox|action=edit}}<br />
|-<br />
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}<br />
|-<br />
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}<br />
|-<br />
| <nowiki>{{ns:2}}</nowiki> || {{ns:2}}<br />
|-<br />
| <nowiki>{{ns:3}}</nowiki> || {{ns:3}}<br />
|-<br />
| <nowiki>{{ns:4}}</nowiki> || {{ns:4}}<br />
|-<br />
| <nowiki>{{ns:5}}</nowiki> || {{ns:5}}<br />
|-<br />
| <nowiki>{{ns:6}}</nowiki> || {{ns:6}}<br />
|-<br />
| <nowiki>{{ns:7}}</nowiki> || {{ns:7}}<br />
|-<br />
| <nowiki>{{ns:8}}</nowiki> || {{ns:8}}<br />
|-<br />
| <nowiki>{{ns:9}}</nowiki> || {{ns:9}}<br />
|-<br />
| <nowiki>{{ns:10}}</nowiki> || {{ns:10}}<br />
|-<br />
| <nowiki>{{ns:11}}</nowiki> || {{ns:11}}<br />
|-<br />
| <nowiki>{{ns:12}}</nowiki> || {{ns:12}}<br />
|-<br />
| <nowiki>{{ns:13}}</nowiki> || {{ns:13}}<br />
|-<br />
| <nowiki>{{ns:14}}</nowiki> || {{ns:14}}<br />
|-<br />
| <nowiki>{{ns:15}}</nowiki> || {{ns:15}}<br />
|-<br />
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}<br />
|}<br />
<br />
'''NUMBEROFARTICLES''' is the number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.<br />
<br />
=== Templates ===<br />
<br />
The [[Wikipedia:MediaWiki|MediaWiki]] software used by Wikipedia has limited support for template inclusion. This means standardized text chunks (such as boilerplate text) can be inserted into articles. For example, typing <nowiki>{{stub}}</nowiki> will appear as "''This article is a [[Wikipedia:The perfect stub article|stub]]. You can help Wikipedia by [[Wikipedia:Find or fix a stub|expanding it]].''" when the page is saved. See [[Wikipedia:Template messages]] for the complete list. Other commonly used ones are: <nowiki>{{disambig}}</nowiki> for disambiguation pages, <nowiki>{{spoiler}}</nowiki> for spoiler warnings and <nowiki>{{sectstub}}</nowiki> like an article stub but for a section. The are many subject-specific stubs e.g.: <nowiki> {{Geo-stub}}, {{Hist-stub}} and {{Linux-stub}}</nowiki>. For a complete list of stubs see [[Wikipedia:Template messages/Stubs]].<br />
<br />
=== Hiding the edit links ===<br />
<br />
Insert '''<nowiki>__NOEDITSECTION__</nowiki>''' into the document to suppress the edit links that appear next to every section header.<br />
<br />
== See also ==<br />
*[[m:Help:Formula]]<br />
*[[m:Help:Editing|Mediawiki user's guide to editing]]<br />
*[[Wikipedia:MediaWiki]].<br />
*[[HTML element]].<br />
*[[Wikipedia:Protection policy]]<br />
<br />
== Using Mozilla Firefox ==<br />
<br />
There is an [https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&numpg=10&id=351 extension] available for Firefox, which may help you to edit a wiki page. This extension can be used for all wikis based on MediaWiki (e.g. for the wikipedia). If you use version 1.5 of Firefox, you will need the developer [http://wikipedia.mozdev.org version] of the extension. Update: The extension doesn't support Firefox 2.0 (not yet).<br />
<br />
If you have installed the extension a new toolbar will appear. This toolbar contains some icons to<br />
*format the text (e.g. bold)<br />
*insert a structure item (e.g. headlines)<br />
*insert a link (internal or external)<br />
*insert a picture<br />
The toolbar can be helpful escpecially for newbies, because it's not necessary to know the (complete) wiki syntax.<br />
<br />
If you want to change the settings for the toolbar, you have to go to the tools menu of Firefox. Then you must click on the settings button of the extension. On the view tab for example you can set, that the toolbar only appears, if the URL contains the word 'wiki'.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Android_Programming/ru&diff=55329
Android Programming/ru
2012-02-06T12:46:10Z
<p>Kverde: /* Details about Android devices */</p>
<hr />
<div>{{Android programming}}<br />
<br />
Смотрите также [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
Общие знания о программировании под Андроид могут очень помочь в разработке интерфейса Lazarus для Андроид.<br />
<br />
==Как...==<br />
<br />
===Построить NDK (Android Native Development Kit) OpenGL ===<br />
<br />
Просто выполните следующие действия:<br />
<br />
'''Шаг 1''' - Скачайте и установите Android NDK, Android SDK и Ant. Боьше информации тут: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones]]<br />
<br />
'''Шаг 2''' - Установите pre-compiled FPC cross-compiler. Инстрцкции здесь: [[Android_Interface#Using_the_pre-compiled_compiler]]<br />
<br />
'''Шаг 3''' - Загрузите последнюю версию lazarus-ccr sourceforge code:<br />
<br />
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr lazarus-ccr<br />
<br />
или если вы думаете что это слишком много, вы можете скачать только каталог lazarus-ccr/bindings/android-ndk<br />
<br />
'''Шаг 4''' - Постройте Pascal Library<br />
<br />
Откройте проект lazarus-ccr/bindings/android-ndk/examples/opengltest/opengltest.lpi<br />
<br />
Откройте пункт меню Project->Project Options->Paths и где написано "Libraries -Fl" вы должны увидеть следующее значение:<br />
<br />
/home/felipe/Programas/android-ndk-r5/platforms/android-9/arch-arm/usr/lib<br />
<br />
Change it to the correct path in your system which points to the NDK and to the library folder for your minimal required Android API Level <br />
<br />
Теперь постройте проект используя Лазарус.<br />
<br />
'''Шаг 5''' - Настройка среды сборки<br />
<br />
Откройте файл opengltest/local.properties и в строке:<br />
<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
<br />
Измените этот путь на местоположение SDK<br />
<br />
'''Шаг 6''' - Постройка APK<br />
<br />
Откройте консоль и введите следущие команды:<br />
<br />
cd lazarus-ccr/bindings/ndk/examples/opengltest/android<br />
ant debug<br />
<br />
Файл APK будет помещен в opengltest/android/bin/<br />
<br />
'''Шаг 7''' - Установка APK<br />
<br />
Если на этом шаге вы получите сообщение об ошибке прав доступа читайте: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones#Recognition_of_devices_under_Linux]]<br />
<br />
Команда чтобы установить APK на телефоне:<br />
<br />
cd opengltest/android<br />
~/Programas/android-sdk-linux/platform-tools/adb install bin/OpenGLNDKTest-debug.apk <br />
2395 KB/s (107299 bytes in 0.043s)<br />
pkg: /data/local/tmp/OpenGLNDKTest-debug.apk<br />
Success<br />
<br />
Если вы получили сообщение об ошибке, что APK уже установлен, вы можете установить с помощью следующей команды:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb uninstall com.pascal.opengltest<br />
<br />
And then you can run adb logcat to see what the log says while you start it in the phone via its newly added icon:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb logcat<br />
<br />
===Чтение параметров экрана===<br />
<br />
First fill a TDisplayMetrics with the correct info:<br />
<br />
<delphi><br />
uses androidutil;<br />
<br />
var<br />
MyDisplayMetrics: TDisplayMetrics;<br />
Str: string;<br />
//<br />
lHeight, lWidth: Integer;<br />
xdpi, ydpi, lScreenSize: Single;<br />
begin<br />
// ..<br />
// Objects<br />
<br />
MyDisplayMetrics := TDisplayMetrics.Create;<br />
Activity.getWindowManager().getDefaultDisplay().getMetrics(MyDisplayMetrics);<br />
</delphi><br />
<br />
And then you can read it from the TDisplayMetrics:<br />
<br />
<delphi><br />
lHeight := MyDisplayMetrics.heightPixels();<br />
lWidth := MyDisplayMetrics.widthPixels();<br />
xdpi := MyDisplayMetrics.xdpi();<br />
ydpi := MyDisplayMetrics.ydpi();<br />
lScreenSize := sqrt(sqr(lHeight / ydpi) + sqr(lWidth / xdpi));<br />
ldensity := MyDisplayMetrics.density();<br />
ldensityDpi := MyDisplayMetrics.densityDpi();<br />
scaledDensity := MyDisplayMetrics.scaledDensity();<br />
</delphi><br />
<br />
Note that lots of devices lie about the xdpi and ydpi, so don't trust the lScreenSize calculated above. Smartphones might report even 10 inches of screen size, while the correct is around 4.<br />
<br />
==Подробная информация об устройствах с Андроид==<br />
<br />
Так как существует много устройств на Android, это может быть полезно для отслеживания информации о них. Смотрите также в википедии Comparison of Android Devices [http://en.wikipedia.org/wiki/Comparison_of_Android_devices] и подробную информацию о процессорах в [https://wiki.mozilla.org/Mobile/Platforms/Android#System_Requirements].<br />
<br />
===Смартфоны===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Производитель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Модель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Процессор'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Версия Андроид'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Комментарий'''<br />
|---<br />
|HTC||Wildfire||HTC Wildfire||armv6||2.1=>2.2||Да||-<br />
|---<br />
|Sony Erricson||Xperia X10||X10i||armv7||1.6=>2.1||Нет||-<br />
|}<br />
<br />
===Tablets===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Производитель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Модель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Процессор'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Версия Андроид'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Комментарий'''<br />
|---<br />
|Toshiba||Folio 100 Tablet||TOSHIBA_FOLIO_AND_A||armv7||2.2||Yes||-<br />
|}<br />
<br />
===List of devices ordered by processor compatibility (ARMv6 vs ARMv7)===<br />
<br />
'''List of ARMv7 devices:'''<br />
<br />
*Advent Vega (P10AN01) <br />
*Dell Streak, Streak 7 <br />
*HTC Desire <br />
*HTC Desire Z (T-Mobile G2) <br />
*HTC Desire HD <br />
*HTC Droid Incredible <br />
*HTC EVO 4G, EVO Shift 4G <br />
*HTC Glacier (T-Mobile myTouch 4G) <br />
*HTC Inspire 4G <br />
*HTC Nexus One <br />
*HTC Thunderbolt 4G <br />
*Huawei Ideos S7 <br />
*LG Optimus Z <br />
*Motorola Atrix 4G <br />
*Motorola Bravo <br />
*Motorola Cliq 2 - untested <br />
*Motorola Defy <br />
*Motorola Droid 2, Droid 2 Global <br />
*Motorola Droid Pro (Motorola PRO) <br />
*Motorola Droid X <br />
*Motorola Xoom <br />
*POV Mobii Tegra Tablet <br />
*Samsung Continuum (i400) <br />
*Samsung Galaxy S (i9000, Captivate, Fascinate, Vibrant, Epic 4G) <br />
*Samsung Galaxy Tab <br />
*Sharp IS03 <br />
*Sony Ericsson Xperia X10 <br />
*Toshiba AS100 <br />
*Viewsonic gTablet <br />
*Acer Liquid E<br />
*Acer Liquid (Liquid A1)<br />
*Archos 101 Internet Tablet<br />
*Motorola Charm<br />
*Motorola Droid (Milestone)<br />
*Samsung Galaxy S 4G<br />
*Samsung Nexus S<br />
<br />
'''List of ARMv6 processors:'''<br />
<br />
*Android SDK emulator <br />
*Asus Garmin nuvifone A50 (T-Mobile Garminfone) <br />
*Augen GENTouch 78 Tablet <br />
*Coby Kyros Internet Tablet (MID7015) <br />
*Geeksphone One, Geeksphone Zero <br />
*HTC Aria <br />
*HTC ChaCha <br />
*HTC Dream (T-Mobile G1, Android Dev Phone 1) <br />
*HTC Droid Eris <br />
*HTC Espresso (T-Mobile myTouch 3G Slide) <br />
*HTC Hero (T-Mobile G2 Touch) <br />
*HTC Legend <br />
*HTC Magic (T-Mobile myTouch 3G, T-Mobile G1 Touch) <br />
*HTC Salsa <br />
*HTC Tattoo <br />
*HTC Wildfire <br />
*Huawei Ascend <br />
*Huawei Ideos U8150-B (T-Mobile Comet) <br />
*Huawei U8110 (T-Mobile Pulse Mini) <br />
*Huawei U8230 <br />
*LG Ally (Apex) (LG VS740) <br />
*LG GW620 (Eve, InTouch Max, LinkMe) <br />
*LG Optimus, Optimus M, Optimus T, Optimus S, Optimus V <br />
*LG Vortex <br />
*LG P500<br />
*MAG iMiTO iM7 <br />
*vMAG iMiTO iM7S <br />
*Motorola Backflip <br />
*Motorola Citrus <br />
*Motorola Cliq (MB200) <br />
*Motorola Dext <br />
*Motorola Devour <br />
*Motorola i1 <br />
*Motorola Spice XT300 <br />
*Motorola Quench XT5 XT502 <br />
*Pandigital Novel <br />
*Samsung GT-S5570 Galaxy Mini <br />
*Samsung i5500 Galaxy 5 (Corby) <br />
*Samsung i5700 Galaxy Portal (Spica) <br />
*Samsung i5800 Galaxy 3 <br />
*Samsung i7500 Galaxy <br />
*Samsung Intercept <br />
*Samsung M900 Moment <br />
*Samsung S5830 Galaxy Ace <br />
*Samsung Transform <br />
*Sanyo ZIO M6000 <br />
*Sony Ericsson Xperia X8 <br />
*Sony Ericsson Xperia X10 Mini <br />
*Sony Ericsson Xperia X10 Mini Pro <br />
*Superpad 10.2" Tablet PC <br />
*Viewsonic ViewPad 7 Tablet <br />
*Velocity Micro T103 Cruz tablet <br />
*Vodafone 845 <br />
*ZTE Blade<br />
<br />
===Playing Sounds and Videos in the Phones===<br />
<br />
Each phone comes with different codecs installed, which will mean that the native Media Player will be able to play different formats in different phones. Bellow is a table showing which formats play in the native Media Player of each phone:<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Telephone'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''webm - VP8'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''m4v - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''ogv - Theora'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mp4 - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mov - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''avi - RLE'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mpg - MPEG-1'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''wmv - WM9'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''3gp - MPEG-4'''<br />
|----<br />
|Emulator||1.6||x||x||x||x||x||x||x||x||OK<br />
|----<br />
|Emulator||2.1||x||x||x||x||x||x||x||x||OK<br />
|----<br />
|Nexus One||2.2||x||OK||x||OK||x||x||x||x||OK<br />
|----<br />
|HTC Desire||1.6||x||OK||x||OK||x||x||x||OK||OK<br />
|----<br />
|Toshiba Folio 100||2.2||x||OK||x||OK||x||x||x||OK||OK<br />
|----<br />
|Xperia X10||2.1||x||OK||x||x||x||x||x||OK||OK<br />
|----<br />
|Xperia X8||2.2||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|HTC Wildfire||2.1||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|HTC Desire HD||2.2||x||OK||x||OK||x||x||x||x||OK<br />
|----<br />
|Galaxy Tab||2.2||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|myPhone A210||1.6||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|Motorola Milestone||2.1||x||OK||x||x||x||x||x||OK||?<br />
|----<br />
|Milestone 2||2.2||x||OK||x||x||x||x||x||sound-only||OK<br />
|}<br />
<br />
==Creating a new Java Android Application==<br />
<br />
This info can be useful for helping implement LCL-CustomDrawn-Android<br />
<br />
Generic instructions here: http://developer.android.com/guide/developing/other-ide.html<br />
<br />
===Showing / Hiding the virtual keyboard===<br />
<br />
See here: http://android-codes-examples.blogspot.com/2011/11/show-or-hide-soft-keyboard-on-opening.html<br />
<br />
To show it:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);<br />
<br />
and for hiding the keyboard:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);<br />
<br />
==References==<br />
<br />
* http://developer.android.com/guide/developing/other-ide.html</div>
Kverde
https://wiki.freepascal.org/index.php?title=Android_Programming&diff=55328
Android Programming
2012-02-06T12:45:36Z
<p>Kverde: /* Подробная информация об устройствах с Андроид */</p>
<hr />
<div>{{Android programming}}<br />
<br />
See also [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
Knowing general Android programming can be very useful to help developing the Lazarus Android Interface.<br />
<br />
==How to...==<br />
<br />
===Build the NDK OpenGL example===<br />
<br />
Just follow these steps:<br />
<br />
'''Step 1''' - Download and install the Android NDK, Android SDK and Ant. More information here: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones]]<br />
<br />
'''Step 2''' - Install the pre-compiled FPC cross-compiler. Instructions here: [[Android_Interface#Using_the_pre-compiled_compiler]]<br />
<br />
'''Step 3''' - Download the latest lazarus-ccr sourceforge code:<br />
<br />
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr lazarus-ccr<br />
<br />
or if you think it is too big you can download just the folder lazarus-ccr/bindings/android-ndk<br />
<br />
'''Step 4''' - Building the Pascal Library<br />
<br />
Open the project lazarus-ccr/bindings/android-ndk/examples/opengltest/opengltest.lpi<br />
<br />
Go to Project->Project Options->Paths and where is written "Libraries -Fl" you should see this value:<br />
<br />
/home/felipe/Programas/android-ndk-r5/platforms/android-9/arch-arm/usr/lib<br />
<br />
Change it to the correct path in your system which points to the NDK and to the library folder for your minimal required Android API Level<br />
<br />
Now build the project using Lazarus.<br />
<br />
'''Step 5''' - Configuring the build environment<br />
<br />
Open the file opengltest/local.properties and in this line:<br />
<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
<br />
Change this to point to your SDK location<br />
<br />
'''Step 6''' - Buildings the APK<br />
<br />
Open a terminal and type these commands:<br />
<br />
cd lazarus-ccr/bindings/ndk/examples/opengltest/android<br />
ant debug<br />
<br />
The APK file will be placed in opengltest/android/bin/<br />
<br />
'''Step 7''' - Install the APK<br />
<br />
In this step if you get error messages about permissions read: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones#Recognition_of_devices_under_Linux]]<br />
<br />
The command to install our APK in the phone is:<br />
<br />
cd opengltest/android<br />
~/Programas/android-sdk-linux/platform-tools/adb install bin/OpenGLNDKTest-debug.apk <br />
2395 KB/s (107299 bytes in 0.043s)<br />
pkg: /data/local/tmp/OpenGLNDKTest-debug.apk<br />
Success<br />
<br />
If you get an error message that it is already installed you can install with this command:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb uninstall com.pascal.opengltest<br />
<br />
And then you can run adb logcat to see what the log says while you start it in the phone via its newly added icon:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb logcat<br />
<br />
===Read the screen metrics===<br />
<br />
First fill a TDisplayMetrics with the correct info:<br />
<br />
<delphi><br />
uses androidutil;<br />
<br />
var<br />
MyDisplayMetrics: TDisplayMetrics;<br />
Str: string;<br />
//<br />
lHeight, lWidth: Integer;<br />
xdpi, ydpi, lScreenSize: Single;<br />
begin<br />
// ..<br />
// Objects<br />
<br />
MyDisplayMetrics := TDisplayMetrics.Create;<br />
Activity.getWindowManager().getDefaultDisplay().getMetrics(MyDisplayMetrics);<br />
</delphi><br />
<br />
And then you can read it from the TDisplayMetrics:<br />
<br />
<delphi><br />
lHeight := MyDisplayMetrics.heightPixels();<br />
lWidth := MyDisplayMetrics.widthPixels();<br />
xdpi := MyDisplayMetrics.xdpi();<br />
ydpi := MyDisplayMetrics.ydpi();<br />
lScreenSize := sqrt(sqr(lHeight / ydpi) + sqr(lWidth / xdpi));<br />
ldensity := MyDisplayMetrics.density();<br />
ldensityDpi := MyDisplayMetrics.densityDpi();<br />
scaledDensity := MyDisplayMetrics.scaledDensity();<br />
</delphi><br />
<br />
Note that lots of devices lie about the xdpi and ydpi, so don't trust the lScreenSize calculated above. Smartphones might report even 10 inches of screen size, while the correct is around 4.<br />
<br />
==Details about Android devices==<br />
<br />
Since there are so many Android devices, it can be useful to keep track of some information about them. See also in the wikipedia Comparison of Android Devices [http://en.wikipedia.org/wiki/Comparison_of_Android_devices] and details about the processors in [https://wiki.mozilla.org/Mobile/Platforms/Android#System_Requirements].<br />
<br />
===Smartphones===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Manufacturer'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Model'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Processor'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android version'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Comments'''<br />
|---<br />
|HTC||Wildfire||HTC Wildfire||armv6||2.1=>2.2||Yes||-<br />
|---<br />
|Sony Erricson||Xperia X10||X10i||armv7||1.6=>2.1||No||-<br />
|}<br />
<br />
===Tablets===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Manufacturer'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Model'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Processor'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android version'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Comments'''<br />
|---<br />
|Toshiba||Folio 100 Tablet||TOSHIBA_FOLIO_AND_A||armv7||2.2||Yes||-<br />
|}<br />
<br />
===List of devices ordered by processor compatibility (ARMv6 vs ARMv7)===<br />
<br />
'''List of ARMv7 devices:'''<br />
<br />
*Advent Vega (P10AN01) <br />
*Dell Streak, Streak 7 <br />
*HTC Desire <br />
*HTC Desire Z (T-Mobile G2) <br />
*HTC Desire HD <br />
*HTC Droid Incredible <br />
*HTC EVO 4G, EVO Shift 4G <br />
*HTC Glacier (T-Mobile myTouch 4G) <br />
*HTC Inspire 4G <br />
*HTC Nexus One <br />
*HTC Thunderbolt 4G <br />
*Huawei Ideos S7 <br />
*LG Optimus Z <br />
*Motorola Atrix 4G <br />
*Motorola Bravo <br />
*Motorola Cliq 2 - untested <br />
*Motorola Defy <br />
*Motorola Droid 2, Droid 2 Global <br />
*Motorola Droid Pro (Motorola PRO) <br />
*Motorola Droid X <br />
*Motorola Xoom <br />
*POV Mobii Tegra Tablet <br />
*Samsung Continuum (i400) <br />
*Samsung Galaxy S (i9000, Captivate, Fascinate, Vibrant, Epic 4G) <br />
*Samsung Galaxy Tab <br />
*Sharp IS03 <br />
*Sony Ericsson Xperia X10 <br />
*Toshiba AS100 <br />
*Viewsonic gTablet <br />
*Acer Liquid E<br />
*Acer Liquid (Liquid A1)<br />
*Archos 101 Internet Tablet<br />
*Motorola Charm<br />
*Motorola Droid (Milestone)<br />
*Samsung Galaxy S 4G<br />
*Samsung Nexus S<br />
<br />
'''List of ARMv6 processors:'''<br />
<br />
*Android SDK emulator <br />
*Asus Garmin nuvifone A50 (T-Mobile Garminfone) <br />
*Augen GENTouch 78 Tablet <br />
*Coby Kyros Internet Tablet (MID7015) <br />
*Geeksphone One, Geeksphone Zero <br />
*HTC Aria <br />
*HTC ChaCha <br />
*HTC Dream (T-Mobile G1, Android Dev Phone 1) <br />
*HTC Droid Eris <br />
*HTC Espresso (T-Mobile myTouch 3G Slide) <br />
*HTC Hero (T-Mobile G2 Touch) <br />
*HTC Legend <br />
*HTC Magic (T-Mobile myTouch 3G, T-Mobile G1 Touch) <br />
*HTC Salsa <br />
*HTC Tattoo <br />
*HTC Wildfire <br />
*Huawei Ascend <br />
*Huawei Ideos U8150-B (T-Mobile Comet) <br />
*Huawei U8110 (T-Mobile Pulse Mini) <br />
*Huawei U8230 <br />
*LG Ally (Apex) (LG VS740) <br />
*LG GW620 (Eve, InTouch Max, LinkMe) <br />
*LG Optimus, Optimus M, Optimus T, Optimus S, Optimus V <br />
*LG Vortex <br />
*LG P500<br />
*MAG iMiTO iM7 <br />
*vMAG iMiTO iM7S <br />
*Motorola Backflip <br />
*Motorola Citrus <br />
*Motorola Cliq (MB200) <br />
*Motorola Dext <br />
*Motorola Devour <br />
*Motorola i1 <br />
*Motorola Spice XT300 <br />
*Motorola Quench XT5 XT502 <br />
*Pandigital Novel <br />
*Samsung GT-S5570 Galaxy Mini <br />
*Samsung i5500 Galaxy 5 (Corby) <br />
*Samsung i5700 Galaxy Portal (Spica) <br />
*Samsung i5800 Galaxy 3 <br />
*Samsung i7500 Galaxy <br />
*Samsung Intercept <br />
*Samsung M900 Moment <br />
*Samsung S5830 Galaxy Ace <br />
*Samsung Transform <br />
*Sanyo ZIO M6000 <br />
*Sony Ericsson Xperia X8 <br />
*Sony Ericsson Xperia X10 Mini <br />
*Sony Ericsson Xperia X10 Mini Pro <br />
*Superpad 10.2" Tablet PC <br />
*Viewsonic ViewPad 7 Tablet <br />
*Velocity Micro T103 Cruz tablet <br />
*Vodafone 845 <br />
*ZTE Blade<br />
<br />
===Playing Sounds and Videos in the Phones===<br />
<br />
Each phone comes with different codecs installed, which will mean that the native Media Player will be able to play different formats in different phones. Bellow is a table showing which formats play in the native Media Player of each phone:<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Telephone'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''webm - VP8'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''m4v - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''ogv - Theora'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mp4 - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mov - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''avi - RLE'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mpg - MPEG-1'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''wmv - WM9'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''3gp - MPEG-4'''<br />
|----<br />
|Emulator||1.6||x||x||x||x||x||x||x||x||OK<br />
|----<br />
|Emulator||2.1||x||x||x||x||x||x||x||x||OK<br />
|----<br />
|Nexus One||2.2||x||OK||x||OK||x||x||x||x||OK<br />
|----<br />
|HTC Desire||1.6||x||OK||x||OK||x||x||x||OK||OK<br />
|----<br />
|Toshiba Folio 100||2.2||x||OK||x||OK||x||x||x||OK||OK<br />
|----<br />
|Xperia X10||2.1||x||OK||x||x||x||x||x||OK||OK<br />
|----<br />
|Xperia X8||2.2||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|HTC Wildfire||2.1||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|HTC Desire HD||2.2||x||OK||x||OK||x||x||x||x||OK<br />
|----<br />
|Galaxy Tab||2.2||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|myPhone A210||1.6||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|Motorola Milestone||2.1||x||OK||x||x||x||x||x||OK||?<br />
|----<br />
|Milestone 2||2.2||x||OK||x||x||x||x||x||sound-only||OK<br />
|}<br />
<br />
==Creating a new Java Android Application==<br />
<br />
This info can be useful for helping implement LCL-CustomDrawn-Android<br />
<br />
Generic instructions here: http://developer.android.com/guide/developing/other-ide.html<br />
<br />
===Showing / Hiding the virtual keyboard===<br />
<br />
See here: http://android-codes-examples.blogspot.com/2011/11/show-or-hide-soft-keyboard-on-opening.html<br />
<br />
To show it:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);<br />
<br />
and for hiding the keyboard:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);<br />
<br />
==References==<br />
<br />
* http://developer.android.com/guide/developing/other-ide.html</div>
Kverde
https://wiki.freepascal.org/index.php?title=Android_Programming&diff=55327
Android Programming
2012-02-06T12:41:12Z
<p>Kverde: /* Details about Android devices */</p>
<hr />
<div>{{Android programming}}<br />
<br />
See also [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
Knowing general Android programming can be very useful to help developing the Lazarus Android Interface.<br />
<br />
==How to...==<br />
<br />
===Build the NDK OpenGL example===<br />
<br />
Just follow these steps:<br />
<br />
'''Step 1''' - Download and install the Android NDK, Android SDK and Ant. More information here: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones]]<br />
<br />
'''Step 2''' - Install the pre-compiled FPC cross-compiler. Instructions here: [[Android_Interface#Using_the_pre-compiled_compiler]]<br />
<br />
'''Step 3''' - Download the latest lazarus-ccr sourceforge code:<br />
<br />
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr lazarus-ccr<br />
<br />
or if you think it is too big you can download just the folder lazarus-ccr/bindings/android-ndk<br />
<br />
'''Step 4''' - Building the Pascal Library<br />
<br />
Open the project lazarus-ccr/bindings/android-ndk/examples/opengltest/opengltest.lpi<br />
<br />
Go to Project->Project Options->Paths and where is written "Libraries -Fl" you should see this value:<br />
<br />
/home/felipe/Programas/android-ndk-r5/platforms/android-9/arch-arm/usr/lib<br />
<br />
Change it to the correct path in your system which points to the NDK and to the library folder for your minimal required Android API Level<br />
<br />
Now build the project using Lazarus.<br />
<br />
'''Step 5''' - Configuring the build environment<br />
<br />
Open the file opengltest/local.properties and in this line:<br />
<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
<br />
Change this to point to your SDK location<br />
<br />
'''Step 6''' - Buildings the APK<br />
<br />
Open a terminal and type these commands:<br />
<br />
cd lazarus-ccr/bindings/ndk/examples/opengltest/android<br />
ant debug<br />
<br />
The APK file will be placed in opengltest/android/bin/<br />
<br />
'''Step 7''' - Install the APK<br />
<br />
In this step if you get error messages about permissions read: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones#Recognition_of_devices_under_Linux]]<br />
<br />
The command to install our APK in the phone is:<br />
<br />
cd opengltest/android<br />
~/Programas/android-sdk-linux/platform-tools/adb install bin/OpenGLNDKTest-debug.apk <br />
2395 KB/s (107299 bytes in 0.043s)<br />
pkg: /data/local/tmp/OpenGLNDKTest-debug.apk<br />
Success<br />
<br />
If you get an error message that it is already installed you can install with this command:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb uninstall com.pascal.opengltest<br />
<br />
And then you can run adb logcat to see what the log says while you start it in the phone via its newly added icon:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb logcat<br />
<br />
===Read the screen metrics===<br />
<br />
First fill a TDisplayMetrics with the correct info:<br />
<br />
<delphi><br />
uses androidutil;<br />
<br />
var<br />
MyDisplayMetrics: TDisplayMetrics;<br />
Str: string;<br />
//<br />
lHeight, lWidth: Integer;<br />
xdpi, ydpi, lScreenSize: Single;<br />
begin<br />
// ..<br />
// Objects<br />
<br />
MyDisplayMetrics := TDisplayMetrics.Create;<br />
Activity.getWindowManager().getDefaultDisplay().getMetrics(MyDisplayMetrics);<br />
</delphi><br />
<br />
And then you can read it from the TDisplayMetrics:<br />
<br />
<delphi><br />
lHeight := MyDisplayMetrics.heightPixels();<br />
lWidth := MyDisplayMetrics.widthPixels();<br />
xdpi := MyDisplayMetrics.xdpi();<br />
ydpi := MyDisplayMetrics.ydpi();<br />
lScreenSize := sqrt(sqr(lHeight / ydpi) + sqr(lWidth / xdpi));<br />
ldensity := MyDisplayMetrics.density();<br />
ldensityDpi := MyDisplayMetrics.densityDpi();<br />
scaledDensity := MyDisplayMetrics.scaledDensity();<br />
</delphi><br />
<br />
Note that lots of devices lie about the xdpi and ydpi, so don't trust the lScreenSize calculated above. Smartphones might report even 10 inches of screen size, while the correct is around 4.<br />
<br />
==Подробная информация об устройствах с Андроид==<br />
<br />
Так как существует много устройств на Android, это может быть полезно для отслеживания информации о них. Смотрите также в википедии Comparison of Android Devices [http://en.wikipedia.org/wiki/Comparison_of_Android_devices] и подробную информацию о процессорах в [https://wiki.mozilla.org/Mobile/Platforms/Android#System_Requirements].<br />
<br />
===Смартфоны===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Производитель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Модель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Процессор'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Версия Андроид'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Комментарий'''<br />
|---<br />
|HTC||Wildfire||HTC Wildfire||armv6||2.1=>2.2||Да||-<br />
|---<br />
|Sony Erricson||Xperia X10||X10i||armv7||1.6=>2.1||Нет||-<br />
|}<br />
<br />
===Tablets===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Производитель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Модель'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Процессор'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Версия Андроид'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Комментарий'''<br />
|---<br />
|Toshiba||Folio 100 Tablet||TOSHIBA_FOLIO_AND_A||armv7||2.2||Yes||-<br />
|}<br />
<br />
===List of devices ordered by processor compatibility (ARMv6 vs ARMv7)===<br />
<br />
'''List of ARMv7 devices:'''<br />
<br />
*Advent Vega (P10AN01) <br />
*Dell Streak, Streak 7 <br />
*HTC Desire <br />
*HTC Desire Z (T-Mobile G2) <br />
*HTC Desire HD <br />
*HTC Droid Incredible <br />
*HTC EVO 4G, EVO Shift 4G <br />
*HTC Glacier (T-Mobile myTouch 4G) <br />
*HTC Inspire 4G <br />
*HTC Nexus One <br />
*HTC Thunderbolt 4G <br />
*Huawei Ideos S7 <br />
*LG Optimus Z <br />
*Motorola Atrix 4G <br />
*Motorola Bravo <br />
*Motorola Cliq 2 - untested <br />
*Motorola Defy <br />
*Motorola Droid 2, Droid 2 Global <br />
*Motorola Droid Pro (Motorola PRO) <br />
*Motorola Droid X <br />
*Motorola Xoom <br />
*POV Mobii Tegra Tablet <br />
*Samsung Continuum (i400) <br />
*Samsung Galaxy S (i9000, Captivate, Fascinate, Vibrant, Epic 4G) <br />
*Samsung Galaxy Tab <br />
*Sharp IS03 <br />
*Sony Ericsson Xperia X10 <br />
*Toshiba AS100 <br />
*Viewsonic gTablet <br />
*Acer Liquid E<br />
*Acer Liquid (Liquid A1)<br />
*Archos 101 Internet Tablet<br />
*Motorola Charm<br />
*Motorola Droid (Milestone)<br />
*Samsung Galaxy S 4G<br />
*Samsung Nexus S<br />
<br />
'''List of ARMv6 processors:'''<br />
<br />
*Android SDK emulator <br />
*Asus Garmin nuvifone A50 (T-Mobile Garminfone) <br />
*Augen GENTouch 78 Tablet <br />
*Coby Kyros Internet Tablet (MID7015) <br />
*Geeksphone One, Geeksphone Zero <br />
*HTC Aria <br />
*HTC ChaCha <br />
*HTC Dream (T-Mobile G1, Android Dev Phone 1) <br />
*HTC Droid Eris <br />
*HTC Espresso (T-Mobile myTouch 3G Slide) <br />
*HTC Hero (T-Mobile G2 Touch) <br />
*HTC Legend <br />
*HTC Magic (T-Mobile myTouch 3G, T-Mobile G1 Touch) <br />
*HTC Salsa <br />
*HTC Tattoo <br />
*HTC Wildfire <br />
*Huawei Ascend <br />
*Huawei Ideos U8150-B (T-Mobile Comet) <br />
*Huawei U8110 (T-Mobile Pulse Mini) <br />
*Huawei U8230 <br />
*LG Ally (Apex) (LG VS740) <br />
*LG GW620 (Eve, InTouch Max, LinkMe) <br />
*LG Optimus, Optimus M, Optimus T, Optimus S, Optimus V <br />
*LG Vortex <br />
*LG P500<br />
*MAG iMiTO iM7 <br />
*vMAG iMiTO iM7S <br />
*Motorola Backflip <br />
*Motorola Citrus <br />
*Motorola Cliq (MB200) <br />
*Motorola Dext <br />
*Motorola Devour <br />
*Motorola i1 <br />
*Motorola Spice XT300 <br />
*Motorola Quench XT5 XT502 <br />
*Pandigital Novel <br />
*Samsung GT-S5570 Galaxy Mini <br />
*Samsung i5500 Galaxy 5 (Corby) <br />
*Samsung i5700 Galaxy Portal (Spica) <br />
*Samsung i5800 Galaxy 3 <br />
*Samsung i7500 Galaxy <br />
*Samsung Intercept <br />
*Samsung M900 Moment <br />
*Samsung S5830 Galaxy Ace <br />
*Samsung Transform <br />
*Sanyo ZIO M6000 <br />
*Sony Ericsson Xperia X8 <br />
*Sony Ericsson Xperia X10 Mini <br />
*Sony Ericsson Xperia X10 Mini Pro <br />
*Superpad 10.2" Tablet PC <br />
*Viewsonic ViewPad 7 Tablet <br />
*Velocity Micro T103 Cruz tablet <br />
*Vodafone 845 <br />
*ZTE Blade<br />
<br />
===Playing Sounds and Videos in the Phones===<br />
<br />
Each phone comes with different codecs installed, which will mean that the native Media Player will be able to play different formats in different phones. Bellow is a table showing which formats play in the native Media Player of each phone:<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Telephone'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''webm - VP8'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''m4v - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''ogv - Theora'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mp4 - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mov - H.264'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''avi - RLE'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''mpg - MPEG-1'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''wmv - WM9'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''3gp - MPEG-4'''<br />
|----<br />
|Emulator||1.6||x||x||x||x||x||x||x||x||OK<br />
|----<br />
|Emulator||2.1||x||x||x||x||x||x||x||x||OK<br />
|----<br />
|Nexus One||2.2||x||OK||x||OK||x||x||x||x||OK<br />
|----<br />
|HTC Desire||1.6||x||OK||x||OK||x||x||x||OK||OK<br />
|----<br />
|Toshiba Folio 100||2.2||x||OK||x||OK||x||x||x||OK||OK<br />
|----<br />
|Xperia X10||2.1||x||OK||x||x||x||x||x||OK||OK<br />
|----<br />
|Xperia X8||2.2||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|HTC Wildfire||2.1||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|HTC Desire HD||2.2||x||OK||x||OK||x||x||x||x||OK<br />
|----<br />
|Galaxy Tab||2.2||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|myPhone A210||1.6||x||OK||x||x||x||x||x||x||OK<br />
|----<br />
|Motorola Milestone||2.1||x||OK||x||x||x||x||x||OK||?<br />
|----<br />
|Milestone 2||2.2||x||OK||x||x||x||x||x||sound-only||OK<br />
|}<br />
<br />
==Creating a new Java Android Application==<br />
<br />
This info can be useful for helping implement LCL-CustomDrawn-Android<br />
<br />
Generic instructions here: http://developer.android.com/guide/developing/other-ide.html<br />
<br />
===Showing / Hiding the virtual keyboard===<br />
<br />
See here: http://android-codes-examples.blogspot.com/2011/11/show-or-hide-soft-keyboard-on-opening.html<br />
<br />
To show it:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);<br />
<br />
and for hiding the keyboard:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);<br />
<br />
==References==<br />
<br />
* http://developer.android.com/guide/developing/other-ide.html</div>
Kverde
https://wiki.freepascal.org/index.php?title=Android_Programming/ru&diff=55322
Android Programming/ru
2012-02-06T06:55:26Z
<p>Kverde: /* Построить пример NDK (Android Native Development Kit) OpenGL */</p>
<hr />
<div>{{Android programming}}<br />
<br />
Смотрите также [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
Общие знания о программировании под Андроид могут очень помочь в разработке интерфейса Lazarus для Андроид.<br />
<br />
==Как...==<br />
<br />
===Построить NDK (Android Native Development Kit) OpenGL ===<br />
<br />
Просто выполните следующие действия:<br />
<br />
'''Шаг 1''' - Скачайте и установите Android NDK, Android SDK и Ant. Боьше информации тут: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones]]<br />
<br />
'''Шаг 2''' - Установите pre-compiled FPC cross-compiler. Инстрцкции здесь: [[Android_Interface#Using_the_pre-compiled_compiler]]<br />
<br />
'''Шаг 3''' - Загрузите последнюю версию lazarus-ccr sourceforge code:<br />
<br />
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr lazarus-ccr<br />
<br />
или если вы думаете что это слишком много, вы можете скачать только каталог lazarus-ccr/bindings/android-ndk<br />
<br />
'''Шаг 4''' - Постройте Pascal Library<br />
<br />
Откройте проект lazarus-ccr/bindings/android-ndk/examples/opengltest/opengltest.lpi<br />
<br />
Откройте пункт меню Project->Project Options->Paths и где написано "Libraries -Fl" вы должны увидеть следующее значение:<br />
<br />
/home/felipe/Programas/android-ndk-r5/platforms/android-9/arch-arm/usr/lib<br />
<br />
Change it to the correct path in your system which points to the NDK and to the library folder for your minimal required Android API Level <br />
<br />
Теперь постройте проект используя Лазарус.<br />
<br />
'''Шаг 5''' - Настройка среды сборки<br />
<br />
Откройте файл opengltest/local.properties и в строке:<br />
<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
<br />
Измените этот путь на местоположение SDK<br />
<br />
'''Шаг 6''' - Постройка APK<br />
<br />
Откройте консоль и введите следущие команды:<br />
<br />
cd lazarus-ccr/bindings/ndk/examples/opengltest/android<br />
ant debug<br />
<br />
Файл APK будет помещен в opengltest/android/bin/<br />
<br />
'''Шаг 7''' - Установка APK<br />
<br />
Если на этом шаге вы получите сообщение об ошибке прав доступа читайте: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones#Recognition_of_devices_under_Linux]]<br />
<br />
Команда чтобы установить APK на телефоне:<br />
<br />
cd opengltest/android<br />
~/Programas/android-sdk-linux/platform-tools/adb install bin/OpenGLNDKTest-debug.apk <br />
2395 KB/s (107299 bytes in 0.043s)<br />
pkg: /data/local/tmp/OpenGLNDKTest-debug.apk<br />
Success<br />
<br />
Если вы получили сообщение об ошибке, что APK уже установлен, вы можете установить с помощью следующей команды:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb uninstall com.pascal.opengltest<br />
<br />
And then you can run adb logcat to see what the log says while you start it in the phone via its newly added icon:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb logcat<br />
<br />
===Чтение параметров экрана===<br />
<br />
First fill a TDisplayMetrics with the correct info:<br />
<br />
<delphi><br />
uses androidutil;<br />
<br />
var<br />
MyDisplayMetrics: TDisplayMetrics;<br />
Str: string;<br />
//<br />
lHeight, lWidth: Integer;<br />
xdpi, ydpi, lScreenSize: Single;<br />
begin<br />
// ..<br />
// Objects<br />
<br />
MyDisplayMetrics := TDisplayMetrics.Create;<br />
Activity.getWindowManager().getDefaultDisplay().getMetrics(MyDisplayMetrics);<br />
</delphi><br />
<br />
And then you can read it from the TDisplayMetrics:<br />
<br />
<delphi><br />
lHeight := MyDisplayMetrics.heightPixels();<br />
lWidth := MyDisplayMetrics.widthPixels();<br />
xdpi := MyDisplayMetrics.xdpi();<br />
ydpi := MyDisplayMetrics.ydpi();<br />
lScreenSize := sqrt(sqr(lHeight / ydpi) + sqr(lWidth / xdpi));<br />
ldensity := MyDisplayMetrics.density();<br />
ldensityDpi := MyDisplayMetrics.densityDpi();<br />
scaledDensity := MyDisplayMetrics.scaledDensity();<br />
</delphi><br />
<br />
Note that lots of devices lie about the xdpi and ydpi, so don't trust the lScreenSize calculated above. Smartphones might report even 10 inches of screen size, while the correct is around 4.<br />
<br />
==Details about Android devices==<br />
<br />
Since there are so many Android devices, it can be useful to keep track of some information about them. See also in the wikipedia Comparison of Android Devices [http://en.wikipedia.org/wiki/Comparison_of_Android_devices] and details about the processors in [https://wiki.mozilla.org/Mobile/Platforms/Android#System_Requirements].<br />
<br />
===Smartphones===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Manufacturer'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Model'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Processor'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android version'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Comments'''<br />
|---<br />
|HTC||Wildfire||HTC Wildfire||armv6||2.1=>2.2||Yes||-<br />
|---<br />
|Sony Erricson||Xperia X10||X10i||armv7||1.6=>2.1||No||-<br />
|}<br />
<br />
===Tablets===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Manufacturer'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Model'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Processor'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android version'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Comments'''<br />
|---<br />
|Toshiba||Folio 100 Tablet||TOSHIBA_FOLIO_AND_A||armv7||2.2||Yes||-<br />
|}<br />
<br />
===List of devices ordered by processor compatibility (ARMv6 vs ARMv7)===<br />
<br />
'''List of ARMv7 devices:'''<br />
<br />
*Advent Vega (P10AN01) <br />
*Dell Streak, Streak 7 <br />
*HTC Desire <br />
*HTC Desire Z (T-Mobile G2) <br />
*HTC Desire HD <br />
*HTC Droid Incredible <br />
*HTC EVO 4G, EVO Shift 4G <br />
*HTC Glacier (T-Mobile myTouch 4G) <br />
*HTC Inspire 4G <br />
*HTC Nexus One <br />
*HTC Thunderbolt 4G <br />
*Huawei Ideos S7 <br />
*LG Optimus Z <br />
*Motorola Atrix 4G <br />
*Motorola Bravo <br />
*Motorola Cliq 2 - untested <br />
*Motorola Defy <br />
*Motorola Droid 2, Droid 2 Global <br />
*Motorola Droid Pro (Motorola PRO) <br />
*Motorola Droid X <br />
*Motorola Xoom <br />
*POV Mobii Tegra Tablet <br />
*Samsung Continuum (i400) <br />
*Samsung Galaxy S (i9000, Captivate, Fascinate, Vibrant, Epic 4G) <br />
*Samsung Galaxy Tab <br />
*Sharp IS03 <br />
*Sony Ericsson Xperia X10 <br />
*Toshiba AS100 <br />
*Viewsonic gTablet <br />
*Acer Liquid E<br />
*Acer Liquid (Liquid A1)<br />
*Archos 101 Internet Tablet<br />
*Motorola Charm<br />
*Motorola Droid (Milestone)<br />
*Samsung Galaxy S 4G<br />
*Samsung Nexus S<br />
<br />
'''List of ARMv6 processors:'''<br />
<br />
*Android SDK emulator <br />
*Asus Garmin nuvifone A50 (T-Mobile Garminfone) <br />
*Augen GENTouch 78 Tablet <br />
*Coby Kyros Internet Tablet (MID7015) <br />
*Geeksphone One, Geeksphone Zero <br />
*HTC Aria <br />
*HTC ChaCha <br />
*HTC Dream (T-Mobile G1, Android Dev Phone 1) <br />
*HTC Droid Eris <br />
*HTC Espresso (T-Mobile myTouch 3G Slide) <br />
*HTC Hero (T-Mobile G2 Touch) <br />
*HTC Legend <br />
*HTC Magic (T-Mobile myTouch 3G, T-Mobile G1 Touch) <br />
*HTC Salsa <br />
*HTC Tattoo <br />
*HTC Wildfire <br />
*Huawei Ascend <br />
*Huawei Ideos U8150-B (T-Mobile Comet) <br />
*Huawei U8110 (T-Mobile Pulse Mini) <br />
*Huawei U8230 <br />
*LG Ally (Apex) (LG VS740) <br />
*LG GW620 (Eve, InTouch Max, LinkMe) <br />
*LG Optimus, Optimus M, Optimus T, Optimus S, Optimus V <br />
*LG Vortex <br />
*LG P500<br />
*MAG iMiTO iM7 <br />
*vMAG iMiTO iM7S <br />
*Motorola Backflip <br />
*Motorola Citrus <br />
*Motorola Cliq (MB200) <br />
*Motorola Dext <br />
*Motorola Devour <br />
*Motorola i1 <br />
*Motorola Spice XT300 <br />
*Motorola Quench XT5 XT502 <br />
*Pandigital Novel <br />
*Samsung GT-S5570 Galaxy Mini <br />
*Samsung i5500 Galaxy 5 (Corby) <br />
*Samsung i5700 Galaxy Portal (Spica) <br />
*Samsung i5800 Galaxy 3 <br />
*Samsung i7500 Galaxy <br />
*Samsung Intercept <br />
*Samsung M900 Moment <br />
*Samsung S5830 Galaxy Ace <br />
*Samsung Transform <br />
*Sanyo ZIO M6000 <br />
*Sony Ericsson Xperia X8 <br />
*Sony Ericsson Xperia X10 Mini <br />
*Sony Ericsson Xperia X10 Mini Pro <br />
*Superpad 10.2" Tablet PC <br />
*Viewsonic ViewPad 7 Tablet <br />
*Velocity Micro T103 Cruz tablet <br />
*Vodafone 845 <br />
*ZTE Blade<br />
<br />
==Creating a new Java Android Application==<br />
<br />
This info can be useful for helping implement LCL-CustomDrawn-Android<br />
<br />
Generic instructions here: http://developer.android.com/guide/developing/other-ide.html<br />
<br />
===Showing / Hiding the virtual keyboard===<br />
<br />
See here: http://android-codes-examples.blogspot.com/2011/11/show-or-hide-soft-keyboard-on-opening.html<br />
<br />
To show it:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);<br />
<br />
and for hiding the keyboard:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);<br />
<br />
==References==<br />
<br />
* http://developer.android.com/guide/developing/other-ide.html</div>
Kverde
https://wiki.freepascal.org/index.php?title=Android_Programming/ru&diff=55321
Android Programming/ru
2012-02-06T06:54:46Z
<p>Kverde: </p>
<hr />
<div>{{Android programming}}<br />
<br />
Смотрите также [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
Общие знания о программировании под Андроид могут очень помочь в разработке интерфейса Lazarus для Андроид.<br />
<br />
==Как...==<br />
<br />
===Построить пример NDK (Android Native Development Kit) OpenGL ===<br />
<br />
Просто выполните следующие действия:<br />
<br />
'''Шаг 1''' - Скачайте и установите Android NDK, Android SDK и Ant. Боьше информации тут: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones]]<br />
<br />
'''Шаг 2''' - Установите pre-compiled FPC cross-compiler. Инстрцкции здесь: [[Android_Interface#Using_the_pre-compiled_compiler]]<br />
<br />
'''Шаг 3''' - Загрузите последнюю версию lazarus-ccr sourceforge code:<br />
<br />
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr lazarus-ccr<br />
<br />
или если вы думаете что это слишком много, вы можете скачать только каталог lazarus-ccr/bindings/android-ndk<br />
<br />
'''Шаг 4''' - Постройте Pascal Library<br />
<br />
Откройте проект lazarus-ccr/bindings/android-ndk/examples/opengltest/opengltest.lpi<br />
<br />
Откройте пункт меню Project->Project Options->Paths и где написано "Libraries -Fl" вы должны увидеть следующее значение:<br />
<br />
/home/felipe/Programas/android-ndk-r5/platforms/android-9/arch-arm/usr/lib<br />
<br />
Change it to the correct path in your system which points to the NDK and to the library folder for your minimal required Android API Level <br />
<br />
Теперь постройте проект используя Лазарус.<br />
<br />
'''Шаг 5''' - Настройка среды сборки<br />
<br />
Откройте файл opengltest/local.properties и в строке:<br />
<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
<br />
Измените этот путь на местоположение SDK<br />
<br />
'''Шаг 6''' - Постройка APK<br />
<br />
Откройте консоль и введите следущие команды:<br />
<br />
cd lazarus-ccr/bindings/ndk/examples/opengltest/android<br />
ant debug<br />
<br />
Файл APK будет помещен в opengltest/android/bin/<br />
<br />
'''Шаг 7''' - Установка APK<br />
<br />
Если на этом шаге вы получите сообщение об ошибке прав доступа читайте: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones#Recognition_of_devices_under_Linux]]<br />
<br />
Команда чтобы установить APK на телефоне:<br />
<br />
cd opengltest/android<br />
~/Programas/android-sdk-linux/platform-tools/adb install bin/OpenGLNDKTest-debug.apk <br />
2395 KB/s (107299 bytes in 0.043s)<br />
pkg: /data/local/tmp/OpenGLNDKTest-debug.apk<br />
Success<br />
<br />
Если вы получили сообщение об ошибке, что APK уже установлен, вы можете установить с помощью следующей команды:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb uninstall com.pascal.opengltest<br />
<br />
And then you can run adb logcat to see what the log says while you start it in the phone via its newly added icon:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb logcat<br />
<br />
===Чтение параметров экрана===<br />
<br />
First fill a TDisplayMetrics with the correct info:<br />
<br />
<delphi><br />
uses androidutil;<br />
<br />
var<br />
MyDisplayMetrics: TDisplayMetrics;<br />
Str: string;<br />
//<br />
lHeight, lWidth: Integer;<br />
xdpi, ydpi, lScreenSize: Single;<br />
begin<br />
// ..<br />
// Objects<br />
<br />
MyDisplayMetrics := TDisplayMetrics.Create;<br />
Activity.getWindowManager().getDefaultDisplay().getMetrics(MyDisplayMetrics);<br />
</delphi><br />
<br />
And then you can read it from the TDisplayMetrics:<br />
<br />
<delphi><br />
lHeight := MyDisplayMetrics.heightPixels();<br />
lWidth := MyDisplayMetrics.widthPixels();<br />
xdpi := MyDisplayMetrics.xdpi();<br />
ydpi := MyDisplayMetrics.ydpi();<br />
lScreenSize := sqrt(sqr(lHeight / ydpi) + sqr(lWidth / xdpi));<br />
ldensity := MyDisplayMetrics.density();<br />
ldensityDpi := MyDisplayMetrics.densityDpi();<br />
scaledDensity := MyDisplayMetrics.scaledDensity();<br />
</delphi><br />
<br />
Note that lots of devices lie about the xdpi and ydpi, so don't trust the lScreenSize calculated above. Smartphones might report even 10 inches of screen size, while the correct is around 4.<br />
<br />
==Details about Android devices==<br />
<br />
Since there are so many Android devices, it can be useful to keep track of some information about them. See also in the wikipedia Comparison of Android Devices [http://en.wikipedia.org/wiki/Comparison_of_Android_devices] and details about the processors in [https://wiki.mozilla.org/Mobile/Platforms/Android#System_Requirements].<br />
<br />
===Smartphones===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Manufacturer'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Model'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Processor'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android version'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Comments'''<br />
|---<br />
|HTC||Wildfire||HTC Wildfire||armv6||2.1=>2.2||Yes||-<br />
|---<br />
|Sony Erricson||Xperia X10||X10i||armv7||1.6=>2.1||No||-<br />
|}<br />
<br />
===Tablets===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Manufacturer'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Model'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Processor'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android version'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Comments'''<br />
|---<br />
|Toshiba||Folio 100 Tablet||TOSHIBA_FOLIO_AND_A||armv7||2.2||Yes||-<br />
|}<br />
<br />
===List of devices ordered by processor compatibility (ARMv6 vs ARMv7)===<br />
<br />
'''List of ARMv7 devices:'''<br />
<br />
*Advent Vega (P10AN01) <br />
*Dell Streak, Streak 7 <br />
*HTC Desire <br />
*HTC Desire Z (T-Mobile G2) <br />
*HTC Desire HD <br />
*HTC Droid Incredible <br />
*HTC EVO 4G, EVO Shift 4G <br />
*HTC Glacier (T-Mobile myTouch 4G) <br />
*HTC Inspire 4G <br />
*HTC Nexus One <br />
*HTC Thunderbolt 4G <br />
*Huawei Ideos S7 <br />
*LG Optimus Z <br />
*Motorola Atrix 4G <br />
*Motorola Bravo <br />
*Motorola Cliq 2 - untested <br />
*Motorola Defy <br />
*Motorola Droid 2, Droid 2 Global <br />
*Motorola Droid Pro (Motorola PRO) <br />
*Motorola Droid X <br />
*Motorola Xoom <br />
*POV Mobii Tegra Tablet <br />
*Samsung Continuum (i400) <br />
*Samsung Galaxy S (i9000, Captivate, Fascinate, Vibrant, Epic 4G) <br />
*Samsung Galaxy Tab <br />
*Sharp IS03 <br />
*Sony Ericsson Xperia X10 <br />
*Toshiba AS100 <br />
*Viewsonic gTablet <br />
*Acer Liquid E<br />
*Acer Liquid (Liquid A1)<br />
*Archos 101 Internet Tablet<br />
*Motorola Charm<br />
*Motorola Droid (Milestone)<br />
*Samsung Galaxy S 4G<br />
*Samsung Nexus S<br />
<br />
'''List of ARMv6 processors:'''<br />
<br />
*Android SDK emulator <br />
*Asus Garmin nuvifone A50 (T-Mobile Garminfone) <br />
*Augen GENTouch 78 Tablet <br />
*Coby Kyros Internet Tablet (MID7015) <br />
*Geeksphone One, Geeksphone Zero <br />
*HTC Aria <br />
*HTC ChaCha <br />
*HTC Dream (T-Mobile G1, Android Dev Phone 1) <br />
*HTC Droid Eris <br />
*HTC Espresso (T-Mobile myTouch 3G Slide) <br />
*HTC Hero (T-Mobile G2 Touch) <br />
*HTC Legend <br />
*HTC Magic (T-Mobile myTouch 3G, T-Mobile G1 Touch) <br />
*HTC Salsa <br />
*HTC Tattoo <br />
*HTC Wildfire <br />
*Huawei Ascend <br />
*Huawei Ideos U8150-B (T-Mobile Comet) <br />
*Huawei U8110 (T-Mobile Pulse Mini) <br />
*Huawei U8230 <br />
*LG Ally (Apex) (LG VS740) <br />
*LG GW620 (Eve, InTouch Max, LinkMe) <br />
*LG Optimus, Optimus M, Optimus T, Optimus S, Optimus V <br />
*LG Vortex <br />
*LG P500<br />
*MAG iMiTO iM7 <br />
*vMAG iMiTO iM7S <br />
*Motorola Backflip <br />
*Motorola Citrus <br />
*Motorola Cliq (MB200) <br />
*Motorola Dext <br />
*Motorola Devour <br />
*Motorola i1 <br />
*Motorola Spice XT300 <br />
*Motorola Quench XT5 XT502 <br />
*Pandigital Novel <br />
*Samsung GT-S5570 Galaxy Mini <br />
*Samsung i5500 Galaxy 5 (Corby) <br />
*Samsung i5700 Galaxy Portal (Spica) <br />
*Samsung i5800 Galaxy 3 <br />
*Samsung i7500 Galaxy <br />
*Samsung Intercept <br />
*Samsung M900 Moment <br />
*Samsung S5830 Galaxy Ace <br />
*Samsung Transform <br />
*Sanyo ZIO M6000 <br />
*Sony Ericsson Xperia X8 <br />
*Sony Ericsson Xperia X10 Mini <br />
*Sony Ericsson Xperia X10 Mini Pro <br />
*Superpad 10.2" Tablet PC <br />
*Viewsonic ViewPad 7 Tablet <br />
*Velocity Micro T103 Cruz tablet <br />
*Vodafone 845 <br />
*ZTE Blade<br />
<br />
==Creating a new Java Android Application==<br />
<br />
This info can be useful for helping implement LCL-CustomDrawn-Android<br />
<br />
Generic instructions here: http://developer.android.com/guide/developing/other-ide.html<br />
<br />
===Showing / Hiding the virtual keyboard===<br />
<br />
See here: http://android-codes-examples.blogspot.com/2011/11/show-or-hide-soft-keyboard-on-opening.html<br />
<br />
To show it:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);<br />
<br />
and for hiding the keyboard:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);<br />
<br />
==References==<br />
<br />
* http://developer.android.com/guide/developing/other-ide.html</div>
Kverde
https://wiki.freepascal.org/index.php?title=Help:Editing/ru&diff=55318
Help:Editing/ru
2012-02-06T06:13:33Z
<p>Kverde: </p>
<hr />
<div>{{Template:Help:Editing}}<br />
<br />
Редактировать страницы wiki очень просто. Просто нажмите кнопку "'''Edit'''" ("'''Править'''") расположенную в верхней части меню справа. Это привдет вас на страницу с текствым полем содержашим редактируемый текст этой страницы. ''''Если вы хотите поэксперементировать, пожалуйста, сделайте это в нашей [[Sand Box|песочнице]], а не сдесь. Вы можете открыть [[Sand Box|песочницу]] в отдельном окне или вкладке чтобы иметь возможность видеть одновременно этот текст и вашы тесты в песочнице.'''''<br />
<br />
Type away, write a short [[Wikipedia:Edit summary|edit summary]] on the small field below the edit-box. You may use shorthand to describe your changes, as described in the [[Wikipedia:Edit summary legend|legend]], and when you've finished, press [[Wikipedia:Show preview|preview]] to see how your changes will look. Then press "Save". Depending on your system, pressing "Enter" while the edit box is not active (when there is no typing cursor in it) may have the same effect as pressing the "Save" button. Also, please do not vandalise the information on {{ns:4}}.<br />
<br />
You can also click on the "'''Discussion'''" tab (or the "'''Discuss this page'''" link) to see the corresponding [[Wikipedia:Talk page|talk page]], which contains comments about the page from other Wikipedia users. Click on the "'''+'''" tab (or "'''Edit this page'''") to add a comment.<br />
<br />
== The wiki markup ==<br />
In the left column of the table below, you can see what effects are possible. In the right column, you can see how those effects were achieved. In other words, to make text look like it looks in the left column, type it in the format you see in the right column.<br />
<br />
You may want to keep this page open in a separate browser window for reference. If you want to try out things without danger of doing any harm, you can do so '''in the [[Sand_Box|sandbox]]'''.<br />
<br />
----<br />
<!--<br />
:'''The rest of this page is deprecated but will be updated periodically.''' <br />
:'''Please direct edits to the [[meta:MediaWiki User's Guide: Editing overview|Meta-Wikimedia version of this page]]'''<br />
<br />
--><br />
=== Sections, paragraphs, lists and lines ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
Start your [[Wikipedia:Manual of Style (headings)|sections]] as follows:<br />
<br />
<!-- The following code messes up the table of contents<br />
and makes the section edit links much less useful,<br />
so please do not use it.<br />
== New section ==<br />
=== Subsection ===<br />
==== Sub-subsection ====<br />
--><br />
<!-- The following should look almost the same, using<br />
HTML headings markup instead of wiki headings.<br />
However, it messes up the section edit links,<br />
so please do not use it.<br />
<h2>New section</h2><br />
<h3>Subsection</h3><br />
<h4>Sub-subsection</h4><br />
--><br />
<!-- The following just uses bolding and font changes,<br />
so it should be safe. However, it might not<br />
look exactly right, especially when people<br />
use non-standard CSS stylesheets.<br />
--><br />
'''<font style="font-size:120%">New section</font>'''<br />
<br />
'''<font style="font-size:110%">Subsection</font>'''<br />
<br />
'''<font style="font-size:100%">Sub-subsection</font>'''<br />
<br />
* Start with a second-level heading (<tt><nowiki>==</nowiki></tt>); do not use first-level headings (=).<br />
* Do not skip levels (e.g., second-level followed by fourth-level).<br />
* A [[#Placement_of_the_Table_of_Contents_.28TOC.29|Table of Contents]] will automatically be added to an article that has four or more sections. <br />
|<br />
<pre><nowiki><br />
== New section ==<br />
<br />
=== Subsection ===<br />
<br />
==== Sub-subsection ====<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A single [[newline]]<br />
generally has no effect on the layout.<br />
These can be used to separate<br />
sentences within a paragraph.<br />
Some editors find that this aids editing<br />
and improves the function ''diff'' <br />
(used internally to compare<br />
different versions of a page).<br />
<br />
But an empty line<br />
starts a new paragraph.<br />
<br />
* When used in a list, a newline ''does'' affect the layout ([[#lists|see below]]).<br />
|<br />
<pre><nowiki><br />
A single [[newline]]<br />
generally has no effect on the layout. <br />
These can be used to separate<br />
sentences within a paragraph.<br />
Some editors find that this aids editing<br />
and improves the function ''diff'' <br />
(used internally to compare<br />
different versions of a page).<br />
<br />
But an empty line<br />
starts a new paragraph.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can break lines<br><br />
without starting a new paragraph.<br />
<br />
* Please use this sparingly.<br />
* Close markup between lines, don't start a [[link]] or ''italics'' or '''bold''' on one line and close it on the next.<br />
|<br />
<pre><nowiki><br />
You can break lines<br><br />
without starting a new paragraph.<br />
</nowiki></pre><br />
|- id="lists" valign="top"<br />
|<br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
|<br />
<pre><nowiki><br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
|<br />
<pre><nowiki><br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
|<br />
<pre><nowiki><br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
<br />
* One item per line; a newline can appear before the colon, but using a space before the colon improves parsing.<br />
|<br />
<pre><nowiki><br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
<br />
* This is primarily for displayed material, but is also used for discussion on [[Wikipedia:Talk page|Talk page]]s.<br />
|<br />
<pre><nowiki><br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
<br />
*This is useful for:<br />
** pasting preformatted text;<br />
** algorithm descriptions;<br />
** program source code;<br />
** [[ASCII art]];<br />
** chemical structures;<br />
* '''WARNING''': If you make it wide, you [[page widening|force the whole page to be wide]] and hence less readable, especially for people who use lower resolutions. Never start ordinary lines with spaces.<br />
|<br />
<pre><nowiki><br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<center>Centered text.</center><br />
<br />
* Note the American spelling of "center" (not "centre").<br />
|<br />
<pre><nowiki><br />
<center>Centered text.</center><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
<br />
* Mainly useful for separating threads on Talk pages.<br />
* Also used to [[Wikipedia:Disambiguation|disambiguate]] within an article without creating a separate page.<br />
|<br />
<pre><nowiki><br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
</nowiki></pre><br />
|}<br />
<br />
=== Links and URLs ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
London has [[public transport]].<br />
<br />
* A link to another Wikipedia article.<br />
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).<br />
* Thus the link above is to the [[URL]] http://www.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also [[Wikipedia:Canonicalization]].<br />
|<br />
<pre><nowiki><br />
London has [[public transport]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
<br />
* Same target, different name.<br />
* This is a [[piped link]].<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
<br />
* Endings are blended into the link.<br />
* Preferred style is to use this instead of a piped link, if possible.<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
See the [[Wikipedia:Manual of Style]].<br />
<br />
* A link to another [[Wikipedia:namespace|namespace]].<br />
|<br />
<pre><nowiki><br />
See the [[Wikipedia:Manual of Style]].<br />
</nowiki></pre><br />
|- id="link-to-section" valign="top"<br />
|<br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
<br />
* The part after the number sign (#) must match a section heading on the page, or an identifier created in some other way. Matches must be exact in terms of spelling, case and punctuation. Links to non-existent sections aren't broken; they are treated as links to the top of the page.<br />
* Identifiers may be created by attaching an <code>id="..."></code> attribute to almost any HTML element.<br />
|<br />
<pre><nowiki><br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|kingdom]].<br />
<br />
Automatically hide namespace:<br />
[[Wikipedia:Village Pump|Village Pump]]. <br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|Manual of Style]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
<br />
* The server fills in the part after the pipe character (|) when you save the page. The next time you open the edit box you will see the expanded piped link. When [[Wikipedia:Show preview|preview]]ing your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to links to sections within the same page ([[#link-to-section|see previous entry]]).<br />
|<br />
<pre><nowiki><br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|]].<br />
<br />
Automatically hide namespace: <br />
[[Wikipedia:Village Pump|]].<br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[The weather in London]] is a page<br />
that doesn't exist yet.<br />
<br />
* You can create it by clicking on the link (but please don't do so with this particular link).<br />
* To create a new page: <br />
*# Create a link to it on some other (related) page.<br />
*# Save that page.<br />
*# Click on the link you just made. The new page will open for editing.<br />
* For more information, see [[Wikipedia:How to start a page|How to start a page]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].<br />
* Please do not create a new article without linking to it from at least one other article.<br />
|<br />
<pre><nowiki><br />
[[The weather in London]] is a page <br />
that doesn't exist yet.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[Wikipedia:How to edit a page]] is this page.<br />
<br />
* [[Self link]]s appear as bold text when the article is viewed.<br />
* Do not use this technique to make the article name bold in the first paragraph; see the [[Wikipedia:Manual of Style#Article names|Manual of Style]].<br />
|<br />
<pre><nowiki><br />
[[Wikipedia:How to edit a page]] is this page.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: [[User:Brockert|Ben Brockert]]<br />
or four to add user name plus date/time:<br />
: [[User:Brockert|Ben Brockert]] 00:18, Nov 19, 2004 (UTC)<br />
Five tildes gives the date/time alone:<br />
: 00:18, Nov 19, 2004 (UTC)<br />
<br />
* The first two both provide a link to your [[Wikipedia:user page|user page]].<br />
|<br />
<pre><nowiki><br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: ~~~<br />
or four for user name plus date/time:<br />
: ~~~~<br />
Five tildes gives the date/time alone:<br />
: ~~~~~<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[USA]]").<br />
* Note that, while it is possible to link to a section, it is not possible to redirect to a section. For example, "<nowiki>#REDIRECT [[United States#History]]</nowiki>" will redirect to the [[United States]] page, but not to any particular section on it. This feature '''will not''' be implemented in the future, so such redirects should not be used.<br />
|<br />
<pre><nowiki><br />
#REDIRECT [[United States]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Link to a page on the same subject in another language by using a link of the form: <nowiki>[[language code:Title]]</nowiki>.<br />
* It does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
* Please see [[Wikipedia:Interlanguage links]] and the [[Wikipedia:Complete list of language wikis available|list of languages and codes]].<br />
|<br />
<pre><nowiki><br />
[[fr:Wikipédia:Aide]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
<br />
|<br />
<pre><nowiki><br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
|<br />
<pre><nowiki><br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To put an article in a [[Wikipedia:Category]], place a link like the one to the right anywhere in the article. As with interlanguage links, it does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
|<br />
<pre><nowiki><br />
[[Category:Character sets]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To ''link'' to a [[Wikipedia:Category]] page without putting the article into the category, use an initial colon (:) in the link.<br />
|<br />
<pre><nowiki><br />
[[:Category:Character sets]]<br />
</nowiki></pre><br />
|- id="link-external" valign="top"<br />
|<br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/ (bad style)<br />
# Unnamed link: [http://www.nupedia.com/] (bad style)<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
<br />
:See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts.<br />
<br />
* Square brackets indicate an external link. Note the use of a ''space'' (not a pipe) to separate the URL from the link text in the "named" version.<br />
* In the [[URL]], all symbols must be among:<br/>'''A-Z a-z 0-9 . _ \ / ~ % - + &amp; # ? ! = ( ) @ \x80-\xFF'''<br />
* If a URL contains a character not in this list, it should be encoded by using a percent sign (%) followed by the [[hexadecimal|hex]] code of the character, which can be found in the table of [[ASCII#ASCII printable characters|ASCII printable characters]]. For example, the caret character (^) would be encoded in a URL as '''%5E'''.<br />
* See [[Wikipedia:External links]] for style issues.<br />
|<br />
<pre><nowiki><br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/<br />
# Unnamed link: [http://www.nupedia.com/]<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|Hello]]<br />
<br />
* All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello<br />
* Note that interwiki links use the ''internal'' link style.<br />
* See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts; if the site you want to link to isn't on the list, use an external link ([[#link-external|see above]]).<br />
* See also [[Wikipedia:How to link to Wikimedia projects]].<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|fr:Bonjour]]<br />
<br />
* All of these forms lead to the URL http://fr.wiktionary.org/wiki/Bonjour<br />
|<br />
<pre><nowiki><br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|]]<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
<br />
* Link to books using their [[Wikipedia:ISBN|ISBN]] numbers. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors.<br />
* ISBN links do not need any extra markup, provided you use one of the indicated formats.<br />
|<br />
<pre><nowiki><br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
<br />
* Link dates in one of the above formats, so that everyone can set their own display order. If [[Special:Userlogin|logged in]], you can use [[Special:Preferences]] to change your own date display setting.<br />
* All of the above dates will appear as "[[20 July|20 July]] [[1969|1969]]" if you set your date display preference to "15 January 2001", but as "[[20 July|July 20]], [[1969|1969]]" if you set it to "January 15, 2001".<br />
|<br />
<pre><nowiki><br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[media:Sg_mrob.ogg|Sound]]<br />
<br />
*To include links to non-image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].<br />
<br />
Some uploaded sounds are listed at [[Wikipedia:Sound]].<br />
|<br />
<pre><nowiki><br />
[[media:Sg_mrob.ogg|Sound]]<br />
</nowiki></pre><br />
|}<br />
<br />
=== Images ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
| A picture: [[Image:Wiki.png]]<br />
<br />
or, with alternative text:<br />
[[Image:Wiki.png|jigsaw globe]]<br />
<br />
or, floating to the right side of the page and with a caption:<br />
[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
[[Image:Wiki.png|right|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
* Only images that have been uploaded to Wikipedia can be used. To upload images, use the [[Special:Upload|upload page]]. You can find the uploaded image on the [[Special:Imagelist|image list]].<br />
* See the [[Wikipedia:Image use policy|image use policy]], [[Wikipedia:Image markup|extended image markup/syntax]] (also possibly [[Wikipedia:Image markup with HTML|image HTML markup]]) for more hints.<br />
* Alternative text, used when the image isn't loaded, in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternate text for images|Alternate text for images]] for help on choosing it.<br />
* The frame tag automatically floats the image right.<br />
| <pre><nowiki><br />
A picture: [[Image:Wiki.png]]</nowiki><br />
<br />
or, with alternative text:<br />
<nowiki>[[Image:Wiki.png|jigsaw globe]]</nowiki><br />
<br />
or, floating to the right side of the page and with a caption:<br />
<nowiki>[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]</nowiki><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
<nowiki>[[Image:Wiki.png|right|Wikipedia Encyclopedia]]</nowiki></pre><br />
|-<br />
|<br />
Clicking on an uploaded image displays a description page, which you can also link directly to: [[:Image:Wiki.png]]<br />
| <pre><nowiki><br />
<br />
[[:Image:Wiki.png]]<br />
</nowiki></pre><br />
|-<br />
|<br />
To include links to images shown as links instead of drawn on the page, use a "media" link.<br />
<br />
<br/>[[media:Tornado.jpg|Image of a Tornado]]<br />
|<br />
<pre><br />
<nowiki><br />
<br />
[[media:Tornado.jpg|Image of a Tornado]]<br />
<br />
</nowiki></pre><br />
|}<br />
<br />
=== Character formatting ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|- valign="top"<br />
! What it looks like<br />
! What you type<br />
|- id="emph" valign="top"<br />
|<br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
* These are double and triple apostrophes (single-quote marks), not double-quote marks.<br />
|<br />
<pre><nowiki><br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<math>\sin x + \ln y</math><br><br />
sin''x'' + ln''y''<br />
<!-- no space between roman "sin" and italic "x" --><br />
<br />
<math>\mathbf{x} = 0</math><br><br />
'''x''' = 0<br />
<br />
Ordinary text should use [[#emph|wiki markup for emphasis]], and should not use <code>&lt;i&gt;</code> or <code>&lt;b&gt;</code>. However, mathematical formulas often use italics, and sometimes use bold, for reasons unrelated to emphasis. Complex formulas should use [[m:Help:Formula|<code>&lt;math&gt;</code> markup]], and simple formulas may use <code>&lt;math&gt;</code>; or <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>; or <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code>. According to [[Wikipedia:WikiProject Mathematics#Italicization and bolding|WikiProject Mathematics]], wiki markup is preferred over HTML markup like <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>.<br />
|<br />
<pre><nowiki><br />
<math>\sin x + \ln y</math><br />
sin''x'' + ln''y''<br />
<br />
<math>\mathbf{x} = 0</math><br />
'''x''' = 0<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
<br />
* For semantic reasons, using <code>&lt;code&gt;</code> where applicable is preferable to using <code>&lt;tt&gt;</code>.<br />
|<br />
<pre><nowiki><br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can use <small>small text</small> for captions.<br />
|<br />
<pre><nowiki><br />
You can use <small>small text</small> for captions.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
<br />
* When editing regular Wikipedia articles, just make your changes and don't mark them up in any special way.<br />
* When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.<br />
|<br />
<pre><nowiki><br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Diacritical marks:'''<br />
<br/><br />
è é ê ë ì í<br />
<br />
À Á Â Ã Ä Å <br/><br />
Æ Ç È É Ê Ë <br/><br />
Ì Í<br />
Î Ï Ñ Ò <br/><br />
Ó Ô Õ<br />
Ö Ø Ù <br/><br />
Ú Û Ü ß<br />
à á <br/><br />
â ã ä å æ<br />
ç <br/><br />
è é ê ë ì í<br/><br />
î ï ñ ò ó ô <br/><br />
&oelig; õ<br />
ö ø ù ú <br/><br />
û ü ÿ<br />
<br />
* See [[meta:Help:Special characters|special characters]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
è é ê ë ì í<br />
<br />
&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; <br />
&amp;AElig; &amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml; <br />
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde; &amp;Ograve; <br />
&amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;Ugrave; <br />
&amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;szlig; &amp;agrave; &amp;aacute; <br />
&amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil; <br />
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml; &amp;igrave; &amp;iacute;<br />
&amp;icirc; &amp;iuml; &amp;ntilde; &amp;ograve; &amp;oacute; &amp;ocirc; <br />
&amp;oelig; &amp;otilde; &amp;ouml; &amp;oslash; &amp;ugrave; &amp;uacute; <br />
&amp;ucirc; &amp;uuml; &amp;yuml;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Punctuation:'''<br />
<br/><br />
¿ ¡ § ¶<br/><br />
&dagger; &Dagger; &bull; &ndash; &mdash;<br/><br />
&lsaquo; &rsaquo; « »<br/><br />
&lsquo; &rsquo; &ldquo; &rdquo;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;<br />
&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;<br />
&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;<br />
&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commercial symbols:'''<br />
<br/><br />
&trade; © ® ¢ &euro; ¥<br/><br />
£ ¤<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;trade; &amp;copy; &amp;reg; &amp;cent; &amp;euro; &amp;yen; <br />
&amp;pound; &amp;curren;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Subscripts:'''<br />
<br/><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
<br />
'''Superscripts:'''<br />
<br/><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&sup1; x&sup2; x&sup3;<br />
*The latter method of superscripting can't be used in the most general context, but is preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.<br />
<br />
&epsilon;<sub>0</sub> =<br />
8.85 &times; 10<sup>&minus;12</sup><br />
C&sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&sup2;]]<br />
|<br />
<br/><br />
<pre><nowiki><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
</nowiki></pre><br />
<br />
<pre><nowiki><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&amp;sup1; x&amp;sup2; x&amp;sup3;<br />
<br />
&amp;epsilon;<sub>0</sub> =<br />
8.85 &amp;times; 10<sup>&amp;minus;12</sup><br />
C&amp;sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&amp;sup2;]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Greek characters:'''<br />
<br/><br />
&alpha; &beta; &gamma; &delta; &epsilon; &zeta;<br/><br />
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu;<br/><br />
&xi; &omicron; &pi; &rho; &sigma; &sigmaf;<br/><br />
&tau; &upsilon; &phi; &chi; &psi; &omega;<br/><br />
&Gamma; &Delta; &Theta; &Lambda; &Xi; &Pi;<br/><br />
&Sigma; &Phi; &Psi; &Omega;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; <br />
&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu; <br />
&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;<br />
&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;<br />
&amp;Gamma; &amp;Delta; &amp;Theta; &amp;Lambda; &amp;Xi; &amp;Pi; <br />
&amp;Sigma; &amp;Phi; &amp;Psi; &amp;Omega;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Math characters:'''<br />
<br/><br />
&int; &sum; &prod; &radic; &minus; &plusmn; &infin;<br/><br />
&asymp; &prop; &equiv; &ne; &le; &ge; &rarr;<br/><br />
&times; &middot; &divide; &part; &prime; &Prime;<br/><br />
&nabla; &permil; &deg; &there4; &alefsym; &oslash;<br/><br />
&isin; &notin; &cap; &cup; &sub; &sup; &sube; &supe;<br/><br />
&not; &and; &or; &exist; &forall; &rArr; &hArr;<br/><br />
&rarr; &harr;<br/><br />
* See also [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;int; &amp;sum; &amp;prod; &amp;radic; &amp;minus; &amp;plusmn; &amp;infin;<br />
&amp;asymp; &amp;prop; &amp;equiv; &amp;ne; &amp;le; &amp;ge; &amp;rarr;<br />
&amp;times; &amp;middot; &amp;divide; &amp;part; &amp;prime; &amp;Prime;<br />
&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym; &amp;oslash;<br />
&amp;isin; &amp;notin; &amp;cap; &amp;cup; &amp;sub; &amp;sup; &amp;sube; &amp;supe;<br />
&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall; &amp;rArr; &amp;hArr;<br />
&amp;rarr; &amp;harr;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Spacing in simple math formulas:'''<br />
<br/><br />
Obviously, ''x''&sup2;&nbsp;&ge;&nbsp;0 is true.<br />
*To space things out without allowing line breaks to interrupt the formula, use non-breaking spaces: <tt>&amp;nbsp;</tt>.<br />
|<br />
<br/><br />
<pre><nowiki><br />
Obviously, ''x''&amp;sup2;&amp;nbsp;&amp;ge;&amp;nbsp;0 is true.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Complicated formulas:'''<br />
<br/><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
* See [[m:Help:Formula]] for how to use <tt>&lt;math></tt>.<br />
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.<br />
|<br />
<br/><br />
<pre><nowiki><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Suppressing interpretation of markup:'''<br />
<br/><br />
<nowiki>Link &rarr; (''to'') the [[Wikipedia FAQ]]</nowiki><br />
* Used to show literal data that would otherwise have special meaning.<br />
* Escape all wiki markup, including that which looks like HTML tags.<br />
* Does not escape HTML character references.<br />
* To escape HTML character references such as <tt>&amp;rarr;</tt> use <tt>&amp;amp;rarr;</tt><br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;nowiki>Link &amp;rarr; (''to'') <br />
the [[Wikipedia FAQ]]&lt;/nowiki><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commenting page source:'''<br />
<br/><br />
''not shown when viewing page''<br />
* Used to leave comments in a page for future editors.<br />
* Note that most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;!-- comment here --><br />
</nowiki></pre><br />
|}<br />
''(see also: [[Chess symbols in Unicode]])''<br />
<br />
=== Tables ===<br />
==== Placement of the Table of Contents (TOC) ====<br />
At the current status of the wiki markup language, having at least four headers on a page triggers the TOC to appear in front of the first header (or after introductory sections). Putting <nowiki>__TOC__</nowiki> anywhere forces the TOC to appear at that point (instead of just before the first header). Putting <nowiki>__NOTOC__</nowiki> anywhere forces the TOC to disappear. See also [[Wikipedia:Section#Compact_TOC|compact TOC]] for alphabet and year headings.<br />
<br />
==== Keeping headings out of the Table of Contents ====<br />
<br />
If you want some subheadings to not appear in the Table of Contents, then make the following replacements.<br />
<br />
Replace <nowiki> == Header 2 == with <h2> Header 2 </h2> </nowiki><br />
<br />
Replace <nowiki> === Header 3 === with <h3> Header 3 </h3> </nowiki><br />
<br />
And so forth.<br />
<br />
For example, notice that the following header has the same font as the other subheaders to this "Tables" section, but the following header does not appear in the Table of Contents for this page.<br />
<br />
<h4> This header has the h4 font, but is NOT in the Table of Contents </h4><br />
<br />
This effect is obtained by the following line of code.<br />
<br />
<nowiki><h4> This header has the h4 font, but is NOT in the Table of Contents </h4></nowiki><br />
<br />
<br />
==== Tables ====<br />
There are two ways to build tables: <br />
*in special Wiki-markup (see [[m:Help:Table]])<br />
*with the usual HTML elements: &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; or &lt;th&gt;.<br />
<br />
For the latter, and a discussion on when tables are appropriate, see [[Wikipedia:How to use tables]].<br />
<br />
=== Variables ===<br />
<br />
''(See also [[m:Help:Variable]])''<br />
{|<br />
|-<br />
! Code<br />
! Effect<br />
|-<br />
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAME}}</nowiki><br />
| {{CURRENTMONTHNAME}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki><br />
| {{CURRENTMONTHNAMEGEN}}<br />
|-<br />
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}<br />
|-<br />
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}<br />
|-<br />
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}<br />
|-<br />
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}<br />
|-<br />
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br />
| {{NUMBEROFARTICLES}}<br />
|-<br />
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}<br />
|-<br />
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}<br />
|-<br />
| <nowiki>{{localurl:pagename}}</nowiki><br />
| {{localurl:pagename}}<br />
|-<br />
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki><br />
| {{localurl:Wikipedia:Sandbox|action=edit}}<br />
|-<br />
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}<br />
|-<br />
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}<br />
|-<br />
| <nowiki>{{ns:2}}</nowiki> || {{ns:2}}<br />
|-<br />
| <nowiki>{{ns:3}}</nowiki> || {{ns:3}}<br />
|-<br />
| <nowiki>{{ns:4}}</nowiki> || {{ns:4}}<br />
|-<br />
| <nowiki>{{ns:5}}</nowiki> || {{ns:5}}<br />
|-<br />
| <nowiki>{{ns:6}}</nowiki> || {{ns:6}}<br />
|-<br />
| <nowiki>{{ns:7}}</nowiki> || {{ns:7}}<br />
|-<br />
| <nowiki>{{ns:8}}</nowiki> || {{ns:8}}<br />
|-<br />
| <nowiki>{{ns:9}}</nowiki> || {{ns:9}}<br />
|-<br />
| <nowiki>{{ns:10}}</nowiki> || {{ns:10}}<br />
|-<br />
| <nowiki>{{ns:11}}</nowiki> || {{ns:11}}<br />
|-<br />
| <nowiki>{{ns:12}}</nowiki> || {{ns:12}}<br />
|-<br />
| <nowiki>{{ns:13}}</nowiki> || {{ns:13}}<br />
|-<br />
| <nowiki>{{ns:14}}</nowiki> || {{ns:14}}<br />
|-<br />
| <nowiki>{{ns:15}}</nowiki> || {{ns:15}}<br />
|-<br />
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}<br />
|}<br />
<br />
'''NUMBEROFARTICLES''' is the number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.<br />
<br />
=== Templates ===<br />
<br />
The [[Wikipedia:MediaWiki|MediaWiki]] software used by Wikipedia has limited support for template inclusion. This means standardized text chunks (such as boilerplate text) can be inserted into articles. For example, typing <nowiki>{{stub}}</nowiki> will appear as "''This article is a [[Wikipedia:The perfect stub article|stub]]. You can help Wikipedia by [[Wikipedia:Find or fix a stub|expanding it]].''" when the page is saved. See [[Wikipedia:Template messages]] for the complete list. Other commonly used ones are: <nowiki>{{disambig}}</nowiki> for disambiguation pages, <nowiki>{{spoiler}}</nowiki> for spoiler warnings and <nowiki>{{sectstub}}</nowiki> like an article stub but for a section. The are many subject-specific stubs e.g.: <nowiki> {{Geo-stub}}, {{Hist-stub}} and {{Linux-stub}}</nowiki>. For a complete list of stubs see [[Wikipedia:Template messages/Stubs]].<br />
<br />
=== Hiding the edit links ===<br />
<br />
Insert '''<nowiki>__NOEDITSECTION__</nowiki>''' into the document to suppress the edit links that appear next to every section header.<br />
<br />
== See also ==<br />
*[[m:Help:Formula]]<br />
*[[m:Help:Editing|Mediawiki user's guide to editing]]<br />
*[[Wikipedia:MediaWiki]].<br />
*[[HTML element]].<br />
*[[Wikipedia:Protection policy]]<br />
<br />
== Using Mozilla Firefox ==<br />
<br />
There is an [https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&numpg=10&id=351 extension] available for Firefox, which may help you to edit a wiki page. This extension can be used for all wikis based on MediaWiki (e.g. for the wikipedia). If you use version 1.5 of Firefox, you will need the developer [http://wikipedia.mozdev.org version] of the extension. Update: The extension doesn't support Firefox 2.0 (not yet).<br />
<br />
If you have installed the extension a new toolbar will appear. This toolbar contains some icons to<br />
*format the text (e.g. bold)<br />
*insert a structure item (e.g. headlines)<br />
*insert a link (internal or external)<br />
*insert a picture<br />
The toolbar can be helpful escpecially for newbies, because it's not necessary to know the (complete) wiki syntax.<br />
<br />
If you want to change the settings for the toolbar, you have to go to the tools menu of Firefox. Then you must click on the settings button of the extension. On the view tab for example you can set, that the toolbar only appears, if the URL contains the word 'wiki'.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Help:Editing/ru&diff=55317
Help:Editing/ru
2012-02-06T06:08:59Z
<p>Kverde: </p>
<hr />
<div>{{Template:Help:Editing}}<br />
<br />
Редактировать страницы wiki очень просто. Просто нажмите кнопку "'''Edit'''" расположенную в верхней части страницы Wiki(или ссылку edit справа или внизу). Это привдет вас на страницу с текствым полем содержашим редактируемый текст этой страницы. ''''Если вы хотите поэксперементировать, пожалуйста, сделайте это в нашей [[Sand Box|песочнице]], а не сдесь. Вы можете открыть [[Sand Box|песочницу]] в отдельном окне или вкладке чтобы иметь возможность видеть одновременно этот текст и вашы тесты в песочнице.'''''<br />
<br />
Type away, write a short [[Wikipedia:Edit summary|edit summary]] on the small field below the edit-box. You may use shorthand to describe your changes, as described in the [[Wikipedia:Edit summary legend|legend]], and when you've finished, press [[Wikipedia:Show preview|preview]] to see how your changes will look. Then press "Save". Depending on your system, pressing "Enter" while the edit box is not active (when there is no typing cursor in it) may have the same effect as pressing the "Save" button. Also, please do not vandalise the information on {{ns:4}}.<br />
<br />
You can also click on the "'''Discussion'''" tab (or the "'''Discuss this page'''" link) to see the corresponding [[Wikipedia:Talk page|talk page]], which contains comments about the page from other Wikipedia users. Click on the "'''+'''" tab (or "'''Edit this page'''") to add a comment.<br />
<br />
== The wiki markup ==<br />
In the left column of the table below, you can see what effects are possible. In the right column, you can see how those effects were achieved. In other words, to make text look like it looks in the left column, type it in the format you see in the right column.<br />
<br />
You may want to keep this page open in a separate browser window for reference. If you want to try out things without danger of doing any harm, you can do so '''in the [[Sand_Box|sandbox]]'''.<br />
<br />
----<br />
<!--<br />
:'''The rest of this page is deprecated but will be updated periodically.''' <br />
:'''Please direct edits to the [[meta:MediaWiki User's Guide: Editing overview|Meta-Wikimedia version of this page]]'''<br />
<br />
--><br />
=== Sections, paragraphs, lists and lines ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
Start your [[Wikipedia:Manual of Style (headings)|sections]] as follows:<br />
<br />
<!-- The following code messes up the table of contents<br />
and makes the section edit links much less useful,<br />
so please do not use it.<br />
== New section ==<br />
=== Subsection ===<br />
==== Sub-subsection ====<br />
--><br />
<!-- The following should look almost the same, using<br />
HTML headings markup instead of wiki headings.<br />
However, it messes up the section edit links,<br />
so please do not use it.<br />
<h2>New section</h2><br />
<h3>Subsection</h3><br />
<h4>Sub-subsection</h4><br />
--><br />
<!-- The following just uses bolding and font changes,<br />
so it should be safe. However, it might not<br />
look exactly right, especially when people<br />
use non-standard CSS stylesheets.<br />
--><br />
'''<font style="font-size:120%">New section</font>'''<br />
<br />
'''<font style="font-size:110%">Subsection</font>'''<br />
<br />
'''<font style="font-size:100%">Sub-subsection</font>'''<br />
<br />
* Start with a second-level heading (<tt><nowiki>==</nowiki></tt>); do not use first-level headings (=).<br />
* Do not skip levels (e.g., second-level followed by fourth-level).<br />
* A [[#Placement_of_the_Table_of_Contents_.28TOC.29|Table of Contents]] will automatically be added to an article that has four or more sections. <br />
|<br />
<pre><nowiki><br />
== New section ==<br />
<br />
=== Subsection ===<br />
<br />
==== Sub-subsection ====<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A single [[newline]]<br />
generally has no effect on the layout.<br />
These can be used to separate<br />
sentences within a paragraph.<br />
Some editors find that this aids editing<br />
and improves the function ''diff'' <br />
(used internally to compare<br />
different versions of a page).<br />
<br />
But an empty line<br />
starts a new paragraph.<br />
<br />
* When used in a list, a newline ''does'' affect the layout ([[#lists|see below]]).<br />
|<br />
<pre><nowiki><br />
A single [[newline]]<br />
generally has no effect on the layout. <br />
These can be used to separate<br />
sentences within a paragraph.<br />
Some editors find that this aids editing<br />
and improves the function ''diff'' <br />
(used internally to compare<br />
different versions of a page).<br />
<br />
But an empty line<br />
starts a new paragraph.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can break lines<br><br />
without starting a new paragraph.<br />
<br />
* Please use this sparingly.<br />
* Close markup between lines, don't start a [[link]] or ''italics'' or '''bold''' on one line and close it on the next.<br />
|<br />
<pre><nowiki><br />
You can break lines<br><br />
without starting a new paragraph.<br />
</nowiki></pre><br />
|- id="lists" valign="top"<br />
|<br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
|<br />
<pre><nowiki><br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
|<br />
<pre><nowiki><br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
|<br />
<pre><nowiki><br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
<br />
* One item per line; a newline can appear before the colon, but using a space before the colon improves parsing.<br />
|<br />
<pre><nowiki><br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
<br />
* This is primarily for displayed material, but is also used for discussion on [[Wikipedia:Talk page|Talk page]]s.<br />
|<br />
<pre><nowiki><br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
<br />
*This is useful for:<br />
** pasting preformatted text;<br />
** algorithm descriptions;<br />
** program source code;<br />
** [[ASCII art]];<br />
** chemical structures;<br />
* '''WARNING''': If you make it wide, you [[page widening|force the whole page to be wide]] and hence less readable, especially for people who use lower resolutions. Never start ordinary lines with spaces.<br />
|<br />
<pre><nowiki><br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<center>Centered text.</center><br />
<br />
* Note the American spelling of "center" (not "centre").<br />
|<br />
<pre><nowiki><br />
<center>Centered text.</center><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
<br />
* Mainly useful for separating threads on Talk pages.<br />
* Also used to [[Wikipedia:Disambiguation|disambiguate]] within an article without creating a separate page.<br />
|<br />
<pre><nowiki><br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
</nowiki></pre><br />
|}<br />
<br />
=== Links and URLs ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
London has [[public transport]].<br />
<br />
* A link to another Wikipedia article.<br />
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).<br />
* Thus the link above is to the [[URL]] http://www.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also [[Wikipedia:Canonicalization]].<br />
|<br />
<pre><nowiki><br />
London has [[public transport]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
<br />
* Same target, different name.<br />
* This is a [[piped link]].<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
<br />
* Endings are blended into the link.<br />
* Preferred style is to use this instead of a piped link, if possible.<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
See the [[Wikipedia:Manual of Style]].<br />
<br />
* A link to another [[Wikipedia:namespace|namespace]].<br />
|<br />
<pre><nowiki><br />
See the [[Wikipedia:Manual of Style]].<br />
</nowiki></pre><br />
|- id="link-to-section" valign="top"<br />
|<br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
<br />
* The part after the number sign (#) must match a section heading on the page, or an identifier created in some other way. Matches must be exact in terms of spelling, case and punctuation. Links to non-existent sections aren't broken; they are treated as links to the top of the page.<br />
* Identifiers may be created by attaching an <code>id="..."></code> attribute to almost any HTML element.<br />
|<br />
<pre><nowiki><br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|kingdom]].<br />
<br />
Automatically hide namespace:<br />
[[Wikipedia:Village Pump|Village Pump]]. <br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|Manual of Style]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
<br />
* The server fills in the part after the pipe character (|) when you save the page. The next time you open the edit box you will see the expanded piped link. When [[Wikipedia:Show preview|preview]]ing your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to links to sections within the same page ([[#link-to-section|see previous entry]]).<br />
|<br />
<pre><nowiki><br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|]].<br />
<br />
Automatically hide namespace: <br />
[[Wikipedia:Village Pump|]].<br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[The weather in London]] is a page<br />
that doesn't exist yet.<br />
<br />
* You can create it by clicking on the link (but please don't do so with this particular link).<br />
* To create a new page: <br />
*# Create a link to it on some other (related) page.<br />
*# Save that page.<br />
*# Click on the link you just made. The new page will open for editing.<br />
* For more information, see [[Wikipedia:How to start a page|How to start a page]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].<br />
* Please do not create a new article without linking to it from at least one other article.<br />
|<br />
<pre><nowiki><br />
[[The weather in London]] is a page <br />
that doesn't exist yet.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[Wikipedia:How to edit a page]] is this page.<br />
<br />
* [[Self link]]s appear as bold text when the article is viewed.<br />
* Do not use this technique to make the article name bold in the first paragraph; see the [[Wikipedia:Manual of Style#Article names|Manual of Style]].<br />
|<br />
<pre><nowiki><br />
[[Wikipedia:How to edit a page]] is this page.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: [[User:Brockert|Ben Brockert]]<br />
or four to add user name plus date/time:<br />
: [[User:Brockert|Ben Brockert]] 00:18, Nov 19, 2004 (UTC)<br />
Five tildes gives the date/time alone:<br />
: 00:18, Nov 19, 2004 (UTC)<br />
<br />
* The first two both provide a link to your [[Wikipedia:user page|user page]].<br />
|<br />
<pre><nowiki><br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: ~~~<br />
or four for user name plus date/time:<br />
: ~~~~<br />
Five tildes gives the date/time alone:<br />
: ~~~~~<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[USA]]").<br />
* Note that, while it is possible to link to a section, it is not possible to redirect to a section. For example, "<nowiki>#REDIRECT [[United States#History]]</nowiki>" will redirect to the [[United States]] page, but not to any particular section on it. This feature '''will not''' be implemented in the future, so such redirects should not be used.<br />
|<br />
<pre><nowiki><br />
#REDIRECT [[United States]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Link to a page on the same subject in another language by using a link of the form: <nowiki>[[language code:Title]]</nowiki>.<br />
* It does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
* Please see [[Wikipedia:Interlanguage links]] and the [[Wikipedia:Complete list of language wikis available|list of languages and codes]].<br />
|<br />
<pre><nowiki><br />
[[fr:Wikipédia:Aide]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
<br />
|<br />
<pre><nowiki><br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
|<br />
<pre><nowiki><br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To put an article in a [[Wikipedia:Category]], place a link like the one to the right anywhere in the article. As with interlanguage links, it does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
|<br />
<pre><nowiki><br />
[[Category:Character sets]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To ''link'' to a [[Wikipedia:Category]] page without putting the article into the category, use an initial colon (:) in the link.<br />
|<br />
<pre><nowiki><br />
[[:Category:Character sets]]<br />
</nowiki></pre><br />
|- id="link-external" valign="top"<br />
|<br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/ (bad style)<br />
# Unnamed link: [http://www.nupedia.com/] (bad style)<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
<br />
:See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts.<br />
<br />
* Square brackets indicate an external link. Note the use of a ''space'' (not a pipe) to separate the URL from the link text in the "named" version.<br />
* In the [[URL]], all symbols must be among:<br/>'''A-Z a-z 0-9 . _ \ / ~ % - + &amp; # ? ! = ( ) @ \x80-\xFF'''<br />
* If a URL contains a character not in this list, it should be encoded by using a percent sign (%) followed by the [[hexadecimal|hex]] code of the character, which can be found in the table of [[ASCII#ASCII printable characters|ASCII printable characters]]. For example, the caret character (^) would be encoded in a URL as '''%5E'''.<br />
* See [[Wikipedia:External links]] for style issues.<br />
|<br />
<pre><nowiki><br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/<br />
# Unnamed link: [http://www.nupedia.com/]<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|Hello]]<br />
<br />
* All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello<br />
* Note that interwiki links use the ''internal'' link style.<br />
* See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts; if the site you want to link to isn't on the list, use an external link ([[#link-external|see above]]).<br />
* See also [[Wikipedia:How to link to Wikimedia projects]].<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|fr:Bonjour]]<br />
<br />
* All of these forms lead to the URL http://fr.wiktionary.org/wiki/Bonjour<br />
|<br />
<pre><nowiki><br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|]]<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
<br />
* Link to books using their [[Wikipedia:ISBN|ISBN]] numbers. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors.<br />
* ISBN links do not need any extra markup, provided you use one of the indicated formats.<br />
|<br />
<pre><nowiki><br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
<br />
* Link dates in one of the above formats, so that everyone can set their own display order. If [[Special:Userlogin|logged in]], you can use [[Special:Preferences]] to change your own date display setting.<br />
* All of the above dates will appear as "[[20 July|20 July]] [[1969|1969]]" if you set your date display preference to "15 January 2001", but as "[[20 July|July 20]], [[1969|1969]]" if you set it to "January 15, 2001".<br />
|<br />
<pre><nowiki><br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[media:Sg_mrob.ogg|Sound]]<br />
<br />
*To include links to non-image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].<br />
<br />
Some uploaded sounds are listed at [[Wikipedia:Sound]].<br />
|<br />
<pre><nowiki><br />
[[media:Sg_mrob.ogg|Sound]]<br />
</nowiki></pre><br />
|}<br />
<br />
=== Images ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
| A picture: [[Image:Wiki.png]]<br />
<br />
or, with alternative text:<br />
[[Image:Wiki.png|jigsaw globe]]<br />
<br />
or, floating to the right side of the page and with a caption:<br />
[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
[[Image:Wiki.png|right|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
* Only images that have been uploaded to Wikipedia can be used. To upload images, use the [[Special:Upload|upload page]]. You can find the uploaded image on the [[Special:Imagelist|image list]].<br />
* See the [[Wikipedia:Image use policy|image use policy]], [[Wikipedia:Image markup|extended image markup/syntax]] (also possibly [[Wikipedia:Image markup with HTML|image HTML markup]]) for more hints.<br />
* Alternative text, used when the image isn't loaded, in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternate text for images|Alternate text for images]] for help on choosing it.<br />
* The frame tag automatically floats the image right.<br />
| <pre><nowiki><br />
A picture: [[Image:Wiki.png]]</nowiki><br />
<br />
or, with alternative text:<br />
<nowiki>[[Image:Wiki.png|jigsaw globe]]</nowiki><br />
<br />
or, floating to the right side of the page and with a caption:<br />
<nowiki>[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]</nowiki><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
<nowiki>[[Image:Wiki.png|right|Wikipedia Encyclopedia]]</nowiki></pre><br />
|-<br />
|<br />
Clicking on an uploaded image displays a description page, which you can also link directly to: [[:Image:Wiki.png]]<br />
| <pre><nowiki><br />
<br />
[[:Image:Wiki.png]]<br />
</nowiki></pre><br />
|-<br />
|<br />
To include links to images shown as links instead of drawn on the page, use a "media" link.<br />
<br />
<br/>[[media:Tornado.jpg|Image of a Tornado]]<br />
|<br />
<pre><br />
<nowiki><br />
<br />
[[media:Tornado.jpg|Image of a Tornado]]<br />
<br />
</nowiki></pre><br />
|}<br />
<br />
=== Character formatting ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|- valign="top"<br />
! What it looks like<br />
! What you type<br />
|- id="emph" valign="top"<br />
|<br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
* These are double and triple apostrophes (single-quote marks), not double-quote marks.<br />
|<br />
<pre><nowiki><br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<math>\sin x + \ln y</math><br><br />
sin''x'' + ln''y''<br />
<!-- no space between roman "sin" and italic "x" --><br />
<br />
<math>\mathbf{x} = 0</math><br><br />
'''x''' = 0<br />
<br />
Ordinary text should use [[#emph|wiki markup for emphasis]], and should not use <code>&lt;i&gt;</code> or <code>&lt;b&gt;</code>. However, mathematical formulas often use italics, and sometimes use bold, for reasons unrelated to emphasis. Complex formulas should use [[m:Help:Formula|<code>&lt;math&gt;</code> markup]], and simple formulas may use <code>&lt;math&gt;</code>; or <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>; or <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code>. According to [[Wikipedia:WikiProject Mathematics#Italicization and bolding|WikiProject Mathematics]], wiki markup is preferred over HTML markup like <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>.<br />
|<br />
<pre><nowiki><br />
<math>\sin x + \ln y</math><br />
sin''x'' + ln''y''<br />
<br />
<math>\mathbf{x} = 0</math><br />
'''x''' = 0<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
<br />
* For semantic reasons, using <code>&lt;code&gt;</code> where applicable is preferable to using <code>&lt;tt&gt;</code>.<br />
|<br />
<pre><nowiki><br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can use <small>small text</small> for captions.<br />
|<br />
<pre><nowiki><br />
You can use <small>small text</small> for captions.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
<br />
* When editing regular Wikipedia articles, just make your changes and don't mark them up in any special way.<br />
* When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.<br />
|<br />
<pre><nowiki><br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Diacritical marks:'''<br />
<br/><br />
è é ê ë ì í<br />
<br />
À Á Â Ã Ä Å <br/><br />
Æ Ç È É Ê Ë <br/><br />
Ì Í<br />
Î Ï Ñ Ò <br/><br />
Ó Ô Õ<br />
Ö Ø Ù <br/><br />
Ú Û Ü ß<br />
à á <br/><br />
â ã ä å æ<br />
ç <br/><br />
è é ê ë ì í<br/><br />
î ï ñ ò ó ô <br/><br />
&oelig; õ<br />
ö ø ù ú <br/><br />
û ü ÿ<br />
<br />
* See [[meta:Help:Special characters|special characters]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
è é ê ë ì í<br />
<br />
&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; <br />
&amp;AElig; &amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml; <br />
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde; &amp;Ograve; <br />
&amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;Ugrave; <br />
&amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;szlig; &amp;agrave; &amp;aacute; <br />
&amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil; <br />
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml; &amp;igrave; &amp;iacute;<br />
&amp;icirc; &amp;iuml; &amp;ntilde; &amp;ograve; &amp;oacute; &amp;ocirc; <br />
&amp;oelig; &amp;otilde; &amp;ouml; &amp;oslash; &amp;ugrave; &amp;uacute; <br />
&amp;ucirc; &amp;uuml; &amp;yuml;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Punctuation:'''<br />
<br/><br />
¿ ¡ § ¶<br/><br />
&dagger; &Dagger; &bull; &ndash; &mdash;<br/><br />
&lsaquo; &rsaquo; « »<br/><br />
&lsquo; &rsquo; &ldquo; &rdquo;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;<br />
&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;<br />
&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;<br />
&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commercial symbols:'''<br />
<br/><br />
&trade; © ® ¢ &euro; ¥<br/><br />
£ ¤<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;trade; &amp;copy; &amp;reg; &amp;cent; &amp;euro; &amp;yen; <br />
&amp;pound; &amp;curren;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Subscripts:'''<br />
<br/><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
<br />
'''Superscripts:'''<br />
<br/><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&sup1; x&sup2; x&sup3;<br />
*The latter method of superscripting can't be used in the most general context, but is preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.<br />
<br />
&epsilon;<sub>0</sub> =<br />
8.85 &times; 10<sup>&minus;12</sup><br />
C&sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&sup2;]]<br />
|<br />
<br/><br />
<pre><nowiki><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
</nowiki></pre><br />
<br />
<pre><nowiki><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&amp;sup1; x&amp;sup2; x&amp;sup3;<br />
<br />
&amp;epsilon;<sub>0</sub> =<br />
8.85 &amp;times; 10<sup>&amp;minus;12</sup><br />
C&amp;sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&amp;sup2;]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Greek characters:'''<br />
<br/><br />
&alpha; &beta; &gamma; &delta; &epsilon; &zeta;<br/><br />
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu;<br/><br />
&xi; &omicron; &pi; &rho; &sigma; &sigmaf;<br/><br />
&tau; &upsilon; &phi; &chi; &psi; &omega;<br/><br />
&Gamma; &Delta; &Theta; &Lambda; &Xi; &Pi;<br/><br />
&Sigma; &Phi; &Psi; &Omega;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; <br />
&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu; <br />
&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;<br />
&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;<br />
&amp;Gamma; &amp;Delta; &amp;Theta; &amp;Lambda; &amp;Xi; &amp;Pi; <br />
&amp;Sigma; &amp;Phi; &amp;Psi; &amp;Omega;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Math characters:'''<br />
<br/><br />
&int; &sum; &prod; &radic; &minus; &plusmn; &infin;<br/><br />
&asymp; &prop; &equiv; &ne; &le; &ge; &rarr;<br/><br />
&times; &middot; &divide; &part; &prime; &Prime;<br/><br />
&nabla; &permil; &deg; &there4; &alefsym; &oslash;<br/><br />
&isin; &notin; &cap; &cup; &sub; &sup; &sube; &supe;<br/><br />
&not; &and; &or; &exist; &forall; &rArr; &hArr;<br/><br />
&rarr; &harr;<br/><br />
* See also [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;int; &amp;sum; &amp;prod; &amp;radic; &amp;minus; &amp;plusmn; &amp;infin;<br />
&amp;asymp; &amp;prop; &amp;equiv; &amp;ne; &amp;le; &amp;ge; &amp;rarr;<br />
&amp;times; &amp;middot; &amp;divide; &amp;part; &amp;prime; &amp;Prime;<br />
&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym; &amp;oslash;<br />
&amp;isin; &amp;notin; &amp;cap; &amp;cup; &amp;sub; &amp;sup; &amp;sube; &amp;supe;<br />
&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall; &amp;rArr; &amp;hArr;<br />
&amp;rarr; &amp;harr;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Spacing in simple math formulas:'''<br />
<br/><br />
Obviously, ''x''&sup2;&nbsp;&ge;&nbsp;0 is true.<br />
*To space things out without allowing line breaks to interrupt the formula, use non-breaking spaces: <tt>&amp;nbsp;</tt>.<br />
|<br />
<br/><br />
<pre><nowiki><br />
Obviously, ''x''&amp;sup2;&amp;nbsp;&amp;ge;&amp;nbsp;0 is true.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Complicated formulas:'''<br />
<br/><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
* See [[m:Help:Formula]] for how to use <tt>&lt;math></tt>.<br />
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.<br />
|<br />
<br/><br />
<pre><nowiki><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Suppressing interpretation of markup:'''<br />
<br/><br />
<nowiki>Link &rarr; (''to'') the [[Wikipedia FAQ]]</nowiki><br />
* Used to show literal data that would otherwise have special meaning.<br />
* Escape all wiki markup, including that which looks like HTML tags.<br />
* Does not escape HTML character references.<br />
* To escape HTML character references such as <tt>&amp;rarr;</tt> use <tt>&amp;amp;rarr;</tt><br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;nowiki>Link &amp;rarr; (''to'') <br />
the [[Wikipedia FAQ]]&lt;/nowiki><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commenting page source:'''<br />
<br/><br />
''not shown when viewing page''<br />
* Used to leave comments in a page for future editors.<br />
* Note that most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;!-- comment here --><br />
</nowiki></pre><br />
|}<br />
''(see also: [[Chess symbols in Unicode]])''<br />
<br />
=== Tables ===<br />
==== Placement of the Table of Contents (TOC) ====<br />
At the current status of the wiki markup language, having at least four headers on a page triggers the TOC to appear in front of the first header (or after introductory sections). Putting <nowiki>__TOC__</nowiki> anywhere forces the TOC to appear at that point (instead of just before the first header). Putting <nowiki>__NOTOC__</nowiki> anywhere forces the TOC to disappear. See also [[Wikipedia:Section#Compact_TOC|compact TOC]] for alphabet and year headings.<br />
<br />
==== Keeping headings out of the Table of Contents ====<br />
<br />
If you want some subheadings to not appear in the Table of Contents, then make the following replacements.<br />
<br />
Replace <nowiki> == Header 2 == with <h2> Header 2 </h2> </nowiki><br />
<br />
Replace <nowiki> === Header 3 === with <h3> Header 3 </h3> </nowiki><br />
<br />
And so forth.<br />
<br />
For example, notice that the following header has the same font as the other subheaders to this "Tables" section, but the following header does not appear in the Table of Contents for this page.<br />
<br />
<h4> This header has the h4 font, but is NOT in the Table of Contents </h4><br />
<br />
This effect is obtained by the following line of code.<br />
<br />
<nowiki><h4> This header has the h4 font, but is NOT in the Table of Contents </h4></nowiki><br />
<br />
<br />
==== Tables ====<br />
There are two ways to build tables: <br />
*in special Wiki-markup (see [[m:Help:Table]])<br />
*with the usual HTML elements: &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; or &lt;th&gt;.<br />
<br />
For the latter, and a discussion on when tables are appropriate, see [[Wikipedia:How to use tables]].<br />
<br />
=== Variables ===<br />
<br />
''(See also [[m:Help:Variable]])''<br />
{|<br />
|-<br />
! Code<br />
! Effect<br />
|-<br />
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAME}}</nowiki><br />
| {{CURRENTMONTHNAME}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki><br />
| {{CURRENTMONTHNAMEGEN}}<br />
|-<br />
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}<br />
|-<br />
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}<br />
|-<br />
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}<br />
|-<br />
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}<br />
|-<br />
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br />
| {{NUMBEROFARTICLES}}<br />
|-<br />
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}<br />
|-<br />
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}<br />
|-<br />
| <nowiki>{{localurl:pagename}}</nowiki><br />
| {{localurl:pagename}}<br />
|-<br />
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki><br />
| {{localurl:Wikipedia:Sandbox|action=edit}}<br />
|-<br />
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}<br />
|-<br />
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}<br />
|-<br />
| <nowiki>{{ns:2}}</nowiki> || {{ns:2}}<br />
|-<br />
| <nowiki>{{ns:3}}</nowiki> || {{ns:3}}<br />
|-<br />
| <nowiki>{{ns:4}}</nowiki> || {{ns:4}}<br />
|-<br />
| <nowiki>{{ns:5}}</nowiki> || {{ns:5}}<br />
|-<br />
| <nowiki>{{ns:6}}</nowiki> || {{ns:6}}<br />
|-<br />
| <nowiki>{{ns:7}}</nowiki> || {{ns:7}}<br />
|-<br />
| <nowiki>{{ns:8}}</nowiki> || {{ns:8}}<br />
|-<br />
| <nowiki>{{ns:9}}</nowiki> || {{ns:9}}<br />
|-<br />
| <nowiki>{{ns:10}}</nowiki> || {{ns:10}}<br />
|-<br />
| <nowiki>{{ns:11}}</nowiki> || {{ns:11}}<br />
|-<br />
| <nowiki>{{ns:12}}</nowiki> || {{ns:12}}<br />
|-<br />
| <nowiki>{{ns:13}}</nowiki> || {{ns:13}}<br />
|-<br />
| <nowiki>{{ns:14}}</nowiki> || {{ns:14}}<br />
|-<br />
| <nowiki>{{ns:15}}</nowiki> || {{ns:15}}<br />
|-<br />
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}<br />
|}<br />
<br />
'''NUMBEROFARTICLES''' is the number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.<br />
<br />
=== Templates ===<br />
<br />
The [[Wikipedia:MediaWiki|MediaWiki]] software used by Wikipedia has limited support for template inclusion. This means standardized text chunks (such as boilerplate text) can be inserted into articles. For example, typing <nowiki>{{stub}}</nowiki> will appear as "''This article is a [[Wikipedia:The perfect stub article|stub]]. You can help Wikipedia by [[Wikipedia:Find or fix a stub|expanding it]].''" when the page is saved. See [[Wikipedia:Template messages]] for the complete list. Other commonly used ones are: <nowiki>{{disambig}}</nowiki> for disambiguation pages, <nowiki>{{spoiler}}</nowiki> for spoiler warnings and <nowiki>{{sectstub}}</nowiki> like an article stub but for a section. The are many subject-specific stubs e.g.: <nowiki> {{Geo-stub}}, {{Hist-stub}} and {{Linux-stub}}</nowiki>. For a complete list of stubs see [[Wikipedia:Template messages/Stubs]].<br />
<br />
=== Hiding the edit links ===<br />
<br />
Insert '''<nowiki>__NOEDITSECTION__</nowiki>''' into the document to suppress the edit links that appear next to every section header.<br />
<br />
== See also ==<br />
*[[m:Help:Formula]]<br />
*[[m:Help:Editing|Mediawiki user's guide to editing]]<br />
*[[Wikipedia:MediaWiki]].<br />
*[[HTML element]].<br />
*[[Wikipedia:Protection policy]]<br />
<br />
== Using Mozilla Firefox ==<br />
<br />
There is an [https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&numpg=10&id=351 extension] available for Firefox, which may help you to edit a wiki page. This extension can be used for all wikis based on MediaWiki (e.g. for the wikipedia). If you use version 1.5 of Firefox, you will need the developer [http://wikipedia.mozdev.org version] of the extension. Update: The extension doesn't support Firefox 2.0 (not yet).<br />
<br />
If you have installed the extension a new toolbar will appear. This toolbar contains some icons to<br />
*format the text (e.g. bold)<br />
*insert a structure item (e.g. headlines)<br />
*insert a link (internal or external)<br />
*insert a picture<br />
The toolbar can be helpful escpecially for newbies, because it's not necessary to know the (complete) wiki syntax.<br />
<br />
If you want to change the settings for the toolbar, you have to go to the tools menu of Firefox. Then you must click on the settings button of the extension. On the view tab for example you can set, that the toolbar only appears, if the URL contains the word 'wiki'.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Help:Editing/ru&diff=55316
Help:Editing/ru
2012-02-06T05:58:09Z
<p>Kverde: New page: {{Template:Help:Editing}} Editing a Wiki page is very easy. Simply click on the "'''Edit'''" tab at the top (or the edit link on the right or bottom) of a Wiki page. This will bring you t...</p>
<hr />
<div>{{Template:Help:Editing}}<br />
<br />
Editing a Wiki page is very easy. Simply click on the "'''Edit'''" tab at the top (or the edit link on the right or bottom) of a Wiki page. This will bring you to a page with a text box containing the editable text of that page. '''''If you want to experiment, please do so in our [[Sand Box|sandbox]], not here. You could open the [[Sand Box|sandbox]] in a separate window or tab to be able to see both this text and your tests in the sandbox.'''''<br />
<br />
Type away, write a short [[Wikipedia:Edit summary|edit summary]] on the small field below the edit-box. You may use shorthand to describe your changes, as described in the [[Wikipedia:Edit summary legend|legend]], and when you've finished, press [[Wikipedia:Show preview|preview]] to see how your changes will look. Then press "Save". Depending on your system, pressing "Enter" while the edit box is not active (when there is no typing cursor in it) may have the same effect as pressing the "Save" button. Also, please do not vandalise the information on {{ns:4}}.<br />
<br />
You can also click on the "'''Discussion'''" tab (or the "'''Discuss this page'''" link) to see the corresponding [[Wikipedia:Talk page|talk page]], which contains comments about the page from other Wikipedia users. Click on the "'''+'''" tab (or "'''Edit this page'''") to add a comment.<br />
<br />
== The wiki markup ==<br />
In the left column of the table below, you can see what effects are possible. In the right column, you can see how those effects were achieved. In other words, to make text look like it looks in the left column, type it in the format you see in the right column.<br />
<br />
You may want to keep this page open in a separate browser window for reference. If you want to try out things without danger of doing any harm, you can do so '''in the [[Sand_Box|sandbox]]'''.<br />
<br />
----<br />
<!--<br />
:'''The rest of this page is deprecated but will be updated periodically.''' <br />
:'''Please direct edits to the [[meta:MediaWiki User's Guide: Editing overview|Meta-Wikimedia version of this page]]'''<br />
<br />
--><br />
=== Sections, paragraphs, lists and lines ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
Start your [[Wikipedia:Manual of Style (headings)|sections]] as follows:<br />
<br />
<!-- The following code messes up the table of contents<br />
and makes the section edit links much less useful,<br />
so please do not use it.<br />
== New section ==<br />
=== Subsection ===<br />
==== Sub-subsection ====<br />
--><br />
<!-- The following should look almost the same, using<br />
HTML headings markup instead of wiki headings.<br />
However, it messes up the section edit links,<br />
so please do not use it.<br />
<h2>New section</h2><br />
<h3>Subsection</h3><br />
<h4>Sub-subsection</h4><br />
--><br />
<!-- The following just uses bolding and font changes,<br />
so it should be safe. However, it might not<br />
look exactly right, especially when people<br />
use non-standard CSS stylesheets.<br />
--><br />
'''<font style="font-size:120%">New section</font>'''<br />
<br />
'''<font style="font-size:110%">Subsection</font>'''<br />
<br />
'''<font style="font-size:100%">Sub-subsection</font>'''<br />
<br />
* Start with a second-level heading (<tt><nowiki>==</nowiki></tt>); do not use first-level headings (=).<br />
* Do not skip levels (e.g., second-level followed by fourth-level).<br />
* A [[#Placement_of_the_Table_of_Contents_.28TOC.29|Table of Contents]] will automatically be added to an article that has four or more sections. <br />
|<br />
<pre><nowiki><br />
== New section ==<br />
<br />
=== Subsection ===<br />
<br />
==== Sub-subsection ====<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A single [[newline]]<br />
generally has no effect on the layout.<br />
These can be used to separate<br />
sentences within a paragraph.<br />
Some editors find that this aids editing<br />
and improves the function ''diff'' <br />
(used internally to compare<br />
different versions of a page).<br />
<br />
But an empty line<br />
starts a new paragraph.<br />
<br />
* When used in a list, a newline ''does'' affect the layout ([[#lists|see below]]).<br />
|<br />
<pre><nowiki><br />
A single [[newline]]<br />
generally has no effect on the layout. <br />
These can be used to separate<br />
sentences within a paragraph.<br />
Some editors find that this aids editing<br />
and improves the function ''diff'' <br />
(used internally to compare<br />
different versions of a page).<br />
<br />
But an empty line<br />
starts a new paragraph.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can break lines<br><br />
without starting a new paragraph.<br />
<br />
* Please use this sparingly.<br />
* Close markup between lines, don't start a [[link]] or ''italics'' or '''bold''' on one line and close it on the next.<br />
|<br />
<pre><nowiki><br />
You can break lines<br><br />
without starting a new paragraph.<br />
</nowiki></pre><br />
|- id="lists" valign="top"<br />
|<br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
|<br />
<pre><nowiki><br />
* Lists are easy to do:<br />
** Start every line with a star.<br />
*** More stars means deeper levels.<br />
**** A newline in a list<br />
marks the end of a list item.<br />
<br />
* An empty line starts a new list.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
|<br />
<pre><nowiki><br />
# Numbered lists are also good<br />
## very organized<br />
## easy to follow<br />
### easier still<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
|<br />
<pre><nowiki><br />
* You can even do mixed lists<br />
*# and nest them<br />
*#* like this<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
<br />
* One item per line; a newline can appear before the colon, but using a space before the colon improves parsing.<br />
|<br />
<pre><nowiki><br />
; Definition list : list of definitions<br />
; item : the item's definition<br />
; another item<br />
: the other item's definition<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
<br />
* This is primarily for displayed material, but is also used for discussion on [[Wikipedia:Talk page|Talk page]]s.<br />
|<br />
<pre><nowiki><br />
: A colon indents a line or paragraph.<br />
A manual newline starts a new paragraph.<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
<br />
*This is useful for:<br />
** pasting preformatted text;<br />
** algorithm descriptions;<br />
** program source code;<br />
** [[ASCII art]];<br />
** chemical structures;<br />
* '''WARNING''': If you make it wide, you [[page widening|force the whole page to be wide]] and hence less readable, especially for people who use lower resolutions. Never start ordinary lines with spaces.<br />
|<br />
<pre><nowiki><br />
IF a line starts with a space THEN<br />
it will be formatted exactly<br />
as typed;<br />
in a fixed-width font;<br />
lines won't wrap;<br />
ENDIF<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<center>Centered text.</center><br />
<br />
* Note the American spelling of "center" (not "centre").<br />
|<br />
<pre><nowiki><br />
<center>Centered text.</center><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
<br />
* Mainly useful for separating threads on Talk pages.<br />
* Also used to [[Wikipedia:Disambiguation|disambiguate]] within an article without creating a separate page.<br />
|<br />
<pre><nowiki><br />
A [[horizontal dividing line]]:<br />
this is above it<br />
----<br />
and this is below it.<br />
</nowiki></pre><br />
|}<br />
<br />
=== Links and URLs ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
|<br />
London has [[public transport]].<br />
<br />
* A link to another Wikipedia article.<br />
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).<br />
* Thus the link above is to the [[URL]] http://www.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also [[Wikipedia:Canonicalization]].<br />
|<br />
<pre><nowiki><br />
London has [[public transport]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
<br />
* Same target, different name.<br />
* This is a [[piped link]].<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport|public transportation]].<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
<br />
* Endings are blended into the link.<br />
* Preferred style is to use this instead of a piped link, if possible.<br />
|<br />
<pre><nowiki><br />
San Francisco also has<br />
[[public transport]]ation.<br />
<br />
Examples include [[bus]]es, [[taxi]]s<br />
and [[streetcar]]s.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
See the [[Wikipedia:Manual of Style]].<br />
<br />
* A link to another [[Wikipedia:namespace|namespace]].<br />
|<br />
<pre><nowiki><br />
See the [[Wikipedia:Manual of Style]].<br />
</nowiki></pre><br />
|- id="link-to-section" valign="top"<br />
|<br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
<br />
* The part after the number sign (#) must match a section heading on the page, or an identifier created in some other way. Matches must be exact in terms of spelling, case and punctuation. Links to non-existent sections aren't broken; they are treated as links to the top of the page.<br />
* Identifiers may be created by attaching an <code>id="..."></code> attribute to almost any HTML element.<br />
|<br />
<pre><nowiki><br />
[[Economics#See also]] is a link<br />
to a section within another page.<br />
<br />
[[#Links and URLs]] is a link<br />
to a section on the current page.<br />
<br />
[[#example]] is a link to an<br />
anchor that was created using<br />
<div id="example">an id attribute</div><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|kingdom]].<br />
<br />
Automatically hide namespace:<br />
[[Wikipedia:Village Pump|Village Pump]]. <br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|Manual of Style]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
<br />
* The server fills in the part after the pipe character (|) when you save the page. The next time you open the edit box you will see the expanded piped link. When [[Wikipedia:Show preview|preview]]ing your edits, you will not see the expanded form until you press '''Save''' and '''Edit''' again. The same applies to links to sections within the same page ([[#link-to-section|see previous entry]]).<br />
|<br />
<pre><nowiki><br />
Automatically hide stuff in parentheses:<br />
[[kingdom (biology)|]].<br />
<br />
Automatically hide namespace: <br />
[[Wikipedia:Village Pump|]].<br />
<br />
Or both:<br />
[[Wikipedia:Manual of Style (headings)|]]<br />
<br />
But not:<br />
[[Wikipedia:Manual of Style#Links|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[The weather in London]] is a page<br />
that doesn't exist yet.<br />
<br />
* You can create it by clicking on the link (but please don't do so with this particular link).<br />
* To create a new page: <br />
*# Create a link to it on some other (related) page.<br />
*# Save that page.<br />
*# Click on the link you just made. The new page will open for editing.<br />
* For more information, see [[Wikipedia:How to start a page|How to start a page]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].<br />
* Please do not create a new article without linking to it from at least one other article.<br />
|<br />
<pre><nowiki><br />
[[The weather in London]] is a page <br />
that doesn't exist yet.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[Wikipedia:How to edit a page]] is this page.<br />
<br />
* [[Self link]]s appear as bold text when the article is viewed.<br />
* Do not use this technique to make the article name bold in the first paragraph; see the [[Wikipedia:Manual of Style#Article names|Manual of Style]].<br />
|<br />
<pre><nowiki><br />
[[Wikipedia:How to edit a page]] is this page.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: [[User:Brockert|Ben Brockert]]<br />
or four to add user name plus date/time:<br />
: [[User:Brockert|Ben Brockert]] 00:18, Nov 19, 2004 (UTC)<br />
Five tildes gives the date/time alone:<br />
: 00:18, Nov 19, 2004 (UTC)<br />
<br />
* The first two both provide a link to your [[Wikipedia:user page|user page]].<br />
|<br />
<pre><nowiki><br />
When adding a comment to a Talk page,<br />
you should sign it by adding<br />
three tildes to add your user name:<br />
: ~~~<br />
or four for user name plus date/time:<br />
: ~~~~<br />
Five tildes gives the date/time alone:<br />
: ~~~~~<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* [[Wikipedia:Redirect|Redirect]] one article title to another by placing a directive like the one shown to the right on the ''first'' line of the article (such as at a page titled "[[USA]]").<br />
* Note that, while it is possible to link to a section, it is not possible to redirect to a section. For example, "<nowiki>#REDIRECT [[United States#History]]</nowiki>" will redirect to the [[United States]] page, but not to any particular section on it. This feature '''will not''' be implemented in the future, so such redirects should not be used.<br />
|<br />
<pre><nowiki><br />
#REDIRECT [[United States]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* Link to a page on the same subject in another language by using a link of the form: <nowiki>[[language code:Title]]</nowiki>.<br />
* It does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
* Please see [[Wikipedia:Interlanguage links]] and the [[Wikipedia:Complete list of language wikis available|list of languages and codes]].<br />
|<br />
<pre><nowiki><br />
[[fr:Wikipédia:Aide]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
<br />
|<br />
<pre><nowiki><br />
'''What links here''' and '''Related changes'''<br />
pages can be linked as:<br />
[[Special:Whatlinkshere/Wikipedia:How to edit a page]]<br />
and<br />
[[Special:Recentchangeslinked/Wikipedia:How to edit a page]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
|<br />
<pre><nowiki><br />
A user's '''Contributions''' page can be linked as:<br />
[[Special:Contributions/UserName]]<br />
or<br />
[[Special:Contributions/192.0.2.0]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To put an article in a [[Wikipedia:Category]], place a link like the one to the right anywhere in the article. As with interlanguage links, it does not matter where you put these links while editing as they will always show up in the same place when you save the page, but placement at the end of the edit box is recommended.<br />
|<br />
<pre><nowiki><br />
[[Category:Character sets]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
* To ''link'' to a [[Wikipedia:Category]] page without putting the article into the category, use an initial colon (:) in the link.<br />
|<br />
<pre><nowiki><br />
[[:Category:Character sets]]<br />
</nowiki></pre><br />
|- id="link-external" valign="top"<br />
|<br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/ (bad style)<br />
# Unnamed link: [http://www.nupedia.com/] (bad style)<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
<br />
:See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts.<br />
<br />
* Square brackets indicate an external link. Note the use of a ''space'' (not a pipe) to separate the URL from the link text in the "named" version.<br />
* In the [[URL]], all symbols must be among:<br/>'''A-Z a-z 0-9 . _ \ / ~ % - + &amp; # ? ! = ( ) @ \x80-\xFF'''<br />
* If a URL contains a character not in this list, it should be encoded by using a percent sign (%) followed by the [[hexadecimal|hex]] code of the character, which can be found in the table of [[ASCII#ASCII printable characters|ASCII printable characters]]. For example, the caret character (^) would be encoded in a URL as '''%5E'''.<br />
* See [[Wikipedia:External links]] for style issues.<br />
|<br />
<pre><nowiki><br />
Three ways to link to external (non-wiki) sources:<br />
# Bare URL: http://www.nupedia.com/<br />
# Unnamed link: [http://www.nupedia.com/]<br />
# Named link: [http://www.nupedia.com Nupedia]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|Hello]]<br />
<br />
* All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello<br />
* Note that interwiki links use the ''internal'' link style.<br />
* See [[MetaWikiPedia:Interwiki_map]] for the list of shortcuts; if the site you want to link to isn't on the list, use an external link ([[#link-external|see above]]).<br />
* See also [[Wikipedia:How to link to Wikimedia projects]].<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|fr:Bonjour]]<br />
<br />
* All of these forms lead to the URL http://fr.wiktionary.org/wiki/Bonjour<br />
|<br />
<pre><nowiki><br />
Linking to other wikis:<br />
# [[Interwiki]] link: [[Wiktionary:Hello]]<br />
# Named interwiki link: [[Wiktionary:Hello|Hello]]<br />
# Interwiki link without prefix: [[Wiktionary:Hello|]]<br />
<br />
Linking to another language's wiktionary:<br />
# [[Wiktionary:fr:Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|Bonjour]]<br />
# [[Wiktionary:fr:Bonjour|]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
<br />
* Link to books using their [[Wikipedia:ISBN|ISBN]] numbers. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors.<br />
* ISBN links do not need any extra markup, provided you use one of the indicated formats.<br />
|<br />
<pre><nowiki><br />
ISBN 012345678X<br />
<br />
ISBN 0-123-45678-X<br />
</nowiki></pre><br />
|- valign=top<br />
|<br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
<br />
* Link dates in one of the above formats, so that everyone can set their own display order. If [[Special:Userlogin|logged in]], you can use [[Special:Preferences]] to change your own date display setting.<br />
* All of the above dates will appear as "[[20 July|20 July]] [[1969|1969]]" if you set your date display preference to "15 January 2001", but as "[[20 July|July 20]], [[1969|1969]]" if you set it to "January 15, 2001".<br />
|<br />
<pre><nowiki><br />
Date formats:<br />
# [[July 20]], [[1969]]<br />
# [[20 July]] [[1969]]<br />
# [[1969]]-[[07-20]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
[[media:Sg_mrob.ogg|Sound]]<br />
<br />
*To include links to non-image uploads such as sounds, use a "media" link. For images, [[#Images|see next section]].<br />
<br />
Some uploaded sounds are listed at [[Wikipedia:Sound]].<br />
|<br />
<pre><nowiki><br />
[[media:Sg_mrob.ogg|Sound]]<br />
</nowiki></pre><br />
|}<br />
<br />
=== Images ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|-<br />
! What it looks like<br />
! What you type<br />
|- valign="top"<br />
| A picture: [[Image:Wiki.png]]<br />
<br />
or, with alternative text:<br />
[[Image:Wiki.png|jigsaw globe]]<br />
<br />
or, floating to the right side of the page and with a caption:<br />
[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
[[Image:Wiki.png|right|Wikipedia Encyclopedia]]<br clear=all><br />
<br />
* Only images that have been uploaded to Wikipedia can be used. To upload images, use the [[Special:Upload|upload page]]. You can find the uploaded image on the [[Special:Imagelist|image list]].<br />
* See the [[Wikipedia:Image use policy|image use policy]], [[Wikipedia:Image markup|extended image markup/syntax]] (also possibly [[Wikipedia:Image markup with HTML|image HTML markup]]) for more hints.<br />
* Alternative text, used when the image isn't loaded, in a text-only browser, or when spoken aloud, is '''strongly''' encouraged. See [[Wikipedia:Alternate text for images|Alternate text for images]] for help on choosing it.<br />
* The frame tag automatically floats the image right.<br />
| <pre><nowiki><br />
A picture: [[Image:Wiki.png]]</nowiki><br />
<br />
or, with alternative text:<br />
<nowiki>[[Image:Wiki.png|jigsaw globe]]</nowiki><br />
<br />
or, floating to the right side of the page and with a caption:<br />
<nowiki>[[Image:Wiki.png|frame|Wikipedia Encyclopedia]]</nowiki><br />
<br />
or, floating to the right side of the page ''without'' a caption:<br />
<nowiki>[[Image:Wiki.png|right|Wikipedia Encyclopedia]]</nowiki></pre><br />
|-<br />
|<br />
Clicking on an uploaded image displays a description page, which you can also link directly to: [[:Image:Wiki.png]]<br />
| <pre><nowiki><br />
<br />
[[:Image:Wiki.png]]<br />
</nowiki></pre><br />
|-<br />
|<br />
To include links to images shown as links instead of drawn on the page, use a "media" link.<br />
<br />
<br/>[[media:Tornado.jpg|Image of a Tornado]]<br />
|<br />
<pre><br />
<nowiki><br />
<br />
[[media:Tornado.jpg|Image of a Tornado]]<br />
<br />
</nowiki></pre><br />
|}<br />
<br />
=== Character formatting ===<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
|- valign="top"<br />
! What it looks like<br />
! What you type<br />
|- id="emph" valign="top"<br />
|<br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
* These are double and triple apostrophes (single-quote marks), not double-quote marks.<br />
|<br />
<pre><nowiki><br />
''Emphasize'', '''strongly''', '''''very strongly'''''.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
<math>\sin x + \ln y</math><br><br />
sin''x'' + ln''y''<br />
<!-- no space between roman "sin" and italic "x" --><br />
<br />
<math>\mathbf{x} = 0</math><br><br />
'''x''' = 0<br />
<br />
Ordinary text should use [[#emph|wiki markup for emphasis]], and should not use <code>&lt;i&gt;</code> or <code>&lt;b&gt;</code>. However, mathematical formulas often use italics, and sometimes use bold, for reasons unrelated to emphasis. Complex formulas should use [[m:Help:Formula|<code>&lt;math&gt;</code> markup]], and simple formulas may use <code>&lt;math&gt;</code>; or <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>; or <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code>. According to [[Wikipedia:WikiProject Mathematics#Italicization and bolding|WikiProject Mathematics]], wiki markup is preferred over HTML markup like <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code>.<br />
|<br />
<pre><nowiki><br />
<math>\sin x + \ln y</math><br />
sin''x'' + ln''y''<br />
<br />
<math>\mathbf{x} = 0</math><br />
'''x''' = 0<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
<br />
* For semantic reasons, using <code>&lt;code&gt;</code> where applicable is preferable to using <code>&lt;tt&gt;</code>.<br />
|<br />
<pre><nowiki><br />
A typewriter font for <tt>monospace text</tt><br />
or for computer code: <code>int main()</code><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can use <small>small text</small> for captions.<br />
|<br />
<pre><nowiki><br />
You can use <small>small text</small> for captions.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
<br />
* When editing regular Wikipedia articles, just make your changes and don't mark them up in any special way.<br />
* When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.<br />
|<br />
<pre><nowiki><br />
You can <s>strike out deleted material</s><br />
and <u>underline new material</u>.<br />
<br />
You can also mark <del>deleted material</del> and<br />
<ins>inserted material</ins> using logical markup<br />
rather than visual markup.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Diacritical marks:'''<br />
<br/><br />
è é ê ë ì í<br />
<br />
À Á Â Ã Ä Å <br/><br />
Æ Ç È É Ê Ë <br/><br />
Ì Í<br />
Î Ï Ñ Ò <br/><br />
Ó Ô Õ<br />
Ö Ø Ù <br/><br />
Ú Û Ü ß<br />
à á <br/><br />
â ã ä å æ<br />
ç <br/><br />
è é ê ë ì í<br/><br />
î ï ñ ò ó ô <br/><br />
&oelig; õ<br />
ö ø ù ú <br/><br />
û ü ÿ<br />
<br />
* See [[meta:Help:Special characters|special characters]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
è é ê ë ì í<br />
<br />
&amp;Agrave; &amp;Aacute; &amp;Acirc; &amp;Atilde; &amp;Auml; &amp;Aring; <br />
&amp;AElig; &amp;Ccedil; &amp;Egrave; &amp;Eacute; &amp;Ecirc; &amp;Euml; <br />
&amp;Igrave; &amp;Iacute; &amp;Icirc; &amp;Iuml; &amp;Ntilde; &amp;Ograve; <br />
&amp;Oacute; &amp;Ocirc; &amp;Otilde; &amp;Ouml; &amp;Oslash; &amp;Ugrave; <br />
&amp;Uacute; &amp;Ucirc; &amp;Uuml; &amp;szlig; &amp;agrave; &amp;aacute; <br />
&amp;acirc; &amp;atilde; &amp;auml; &amp;aring; &amp;aelig; &amp;ccedil; <br />
&amp;egrave; &amp;eacute; &amp;ecirc; &amp;euml; &amp;igrave; &amp;iacute;<br />
&amp;icirc; &amp;iuml; &amp;ntilde; &amp;ograve; &amp;oacute; &amp;ocirc; <br />
&amp;oelig; &amp;otilde; &amp;ouml; &amp;oslash; &amp;ugrave; &amp;uacute; <br />
&amp;ucirc; &amp;uuml; &amp;yuml;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Punctuation:'''<br />
<br/><br />
¿ ¡ § ¶<br/><br />
&dagger; &Dagger; &bull; &ndash; &mdash;<br/><br />
&lsaquo; &rsaquo; « »<br/><br />
&lsquo; &rsquo; &ldquo; &rdquo;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;iquest; &amp;iexcl; &amp;sect; &amp;para;<br />
&amp;dagger; &amp;Dagger; &amp;bull; &amp;ndash; &amp;mdash;<br />
&amp;lsaquo; &amp;rsaquo; &amp;laquo; &amp;raquo;<br />
&amp;lsquo; &amp;rsquo; &amp;ldquo; &amp;rdquo;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commercial symbols:'''<br />
<br/><br />
&trade; © ® ¢ &euro; ¥<br/><br />
£ ¤<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;trade; &amp;copy; &amp;reg; &amp;cent; &amp;euro; &amp;yen; <br />
&amp;pound; &amp;curren;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Subscripts:'''<br />
<br/><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
<br />
'''Superscripts:'''<br />
<br/><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&sup1; x&sup2; x&sup3;<br />
*The latter method of superscripting can't be used in the most general context, but is preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.<br />
<br />
&epsilon;<sub>0</sub> =<br />
8.85 &times; 10<sup>&minus;12</sup><br />
C&sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&sup2;]]<br />
|<br />
<br/><br />
<pre><nowiki><br />
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub><br />
</nowiki></pre><br />
<br />
<pre><nowiki><br />
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup><br />
or x&amp;sup1; x&amp;sup2; x&amp;sup3;<br />
<br />
&amp;epsilon;<sub>0</sub> =<br />
8.85 &amp;times; 10<sup>&amp;minus;12</sup><br />
C&amp;sup2; / J m.<br />
<br />
1 [[hectare]] = [[1 E4 m&amp;sup2;]]<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Greek characters:'''<br />
<br/><br />
&alpha; &beta; &gamma; &delta; &epsilon; &zeta;<br/><br />
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu;<br/><br />
&xi; &omicron; &pi; &rho; &sigma; &sigmaf;<br/><br />
&tau; &upsilon; &phi; &chi; &psi; &omega;<br/><br />
&Gamma; &Delta; &Theta; &Lambda; &Xi; &Pi;<br/><br />
&Sigma; &Phi; &Psi; &Omega;<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;alpha; &amp;beta; &amp;gamma; &amp;delta; &amp;epsilon; &amp;zeta; <br />
&amp;eta; &amp;theta; &amp;iota; &amp;kappa; &amp;lambda; &amp;mu; &amp;nu; <br />
&amp;xi; &amp;omicron; &amp;pi; &amp;rho; &amp;sigma; &amp;sigmaf;<br />
&amp;tau; &amp;upsilon; &amp;phi; &amp;chi; &amp;psi; &amp;omega;<br />
&amp;Gamma; &amp;Delta; &amp;Theta; &amp;Lambda; &amp;Xi; &amp;Pi; <br />
&amp;Sigma; &amp;Phi; &amp;Psi; &amp;Omega;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Math characters:'''<br />
<br/><br />
&int; &sum; &prod; &radic; &minus; &plusmn; &infin;<br/><br />
&asymp; &prop; &equiv; &ne; &le; &ge; &rarr;<br/><br />
&times; &middot; &divide; &part; &prime; &Prime;<br/><br />
&nabla; &permil; &deg; &there4; &alefsym; &oslash;<br/><br />
&isin; &notin; &cap; &cup; &sub; &sup; &sube; &supe;<br/><br />
&not; &and; &or; &exist; &forall; &rArr; &hArr;<br/><br />
&rarr; &harr;<br/><br />
* See also [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&amp;int; &amp;sum; &amp;prod; &amp;radic; &amp;minus; &amp;plusmn; &amp;infin;<br />
&amp;asymp; &amp;prop; &amp;equiv; &amp;ne; &amp;le; &amp;ge; &amp;rarr;<br />
&amp;times; &amp;middot; &amp;divide; &amp;part; &amp;prime; &amp;Prime;<br />
&amp;nabla; &amp;permil; &amp;deg; &amp;there4; &amp;alefsym; &amp;oslash;<br />
&amp;isin; &amp;notin; &amp;cap; &amp;cup; &amp;sub; &amp;sup; &amp;sube; &amp;supe;<br />
&amp;not; &amp;and; &amp;or; &amp;exist; &amp;forall; &amp;rArr; &amp;hArr;<br />
&amp;rarr; &amp;harr;<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Spacing in simple math formulas:'''<br />
<br/><br />
Obviously, ''x''&sup2;&nbsp;&ge;&nbsp;0 is true.<br />
*To space things out without allowing line breaks to interrupt the formula, use non-breaking spaces: <tt>&amp;nbsp;</tt>.<br />
|<br />
<br/><br />
<pre><nowiki><br />
Obviously, ''x''&amp;sup2;&amp;nbsp;&amp;ge;&amp;nbsp;0 is true.<br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Complicated formulas:'''<br />
<br/><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
* See [[m:Help:Formula]] for how to use <tt>&lt;math></tt>.<br />
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.<br />
|<br />
<br/><br />
<pre><nowiki><br />
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Suppressing interpretation of markup:'''<br />
<br/><br />
<nowiki>Link &rarr; (''to'') the [[Wikipedia FAQ]]</nowiki><br />
* Used to show literal data that would otherwise have special meaning.<br />
* Escape all wiki markup, including that which looks like HTML tags.<br />
* Does not escape HTML character references.<br />
* To escape HTML character references such as <tt>&amp;rarr;</tt> use <tt>&amp;amp;rarr;</tt><br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;nowiki>Link &amp;rarr; (''to'') <br />
the [[Wikipedia FAQ]]&lt;/nowiki><br />
</nowiki></pre><br />
|- valign="top"<br />
|<br />
'''Commenting page source:'''<br />
<br/><br />
''not shown when viewing page''<br />
* Used to leave comments in a page for future editors.<br />
* Note that most comments should go on the appropriate [[Wikipedia:Talk page|Talk page]].<br />
|<br />
<br/><br />
<pre><nowiki><br />
&lt;!-- comment here --><br />
</nowiki></pre><br />
|}<br />
''(see also: [[Chess symbols in Unicode]])''<br />
<br />
=== Tables ===<br />
==== Placement of the Table of Contents (TOC) ====<br />
At the current status of the wiki markup language, having at least four headers on a page triggers the TOC to appear in front of the first header (or after introductory sections). Putting <nowiki>__TOC__</nowiki> anywhere forces the TOC to appear at that point (instead of just before the first header). Putting <nowiki>__NOTOC__</nowiki> anywhere forces the TOC to disappear. See also [[Wikipedia:Section#Compact_TOC|compact TOC]] for alphabet and year headings.<br />
<br />
==== Keeping headings out of the Table of Contents ====<br />
<br />
If you want some subheadings to not appear in the Table of Contents, then make the following replacements.<br />
<br />
Replace <nowiki> == Header 2 == with <h2> Header 2 </h2> </nowiki><br />
<br />
Replace <nowiki> === Header 3 === with <h3> Header 3 </h3> </nowiki><br />
<br />
And so forth.<br />
<br />
For example, notice that the following header has the same font as the other subheaders to this "Tables" section, but the following header does not appear in the Table of Contents for this page.<br />
<br />
<h4> This header has the h4 font, but is NOT in the Table of Contents </h4><br />
<br />
This effect is obtained by the following line of code.<br />
<br />
<nowiki><h4> This header has the h4 font, but is NOT in the Table of Contents </h4></nowiki><br />
<br />
<br />
==== Tables ====<br />
There are two ways to build tables: <br />
*in special Wiki-markup (see [[m:Help:Table]])<br />
*with the usual HTML elements: &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; or &lt;th&gt;.<br />
<br />
For the latter, and a discussion on when tables are appropriate, see [[Wikipedia:How to use tables]].<br />
<br />
=== Variables ===<br />
<br />
''(See also [[m:Help:Variable]])''<br />
{|<br />
|-<br />
! Code<br />
! Effect<br />
|-<br />
| <nowiki>{{CURRENTMONTH}}</nowiki> || {{CURRENTMONTH}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAME}}</nowiki><br />
| {{CURRENTMONTHNAME}}<br />
|-<br />
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki><br />
| {{CURRENTMONTHNAMEGEN}}<br />
|-<br />
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}<br />
|-<br />
| <nowiki>{{CURRENTDAYNAME}}</nowiki> || {{CURRENTDAYNAME}}<br />
|-<br />
| <nowiki>{{CURRENTYEAR}}</nowiki> || {{CURRENTYEAR}}<br />
|-<br />
| <nowiki>{{CURRENTTIME}}</nowiki> || {{CURRENTTIME}}<br />
|-<br />
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br />
| {{NUMBEROFARTICLES}}<br />
|-<br />
| <nowiki>{{PAGENAME}}</nowiki> || {{PAGENAME}}<br />
|-<br />
| <nowiki>{{NAMESPACE}}</nowiki> || {{NAMESPACE}}<br />
|-<br />
| <nowiki>{{localurl:pagename}}</nowiki><br />
| {{localurl:pagename}}<br />
|-<br />
| <nowiki>{{localurl:</nowiki>''Wikipedia:Sandbox''<nowiki>|action=edit}}</nowiki><br />
| {{localurl:Wikipedia:Sandbox|action=edit}}<br />
|-<br />
| <nowiki>{{SERVER}}</nowiki> || {{SERVER}}<br />
|-<br />
| <nowiki>{{ns:1}}</nowiki> || {{ns:1}}<br />
|-<br />
| <nowiki>{{ns:2}}</nowiki> || {{ns:2}}<br />
|-<br />
| <nowiki>{{ns:3}}</nowiki> || {{ns:3}}<br />
|-<br />
| <nowiki>{{ns:4}}</nowiki> || {{ns:4}}<br />
|-<br />
| <nowiki>{{ns:5}}</nowiki> || {{ns:5}}<br />
|-<br />
| <nowiki>{{ns:6}}</nowiki> || {{ns:6}}<br />
|-<br />
| <nowiki>{{ns:7}}</nowiki> || {{ns:7}}<br />
|-<br />
| <nowiki>{{ns:8}}</nowiki> || {{ns:8}}<br />
|-<br />
| <nowiki>{{ns:9}}</nowiki> || {{ns:9}}<br />
|-<br />
| <nowiki>{{ns:10}}</nowiki> || {{ns:10}}<br />
|-<br />
| <nowiki>{{ns:11}}</nowiki> || {{ns:11}}<br />
|-<br />
| <nowiki>{{ns:12}}</nowiki> || {{ns:12}}<br />
|-<br />
| <nowiki>{{ns:13}}</nowiki> || {{ns:13}}<br />
|-<br />
| <nowiki>{{ns:14}}</nowiki> || {{ns:14}}<br />
|-<br />
| <nowiki>{{ns:15}}</nowiki> || {{ns:15}}<br />
|-<br />
| <nowiki>{{SITENAME}}</nowiki> || {{SITENAME}}<br />
|}<br />
<br />
'''NUMBEROFARTICLES''' is the number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.<br />
<br />
=== Templates ===<br />
<br />
The [[Wikipedia:MediaWiki|MediaWiki]] software used by Wikipedia has limited support for template inclusion. This means standardized text chunks (such as boilerplate text) can be inserted into articles. For example, typing <nowiki>{{stub}}</nowiki> will appear as "''This article is a [[Wikipedia:The perfect stub article|stub]]. You can help Wikipedia by [[Wikipedia:Find or fix a stub|expanding it]].''" when the page is saved. See [[Wikipedia:Template messages]] for the complete list. Other commonly used ones are: <nowiki>{{disambig}}</nowiki> for disambiguation pages, <nowiki>{{spoiler}}</nowiki> for spoiler warnings and <nowiki>{{sectstub}}</nowiki> like an article stub but for a section. The are many subject-specific stubs e.g.: <nowiki> {{Geo-stub}}, {{Hist-stub}} and {{Linux-stub}}</nowiki>. For a complete list of stubs see [[Wikipedia:Template messages/Stubs]].<br />
<br />
=== Hiding the edit links ===<br />
<br />
Insert '''<nowiki>__NOEDITSECTION__</nowiki>''' into the document to suppress the edit links that appear next to every section header.<br />
<br />
== See also ==<br />
*[[m:Help:Formula]]<br />
*[[m:Help:Editing|Mediawiki user's guide to editing]]<br />
*[[Wikipedia:MediaWiki]].<br />
*[[HTML element]].<br />
*[[Wikipedia:Protection policy]]<br />
<br />
== Using Mozilla Firefox ==<br />
<br />
There is an [https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&numpg=10&id=351 extension] available for Firefox, which may help you to edit a wiki page. This extension can be used for all wikis based on MediaWiki (e.g. for the wikipedia). If you use version 1.5 of Firefox, you will need the developer [http://wikipedia.mozdev.org version] of the extension. Update: The extension doesn't support Firefox 2.0 (not yet).<br />
<br />
If you have installed the extension a new toolbar will appear. This toolbar contains some icons to<br />
*format the text (e.g. bold)<br />
*insert a structure item (e.g. headlines)<br />
*insert a link (internal or external)<br />
*insert a picture<br />
The toolbar can be helpful escpecially for newbies, because it's not necessary to know the (complete) wiki syntax.<br />
<br />
If you want to change the settings for the toolbar, you have to go to the tools menu of Firefox. Then you must click on the settings button of the extension. On the view tab for example you can set, that the toolbar only appears, if the URL contains the word 'wiki'.</div>
Kverde
https://wiki.freepascal.org/index.php?title=Template:Help:Editing&diff=55315
Template:Help:Editing
2012-02-06T05:57:49Z
<p>Kverde: </p>
<hr />
<div><small> <br />
[[Help:Editing/de|'''Deutsch (de)''']]<br />
[[Help:Editing|'''English (en)''']]<br />
[[Help:Editing/fr|'''Français (fr)''']]<br />
[[Help:Editing/ru|'''Russian (ru)''']]<br />
</small></div>
Kverde
https://wiki.freepascal.org/index.php?title=Lazarus_Documentation/ru&diff=55314
Lazarus Documentation/ru
2012-02-06T05:55:58Z
<p>Kverde: /* Советы, специфичные для определённой платформы */</p>
<hr />
<div>{{Lazarus Documentation}}<br />
<br />
==Учебники по Lazarus и Pascal==<br />
*[[Overview_of_Free_Pascal_and_Lazarus/ru|Описание Free Pascal и Lazarus]] - Краткое описание возможностей этих средств разработки.<br />
*[[Lazarus Tutorial/ru | Учебник Lazarus]] - Учебник для начинающих и детальное описание интерфейса Lazarus IDE.<br />
*[[Lazarus_IDE_Tools/ru|Инструменты IDE Lazarus]] - Учебник промежуточного уровня о кодах завершения и других инструментах IDE.<br />
*[[Lazarus Database Tutorial/ru | Учебник Lazarus и Базы данных]] - Введение по работе Lazarus с базами данных.<br />
*[[Developing with Graphics]] - Несколько основных примеров программирования графики.<br />
*[[Pascal Tutorial]] - [http://www.taoyue.com/ Tao Yue's] [http://www.taoyue.com/tutorials/pascal/ Pascal Tutorial] (размещен с разрешением).<br />
*[[Object Oriented Programming with FreePascal and Lazarus/ru | Объектно ориентированное программирование в FreePascal и Lazarus]] - Объектно-ориентированое программирование для начинающих.<br />
*[[Programming_with_Objects_and_Classes/ru|Программирование с помощью объектов и классов]] - Учебник по объектно-ориентированному программированию на FPC<br />
*[[Console Mode Pascal/ru | Паскаль в консольном режиме]] - работа с интерфейсом Lazarus IDE для написания программ Pascal, работающих в консольном режиме.<br />
*[[Executing External Programs/ru | Запуск внешних программ]] - Краткое обучение по запуску внешних программ из разрабатываемой.<br />
*[[Hardware Access/ru | Доступ к аппаратному обеспечению]] - Как работать с внешними устройствами: картами ISA, картами PCI, параллельными и последовательными портами и устройствами USB.<br />
*[[Networking/ru | Работа с сетью]] - Учебник по протоколу TCP/IP, созданию защищенных сетевых программ, WebServices, и т.д.<br />
*[[XML Tutorial/ru | Учебник по XML]] - Запись и чтение файлов XML<br />
*[[TXMLPropStorage/ru|TXMLPropStorage]] - Использование TXMLPropStorage для сохранения индивидуальных настроек.<br />
*[[Multithreaded Application Tutorial/ru | Создание многопоточных приложений]] - Как разработать многопоточные приложения при помощи Free Pascal и Lazarus<br />
*[[Manager Worker Threads System]] - Пример разработки приложения, управляющего поточной работой.<br />
*[[Streaming components]] - Как записать компоненты в потоки, а также читать и создавать компоненты из потоков<br />
*[[OpenGL Tutorial/ru | Уроки OpenGL]] - Как работать с GLUT в Lazarus<br />
*[[Creating bindings for C libraries]] - Как конвертировать файлы заголовка C (.h) в блоки Паскаля<br />
*[[Lazarus/FPC Libraries/ru| Библиотеки в Lazarus/FPC]] - Как создавать и использовать динамические библиотеки (.so, .dll, .dylib) <br />
*[[Translations / i18n / localizations for programs/ru|Локализация приложений]] - Как получать локализованные версии разрабатываемых программ и пакетов<br />
*[[Daemons and Services]] - Как разрабатывать службы windows и/или демоны linux.<br />
*[[Office Automation/ru | Взаимодействие с офисными приложениями]] - Как взаимодействовать с офисными программами и создавать электронные таблицы, текстовые документы, презентации, и т.д.<br />
*[[Lazarus Inline Assembler]] - начальное руководство.<br />
*[[VirtualTreeview Example for Lazarus]] - Использование VirtualTreeview в Lazarus.<br />
*[http://aprendepascal.wikidot.com Programando en Pascal] - Испанский учебник по FPC/Lazarus, находящийся на Wikidot.<br />
*[[Webbrowser/ru| Веб-браузер]] - управление веб-браузером<br />
*[[Playing videos]] - Как запустить видео<br />
*[[Using INI Files/ru|Использование INI файлов]] - Как работать с INI-файлами в Паскаль.<br />
<br />
===Руководства пользователя Lazarus===<br />
*[[Lazarus_Faq/ru|Lazarus Faq]] - Основная информация о Lazarus и отличия для Linux и Windows.<br />
*[[Lazarus_DB_Faq/ru|Lazarus Faq по базам данных]] - FAQ по базам данных, с которыми работает Lazarus.<br />
*[[Databases_in_Lazarus/ru|Базы данных в Lazarus]] - Описание работы с базами данных в Lazarus<br />
*[[Code_Examples/ru|Примеры кода]] - Рабочие примеры программ для Lazarus.<br />
*[[Feature_Ideas|Wishlist/Wanted Features]] - Возможности, которые хочется видеть в Lazarus<br />
*[[How_do_I_create_a_bug_report/ru|Как добавить ошибку в баг-репорт]] - Как сообщить об ошибках в работе Lazarus?<br />
<br />
===Установка=== <br />
*[[Installing Lazarus]] - Руководство по установке<br />
*[[Getting Lazarus]] - Инструкция, как скачивать релизы или SVN версии Lazarus<br />
*[[Multiple Lazarus/ru|Несколько версий Lazarus]] - Как устанавливать несколько версий lazarus'а на одну машину<br />
<br />
===Среда разработки (IDE)===<br />
*[[Lazarus IDE| Среда Lazarus]] - Назначение основных окон в среде.<br />
*[[Lazarus IDE Shortcuts|Горячие клавиши]] - Описание горячих клавиш среды.<br />
*[[IDE tricks|Советы на каждый день]] - Полезные советы по использованию Lazarus.<br />
*[[Lazarus Packages|Пакеты Lazarus]] - Пособие по созданию своих пакетов для Lazarus.<br />
*[[Install Packages|Установка пакетов]] - Небольшое пособие об установке пакетов.<br />
*[[Extending the IDE/ru|Расширяем Lazarus]] - Добавление необходимого функционала в Lazarus.<br />
*[[Adding Kylix Help|Использование справки Kylix]] - Руководство о том, как добавить файлы справки Borland к редактору Lazarus.<br />
*[[Using Lazarus for other computer languages/ru|Lazarus для других языков]] - Подключение языков C, Java (и т.п.) к Lazarus<br />
*[[IDE Development|Разработка]] - Набор заметок о текущем состоянии разработки среды.<br />
*[[Lazarus for education|Lazarus для обучения]] - Статья о том, как настроить среду для удобства начинающих.<br />
<br />
===LCL - библиотека компонентов Lazarus===<br />
*[[doc:lcl/|LCL documentation]] - Помощь по LCL (в разработке).<br />
*[[LCL Components]] - Руководство по стандартным компонентам LCL, дополнение к предыдущему пункту<br />
*[[The LCL in various platforms]] - Краткое обсуждение работы компонентов LCL на разных платформах.<br />
*[[Autosize / Layout]] - Как разрабатывать формы, которые работают на всех платформах.<br />
*[[Main Loop Hooks]] - How to handle multiple event sources<br />
*[[Asynchronous Calls]] - How to queue methods for later execution<br />
*[[File size and smartlinking]] - How to smartlink applications and create smaller executables.<br />
*[[Accessing the Interfaces directly]] - Example how to access the LCL widgetsets<br />
*[[Add Help to Your Application]] - How to create a Online Help for your application<br />
*[[Anchor Sides]] - Description of Anchor Sides Feature<br />
*[[LCL Tips/ru]] - Tips and tricks<br />
*[[LCL Defines]] - Choosing the right options to recompile LCL<br />
<br />
===Разработчику===<br />
*[[The Power of Proper Planning and Practices]] - Здравый смысл - лучшая практика при программировании в Free Pascal и Lazarus<br />
*[[Multiplatform Programming Guide]] - Как разрабатывать кроссплатформенные приложения и как портировать с одной платформы в другую<br />
*[[Deploying Your Application]] - Как создать инсталлятор для вашего приложения<br />
*[[Cross compiling]] - Создание бинарников для другой платформы<br />
*[[GDB Debugger Tips]] - Известные Проблемы / Советы для отладки Pascal с использованием GDB<br />
*[[Remote Debugging]] - Как отлаживать ваши Lazarus-приложения с другой машины<br />
*[[Application Icon]] - Установка иконки приложения<br />
*[[Using Pascal Libraries with .NET and Mono]] - вы можете использовать ваш код Pascal вместе с .NET и Mono<br />
*[[Pascal and PHP]] - Подключение Pascal к PHP<br />
*[[Developing Python Modules with Pascal]] - дополняем Python с помощью Pascal<br />
<br />
===Советы, специфичные для определённой платформы===<br />
*[[OS X Programming Tips]] - Установка Lazarus, полезные инструменты, команды Unix и многое другое...<br />
*[[Windows Programming Tips]] - Советы по программированию в Windows для рабочих станций...<br />
*[[WinCE Programming Tips/ru]] - Советы по программированию в WinCE (использование вибрации, кнопка виртуальной клавиатуры и всё такое ...)<br />
*[[Android Programming/ru]] - Для смарфонов и планшетов с Android.<br />
*[[iPhone/iPod development]] - Об испоьщовании Объектного Паскаля для разработки iOS-приложений.<br />
<br />
===Утилиты===<br />
*[[Lazarus Documentation Editor]] - Использование "lazde" для создания документации<br />
*[[FPDoc Editor]] - Интегрированый редактор для документирования<br />
*[[FPDoc Updater]] - GUI-утилита для изменения файлов FPDoc<br />
*[[lazbuild]] - Компилирование проектов и пакетов без IDE<br />
*[[LazSVNPkg]] - Lazarus SVN IDE Plugin<br />
<br />
===Переход из Delphi===<br />
*[[Lazarus Components]] - Сравнение компонентов Lazarus и Turbo Delphi<br />
*[[Lazarus For Delphi Users]] - Для пользователей Delphi, которые хотят начать программировать в Lazarus<br />
*[[Code Conversion Guide]] - Как конвертировать существующий код и компоненты Delphi и Kylix в Lazarus<br />
<br />
===Руководства по улучшению и развитию Lazarus===<br />
*[[Lazarus Development Process/ru| Процесс развития Lazarus]] - Планы, идеи, текущая разработка<br />
*[[How To Help Developing Lazarus/ru| Как помочь развитию Lazarus]] - Руководство, которое подскажет новичкам как начать участвовать в развитии и совершенствовании Lazarus<br />
*[[Version Numbering/ru| Нумерация версий]] - Пояснение по поводу различий в нумерации версий Lazarus<br />
*[[Creating A Patch/ru| Создание патча (patch)]] - Руководство о том, как создать патч, для исправления ошибок в FPC/Лазарусе или их компонтентах.<br />
*[[Creating a Backtrace with GDB]] - Руководство по трассировке чтобы помочь в отладке программ<br />
*[[Nomenclature/ru| Терминология]] - Руководство по выбору имени для нового метода или свойства<br />
*[[DesignGuidelines|Design Guide Lines]] - Руководство, что делать при изменении исходного кода Lazarus.<br />
*[[GUI design]] - Заметки о разработке lazarus GUI<br />
*[[Roadmap]] - Идеи о текущем состоянии различных частей Lazarus<br />
*[[Road To 1.0]] - Что необходимо сделать для Lazarus 1.0 и списки To Do<br />
*[[Moderating the bug tracker]] - Guidelines for lazarus developers and moderators for using the [http://www.freepascal.org/mantis/ bug tracker].<br />
*[[Codetools]] - How the codetools are integrated into the IDE<br />
*[[Creating IDE Help]] - How to extend the IDE documentation<br />
*[[Unit not found - How to find units]] - How to setup the IDE and source files<br />
*[[Bounties]] - Need a particular new feature soon? Set a price here. <br />
<br />
===LCL - Библиотека компонентов Lazarus===<br />
*[[LCL Messages]] - Guide related to LCL Messages<br />
*[[LCL Internals]] - Some info about the inner workings of the LCL<br />
*[[LCL Key Handling]] - Help! A key press, what now?<br />
*[[LCL Internals - Resizing, Moving]] - How the LCL communicates with the LCL interface to resize, move controls<br />
*[[LCL Drag Drop]] - Managing dragging, dropping and docking<br />
*[[LCL Unicode Support]] - Road to Unicode enabled Lazarus<br />
*[[LCL Documentation Roadmap]] - Which units have to be documented<br />
*[[LCL Bindings]] - Bindings to use LCL on other languages<br />
<br />
===Interfaces===<br />
{{Interfaces}}<br />
<br />
===Переводы===<br />
* [[Getting translation strings right]] A few notes for programmers on how to create and use translateable strings in your application. Quickly discusses general things about creating strings, offers a few hints on implementation issues and points out some things to consider when using English as base language in particular.<br />
* '''Localization Notes:'''<br />
:* [[German localization notes|German]] - Notes and guidelines for translating the Lazarus IDE to German, including a small dictionary to look up often used translations.<br />
:* [[Portuguese-Brazilian Localization Notes|Portuguese-Brazilian]] - Small dictionary containing common translations of terms used in the Lazarus IDE for the Portuguese-Brazilian translation.<br />
:* [[Russian localization notes|Russian]] - Notes and guidelines for translating the Lazarus IDE into Russian.<br />
<!-- *[[TO-DO]] Remaining Tasks --><br />
* [[Help:Add language bar | Add language bar]] explains how you can add a list of translations to the top of a wiki page.<br />
*[[Translations_/_i18n_/_localizations_for_programs#Translating_the_IDE|Translating the IDE]]<br />
<br />
==Документация по дополнительным компонентам==<br />
*[[Pascal Script]] and [[Pascal Script Examples]] - How to use the pascal script components in Lazarus<br />
*[[OpenGL]] - How to use OpenGL in Lazarus<br />
*[[KOL-CE/ru | KOL-CE]] - Библиотека KOL&MCK, потрированная под Free Pascal/Lazarus. Как создавать компактные приложения для Win32/WinCE в Lazarus.<br />
<br />
==Документация по компилятору Free Pascal==<br />
In addition to [http://lazarus-ccr.sourceforge.net/fpcdoc/ this site], the latest version of the documentation can also be found online and in a variety of downloadable formats on the main [http://www.freepascal.org/docs.html Free Pascal Compiler site].<br />
There is now also a WiKi site for FreePascal [http://www.freepascal.org/wiki/index.php/Main_Page] very similar in style to this one, to allow developers to submit documentation in addition to the official FPC documents below.<br />
<br />
*[http://lazarus-ccr.sourceforge.net/fpcdoc/user/user.html User's guide]<br />
*[http://lazarus-ccr.sourceforge.net/fpcdoc/prog/prog.html Programmer's guide]<br />
*[http://lazarus-ccr.sourceforge.net/fpcdoc/ref/ref.html Reference guide for the system unit, and supported Pascal constructs]<br />
*[http://lazarus-ccr.sourceforge.net/fpcdoc/rtl/index.html Run-Time Library reference manual]<br />
*[http://lazarus-ccr.sourceforge.net/fpcdoc/fcl/index.html Free Component Library reference manual]<br />
*[http://lazarus-ccr.sourceforge.net/fpcdoc/fpdoc/fpdoc.html Free Pascal documentation tool manual]<br />
*[[Build messages]]<br />
<br />
==Блоги и сайты связанные с Lazarus==<br />
'''Блоги'''<br />
*[http://lazarus-dev.blogspot.com/ Lazarus Development] - A blog of lazarus developers regards development process.<br />
*[[Adventures of a Newbie]] - A blog of a newbie getting started with some tutorial information in a running log.<br />
*[http://lazarusroad.blogspot.com/ On the road with Lazarus/Freepascal] - A blog dedicated to register my experiences while programming with Lazarus and Freepascal (by Luiz Américo)<br />
*[http://port2laz.blogspot.com/ Porting to Lazarus] - This blog describes the porting of a medium-sized application (~100 kloc) from D7 with CLX to Lazarus (by Alexsander da Rosa)<br />
*[http://living-lazarus.blogspot.com/ Living Lazarus] - One mans exploration into the possibilities of an open source RAD (by [[User:Wibblytim|Wibblytim]]).<br />
*[http://beeography.wordpress.com/tag/object-pascal/ Bee.ography] just (another) Bee’s buzz!<br />
*[http://donaldshimoda.blogspot.com/ Parallel Pascal Worlds] Donald Shimoda.<br />
<br />
'''Сайты'''<br />
*[[swainbrain pascal wiki]] - unique free pascal tutorials and info [http://mercury.it.swin.edu.au/swinbrain/index.php/Pascal#Pascal_Development_Tools swainbrain]</div>
Kverde
https://wiki.freepascal.org/index.php?title=Android_Programming/ru&diff=55313
Android Programming/ru
2012-02-06T05:54:35Z
<p>Kverde: </p>
<hr />
<div>{{Android programming}}<br />
<br />
See also [[Custom Drawn Interface/Android]]<br />
<br />
__TOC__<br />
<br />
Knowing general Android programming can be very useful to help developing the Lazarus Android Interface.<br />
<br />
==How to...==<br />
<br />
===Build the NDK OpenGL example===<br />
<br />
Just follow these steps:<br />
<br />
'''Step 1''' - Download and install the Android NDK, Android SDK and Ant. More information here: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones]]<br />
<br />
'''Step 2''' - Install the pre-compiled FPC cross-compiler. Instructions here: [[Android_Interface#Using_the_pre-compiled_compiler]]<br />
<br />
'''Step 3''' - Download the latest lazarus-ccr sourceforge code:<br />
<br />
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr lazarus-ccr<br />
<br />
or if you think it is too big you can download just the folder lazarus-ccr/bindings/android-ndk<br />
<br />
'''Step 4''' - Building the Pascal Library<br />
<br />
Open the project lazarus-ccr/bindings/android-ndk/examples/opengltest/opengltest.lpi<br />
<br />
Go to Project->Project Options->Paths and where is written "Libraries -Fl" you should see this value:<br />
<br />
/home/felipe/Programas/android-ndk-r5/platforms/android-9/arch-arm/usr/lib<br />
<br />
Change it to the correct path in your system which points to the NDK and to the library folder for your minimal required Android API Level<br />
<br />
Now build the project using Lazarus.<br />
<br />
'''Step 5''' - Configuring the build environment<br />
<br />
Open the file opengltest/local.properties and in this line:<br />
<br />
sdk.dir=/home/felipe/Programas/android-sdk-linux<br />
<br />
Change this to point to your SDK location<br />
<br />
'''Step 6''' - Buildings the APK<br />
<br />
Open a terminal and type these commands:<br />
<br />
cd lazarus-ccr/bindings/ndk/examples/opengltest/android<br />
ant debug<br />
<br />
The APK file will be placed in opengltest/android/bin/<br />
<br />
'''Step 7''' - Install the APK<br />
<br />
In this step if you get error messages about permissions read: [[Android_Interface/Using_the_Android_SDK%2C_Emulator_and_Phones#Recognition_of_devices_under_Linux]]<br />
<br />
The command to install our APK in the phone is:<br />
<br />
cd opengltest/android<br />
~/Programas/android-sdk-linux/platform-tools/adb install bin/OpenGLNDKTest-debug.apk <br />
2395 KB/s (107299 bytes in 0.043s)<br />
pkg: /data/local/tmp/OpenGLNDKTest-debug.apk<br />
Success<br />
<br />
If you get an error message that it is already installed you can install with this command:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb uninstall com.pascal.opengltest<br />
<br />
And then you can run adb logcat to see what the log says while you start it in the phone via its newly added icon:<br />
<br />
~/Programas/android-sdk-linux/platform-tools/adb logcat<br />
<br />
===Read the screen metrics===<br />
<br />
First fill a TDisplayMetrics with the correct info:<br />
<br />
<delphi><br />
uses androidutil;<br />
<br />
var<br />
MyDisplayMetrics: TDisplayMetrics;<br />
Str: string;<br />
//<br />
lHeight, lWidth: Integer;<br />
xdpi, ydpi, lScreenSize: Single;<br />
begin<br />
// ..<br />
// Objects<br />
<br />
MyDisplayMetrics := TDisplayMetrics.Create;<br />
Activity.getWindowManager().getDefaultDisplay().getMetrics(MyDisplayMetrics);<br />
</delphi><br />
<br />
And then you can read it from the TDisplayMetrics:<br />
<br />
<delphi><br />
lHeight := MyDisplayMetrics.heightPixels();<br />
lWidth := MyDisplayMetrics.widthPixels();<br />
xdpi := MyDisplayMetrics.xdpi();<br />
ydpi := MyDisplayMetrics.ydpi();<br />
lScreenSize := sqrt(sqr(lHeight / ydpi) + sqr(lWidth / xdpi));<br />
ldensity := MyDisplayMetrics.density();<br />
ldensityDpi := MyDisplayMetrics.densityDpi();<br />
scaledDensity := MyDisplayMetrics.scaledDensity();<br />
</delphi><br />
<br />
Note that lots of devices lie about the xdpi and ydpi, so don't trust the lScreenSize calculated above. Smartphones might report even 10 inches of screen size, while the correct is around 4.<br />
<br />
==Details about Android devices==<br />
<br />
Since there are so many Android devices, it can be useful to keep track of some information about them. See also in the wikipedia Comparison of Android Devices [http://en.wikipedia.org/wiki/Comparison_of_Android_devices] and details about the processors in [https://wiki.mozilla.org/Mobile/Platforms/Android#System_Requirements].<br />
<br />
===Smartphones===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Manufacturer'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Model'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Processor'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android version'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Comments'''<br />
|---<br />
|HTC||Wildfire||HTC Wildfire||armv6||2.1=>2.2||Yes||-<br />
|---<br />
|Sony Erricson||Xperia X10||X10i||armv7||1.6=>2.1||No||-<br />
|}<br />
<br />
===Tablets===<br />
<br />
{| BORDER="1" CELLSPACING="0"<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Manufacturer'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Model'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android API Name (Build.Model)'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Processor'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Android version'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Multi-touch'''<br />
!COLSPAN="1" STYLE="background:#ffdead;"|'''Comments'''<br />
|---<br />
|Toshiba||Folio 100 Tablet||TOSHIBA_FOLIO_AND_A||armv7||2.2||Yes||-<br />
|}<br />
<br />
===List of devices ordered by processor compatibility (ARMv6 vs ARMv7)===<br />
<br />
'''List of ARMv7 devices:'''<br />
<br />
*Advent Vega (P10AN01) <br />
*Dell Streak, Streak 7 <br />
*HTC Desire <br />
*HTC Desire Z (T-Mobile G2) <br />
*HTC Desire HD <br />
*HTC Droid Incredible <br />
*HTC EVO 4G, EVO Shift 4G <br />
*HTC Glacier (T-Mobile myTouch 4G) <br />
*HTC Inspire 4G <br />
*HTC Nexus One <br />
*HTC Thunderbolt 4G <br />
*Huawei Ideos S7 <br />
*LG Optimus Z <br />
*Motorola Atrix 4G <br />
*Motorola Bravo <br />
*Motorola Cliq 2 - untested <br />
*Motorola Defy <br />
*Motorola Droid 2, Droid 2 Global <br />
*Motorola Droid Pro (Motorola PRO) <br />
*Motorola Droid X <br />
*Motorola Xoom <br />
*POV Mobii Tegra Tablet <br />
*Samsung Continuum (i400) <br />
*Samsung Galaxy S (i9000, Captivate, Fascinate, Vibrant, Epic 4G) <br />
*Samsung Galaxy Tab <br />
*Sharp IS03 <br />
*Sony Ericsson Xperia X10 <br />
*Toshiba AS100 <br />
*Viewsonic gTablet <br />
*Acer Liquid E<br />
*Acer Liquid (Liquid A1)<br />
*Archos 101 Internet Tablet<br />
*Motorola Charm<br />
*Motorola Droid (Milestone)<br />
*Samsung Galaxy S 4G<br />
*Samsung Nexus S<br />
<br />
'''List of ARMv6 processors:'''<br />
<br />
*Android SDK emulator <br />
*Asus Garmin nuvifone A50 (T-Mobile Garminfone) <br />
*Augen GENTouch 78 Tablet <br />
*Coby Kyros Internet Tablet (MID7015) <br />
*Geeksphone One, Geeksphone Zero <br />
*HTC Aria <br />
*HTC ChaCha <br />
*HTC Dream (T-Mobile G1, Android Dev Phone 1) <br />
*HTC Droid Eris <br />
*HTC Espresso (T-Mobile myTouch 3G Slide) <br />
*HTC Hero (T-Mobile G2 Touch) <br />
*HTC Legend <br />
*HTC Magic (T-Mobile myTouch 3G, T-Mobile G1 Touch) <br />
*HTC Salsa <br />
*HTC Tattoo <br />
*HTC Wildfire <br />
*Huawei Ascend <br />
*Huawei Ideos U8150-B (T-Mobile Comet) <br />
*Huawei U8110 (T-Mobile Pulse Mini) <br />
*Huawei U8230 <br />
*LG Ally (Apex) (LG VS740) <br />
*LG GW620 (Eve, InTouch Max, LinkMe) <br />
*LG Optimus, Optimus M, Optimus T, Optimus S, Optimus V <br />
*LG Vortex <br />
*LG P500<br />
*MAG iMiTO iM7 <br />
*vMAG iMiTO iM7S <br />
*Motorola Backflip <br />
*Motorola Citrus <br />
*Motorola Cliq (MB200) <br />
*Motorola Dext <br />
*Motorola Devour <br />
*Motorola i1 <br />
*Motorola Spice XT300 <br />
*Motorola Quench XT5 XT502 <br />
*Pandigital Novel <br />
*Samsung GT-S5570 Galaxy Mini <br />
*Samsung i5500 Galaxy 5 (Corby) <br />
*Samsung i5700 Galaxy Portal (Spica) <br />
*Samsung i5800 Galaxy 3 <br />
*Samsung i7500 Galaxy <br />
*Samsung Intercept <br />
*Samsung M900 Moment <br />
*Samsung S5830 Galaxy Ace <br />
*Samsung Transform <br />
*Sanyo ZIO M6000 <br />
*Sony Ericsson Xperia X8 <br />
*Sony Ericsson Xperia X10 Mini <br />
*Sony Ericsson Xperia X10 Mini Pro <br />
*Superpad 10.2" Tablet PC <br />
*Viewsonic ViewPad 7 Tablet <br />
*Velocity Micro T103 Cruz tablet <br />
*Vodafone 845 <br />
*ZTE Blade<br />
<br />
==Creating a new Java Android Application==<br />
<br />
This info can be useful for helping implement LCL-CustomDrawn-Android<br />
<br />
Generic instructions here: http://developer.android.com/guide/developing/other-ide.html<br />
<br />
===Showing / Hiding the virtual keyboard===<br />
<br />
See here: http://android-codes-examples.blogspot.com/2011/11/show-or-hide-soft-keyboard-on-opening.html<br />
<br />
To show it:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);<br />
<br />
and for hiding the keyboard:<br />
<br />
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);<br />
imm.hideSoftInputFromWindow(singleedittext.getWindowToken(),0);<br />
<br />
==References==<br />
<br />
* http://developer.android.com/guide/developing/other-ide.html</div>
Kverde
https://wiki.freepascal.org/index.php?title=Template:Android_programming&diff=55311
Template:Android programming
2012-02-06T05:52:39Z
<p>Kverde: </p>
<hr />
<div><small><br />
[[Android_Programming|'''English (en)''']] |<br />
[[Android_Programming/ru|'''Русский (ru)''']] |<br />
</small></div>
Kverde