1{
2    This file is part of the Free Pascal run time library.
3    Copyright (c) 2016 by Yury Sidorov,
4    member of the Free Pascal development team.
5
6    Header of Android-specific part of the System unit.
7
8    See the file COPYING.FPC, included in this distribution,
9    for details about the copyright.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 **********************************************************************}
15
16const
17  // Android system log priority
18  ANDROID_LOG_VERBOSE = 2;
19  ANDROID_LOG_DEBUG   = 3;
20  ANDROID_LOG_INFO    = 4;
21  ANDROID_LOG_WARN    = 5;
22  ANDROID_LOG_ERROR   = 6;
23  ANDROID_LOG_FATAL   = 7;
24
25// Default priority for syslog messages.
26var DefaultSysLogPriority: longint = ANDROID_LOG_DEBUG;
27
28// Set default tag for syslog messages. Initially the tag is set to the current module name.
29procedure SetDefaultSysLogTag(const Tag: string);
30
31// Write a message to the Android system log.
32procedure SysLogWrite(Priority: longint; Tag, Msg: PAnsiChar); overload;
33procedure SysLogWrite(Priority: longint; Msg: PAnsiChar); overload;
34procedure SysLogWrite(Msg: PAnsiChar); overload;
35
36// Redirects standard output and error to the Android system log.
37// The redirection is performed automatically for shared libraries loaded by Java applications.
38procedure RedirectOutputToSysLog;
39
40// Returns an Android system property.
41function GetSystemProperty(Name: PAnsiChar): shortstring;
42
43// Returns an Android API level of the host system.
44function SystemApiLevel: shortint;
45
46// True when the current program is a shared library loaded by a Java application.
47var IsJniLibrary: boolean;
48
49