Posts

How to make a delay in Go Language

Image
The Sleep() method pauses the execution of the current thread temporarily.  Sleep()  is part of the time package. This method takes the duration as an argument.  Here is an example code that shows how to make a delay in Go Language. Here, 3*time.Second, means 3 seconds. This will sleep the current goroutine so other goroutines will continue to run. package main import ( "fmt" "time" ) func main() { // Before sleep fmt.Println( "Before sleep the time is:" , time.Now().Unix()) // pauses execution for 3 seconds time.Sleep( 3 * time.Second) // After sleep fmt.Println( "After sleep the time is:" , time.Now().Unix()) } Output : Goroutines Goroutines are methods that run concurrently with other methods. Goroutines can be thought of as lightweight threads. The cost of creating a Goroutine is tiny when compared to a thread.  Every concurrently executing activity in the Go language is known as Goroutines. Another Examp

React Native - Seekbar Slider - Mobile Application development

Image
Congratulations! You are standing in the right place! In this article, we would be going to engender a react native application with the Text component and Slider component . We are going to create a mobile app like below,   Implementation: First, You must set up your local development environment. Follow the below link to set up your local environment.   https://www.knowledgefactory.net/2021/01/react-native-environment-setup-create-demo.html After executing the commands mentioned in this  link , a folder with a specified name is created with the following contents. Next, we are going to edit the  App.js  file and write the below code. Import AppRegistry, StyleSheet, Text, View, and Slider component in our project. import React, { Component } from 'react' ; import { AppRegistry, StyleSheet, Text, View, Slider } from 'react-native' ; Engender constructor() constructor () { super (); this .state = { SliderInitValue: 18 } } Engender a Parent View 

React Native - GridView Layout - Mobile Application development

Image
  Congratulations! You are standing in the right place!  In this article, w e are engendering a customized GridView for both android and iOS applications. We are going to create a mobile app like below, Implementation: You must set up your local development environment. Follow the below link to set up your local environment.   https://www.knowledgefactory.net/2021/01/react-native-environment-setup-create-demo.html After executing the commands mentioned in this  link , a folder with a specified name is created with the following contents. Next, we are going to edit the  App.js  file and write the below code. Import AppRegistry, StyleSheet, FlatList, Text, View, Alert and Platform component in your project. import React, { Component } from 'react' ; import { AppRegistry, StyleSheet, FlatList, Text, View, Alert, Platform } from 'react-native' ; Engender constructor in your project’s class and inside that constructor define super( ) method with props inside i

Display Image in React Native - Mobile Application - Example

Image
  Congratulations! You are standing in the right place! In this article, we will discuss h ow to exhibit image in react native application utilizing online URL. We are going to create a mobile app like below, Implementation: You must set up your local development environment. Follow the below link to set up your local environment.   https://www.knowledgefactory.net/2021/01/react-native-environment-setup-create-demo.html After executing the commands mentioned in this  link , a folder with a specified name is created with the following contents. Next, we are going to edit the App.js file and write the below code. import React, { Component } from 'react' ; import { AppRegistry, Image } from 'react-native' ; export default class App extends Component { render() { let Image_URL ={ uri: 'https://raw.githubusercontent.com/knowledgefactory4u/ Javascript/master/photo-1611337449232-e3183e932494.jpeg' }; return ( <Image source = { Image_URL } style =

React Native - Rest API calls using Axios - Mobile App development

Image
  Congratulations! You are standing in the right place! In this article, we will discuss how to use  Axios  to access the Rest API within a React application. We are going to create a mobile app like below, Implementation: You must set up your local development environment. Follow the below link to set up your local environment.   https://www.knowledgefactory.net/2021/01/react-native-environment-setup-create-demo.html After executing the commands mentioned in this  link , a folder with a specified name is created with the following contents. Next, we are going to edit the App.js file and write the below code. import React, { useEffect, useState } from 'react' ; import { FlatList, Text, View } from 'react-native' ; import axios from 'axios' export default App = () => { const [isLoading, setLoading] = useState( true ); const [data, setData] = useState([]); console.log(data); useEffect(() => { axios( 'https://r