sharp alternatives and similar packages
Based on the "Utility" category.
Alternatively, view sharp alternatives based on common mentions on social networks and blogs.
-
timber
A logger with a small, extensible API which provides utility on top of Android's normal Log class. -
ExpirableDiskLruCache
Java implementation of a Disk-based LRU cache which specifically targets Android compatibility. -
tape
A lightning fast, transactional, file-based FIFO for Android and Java. -
OpenKeychain
OpenKeychain is an OpenPGP implementation for Android. -
joda-time-android
Joda-Time library with Android specialization -
easydeviceinfo
:iphone: [Android Library] Get device information in a super easy way. -
Android-Templates-And-Utilities
Collection of source codes, utilities, templates and snippets for Android development. -
secure-preferences
Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure. -
greenrobot-common
General purpose utilities and hash functions for Android and Java (aka java-common) -
Androl4b
A Virtual Machine For Assessing Android applications, Reverse Engineering and Malware Analysis -
vector-compat
A support library for VectorDrawable and AnimatedVectorDrawable classes introduced in Lollipop -
CastCompanionLibrary-android
CastCompanionLibrary-android is a library project to enable developers integrate Cast capabilities into their applications faster and easier. -
android_dbinspector
Android library for viewing, editing and sharing in app databases. -
AndroidBillingLibrary
Android Market In-app Billing Library -
motion
An Android library allowing images to exhibit a parallax effect that reacts to the device's tilt -
Colours
A beautiful set of predefined colors and a set of color methods to make your Android development life easier. -
MrVector
[Deprecated] AKA VectorDrawableCompat: A 7+ backport of VectorDrawable -
EasyCamera
Wrapper around the android Camera class that simplifies its usage -
Reservoir
Android library to easily serialize and cache your objects to disk using key/value pairs. -
android-validation-komensky
A simple library for validating user input in forms using annotations. -
dspec
A simple way to define and render UI specs on top of your Android UI. -
routable-android
Routable, an in-app native URL router, for Android -
android-intents
A small library which will save you from writing the same intent creation code again and again for the most simple tasks
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of sharp or a related project?
Popular Comparisons
README
Sharp
Sharp is a Scalable Vector Graphics (SVG) implementation for Android. It facilitates loading vector graphics as SharpDrawables, and can effectively be used wherever a conventional image would be displayed, whether it be as a background, ImageView source, inside a StateListDrawable or used as composites in a TextView.
Forked from:
https://github.com/pents90/svg-android
Merged changes from forks:
https://github.com/b2renger/svg-android
https://github.com/mindon/svg-android
https://github.com/josefpavlik/svg-android
Download
Download the latest from mavenCentral()
using Gradle:
dependencies {
implementation 'com.pixplicity.sharp:library:[VERSION_HERE]@aar'
}
Sample
A sample is included in this repository.
It's easy to load an SVG:
Sharp.loadResource(getResources(), R.raw.cartman)
.into(mImageView);
SVGs can be loaded from various sources:
loadAsset(AssetManager, String)
loads SVG data from an Android application asset;loadResource(Resources, int)
loads SVG data from an Android application resource;loadString(String)
loads SVG data directly from a String;loadInputStream(InputStream)
loads SVG data from an InputStream (but it's your responsibility to close it afterwards);loadFile(File)
loads SVG data from a File, internally opening and closing a FileInputStream to do so.loadPath(String)
loads SVG data directly from a String (but uses a lot of memory doing so).
Sharp facilitates the application of the resulting drawable as well, through the following methods:
into(View)
takes care of loading the SVG into the source of the ImageView, or setting the background if the view is not an ImageView;getDrawable(View)
generates aSharpDrawable
, which is a subclass ofPictureDrawable
that respects theSharpPicture
boundaries.getDrawable(View, DrawableCallback)
does the same, but on a background thread with callbacks ofDrawableCallback
;getSharpPicture()
generates aSharpPicture
, a wrapper containing aPicture
and the SVG bounds and limits;getSharpPicture(PictureCallback)
does the same, but on a background thread with callbacks ofPictureCallback
;withAssets(AssetManager)
provides access to your application's assets, allowing Sharp to read typefaces;
It's recommended to use into(View)
or getDrawable(View)
, as the View parameter takes care of setting the view's layer type to View.LAYER_TYPE_SOFTWARE
.
Typefaces
By loading an SVG from the assets directory using loadAsset(AssetManager, String)
, or by loading it through a different mechanism and providing access to your application's assets using withAssets(AssetManager)
, Sharp can read typeface files automatically from the assets directory.
Sharp expects the typeface to be present as:
/assets/fonts/[typeface name].ttf
If your font does not appear, check Logcat for any insightful error messages.
Why isn't my SVG appearing?
If you're setting your view's drawable manually, instead of using into()
or intoBackground()
, be sure to set the view's layer type to View.LAYER_TYPE_SOFTWARE
.
Why no hardware acceleration?
Excellent question! Aside from the fact that PictureDrawable doesn't render correctly, paths do not efficiently render in hardware acceleration. Even if it worked, it would have poor performance. Read this excellent discussion about why this is, if you're interested.
You don't need to disable hardware acceleration on your entire application. Only individual views need to have the layer type changed, and providing your view into SharpPicture.getDrawable(View)
takes care of this for you.
Known issues
- Text size and position isn't accurate. It's recommended to convert all text to paths in order for it to appear pixel-perfect.
- Android's Gradle plugin 2.0.0 (in the preview channel as of January 2016) no longer allows you to place SVG files in
/res/drawable
. We recommend placing them in/res/raw
(or/assets
and usingloadAsset()
) instead.
License
Licensed under the Apache license 2.0.
*Note that all licence references and agreements mentioned in the sharp README section above
are relevant to that project's source code only.