GitHub - IanDarwin/Android-Cookbook-Examples: Contributed code examples from O'Reilly Android Cookbook. See #user-content-table README below!

AboutBoxDemo

Ian Darwin

A re-usable About dialog.

-

AboutInfo

Ian Darwin

Info about device and screen

-

ActionBarCompat

Ian Darwin

Simple ActionBar demo(s)

-

AddContact

Ian Darwin

Add a contact

Shows ContactsContract, content provider

AdMobDemo

Ian Darwin

Using AdMob with interstitial (inter-Activity) ads.

-

Analytics

Ian Darwin

Ashwini’s Google Analytics for Android Demo, slightly updated.

-

AndroidPlot

Rachee Singh

Graphing

-

AndroidRss

Wagied Davids

RSS Reader

Works under Maven; Eclipse fails w/ Maven Configuration Problem

AppDownloader

Ian Darwin

Installs another app

Downloading, package management

AppShortcutsDemo

Ian Darwin

Shows App Shortcuts, which appear with long-press on app’s launcher icon.

-

AppSingleton

Ian Darwin

Compilable example of the Application Singleton pattern recipe.

-

AsyncTaskDemo

Ian Darwin

Demo of AsyncTask

-

AutocompleteTextViewContacts

Ian Darwin

Contact picker with autocomplete

-

AutoUpdater

Ian Darwin

App can update itself

see AppDownloader

BackupManager

Ian Darwin

Use Android Backup scheme.

-

BluetoothConnectToDevice

Ian Darwin

Using BlueTooth to connect

-

BluetoothDemo

Ian Darwin

Bluetooth Connection

-

BrowserBookmarks

Ian Darwin

Use the now-defunct Browser Bookmarks content provider

-

CalAdder

Ian Darwin

Add appointment to Calendar

Calendar via Content Provider

CallFaker

Ian Darwin

Pretend a call happened, for testing

-

CallInterceptorIncoming

Johan Pelgrim

Intercept an incoming phone call.

-

CallInterceptorOutgoing

Johan Pelgrim

Intercept outgoing phone calls.

Compiles and runs, but doesn’t intercept the call.

CameraIntent

Ian Darwin

CameraIntent - get the camera to take a picture, using androidx API

-

CardDemo

Ian Darwin

Demonstation of Card widget.

-

CheckBoxRadioButton

Ian Darwin

GUI demo

name says it

CircleViewGroup

Ian Darwin

Attempt at a custom layout manager.

-

ContentProviderBookmarks

Ian Darwin

List of bookmarks from Bookmarks Content Provider

Browser ContentProvider

ContentProviderList

Ian Darwin

List of ContentProviders

-

ContentProviderSample

Ashwini Shahapurkar

Implement a ContentProvider

-

ContentProviderTest

Ian Darwin

Test it

-

CordovaDemo

Ian Darwin

Simple Cordova (nee PhoneGap) cross-platform (web-based) toolkit demo.

-

CountDownTimerExample

Wagied Davids

Time-based activity

-

CryptoDemos

Ian Darwin

Cryptography anyone?

-

CurrentMoodWidget

Ian Darwin

Application Widgets have a live display on the home page, like the standard Clock program.

-

CursorLoaderDemo

Ian Darwin

How to load data properly using CursorLoader

-

CustomMenu

Ian Darwin

Menu

-

CustomSubMenu

Ian Darwin

Submenu, created programmatically

-

CustomToast

Rachee Singh

Toast

-

DatabaseFromFile

Ian Darwin

Create a database from an SQLite .db file in 'assets'.

-

DataToCursor

Ian Darwin

Fake up a Cursor from a list of files

-

DateFormatDemo

Ian Darwin

Example of various DateFormat usages (the Android one, not java.text nor java.time).

-

DemoSmali

Ian Darwin

A pedagogic project that can be used to show off Smali for short functions.

-

DialogDemos

Ian Darwin

Dialogs

-

DragDropDemo

Ian Darwin

A simple Drag-and-drop example.

-

DreamsDemo

Ian Darwin

Demo of "Dreams" (4.x screensaver)

-

EmailTextView

Wagied Davids

Send contents of EditText via email

-

EmailWithAttachments

Marco Dinacci

Attach file to email

-

EpochJSCalendar

Wagied Davids

Java + JavaScript Epoch Calendar

-

EventListenersDemo

Daniel Fowler

5 Ways to Wire an Event Listener.

-

FacebookSdk

N/R. Pending check.

Access FB API

-

FaceFinder

Wagied Davids

Face locator API in photos

-

FileProviderDemo

Ian Darwin

Demo of FileProvider.

-

FilesystemDemos

Ian Darwin

Internal and external files.

-

FindMeX

Ian Darwin

Find Me X

