Blog Post

PSPDFKit 2.9 for Android

Today we are bringing you the first big update of PSPDFKit for Android in 2017 - version 2.9, including dual-page scrolling mode, custom localizations support, improved theming, better API and more.

Dual-Page Scrolling Mode

One of the most requested features in the last year was dual-page scrolling mode. And it’s finally here with all of its glory!

Dual-page mode

Dual-page scrolling mode is enabled by default on all devices that are wide enough to support it (i.e. tablets in landscape). Therefore, to start using it, you don’t need to change your configuration. We also made many aspects of the new scrolling mode customizable so that you can build a UI that fits your needs. Take a look into PSPDFActivityConfiguration.Builder and discover all the new options, like layoutMode, firstPageAlwaysSingle and showGapBetweenPages, for yourself.

Localizations

We are shipping localizations for more than 20 languages. In this release, we’ve added all the necessary machinery to enable you to add or override existing localizations during application runtime. You can even add support for brand new languages.

For this to work, you need to implement your own LocalizationListener or override its default implementation DefaultLocalizationListener and set it via PSPDFKit#setLocalizationListener.

Dialog Styling

We’ve also expanded our already extensive set of theme-able attributes with more attributes for styling modal dialogs that are used across the framework. This means that our dialogs won’t default to light theme anymore and can be tweaked to your liking. Another added benefit is that we’ve revisited all our dialog implementations and streamlined their design.

Dialog styling

See the new guide article for a list of new theme attributes. For comprehensive usage example, take a look into dark_theme.xml in our Catalog app.

Document Title Overlay

We now show the document title in an overlay by default, because we noticed that the document title was truncated in the action bar on smaller screens for some documents. To customize this behavior, you can use hideDocumentTitleOverlay in PSPDFActivityConfiguration.Builder to always display the document title in the action bar.

Document title overlay

Collapsible Outline

The document outline now supports collapsible elements. This gives you a better overview when using documents with many outline elements.

Collapsible outline

API Polishing

Our long term goal when designing our API is to make it simple to use and be attentive to your needs. Since the last version, we’ve improved on various API, which were not that easy to use or were lacking in other aspects.

By using PSPDFLibrary, you were able to get fast and efficient full text search via a simple API. With this release, we reworked PSPDFLibrary internals. This means better speed (up to 10x) and lower memory usage. Because of this, you shouldn’t hesitate even when throwing large document libraries at it. We also now use SQLite’s FTS 5, upgraded from FTS4.

With FTS 5, we get a lot of improvements, like:

  • Lower memory usage: Due to its incremental nature, extraction of data in FTS 5 has a lower peak memory allocation than FTS 4.

  • Faster search: With smart heuristics, the new engine can now determine if it is possible to extract results without inspecting the entire database.

  • Faster insertions: Enqueuing documents to PSPDFLibrary is now much quicker in cases where additional operations need to be performed on the FTS tables.

  • Fewer bugs: SQLite’s FTS4 had a few issues with false positive results that have been resolved with FTS 5.

Since we've migrated to FTS5, all your documents will need to be reindexed.

More Improvements

  • We fixed a security issue where DocumentSharingProvider could expose other application files than those being shared. More information on this can be found in an announcement we posted.

  • Threading is hard. We fixed a race condition in our initialization code inside PSPDFKit#initialize.

  • Repeatedly highlighting the same sentence would not create overlapping highlights anymore.

  • Document editor now retains non-saved editing state after rotation.

We also fixed a huge amount of other issues and introduced multiple minor enhancements in this release. If you’re interested in all the details, see the full list of changes in PSPDFKit 2.9 for Android.

Related Products
Share Post
Free 60-Day Trial Try PSPDFKit in your app today.
Free Trial

Related Articles

Explore more
DEVELOPMENT  |  Android • iOS • Objective-C • C++

Super Fast Builds Using distcc

PRODUCTS  |  Android • Releases

PSPDFKit 2.8 for Android

DEVELOPMENT  |  Android • Kotlin • Java • Tips

A clean status bar with Android System UI and QuickDemo