Skip to content

Instantly share code, notes, and snippets.

@granoeste
granoeste / EachDirectoryPath.md
Last active April 4, 2024 22:32
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@akiatoji
akiatoji / _sns_description
Last active January 15, 2020 02:30
AWS SNS Sample code.
Notes on how to use AWS SNS:
1. Subscribe an HTTP endpoint (i.e. http://myhost/sns_endpoint) on AWS Console
2. AWS will send subscription confirmation right away
3. SNS_controller responds to subscription confirmation by sending confirmation using Fog.
4. Once AWS is happy, you can start sending notifications to your end point via SNS.
aws = require ('aws-lib')
access_key_id = "<Your access key id>"
secret_access_key = "<Your secret access key>"
options = {
"path" : "<Your queue URL, just the /accountid/queue_name is needed>"
}
sqs = aws.createSQSClient(access_key_id, secret_access_key, options)