WebView Implementation Example in Android

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

290 Views

Before getting into webview implementation we should know what is webview. Webview is a extended of a view and it is used to show HTML content or web pages.Methods are available in webview.clearHistory() − it is used to clear webview historydestroy() − It is used to destroy internal state of webview.getUrl() −it is used to return current webview url.getTitle() − It is used to return current webview tittle.canGoBack() − It indicates about current webview has back history items.Using webview, it opens webview content in default android browsers. If you want to open inside of application. ShouldOverrideUrlLoading as shown below.private class ... Read More

Pass Array to MySQL Stored Routine

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

5K+ Views

We need to create a stored procedure to display how to pass array to MySQL stored routine. Let us first create a table for our example. Creating a table mysql> create table FindDemo -> ( -> name varchar(100) -> ); Query OK, 0 rows affected (0.46 sec) Inserting some records into the table. mysql> insert into FindDemo values('John'), ('Smith'); Query OK, 2 rows affected (0.13 sec) Records: 2 Duplicates: 0 Warnings: 0 To display all records. mysql> select *from FindDemo; The following is ... Read More

Enhance Your Logging Experience with Timber in Android

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

409 Views

Timber library is a extended library of android Log's. While developing android applications, most of developers prefer Android Logs. But here problem is about clean logs while deploy android project. To avoid this process using Timber library.This example demonstrate about how to integrate Timber in android.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 Timber library in build.gradle as shown belowapply plugin: 'com.android.application' android {    compileSdkVersion 28    defaultConfig {       applicationId "com.example.andy.myapplication"       ... Read More

Infrared Transmission

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

3K+ Views

Infrared waves are those between the frequencies 300GHz and 400THz in the electromagnetic spectrum. Their wavelengths are shorter than microwaves but longer than visible light. Infrared propagation is line of sight. They cannot penetrate walls and sun’s infrared rays interfere with these rays. So cannot be used for long – range communication. As their usage is confined within closed space, they do not need any government permissions for their applications. Applications of Infrared Waves in Communications Remote controls for television, stereos and other home appliances. Wireless LANs Wireless modem, keyboard, mouse, printer etc Fire detectors Night vision ... Read More

Handle Fragmentation of Auto-Increment ID Column in MySQL

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

366 Views

Whenever we renumber, there might be a problem. There is a need to declare a unique ID for a column. In MySQL version 5.6 InnoDB, we can reuse the auto_increment ID by including the ID column in an INSERT statement and we can give any specific value that we want. The situations are as follows − Whenever we delete the ID with the highest number Whenever we start and stop MySQL server Whenever we insert a new record Example of ID auto increment using auto_increment variable. mysql> create table UniqueAutoId -> ( ... Read More

Create Custom ActionBar in Android

Chandu yadav
Updated on 30-Jul-2019 22:30:23

4K+ Views

Before getting into example we should know what is action bar in android. Action bar just like header in android. Either we can use same action bar for all screen or we can change action bar for particular activity.This example demonstrate about how to create a custom action bar in Android.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 2 − Add the following code to src/MainActivity.javaimport android.os.Bundle; import android.support.v7.app.ActionBar; import ... Read More

Light Transmission

George John
Updated on 30-Jul-2019 22:30:23

3K+ Views

Electromagnetic waves within the frequency range of 400 THz – 790 THz are detected by the human eye. Light transmission is line of sight propagation and is blocked by obstacles. Laser Signals Optical signalling can be obtained by laser signals. For example, the LANs in two buildings can be connected by installing laser signalling system on the rooftops. Laser rays are unidirectional. So both the transmitter and the receiver need perfectly aligned photo-emitter and photo-detector. Visual Light Communication A more used variant of light transmission is visual light communication (VLC). VLC refers to data communication using visible ... Read More

Methods for Tracking Database Schema Changes in MySQL

George John
Updated on 30-Jul-2019 22:30:23

927 Views

Whenever a table is present in a project with a single database, we can do database schema changes using schema version or migration. It aims to keep track of database schema changes or structural changes. The table creation to keep track of schema changes. mysql> create table SchemaDatabaseMethodDemo -> ( -> `WhenTime` timestamp not null default CURRENT_TIMESTAMP, -> `TheKey` varchar(200) not null, -> `Version` varchar(200), -> primary key(`TheKey`) -> )ENGINE=InnoDB; Query OK, 0 rows affected (0.45 sec) Inserting records into ... Read More

Speed Up Gradle Build Process in Android Studio

George John
Updated on 30-Jul-2019 22:30:23

286 Views

Before getting info speed up gradle build, we should know that, what is gradle build.Before eclipse, we dont have any automation scripts to build java and XML code to android apk. So that we used commands to generate apk. To optimize this process, gradle build come into the picture. Gradle is automated script to build and generate apk using android studio. What is Gradle sync ? Gradle sync is automation process to download dependencies which are declare in gradle file. A simple example as shown below − How to speed Gradle Build in android? Step 1 − Open gradle.properties ... Read More

Introduction to Miscellaneous Problems

Samual Sam
Updated on 30-Jul-2019 22:30:23

604 Views

We have seen different problems in different sections. There are some other problems which are not categorized. In this section we will see some of the random problems. In this Section We are going to cover. Adding base n numbers Babylonian method to find the square root Factorial of a large number Check if a given point lies inside a Polygon Check Perfect Square or Not Check if given four points form a Square Check if two given sets are disjoint? Check if two line segments intersect Check whether a given point lies inside a Triangle Connect n ropes ... Read More

Advertisements