Using Skia in Android NDK
Asked Answered
K

4

19

Is it true that android.graphics.* depends on the native Skia library? If so, is it possible to access the Skia library in my native C/C++ codes?

Krypton answered 14/6, 2011 at 10:36 Comment(0)
D
17

Skia is not offered as a lib/sharedlib inside android, as its api is not guaranteed to be stable over time.

there is no sample implementation of controls in C/C++, all the widget/view sub-system is done in Java

for skia http://code.google.com/p/skia/

Departmentalism answered 14/6, 2011 at 10:41 Comment(3)
Thanks, Rishabh. A followup question, is it possible to custom build the skia lib and include it in my jni? If so, how to do that?Krypton
Check this out this will help code.google.com/p/skia/source/browse/trunk/android_sample/…Departmentalism
Also, you should accept answers to your questions if you've found them to be useful(See there is a tick there)and also use upvotes. It will help you get more answers.Departmentalism
Q
5

Skia can be use using native c/c++ code but you need android source to build your app and generate lib<>.so and apk because its make needs external/skia/..... in Android.mk[sample code as indicated by Rishabh]

Actually I tried one sample in which i pass canvas object to my native code using JNI and drawXXX() on canvas using skia apis.

You can refer to Android graphics pipeline to understand android graphics pipleline.

Quell answered 27/6, 2011 at 17:7 Comment(0)
C
4

This is a minimal Android app that uses JNI and Skia to do rendering.

https://skia.googlesource.com/skia/+/master/platform_tools/android/examples/hello_skia_app/

Choirmaster answered 27/3, 2014 at 7:48 Comment(3)
404, not found.Kythera
github.com/osmandapp/OsmAnd-external-skia/tree/master/…Choirmaster
github.com/android/platform_external_skia/tree/master/…Choirmaster
W
2

If you are developing using AOSP it's very simple - you can link previously built libskia.so in your NDK app

Wadi answered 4/12, 2015 at 10:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.