Skip to content

gengchun/Android_Samples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Samples

sample codes for Android

Vision 1

Face Detection using Vision API

Vision2

Detect Faces from Camera images using camara2 API and Mobile Vision API

Vision3

Detect Barcodes from Camera images using camara2 API and Vision API

Vision4

Detect Texts from Camera images using camara2 API and Vision API

Vision5

Detect Faces from Camera images using camara2 API and Vision API

Vision6

Detect Faces from Camera images using camara2 API and Vision API

Vision7

Detect Faces and Barcodes from Camera images using camara2 API and Vision API

Vision8

Detect Faces from image files using Vision API
show rectangle aroud the Face
trimming out the Face

CloudVision1

Label Detect using CloudVision API

CloudVision2

WEB Detect using CloudVision API

CloudVision3

Label Detect with Remote Image using CloudVision API

CloudVision4

Face Detect using CloudVision API

ScreenCapture1

ScreenCapture using MediaProjection API
mirroring to SutfaceView

ScreenCapture2

ScreenCapture using MediaProjection API
show ScreenShot with Bitmap
save ScreenShot

Osm 1

show Beef Bowl Map

Camera2 API

https://github.com/ohwada/Android_Samples/blob/master/camera2.md

Camera21

Camera Preview using Camera2 API

Camera22

Take Picture using Camera2 API

Camera23

Record Video using Camera2 API

Camera 24

Take Picture with RAW format using Camera2 API

Camera 25

overlay on camera preview using Camera2 API
overlay on camera preview

Camera 26

Face Detection using Camera2 API

Camera 27

Take Picture using Camera2 API
and Camera2Source similar to CameraSource of Vision API

Camera 28

Face Detection using Camera2 API
and Camera2Source similar to CameraSource of Vision API

Camera 29

Take Picture with Shutter Sound using Camera2 API
and Camera2Source similar to CameraSource of Vision API

Camera 211

Auto Focus using Camera2 API

Camera 212

explore supported Camera2 Features using Camera2 API

Camera 213

record Video using Camera2 API

Camera 214

Take Picture with Raw format using Camera2 API

Camera 215

zoom Camera using Camera2 API

Camera 216

Take Picture with Location using Camera2 API and LocationManager

Camera 217

take Picture with Manul Exposure using Camera2 API

Camera 218

take Picture with Burst mode using Camera2 API

Camera 219

WebCamera using Camera2 API

Camera 221

record Video using Camera2 API and MediaCodec

Camera 222

streaming H264 using Camera2 API and MediaCodec

Camera 223

RTSP Server using Camera2 API and MediaCodec

Camera 224

convert Camera image to Sepia

Camera 225

Face Detection and overlay image

OpenCV

https://github.com/ohwada/Android_Samples/blob/master/OpenCV.md

Opencv412Lib

build OpenCV Android 4.1.2 with Android Studio 2.2

Opencv41

show message as whether build and load Successfully

Opencv42

display Camera Preview

Opencv43

convert camera images to Sepia

Opencv44

15-puzzle

Opencv45

show Histograms

Opencv46

detect an area of ​​the same color as the color of the touched location

Opencv47

find Camera Calibration Pattern and highlight pattern

Opencv48

detect interest points using native code
and draw small red circle on interest points

Opencv49

detect Faces
and draw Rectangle on Faces

Opencv51

Cat Face Detection

Opencv52

Mobilenet object detection

Opencv53

QRCodeDetector

Opencv54

Camera Preview with GLSurfaceView

Opencv55

convrt image with GLSurfaceView

OpenGL

OpenGL ES 2.0 Sample

OpenGL1

fill the background with color

OpenGL2

draw Triangle

OpenGL3

draw Square and Triangle

OpenGL4

draw rotating Cube

OpenGL5

draw Rectangle with Texture

OpenGL6

draw Rectangle with Image Texture

OpenGL7

draw Square and moving Triangle

