npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nativescript-fast-android-r

v1.1.0

Published

Your awesome NativeScript plugin.

Downloads

15

Readme

nativescript-fast-android-r

In {N}, querying android.R, like using android.R.integer.config_longAnimTime, will cause an UI lag for over 500ms the first time it's called. R is a big class with many child static classes, so yhis slowdown may be because {N} loads all the R class metadata at runtime.

This plugin provides the proxy object androidR that uses Reflection to query the static class integer and field config_longAnimTime to return the value.

Installation

tns plugin add nativescript-fast-android-r

Usage

To use this plugin, simply import androidR and use it like you'd use android.R

import { androidR } from "nativescript-fast-android-r";
console.log(androidR.integer.config_longAnimTime);

Peformance

Querying android.R for the first time takes usually from 400-800ms, and a negligible time from then onwards.

console.log(android.R.integer.config_longAnimTime); // 400-800ms
console.log(android.R.integer.config_longAnimTime); // ~0ms
console.log(android.R.integer.config_shortAnimTime); // ~0ms
console.log(android.R.integer.config_shortAnimTime); // ~0ms
console.log(android.R.transition.explode); // ~0ms
console.log(android.R.transition.explode); // ~0ms

fast-android-r caches all classes and values that are queried. The first query usually takes <5ms. Subsequent queries to the same value will take negligible time (O(1) lookup). First time queries to other fields/classes usually take <2ms.

console.log(androidR.integer.config_longAnimTime); // 0-4ms
console.log(androidR.integer.config_longAnimTime); // ~0ms
console.log(androidR.integer.config_shortAnimTime); // 0-2ms
console.log(androidR.integer.config_shortAnimTime); // ~0ms
console.log(androidR.transition.explode); // 0-4ms
console.log(androidR.transition.explode); // ~0ms

Future possibilities

WAlthough some values from the R class are dynamic (e.g.: resources, strings, etc), most of them are not (integer.config_longAnimTime, integer.config_longAnimTime and others defined in the documentation). It may be benefitial to preload immutable values into the cache while allowing "dynamic" values to be queried.

License

Apache License Version 2.0, January 2004