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

Category: Code Snippets

Read a json/text file from assets folder

January 27, 2021 apktutor Leave a comment

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, Simple App Examples

Android code snippets 1

August 19, 2020 apktutor Leave a comment

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 Leave a comment

 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

Creating Map Variable and Map List

January 15, 2019 apktutor Leave a comment

Create a Map variable // Create a new HashMap HashMap<String, Object> mapVariable = new HashMap<String, Object>(); // Add items to…

Continue Reading →

Posted in: Adapter View, Code Snippets Filed under: ArrayList HashMap, HashMap Android, Map List, Map Variable

Simple Intent operations

January 8, 2019 apktutor Leave a comment

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, Uncategorized Filed under: Android Intent, Intent operations, Intent to launch Activity, Launch new Activity

Create OptionsMenu programmatically

January 4, 2019 apktutor Leave a comment

Continue Reading →

Posted in: Code Snippets, User Interface Components Filed under: onCreateOptionsMenu, OptionsMenu

Create OptionsMenu using an XML menu

December 30, 2018 apktutor Leave a comment

Continue Reading →

Posted in: Code Snippets, User Interface Components Filed under: Android OptionsMenu, MenuInflater, onCreateOptionsMenu, OptionsMenu

Display Toast messages at different positions

December 21, 2018 apktutor 9 Comments

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

Categories

  • Adapter View (9)
  • Advanced Android App Examples (2)
  • Code Snippets (8)
  • Layouts and Widgets (22)
  • Simple App Examples (21)
  • Uncategorized (11)
  • User Interface Components (2)

Recent posts

  • Read a json/text file from assets folder
  • Android canvas detect touch points
  • Plot numbers as Line graph on canvas
  • Create a View class using Canvas
  • Get video thumbnail from url of video
  • Android code snippets 1
  • Copy file from assets folder to external cache
  • Using Google Sign In with Firebase Auth in AIDE
  • Encrypt and decrypt text
  • GridView with Image and Text

Join Our Newsletter

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


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