OpenGL8

draw Square and scaling Triangle

OpenGL9

draw Images continuously like slot machine

OpenCL1

calculate array addition with GPU by OpenCL program

OpenCL2

create String "Hello, World!'' with GPU by OpenCL program

OpenCL3

show OpenCL Version

OpenCL4

convert Image to black and white

OpenCL5

Gaussian Filter

OpenCL6

detect line from Camera image

MediaCodec

Sample code for MediaCodec and MediaMuxer

MediaMuxer1

Encode and Mux Test

MediaMuxer2

CameraToMpegTest

ImageFormatConverter

convert YUV420_888 to YUV420Planar

MediaPlayer

https://github.com/ohwada/Android_Samples/blob/master/MediaPlayer.md

AudioPlayer1

play Audio Files using MediaPlayer

VideoPlayer

play Video files using MediaPlayer

VoiceRecorder1

record Voice using MediaRecorder

Dialog

https://github.com/ohwada/Android_Samples/blob/master/dialog.md

AlertDialog1

customize of AlertDialog

Dialog1

Yes No Dialog resembles AlerDialog

ImageDialog 1

show Image in AlertDialog

CSV Library

https://github.com/ohwada/Android_Samples/blob/master/csv.md

Csv 1

read and write CSV file using OpenCSV

Csv 2

read and write CSV file using univocity-parsers

Csv 3

read and write CSV file using Apache Commons CSV

Osmdroid

https://github.com/ohwada/Android_Samples/blob/master/osmdroid.md

Osmdroid1

display OpenStreetMap

Osmdroid2

display OpenStreetMapwith Markers

Osmdroid 3


Osmdroid 4

display OpenStreetMap with Tiles Overlay and Custom Tile Source

Osmdroid 5

display OpenStreetMap with MinimapItemizedoverlay and custom Icon using Osmdroid

Osmdroid 6

display Offline Map using Osmdroid

Osmdroid 7

Tile Downloader for Offline Map

Osmdroid 8

OpenStreetMap with Marker and window info

Osmdroid 9

bookmark the location of the map using Osmdroid

Osmdroid 10

display Map Tile of Japan GSI using Osmdroid

Osmbonuspack1

display OpenStreetMap with loading KML

Osmbonuspack2

display OpenStreetMap with loading KML and custom Style

Osmdroidwms 1

display Map Tile of Japan MILT using Osmdroid

Osmdroidwms 2

display Map Tile of Japan MILT with WMS capabilities using Osmdroid

Image Library

https://github.com/ohwada/Android_Samples/blob/master/Image_Library.md

Picasso Sample 1

display image with Picasso

Picasso Sample 2

retouch image with Picasso

Glide Sample 1

display image with Glide

Glide Sample 2

display animation gif with Glide 3.7.0

Giphy

display animation gif with Giphy API and Glide 4.4.0

Fresco Sample 1

display image with Fresco

GPUImage Sample 1

retouch image with GPUImage

GPUImage Sample 2

retouch image with GPUImage

SVG Sample

display SVG Image with SVG Library 1.2.1

Glide SVG Sample 1

display SVG Image with Glide 3.7.0 and SVG Library 1.2.1

Vector Image Sample

display Vector Image

Http Library

https://github.com/ohwada/Android_Samples/blob/master/Http_Library.md

Volley Sample 1

get text from web server and post data to web server with Volley

OkHttp Sample 1

get text from web server and post data to web server with Volley

Retrofit Sample 1

get text from web server and post data to web server with Volley

Ion Sample 1

get text from web server and post data to web server with Volley

Ion Sample 2

get json and parse

Ion Sample 3

get image and display in ImageView

LivedoorWeather

Weather Report with Livedoor Weather API

RSS Parser Library

RSS-Parser

RSS Reader for Android Authority

RSS

RSS Reader for BBC World News

Yahoo News

RSS Reader for Yahoo News

RecyclerView

