The Stanford Android Library
Android is hard, so we make it easier.
Written by Marty Stepp (stepp AT stanford DOT edu)
The library:
For instructions about how to add the library to your Android Studio project, see the slides below.
Documentation:
The following PDF slides include documentation and instructions for how to install and use the library.
For more detailed documentation, consult the following generated Javadoc HTML page which contains the complete API.
Documentation is currently a work in progress.
-
-
(last updated 2017/02/28)
If you ever want to see how a given library method works, in your own code at the location where you're calling our library method, right-click its name and choose "Go To" → "Declaration".
This will jump you into the source code of the relevant method.
License and Terms:
The library is completely open and free to use, modify, sell, etc. for any purposes, commercial or otherwise.
Full source code is available on GitHub.
FAQ:
-
Q: I'm looking at the docs, and a feature that's listed isn't compiling!
I don't think the feature is there in my JAR at all.
-
A: Are you sure you have the latest version of the JAR?
Try re-downloading it from here into your project's app/libs/ folder and compiling again.
Recent Changes:
-
2019/02/21: Added initial Kotlin features in preparation for more major overhaul.
Small changes/improvements to graphics package.
-
2017/02/27: Added GObject constructors that take a GCanvas.
Updated SimpleFirebase lib to include pushById and sign-in options.
-
2017/02/21: Added SimpleFirebase library.
-
2017/02/06: Added listen() and event() methods to SimpleActivity and SimpleEvents (!!!).
Added $__() overloads that take a View parent and an int viewID in SimpleActivity.
Added $$(), findChildren, and findDescendents in SimpleActivity.
Added automatic request-code generation for startActivityForResult in SimpleActivity.
Added get/setInteger/StringArrayListExtra to SimpleActivity.
Added SimplePreferences get() and get/set[Shared]StringSet.
Added $A(), and log/println, and get*Extra, to SimpleFragment.
Added SimpleView class with some $() related methods.
-
2017/01/17: Added $() methods to SimpleActivity for finding various views by ID.
-
2016/04/07: SimpleList library changed to accept resource IDs or ListView references.
-
2016/04/05: Made many 'void' methods in SimpleXxx classes return 'this' for chainability.
-
2016/03/01: Added XML to JSON conversion.
Added findViewGroup, networkConnectionExists methods to SimpleActivity.
Bug fixes in GSprite class.
-
2016/02/26: Added initial version of SimpleNotification class.
Improvements to SimpleService class.
Added initial version of SimpleIntentService class.
-
2016/02/23: Improvements to SimpleDatabase and related database classes.
-
2016/02/19: Added SimpleDatabase, SimpleCursor, Row classes.
-
2016/02/19: Added GArrow; SimpleActivity getLocation; localization methods.
-
2016/02/09: Added SimpleCanvas, GCanvas, and GObject classes for 2D graphics.
-
2016/02/03: Added getScreenWidth/Height.
-
2016/02/01: Added hasPreference, hasSharedPreference.
-
2016/01/30: Refactored dialog methods to use global settings for cancelable and icon.
Enabled global dialog icon, title, cancelable, etc. settings in res/values/strings.xml.
Refactored openXxxStream methods.
-
2016/01/29: Added methods related to popping up date/time pickers and progress dialogs.
Bug fixes for some dialog methods.
-
2016/01/28: Added methods related to popping up alert dialogs: showAlertDialog, showInputDialog, etc.
-
2016/01/27: Added setTraceLifecycle, handleEnterKeyPress, onEnterKeyPress, getExtra.
Media player bug fix.
Added initial version of SimpleCanvas and SimpleSprite for 2D graphics and basic games.
-
2016/01/26: getDocumentsDirectory, ..., getPhotosDirectory.
Added overloads of openExternal... file methods that accept a File for a directory.
Added fragment methods: addFragment, remove, replace, hide, showFragment.
Added methods to convert between resource names and IDs, and to get all resources of a given type.
-
2016/01/25: Added isPortrait, isLandscape, photoGallery methods; improved JavaDoc comments.
-
2016/01/20: Fixed bug with listSetItems.
-
2016/01/20: Added speechToTextSupported, textToSpeechSupported.
-
2016/01/20: Added soundPause, soundGetPosition.
-
2016/01/20: Fixed bug with unloading TextToSpeech engine in onDestroy.
-
2016/01/18: Initial version of library.