Posts

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

React Native - Rest API calls using Fetch - Mobile App

Image
Congratulations! You are standing in the right place! In this article, we will discuss how to use Fetch 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. App.js import React, { useEffect, useState } from 'react' ; import { FlatList, Text, View } from 'react-native' ; export default App = () => { const [isLoading, setLoading] = useState( true ); const [data, setData] = useState([]); console.log(data); useEffect(() => { fetch( 'https://raw.githubusercontent.com/knowledgefactory4u/Ja

Go Language - Switch Statement

Image
A switch statement is a shorter way to write a sequence of if-else statements. It runs the first case whose value is equal to the condition expression. The cases are evaluated from top to bottom, stopping when a case succeeds. If no case matches and there is a default case, its statements are executed. Example 1: package main import "fmt" func main() { day := 6 switch day { case 1 : fmt.Println( "Sunday" ) case 2 : fmt.Println( "Monday" ) case 3 : fmt.Println( "Tuesday" ) case 4 : fmt.Println( "Wednesday" ) case 5 : fmt.Println( "Thursday" ) case 6 : fmt.Println( "Friday" ) case 7 : fmt.Println( "Saturday" ) } } Output: Example 2: break breaks the inner switch package main import "fmt" func main() { loop: for i := 0 ; i < 9 ; i++ { fmt.Printf( "%d" , i) sw

React Native - TextInput, Keyboard, TouchableOpacity, Button, and Alert - Example

Image
In this article, we will discuss how to create a simple input form + a button press + Alert by utilizing the React Native framework and Android Studio. React Native Local Environment Setup - click here We are going to create a mobile app like below, Terminologies : TextInput is the underlying component to input text. It has diverse props that configure the different features, such as onChangeText which takes a function and call it whenever the text is transmuted. The onSubmitEditing prop takes a function, which is called when the text is submitted. <ScrollView> <View style = { styles.inputContainer } > <TextInput style = { styles.textInput } placeholder = "Email" maxLength = { 20 } onBlur = { Keyboard.dismiss } value = {this .state.name } onChangeText = {this .handleNameChange } /> </View> </ScrollView> Touchab