https://github.com/ohwada/Android_Samples/blob/master/RecyclerView.md

RecycleView Sample 1

display text in list
with ItemClickListener

RecyclerView Sample 2

display text in list
add item and remove item with animation

RecyclerView Sample 3

display text in SortedList

RecyclerView Header

display text in List and Header Footer

Share Intent

https://github.com/ohwada/Android_Samples/blob/master/Share_Intent.md

ShareProviderSample

send Share Intent with ShareCompat

ShareRecieverSample

recieve Share Intent with ShareCompat

ShareActionProviderSample

send Share Intent with ShareActionProvider

ShareRecieverSample2

recieve Share Intent

MailShareProviderSample

send Share Intent to GMAIL App

MailShareRecieverSample

recieve Share Intent for Mail app

Gmail

https://github.com/ohwada/Android_Samples/blob/master/Gmail.md

JavaMail sample 1

send mail with JavaMail via Gmail SMTP server

JavaMail sample 2

get mail with JavaMail from Gmail IMAP server

GmaillApiSample

get Gmail Label with Gmail API

MIDI

sample codes for Android MIDI API
https://github.com/ohwada/Android_Samples/blob/master/MIDI.md

MIDI Synth Sample


MIDI Keyboard Sample


MIDI Player Sample1

play MIDI File with MIDI Symth

MIDI Player Sample2

play MIDI File with android-midi-lib

##Media Player MIDI Sample
play MIDI File with Media Player

OSC

sample codes for Android OSC
https://github.com/ohwada/Android_Samples/blob/master/OSC.md

Java OSC Sample

send OSC Message with JavaOSC Library

OSC Reciver Sample

recieve OSC Message with JavaOSC Library

OSC Reciver Sample 2

recieve OSC Message with JavaOSC Library
improved version of OSC Reciver Sample

NDK

sample codes for Android NDK ( Native Development Kit )
https://github.com/ohwada/Android_Samples/blob/master/NDK.md

NdkHelloLibs

this sample shows you how to manage 3rd party C/C++ libraries with Android Studio.

Ndk2

hello-jni
this sample use JNI to call C code from a Android Java Activity.

Ndk3

hello-jniCallback
this sample is an Aadd-on to Hello JNI sample to demonstrate calling back to Java from C code

Ndk4

Hello GL2
this sample draws a triangle using GLES 2.0 API.

Ndk5

GL ES 3.0 JNI
fills small rotating squares on on the entire screen
this sample demonstrates how to use OpenGL ES 3.0 from JNI/native code.

Ndk6

Bitmap Plasma
this sample uses JNI to render a plasma effect in an Androide

Ndk7

native-activity
this sample that initializes a GLES 2.0 context
fill background with Color Magenta

Ndk8

classic-teapot
draw Teapot

AAR

sample codes for AAR( Android Archive )

AarDemo1

show Library Activity

AarLib1

Android Library Sample
show Sample Activity

Others

BitmapRegionDecoder1

crop Image using BitmapRegionDecoder

CropIntent1

crop Image using CropIntent

SimpleCropView1


Scroller1

Scroller Sample
move the red square by accelerating, when flick the screen

Scroller2

Scroller Sample
scroll and switch Pages , when flick left or right

Renderscript1

BasicRenderScript

Renderscript2

RenderScriptIntrinsic

CpuInfo

read "/proc/cpuinfo"
and show Cpuinfo

GpuInfo

show Gpuinfo using Open GL ES

SSDP Client

send SSDP Discovery command

Html1

show rendered HTML in TextView
remove HTML tags

FileProvider1

Share Files

Preference1

Sample of Preference

VideoPlayer1

play Video files using MediaPlayer

AudioPlayer1

play Audio Files using MediaPlayer

RoundedImageView1

show Rounded image using RoundedImageView

TextureView 1

sample code of TextureView

Nanohttpd 1

Web Server on Android using NanoHttpd

