aboutsummaryrefslogtreecommitdiff
path: root/dist/etc/android/README
blob: 31bc8049b29266fb4f1bba01fe51cf44e3a7e810 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
This file describes how to build and use XSD/e with Android. While it should
be possible to build the XSD/e runtime library (libxsde) using GNU make and
the native XSD/e build system, the amount of compiler options one has to
keep track of makes this approach impractical. Instead, the configuration
files and makefiles in this directory implement a split build procedure
where the XSD/e build system is used to generate the XSD/e configuration
header (libxsde/xsde/config.h) as well as the list of source files that
need to be compiled. Then the Android build system is used to compile the
source files and build the libxsde.a library. The XSD/e build system is
transparently invoked by the Android build system when the XSD/e
configuration file is changed.

This directory also includes the Android makefile (Android.mk) for the
'minimal' C++/Hybrid example (examples/cxx/hybrid/minimal) which shows
how to integrate the libxsde build into your application's build, set
up the include directories, as well as compile the schemas with the
XSD/e compiler.

To set up an application to use XSD/e, follow these steps:

1.  Unpack the pre-compiled XSD/e package for your host development 
    platform into your application's 'jni' directory. Rename the
    resulting directory to 'xsde' or, alternatively, adjust the
    MY_XSDE_DIR variable in steps 4.a/4.b.

2.  Copy the xsde/etc/android/config.make configuration file to the
    xsde/config/ directory. The default configuration disables STL,
    iostream, and C++ exceptions which can be enabled if supported
    by the Android NDK you are using. You may also adjust other
    configuration parameters except for those in the "Toolchain"
    section.

3.  Copy the xsde/etc/android/libxsde/Android.mk file to the 
    xsde/libxsde/ directory.

4.a If you would like to integrate the libxsde build into an existing
    application, then in your top-level Android.mk file (in the jni/ 
    directory), replace the following line at the beginning of the file:

    LOCAL_PATH := $(call my-dir)

    With the following fragment:

    MY_XSDE_DIR := xsde
    MY_LOCAL_PATH := $(call my-dir)

    include $(MY_LOCAL_PATH)/$(MY_XSDE_DIR)/libxsde/Android.mk

    LOCAL_PATH := $(MY_LOCAL_PATH)

    Also add the following two lines after the LOCAL_SRC_FILES
    definition:

    LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(MY_XSDE_DIR)/libxsde
    LOCAL_STATIC_LIBRARIES := libxsde

4.b Alternatively, if you would like to build the 'minimal' example
    from the XSD/e distribution, replace the top-level Android.mk 
    file with xsde/etc/android/minimal/Android.mk. You will also
    need to copy over the driver.cxx and person.xsd files from the
    xsde/examples/cxx/hybrid/minimal/ directory.

5.  Run ndk-build in the jni/ directory which should build the libxsde
    library as well as the application.

For information on how to perform schema compilation from the Android
makefile, refer to the sample Android.mk file for the 'minimal' example.