Found 1631 Articles for Android

How to set Android Toast duration longer than Toast.LENGTH_LONG using Kotlin?

Azhar
Updated on 26-May-2020 06:20:20

281 Views

This example demonstrates how to set Android Toast duration longer than Toast.LENGTH_LONG using Kotlin.Step 1 − Create a new project in Android Studio, go to File? New Project and fill all required details to create a new project.Step 2  − Add the following code to res/layout/activity_main.xml.         Step 3 − Add the following code to src/MainActivity.ktimport android.os.Bundle import android.os.CountDownTimer import android.view.View import android.widget.Toast import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    private lateinit var mToastToShow: Toast    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp" ... Read More

How to convert a Base64 string into a BitMap image in Android App using Kotlin?

Azhar
Updated on 26-May-2020 06:15:06

1K+ Views

This example demonstrates how to convert a Base64 string into a BitMap image in Android App using Kotlin.Step 1 − Create a new project in Android Studio, go to File? New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         Step 3 − Add the following code to src/MainActivity.ktimport android.graphics.Bitmap import android.graphics.BitmapFactory import android.os.Bundle import android.util.Base64 import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity import java.io.ByteArrayOutputStream class MainActivity : AppCompatActivity() {    lateinit var imageView: ImageView    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       ... Read More

How to set the absolute position of a view in Android using Kotlin?

Azhar
Updated on 26-May-2020 06:05:59

512 Views

This example demonstrates how to set the absolute position of a view in Android using Kotlin.Step 1 − Create a new project in Android Studio, go to File? New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.ktimport android.os.Bundle import android.widget.ImageView import android.widget.RelativeLayout import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() {    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       val relativeLayout: RelativeLayout = findViewById(R.id.relativeLayout)       val imageView = ImageView(this)     ... Read More

How to disable Home and other system buttons in Android using Kotlin?

Azhar
Updated on 26-May-2020 06:00:41

467 Views

This example demonstrates how to disable Home and other system buttons in Android using Kotlin.Step 1 − Create a new project in Android Studio, go to File? New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.Example            Step 3 − Add the following code to src/MainActivity.ktExampleimport android.os.Bundle import android.view.View import androidx.appcompat.app.AppCompatActivity import java.util.* class MainActivity : AppCompatActivity() {    override fun onCreate(savedInstanceState: Bundle?) {       super.onCreate(savedInstanceState)       setContentView(R.layout.activity_main)       title = "KotlinApp"    }    override fun onWindowFocusChanged(hasFocus: ... Read More

Difference between Java and Kotlin in Android with Examples

Mahesh Parahar
Updated on 16-Apr-2020 05:57:32

205 Views

Kotlin was introduced in Android development considering multiple enhancements in Kotlin w.r.t Java. For example:Less no. of Lines and easier development with the same functionality.Java: TextView displayText = (TextView) findViewById(R.id.textView); displayText.setText("Hello World"); Kotlin: textView.setText("Hello World")Compile-time handling of infamous null pointer exception.var value: String = "abc" // compilation error value = nullData class instead of POJO.data class User(val name: String, val age: Int)The following are some of the important differences between Java and Kotlin.Sr. No.KeyJavaKotlin1ExceptionsJava uses checked exceptions for exception handling.Kotlin has no checked exception. It throws compile-time errors.2Null HandlingJava has not enforced null check thus null pointer exception ... Read More

How To Turn Your TV Into Smart TV

Sharon Christine
Updated on 24-Jan-2020 09:48:04

2K+ Views

Instead of shopping for an expensive smart TV, you’ll be able to convert your existing TV into a web-enabled entertainment center by just spending a few thousands of rupees. With this, you’ll have access to everything the Web, the PC and the Google Play store have to offer.Here are some helpful gadgets which will facilitate your recent TV work like a smart TV –Portable Media PlayersIf you’re working on a tight budget, you might want to consider an ultra-portable media player. These thumb-sized sticks, which resemble USB pen drives, are capable of streaming content – pictures, music, videos – wirelessly ... Read More

Ways To Speed Up Your Android Phone

karthikeya Boyini
Updated on 23-Jan-2020 11:46:03

184 Views

No one likes a slow running smartphone, but over the time you may have noticed that your once-speedy Android device has slowed down considerably. There are plenty of tips and tricks to speed up your Android device and make it perform like new. Some of them are:Clear your Cached DataAndroid apps are constantly caching small pieces of data which can build up over time in applications that typically affect the performance of the phone and you want to clear an app’s cached data, either to regain some used space or to try to fix a misbehaving app. To clear cache ... Read More

How to Reclaim your Smart Phone’s Storage Space Quickly

karthikeya Boyini
Updated on 20-Jan-2020 10:37:04

69 Views

A smartphone is not just a phone, it can be a phone, a music player, a video player, a radio, an electronic musical instrument, a GPS, a gaming console, a heart rate monitor, a personal trainer, a digital camera, a document scanner, a messenger, a word processor, a personal pocket computer and the list of infinite possibilities goes on and on beyond your expectation, even beyond your imagination.Not only a gadget, a smartphone can be a status symbol for a huge number of people. A smartphone reflects and complements the personality of its owner. There is only one answer to ... Read More

Best Photography Apps for Android

karthikeya Boyini
Updated on 20-Jan-2020 06:50:46

100 Views

Many a time, we click photos and would like to get them edited as per our needs which complete the job. There exists a lot of tools and tricks in various android apps in the play store that will let your favorite photos look even better.Before that, most of the best camera apps have the capability to make even the dullest of photos pop with vivid color and life. Luckily there are a range of available photo editors which are either free of cost or of extremely cheap rates on the Google Play Store designed to provide best results. Let ... Read More

Review of the New Google’s Pixel

Sharon Christine
Updated on 17-Jan-2020 12:33:08

92 Views

Google’s recent attempt to beat Apple at its core, might end up hurting its own Android partner, Samsung, especially in the Indian market.On Tuesday, Oct 14th Alphabet Inc’s Google at an event, has made an announcement about its launch of new “Pixel” smart-phone. Its latest effort is to target consumers to buy its Google branded device and to challenge the iPhone, most powerful personal device of world from Apple, at the high end of $400 billion global market.Rick Osterloh, Google hardware chief, has revealed few details about “Pixel” smart-phone after the event launch. He added, this smartphone has the best ... Read More

Advertisements