MyIpAddress 1

IP Address of Android phone myself

FilePicker 1

read and write file with FilePicker

Sqlite1

SQLite Sample

JetBoy

JetBoy is Android sample game that demonstrates the use of the android.media.JetPlayer class

Databinding Sample

bind Application Logic and Layout

Snackbar Sample

Snackbar show a brief message at the bottom of the screen

Wasp DB Sample

key/value data storage library for Android

Kryo Sample

Java binary serialization

Service Sample 1

send Broadcast Message from Service to Activity

Service Sample 2

send and recieve messages between Activity and Service

StreetView PanoramaView Sample

display StreetView with Google Play Services maps:11.0.0

WebView Sample

display HTML in WebView

WebView 2

click listener of a tag

HTML in TextView

display HTML in TextView

Menu 1

display Menu without Support Libraly

Menu 2

display Menu with Support Libraly

Tab Layout Sample

app has 3 tabs

GSON Sample 1

convert Java Objects into JSON and back with GSON

Asset Sample 1

rearead file in assets fonlder of app

Animation Sample 1

animate view with ViewCompat

Animation Sample 2

animate view with AnimationDrawable

Animation Sample 3

animate view with Animation object

ListView Sample 1

display text in list

ListView Sample 2

display image and text in list

Nougat Sample 1

ScopedDirectoryAccess
call the permission dialog and copy image files


Line Chart Sample 1

Line Chart


Line Chart Time Sample 1

Line Chart of
Time data with Random values


Line Chart Time Sample 2

Line Chart of Sin Wave Data at one hour interval using l using MPChart 3.0.2


Line Chart Time Sample 3

Line Chart of Sin Wave Data at one minute interval using MPChart 2.1.6


Line Chart Time Sample 4

Line Chart of Sin Wave Data at one minute interval using MPChart 3.0.3


Line Chart Time Sample 5

Line Chart of Sin Wave Data at one second interval using MPChart 3.0.3


Line Chart Time Sample 6

Line Chart of Sin Wave Data at one millli second interval using MPChart 3.0.3

Real Time Line Chart Sample 1

Line Chart of Real Time data

Storage Sample 1

write Storage for Android 4.4
wrie to application specific area

Storage Sample 2 and 3

write Storage for Android 4.4
two different applications write to the application sharing area

Storage Sample 4

write Storage in Android4.4 earlier style

Font Sample 4

Japanese fonts
enclose Japanese fonts in Android application

Strorage Access Sample 1

Strorage Access Framework
call the picker specified image files


Permission Sample 1

Android 6.0 runtime permission
call trequest permissions


Logcat Sample 1

view logcat in activity
write logcat to file


Uncaught Exception Sample 1

write to log file when uncaught exception occurs

Device Id Sample 1

get Device Identities
IMEI, IMSI, ICCID, Mac Address, Android ID


System Info Sample 1

get System Informations
BRAND, DEVICE, MANUFACTURER, MODEL, VERSION.SDK_INT


Package Info Sample 1

get Package Informations
firstpackageName, versionCode, InstallTime


UUID Sample 1

genatate UUID
genatate once, save abd reuse



ServiceList Sample 1

get Service List in running

<

Sensor Sample 1

get values of Sensors
Light, Temperature, Humidity, Pressure


###Sensor Sample 2

get values of Enviromental Sensors
Temperature, Humidity, Pressure


Broadcast Receiver Sample 1

receive Broadcast events
ACTION_TIME_TICK, ACTION_TIME_CHANGED, ACTION_TIMEZONE_CHANGED

Content Observer Sample 1

observe events from Content Provider
receive events System Setting changeed

DigitalClock


AnalogClock


Caller Sample

Output the caller's class name and method name to logcat

About

Code Samples for Android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 47.8%
  • C++ 45.4%
  • C 4.0%
  • CMake 2.6%
  • Objective-C 0.1%
  • HTML 0.1%