Android tutorials

How to make android studio login page Sql (part 1)

android studio login page Sql in urdu and hindi for beginner

Android studio login page SQL in Urdu and Hindi for a beginner:

Android studio login page SQL Urdu and Hindi: Welcome to Rise Pakistani Urdu and Hindi tutorial. Today we will continue the first part of android studio login page SQL Urdu and Hindi. You can watch my video tutorial on my website RisePakistani or Youtube channel. If you like my video please like my video. If you have any issue please comment here thank you.

Internet permission:

Android manifest file

Add this code in your android studio AndroidManifest.xml   file.  This code allows you to get internet permission in your android app.

 

 

<uses-permission android:name="android.permission.INTERNET" />

Login view page or user interface:

Add this code in your Activity.xml file which used to show interface on the mobile screen.  Here user will insert username and password and inter login button.

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Login"/>
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/username"
    />
<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/password"
    />
<Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/login"
    android:text="login"
    android:onClick="loginbtn"
    />

Php Connection to MySQL:

If we want to get data to form MySql database, we need to able to connect to the server.

By following this link https://www.w3schools.com/php/php_mysql_connect.asp  you can learn how to make a connection with the server.

Main Activity :

The main activity is an important part of your app. All action can be performed in this part. you can make different activity in your app. Activity is the part where all activities are performed according to a user click.

EditText username, pass;

//Dbconn db;

   @Override
   protected void onCreate(Bundle savedInstanceState){
       super.onCreate( savedInstanceState );
      // set activity_main.xml layout
       setContentView( R.layout.activity_main );
      //  get user name id
       username=findViewById( R.id.username );
       // get user password id
       pass = findViewById( R.id.password );

   }

This code will execute on click login button.

public void loginbtn(View view)
{
// get username in string
 String user_name= username.getText().toString(); 
// get user password in string
 String user_pass= pass.getText().toString();
// get type
 String type= "Login"; 
 Dbconn dbconn=new Dbconn(this);
 dbconn.execute( type,user_name,user_pass );
 //Toast.makeText( this, "hj gkhg h gk0", Toast.LENGTH_SHORT ).show();
 }

 

click here and watch more video. If you like my video, please subscribe to my website.

Tags

Related Articles

Adblock Detected

Please consider supporting us by disabling your ad blocker