IllegalArgumentException: Incomplete location object, missing timestamp or accuracy, Progress:334

FloatingActionButtonSnackbarDemo

Ian Darwin

Demo of 'fab' Floating Abstract Button

-

FlutterDemo

Ian Darwin

Flutter is a new SDK for cross-platform development

-

FontDemo

Ian Darwin

Using a custom font

You need to provide the font file! Example uses Iceberg font…​

FragmentsDemos

Ian Darwin

Simple Fragment and List-Detail Fragments in one project

-

Gallery

Ian Darwin

Simple Photo Gallery example.

Deprecated

GcmClient

Ian Darwin

Google Cloud Messaging - receiver

-

GcmMockServer

Ian Darwin

Google Cloud Messaging - sender

-

GeneralPrompter

Ian Darwin

A program that shows the Storage Facility to prompt for all files.

-

HapticFeedback

Ian Darwin

Haptic Feedback recipe.

-

HelloCommandLine

Ian Darwin

HelloWorld

SDK

HelloEclipse

Ian Darwin

HelloWorld

Eclipse ADT

HelloGradle

Ian Darwin

Hello World with Gradle but NOT Studio.

-

HelloMaven

Ian Darwin

HelloWorld using Maven with android-maven-plugin.

-

HelloStudioTesting

Ian Darwin

HelloWorld of StudioTesting

-

HelloTestingTarget

Adrián Santalla

ADT Testing - subject

-

HelloTestingTestProject

Ian Darwin

ADT Testing - Tests

-

HomeAppListView

Ian Darwin

A Home Application

Shows running a program

IconizedListView

Ian Darwin

List View with Icon

-

ImageButtonDemo

Ian Darwin

ImageButtons!

-

IntentsDemo

Ian Darwin

Intents

-

IPCDemo

Ian Darwin

IPC - Inter-Process Communication, simplified demo (2 versions, alas).

-

IpcServiceDemo

Rupesh Chavan

IPC - Inter-Process Communication, simplified demo (2 versions, alas).

-

JavascriptDataDemo

Ian Darwin

Getting data from Java to JavaScript and back.

-

JavaTimeDemo

Ian Darwin

Demos of java.time date/time API

Actually JSR-310 API; almost same but different package

JSONParsing

Ian Darwin

Simple example of JSON parsing using built-in JSONObject.

-

KotlinVolleyDemo

Ian Darwin

Kotlin version of Volley demo

-

LayoutBorder

Ian Darwin

Layout Border Demo Project Source for Android

-

ListViewAdvanced

Marco Dinacci

ListView

-

ListViewDemos

Ian Darwin

ListView

-

ListViewEmpty

Rachee Singh

ListView with empty list: don’t show blank screen!

-

ListViewSectionHeader

Ian Darwin

ListView with section headers

-

LocalBroadcastDemo

Ian Darwin

Local Broadcast Receiver

-

MapDemosV2

Ian Darwin

This is the Google API Maps V2 Demo.

-

MapsV2AddToProject

Ian Darwin

Adding a Google Maps V2 MapActivity to a project

You must ask for permission from Google (get and provide your own Google API key).

MarketSearch

Ian Darwin

Search the Play Store

-

MaterialDemos

Ian Darwin

MaterialDesign demos

-

MediaPlayerDemo

Ian Darwin

Play media

-

MediaPlayerInteractive

Ian Darwin

Media Player demo from Marco Dinacci, thanks.

-

MediaRecorderDemo

Marco Dinacci

Simple sound recorder

-

MenuAction

Ian Darwin

Menu Action Handling

-

MessengerDemo

Ian Darwin

Using a Messenger to send requests to a Service

-

NativeFunctFromJS

Ian Darwin

Try to invoke native code from JavaScript.

-

NdkDemo

Ian Darwin

Native Development Kit

C Code

NotificationDemo

Ian Darwin

Notifications

-

NumberPickers

Ian Darwin

UI for picking numbers

-

OAuth2Demo

Ian Darwin

Demo of OAuth2 to Google Tasks.

-

OpenGlDemo

Marco Dinacci

OpenGL graphics

-

OrientationChanges

Wagied Davids

Rotation

-

OSMIntro

Rachee Singh

Basic OSM map app demo.

Builds with Maven, not with Eclipse. Maybe m2e aar support, isn’t, yet.

OSMOverlay

Ian Darwin

OSM Map with a map marker overlay

Compiles, runs, doesn’t load map tiles; needs upgrading to osmdroid-android 5.5

OSMTouchEvents

Ian Darwin

OSM Map with touch event handling.

Builds with Maven, not with Eclipse. Maybe m2e aar support, isn’t, yet.

PdfShare

Ian Darwin

Create and share a PDF

-

PermissionRequest

Ian Darwin

Shows asking for permissions at runtime, i.e,. "the new way"

