Question of using ContentLoadingProgressBar

android.support.v4.widget.ContentLoadingProgressBar is subclass of ProgressBar. That waits a minimum time to be dismissed before showing. Once visible, the progress bar will be visible for a minimum amount of time to avoid “flashes” in the UI when an event could take a largely variable time to complete (from none, to a user perceivable amount)….

read more

Example using SafetyNet reCAPTCHA API in Android App

reCAPTCHA Android API announced as part of Google Play Services. It’s a simple example to use SafetyNet reCAPTCHA API in Android App. Basically, it follow the steps in the tutorial SafetyNet reCAPTCHA API. – Create a Android Project in Android Studio as as usually, with minSdkVersion of 14 or higher. We…

read more

Read Exif tag of JPG using ExifInterface(String filename)

Last posts show how to Read Exif tag of JPG using ExifInterface(FileDescriptor) and using ExifInterface(InputStream). But both ExifInterface(FileDescriptor) and ExifInterface(InputStream) added in API level 24, Android 7.0. In this post, I will show how to use ExifInterface(String filename), added in API level 5. Such that we can set Min Sdk Version to API 19….

read more

Read Exif tag of JPG using ExifInterface(InputStream)

Last post show how to open image of jpeg using Intent.ACTION_OPEN_DOCUMENT (added in API level 19), then display the image and read the Exif tag using ExifInterface (FileDescriptor)(added in API level 24). Here is another alternative using ExifInterface(InputStream) (added in API level 24) to read Exif. Simple modify the method showExif(Uri photoUri). All…

read more

Read Exif tag of JPG using ExifInterface(FileDescriptor)

android.media.ExifInterface is a class for reading and writing Exif tags in a JPEG file or a RAW image file.Supported formats are: JPEG, DNG, CR2, NEF, NRW, ARW, RW2, ORF, PEF, SRW and RAF.Attribute mutation is supported for JPEG image files. This example show how to open image of jpeg using Intent.ACTION_OPEN_DOCUMENT (added…

read more

Create PDF using PdfDocument

android.graphics.pdf.PdfDocument enables generating a PDF document from native Android content. This example show how to create a two page PDF file using PdfDocument, store as “/sdcard/test.pdf”. Then use last example Display PDF using PdfRenderer to view it. (remark: if you use last example to view the PDF file, you have to change targetPdf…

read more

Display PDF using PdfRenderer

The class android.graphics.pdf.PdfRenderer enables rendering a PDF document. This example show how to: MainActivity.java package com.blogspot.android_er.androidpdf;import android.graphics.Bitmap;import android.graphics.pdf.PdfRenderer;import android.os.Bundle;import android.os.ParcelFileDescriptor;import android.support.v7.app.AppCompatActivity;import android.widget.ImageView;import android.widget.Toast;import java.io.File;import java.io.IOException;public class MainActivity extends AppCompatActivity { String targetPdf = “/sdcard/MagPi54.pdf”; ImageView pdfView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); pdfView = (ImageView)findViewById(R.id.pdfview); try { openPDF();…

read more