This is a lightweight 2D vector drawing framework using TouchVGCore for Android.
Features described in Online document. Please visit TouchVG Demo to see more examples.
This is an open source LGPL 2.1 licensed project. It uses the following open source projects:
- TouchVGCore (LGPL): Cross-platform vector drawing libraries using C++.
- svg-android (Apache): Vector graphics support for Android.
- simple-svg (BSD): A C++ header file for creating SVG files.
- rapidjson (MIT): A fast JSON parser/generator for C++ with both SAX/DOM style API.
- x3py (Apache): Compile script files.
- SWIG (GPL): Use the tool to generate the glue code for Java and C#.
Contributors and sponsors are welcome. You may translate, commit issues or pull requests on this Github site. To contribute, please follow the branching model outlined here: A successful Git branching model.
Welcome to the Chinese QQ group 192093613
to discuss and share.
- Zhang Yungui
- Archer
- ljlin
- Pengjun / Line and triangle commands
- Proteas
-
Enter the directory of this project, then type
./build.sh
to generate libtouchvg.so and JNI classes.-
Need to install the lastest version of SWIG, and add the location to PATH on Windows.
-
Need to add the NDK installation location to PATH.
-
If the error
build/gmsl/__gmsl:512: *** non-numeric second argument to wordlist function
occurs, then open thebuild/gmsl/__gmsl
file in the NDK installation directory, and change line 512 to:int_encode = $(__gmsl_tr1)$(wordlist 1,$(words $1),$(__gmsl_input_int))
-
MSYS is recommended on Windows.
-
-
Import this project in eclipse, then build
touchvg
project.-
Android SDK version of the projects may need to modify according to your installation.
-
Recommend using the newer ADT Bundle to avoid complex configuration.
-
-
Don't want to build libtouchvg.so and jar? Then you can download the prebuilt libraries and extract to
yourapp/libs
. -
Regenerate libtouchvg.so and JNI classes:
-
Type
./build.sh -B
to rebuild the native libraries. -
Type
./build.sh APP_ABI=x86
to build for the x86 (Intel Atom) Emulator. -
Type
./build.sh -swig
to regenerate the kernel JNI classes.
-
-
Add
#include "mglog.h"
and useLOGD("your message %d", someint)
in the C++ files needed to debug. -
Set LogCat filter in Eclipse:
tag:dalvikvm|AndroidRuntime|vgjni|touchvg|vgstack|libc|DEBUG
. -
Print JNI functions to locate problems of libc crash:
- Add
python addlog.py
in jni/build.sh. - Type
./build.sh -swig
to add log in all JNI entry functions, or removetouchvg_java_wrap.cpp
and type./build.sh
.
- Add
-
You can use newproj.py to create library project containing your own shapes and commands. So the TouchVG and TouchVGCore libraries does not require changes.
-
Checkout and enter DemoCmds directory, then type
python newproj.py YourCmds
:git clone https://github.com/touchvg/DemoCmds.git cd DemoCmds python newproj.py MyCmds
-