Friday, April 17, 2020
Saturday, March 14, 2020
LoginActivity.Java
So Guys here is the whole code of loginactivity in android.....
public class LoginActivity extends Activity { EditText l_email, l_password; TextView l_forgot, l_newac; Button login; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); l_email = findViewById(R.id.login_email); l_password = findViewById(R.id.login_password); l_forgot = findViewById(R.id.login_forgotpwd); l_newac = findViewById(R.id.login_newaccount); login = findViewById(R.id.login_btn); l_forgot.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent logintoforgot = new Intent(LoginActivity.this, ForgotActivity.class); startActivity(logintoforgot); } }); l_newac.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent logintoregister = new Intent(LoginActivity.this, RegisterActivity.class); startActivity(logintoregister); } }); login.setOnClickListener(new View.OnClickListener() { @Override }
}
Login Activity
So here is the main important things directly comes after the splash screen is login.
so here how i created my login screen is as below.
so here how i created my login screen is as below.
In which i used below Widgets.
1.Imageview2.Edittext3.Textview4.Button
That much i used in that used in this activity below is brief information about how i used these all widget in that.
First of all that talk about imageview i used imageview as top of logo, after that edittext for the email address and another edittext is for pasword .
after the textview i used is for the forgot pasword link if suppose person forgot your application password after open this application he can get an new password.
and button is for going to the another which i was settled in click listener.
Last widget is about to create a new registration about .
NOTE: Java code will be uploaded in short time.
Tuesday, January 7, 2020
1. SplashScreen Design in android studio for my project.
First of all I started with the Splash Screen Activity, I
thought its look pretty good for user who like to start well.
So simply i took Imageview for that I already created my
own logo:-
Then in xml file my code was look like.
|
activity_splash.xml
|
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/colorPrimary" android:orientation="vertical" tools:context=".SplashActivity"> <ImageView android:id="@+id/splash" android:layout_width="250dp" android:layout_height="match_parent" android:layout_gravity="center" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:paddingLeft="10dp" android:paddingTop="10dp" android:paddingRight="10dp" android:paddingBottom="10dp" android:src="@drawable/qweqweqwe" /> </LinearLayout> |
In imageview all are the same field that we use regular
In our android projects,
After it I coded for my java file lets see what I need to
write for having splash screen.
|
SplashActivity.java
|
package milan.com.sampledesign; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import androidx.appcompat.app.AppCompatActivity; public class SplashActivity extends AppCompatActivity { Handler handler; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { Intent splash = new Intent(MainActivity.this, Login_activity.class); startActivity(splash); } }, 3000); } } |
Explanations for java file of splashactivity.
I took Handler class because handler class allow user to
send and process message so in declaration section I declare “Handler” and its
object “handler”,
After I casted in initialization section that “ handler
=new Handler(); ” and I wrote second line post delayed means user need to wait
for that much time that we specified on our project and for that I wrote
“handler.postdelayed(new Runnable)” now this runnable means its started again
its process.
So I simply put link in that method look how.
Intent splash = new Intent(SplashActivity.this,LoginActivity.class);
Startactivity(splash);
//finish();
So I put intent in which I define source and destination,
after it I said to start my activity.
Next my activity will be login activity you will get the post of login screen is to as early as possible.
Subscribe to:
Comments (Atom)