-

PhoneGapDemo

Shraddha Shravagi

HTML5 app using phonegap/cordova

-

PinchAndZoom

Ian Darwin

Pinch-and-zoom graphics demo

-

PreferencesDemo

Ian Darwin

Preferences

-

ProgressDialogDemo

Ian Darwin

Demo of a pop-up indefinite progress dialog.

-

RangeGraphDemo

Ian Darwin

Using a graphing library

-

RatingBarDemo

Ian Darwin

Show use of 5-star RatingBar as used in rankings, surveys, &c.

-

Rebooter

Ian Darwin

How to reboot, and why you can’t

-

RecipeList

Ian Darwin

= RecipeList - use an AsyncTask to download data over the 'net via HTTP.

-

RecyclerViewDemo

Ian Darwin

Demo of RecyclerView, the faster ListView.

-

RemoteSystemsTempFiles

Ian Darwin

This folder is created automatically by Eclipse and can be ignored.

-

RGraphDemo

Wagied Davids

Using a graphing library

-

RoomDemo

Ian Darwin

Demo of Room, the official Android ORM.

-

RuntimeLog

Ian Darwin

A simpe runtime log facility

-

ScanBarcode

Ian Darwin

Scan barcode using ZXing app via Intent

-

SecondScreen

Ian Darwin

Trivial example of one Activity (screen) starting another.

-

SendSMS

Colin Wilcox

Sends an SMS

-

SensorShakeDetection

Thomas Manthey

Use Accellerometer to detect if the user has shaken the device.

-

SensorUpOrDown

Rachee Singh

Code for r2051, Checking Whether a Device Is Facing Up or Down

-

ServiceDemos

Ian Darwin

Demo a couple of kinds of Service.

-

ShareActionProviderDemo

Ian Darwin

ICS "Share" action

-

ShellCommand

Ian Darwin

Run a Unix/Linux command via Runtime.exec, capture the output.

-

SimpleAccountAndSyncDemo

Ian Darwin

User account on device

-

SimpleCalendar

Ian Darwin

Calendar

-

SimpleDialer

Ian Darwin

Trivial Dialer - launches Dialer app via Intent

-

SimpleJumper

Wagied Davids

Common code for flixel-gdx-based gaming demo.

Game starts, can move left-right only, no scenery. Fails on Intel phone/emulator

SimplePool

Wagied Davids

Start of a pool/billiards game using AndEngine.

-

SimpleTorchLight

Saketkumar Srivastav

Simple Torchlight/Flashlight example.

(Most devices now have a built-in control for this)

SlidingDrawer-Topdown

Wagied Davids

The main code is from the "Sliding Drawer - Top Down" recipe

-

SMSReceive

Ian Darwin

Receive an incoming SMS.

-

SnackBarDemo

Ian Darwin

Snackbar (bottom message text) demo

-

SoapDemo

Ian Darwin

XML SOAP Web Service

-

SoftKeyboardEnterNext

Jonathan Fuerth

Change the Enter key to "Next" on one-line text fields.

-

SoundRec

Ian Darwin

Sound Recorder

-

Speaker

Ian Darwin

Text To Speech (TTS)

-

SpeechRecognizerDemo

Ian Darwin

Speech Recognizer.

-

SpinnerDemo

Ian Darwin

Drop-down Spinner Demos

-

SpinningCubeDemo

Marco Dinacci

OpenGL Spinning Cube, from Marco Dinacci

-

SplashDialog

Rachee Singh

Splash screen

-

SQLiteDemos

Ian Darwin

SQLite demos

-

StandardDrawables

Ian Darwin

Use Existing Drawables

-

StaticFileRead

Ian Darwin

StaticFileRead - read a file from the application

-

StringsXML

Daniel Fowler

Demos for "Nuances of Strings.xml" recipe.

-

TabHostDemo

Ian Darwin

TabHost Demo: Demo of the TabHost widget, in a Dialog.

-

TabSwipeDemo

Ian Darwin

Tabbable and swipeable layout

-

TeleCorder

Ian Darwin

Telephone call recorder (in progress!)

-

TelephonyManager

Pratik Rupwal

Displays phone info

-

TestingWithEspresso

Ian Darwin

HelloWorld of EspressoTesting

-

Tipster

Sunit Katkar

Full app: compute and show restaurant bill with tip

-

UniqueId

Ian Darwin

Find device’s unique ID

-

Vibrate

Rachee Singh

Make the device vibrate

-

ViewPagerDemo

Ian Darwin

Swipe among views

-

VolleyDemo

Ian Darwin

Demo of Volley networking library

-

WheelPickerDemo

Wagied Davids

Apple-style Wheel Picker Demo

-

WindowBackgroundDemo

Ian Darwin

Graphical window background

-