Tuesday, 19 July 2022

Advantages of React Native

 There are several advantages of React Native

==>Java Script :- To build react native application java script knowledge is                             require.

==>Cross-Platform Usage :- React native app is perform in Android and                                               iOS both platforms.

==>Instant Reflect :- When we make some changes in code it is reflect                                     instantly in app. 

==>Performance :- The code written in react native which compiled into                                  native code , which enable for android and iOS both                                  operating system , and it performs same in both                                      platforms.

Thursday, 30 June 2022

What is React Native ?

React Native is open source mobile application framework.

React Native is created by Facebook.

It is used to create application for Android , iOS and Web.

React Native application coding is requires java script fundamentals.

Tuesday, 7 December 2021

How to load url in web view in android

When we want to display any url content in our android application we need to display it in Web view .

So lets see how to load url in android application using Web view.

Here is your .xml file

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">


<ProgressBar
android:id="@+id/progress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_marginBottom="-8dp"
android:layout_marginTop="-8dp"/>

<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>

And after that we have to do code for web view in .java file.

package com.myexample;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class MyActivity extends AppCompatActivity {

WebView webView;
ProgressBar progressBar;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webivew_layout);

webView = (WebView) findViewById(R.id.webview);
progressBar = (ProgressBar) findViewById(R.id.progress);

webView.setWebChromeClient( new MyWebChromeClient());
webView.setWebViewClient( new webClient());
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setSupportZoom(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("Http://google.com");

}


public class MyWebChromeClient extends WebChromeClient {
public void onProgressChanged(WebView view, int newProgress) {
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgress(newProgress);
}
}

public class webClient extends WebViewClient {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}

@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
progressBar.setVisibility(View.GONE);
}
}

@Override
public void onBackPressed() {
if (webView.canGoBack()) {
webView.goBack();
progressBar.setVisibility(View.GONE);
} else {
super.onBackPressed();
}
}
}

This is how we can call any url in our android application using  web view.

Tuesday, 28 September 2021

Splash Screen

Here we are making splash screen which is used in all application as a first screen.

So lets start to learn how to make the splash screen.

First make .xml layout for it , most of splash screen are with image.

So here is your splash_screen.xml 

Wednesday, 21 April 2021

How to Display Current Location on Google Map with Kotlin Android



How to display my current location on google map in android with using Kotlin Android


So Lets start how to display current location on google map with Kotlin Android with Google Map API services.

Step 1 : You need to Google Developer Console and sign in

Step 2 : Create your new project by clicking on CREATE PROJECT and give name of project.

Step 3 : Now click on API's and Services and open Dashboard.

Step 4 : Now Click on Enable API and Services.

Step 5 : Now Enable the Google Map Android API.

Step 6 : Now click on Credentials.

Step 7 : Click on Create Credentials and choose API key

Step 8 : Now there is your API key for Google Map , copy it and paste it on you android code , location is in your app/res/values/ here google_maps_api.xml file is there.


Now create Android Studio project with google Map.

Saturday, 3 April 2021

How to make EditText Mask format in Android

 How to make like below image in android.


This is the called as Edittext mask making , it means that how to make edittext inserting data format like card view , like expiry date format etc...

So here we learn how to make Edittext Mask Making Format in android.

Wednesday, 31 March 2021

Android Text Shader with Gradient Style

 How to set textview gradient color in android , below image is  showing the text with gradient style , this style is apply with 2 colors and Text Shader method.




So , lets start to learn how to do the textview gradient color.


txtshader1.getPaint().setShader(SetTextShader_Gradient1(mContext));

Shader textShader=new LinearGradient(0, 0, 0, 60,
new int[]{mContext.getColor(R.color.text_gradiet_1),mContext.getColor(R.color.text_gradiet_2)},
new float[]{0, 1}, Shader.TileMode.CLAMP);


This is the how Textview work with colors using Text Shader.
Here is the code for this doing Textview with gradient style.





Find Hours Diffrence in Kotlin

  In Kotlin, determining the difference in hours between two timestamps is a common task, especially in scenarios involving time-based calcu...