This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = function(context, event, callback) { | |
let twiml = new Twilio.twiml.VoiceResponse(); | |
var fetch = require('node-fetch'); | |
// Define the list of sermons and fetch the data | |
const url = '<enter the URL of the json object to read>'; | |
fetch(url) | |
.then(response => response.json()) | |
.then(function(data) { | |
// Validate we have some sermon data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sermons":[ | |
{ | |
"id": 1, | |
"title": "Description for first mp3, e.g. Sunday 9:15", | |
"url": "<enter URL of first mp3>" | |
}, | |
{ | |
"id": 2, | |
"title": "Description for second mp3, e.g. Sunday 10:45", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> | |
<channel> | |
<item> | |
<title>The title of the podcast one</title> | |
<itunes:author>Author one</itunes:author> | |
<enclosure url="https://your-host-name/podcast-one.mp3" type="audio/mpeg"></enclosure> | |
</item> | |
<item> | |
<title>The title of the podcast two</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = function(context, event, callback) { | |
let twiml = new Twilio.twiml.VoiceResponse(); | |
let Parser = require('rss-parser'); | |
let parser = new Parser(); | |
// Define the list of sermons and fetch the data | |
const url = '<enter the URL of RSS feed to read>'; | |
parser.parseURL(url, function (err, feed) { | |
if (err) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package uk.co.brightec.barcodeblogpost | |
import android.graphics.Bitmap | |
import android.os.Bundle | |
import androidx.annotation.ColorInt | |
import androidx.appcompat.app.AppCompatActivity | |
import com.google.zxing.BarcodeFormat | |
import com.google.zxing.oned.Code128Writer | |
import kotlinx.android.synthetic.main.activity_main.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun displayBitmap(value: String) { | |
val widthPixels = resources.getDimensionPixelSize(R.dimen.width_barcode) | |
val heightPixels = resources.getDimensionPixelSize(R.dimen.height_barcode) | |
image_barcode.setImageBitmap( | |
createBarcodeBitmap( | |
barcodeValue = value, | |
barcodeColor = getColor(R.color.colorPrimary), | |
backgroundColor = getColor(android.R.color.white), | |
widthPixels = widthPixels, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun createBarcodeBitmap( | |
barcodeValue: String, | |
@ColorInt barcodeColor: Int, | |
@ColorInt backgroundColor: Int, | |
widthPixels: Int, | |
heightPixels: Int | |
): Bitmap { | |
val bitMatrix = Code128Writer().encode( | |
barcodeValue, | |
BarcodeFormat.CODE_128, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<ImageView | |
android:id="@+id/image_barcode" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<dimen name="width_barcode">300dp</dimen> | |
<dimen name="height_barcode">65dp</dimen> | |
</resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example | |
import android.support.v7.recyclerview.extensions.AsyncDifferConfig | |
import android.support.v7.recyclerview.extensions.AsyncListDiffer | |
import android.support.v7.util.DiffUtil | |
import android.support.v7.util.ListUpdateCallback | |
import android.support.v7.widget.RecyclerView | |
/** | |
* {@link RecyclerView.Adapter RecyclerView.Adapter} base class based on |
NewerOlder