Skip to content
ApkTutor
Android tutorials for beginners. Learn through our numerous examples.
  • Home
  • About Us
  • Contact Us
  • Privacy Policy
  • Sketchware downloads

Category: Code snippets

Read a json/text file from assets folder

January 27, 2021 apktutor

We can add any file to be incorporated in android project in assets folder, located at ‘/app/src/main/assets/’ and then open…

Continue Reading →

Posted in: Code snippets

Get video thumbnail from url of video

August 27, 2020 apktutor

In android, we can use the MediaMetadataRetriever to retrieve a thumbnail image of an online video from its url. MediaMetadataRetriever…

Continue Reading →

Posted in: Code snippets

Android code snippets 1

August 19, 2020 apktutor

Disable screenshot getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); Hide suggestions from the soft keyboard on EditText view EditText.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); Hide soft keyboard on Button Click…

Continue Reading →

Posted in: Code snippets Filed under: disable screenshot, get Screen Height, Get Screen Width in android, Hide keyboard

Copy file from assets folder to external cache

July 8, 2020 apktutor

 Suppose you have a file IsolationWardGuidelines.pdf in assets folder of your project and you want to copy it to external…

Continue Reading →

Posted in: Code snippets

Simple Intent operations

January 8, 2019 apktutor

An Intent is a description of an operation or action to be performed. It can be used to launch an…

Continue Reading →

Posted in: Code snippets Filed under: Android Intent, Intent operations, Intent to launch Activity, Launch new Activity

Display Toast messages at different positions

December 21, 2018 apktutor

We can apply Gravity to the toast message to display it at various positions on the screen. Below are codes…

Continue Reading →

Posted in: Code snippets

Android Toast Example

September 1, 2018 apktutor

A toast displays a simple message in a small popup, which automatically disappear after a timeout. The code to display…

Continue Reading →

Posted in: Code snippets Filed under: Android Toast message, Toast example, Toast message code
  • AdapterViews (10)
  • Advanced app examples (8)
  • Android canvas (3)
  • Code snippets (7)
  • Dialog (6)
  • Layouts and widgets (15)
  • Menu (2)
  • Notification (1)
  • Service (4)
  • Simple app examples (13)

Recent posts

  • Read and write files in app private storage
  • Detect faces in an image using ML Kit API.
  • Extract text from images
  • Crop and Rotate Image
  • Get meta data using Uri of a file
  • Android Notification Example
  • Moving between fragments
  • Pick and display a pdf file
  • BottomSheetDialog Example Android
  • Play music using MediaPlayer in Service

Join Our Newsletter

Sign up to receive timely, useful information in your inbox.


Privacy Policy
Copyright © 2023 ApkTutor — Primer WordPress theme by GoDaddy