diff --git a/Login.java b/Login.java new file mode 100644 index 0000000000000000000000000000000000000000..26c3183acb6e7e7076a1f9f85b482d900f3e09bd --- /dev/null +++ b/Login.java @@ -0,0 +1,199 @@ +package com.example.fund_restart; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; + +public class Login extends AppCompatActivity implements View.OnClickListener { + String pass; + private static final int GOOGLE_TEZ_REQUEST_CODE = 123; + ImageView orphanage,assam,bihar,military,ipay,ipay_assam,ipay_coro,ipay_bihar,map; + TextView ct1,ct2,ct3,ct4; + private static final String GOOGLE_TEZ_PACKAGE_NAME = "com.google.android.apps.nbu.paisa.user"; + Button bihar_web,bihar_pay,assam_web,assam_pay,military_web,military_pay,orphanage_web,orphanage_pay; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + map = findViewById(R.id.map); + ipay = findViewById(R.id.ipay); + ct1 = findViewById(R.id.ct1); + ct2 = findViewById(R.id.ct2); + ct3 = findViewById(R.id.ct3); + ct4 = findViewById(R.id.ct4); + ipay_bihar = findViewById(R.id.ipay_milit); + ipay_coro = findViewById(R.id.ipay_bihar); + ipay_assam = findViewById(R.id.ipay_assam); + bihar_pay = findViewById(R.id.bihar_pay); + bihar_web = findViewById(R.id.bihar_web); + military_pay= findViewById(R.id.military_pay); + military_web= findViewById(R.id.military_web); + assam_web=findViewById(R.id.assam_web); + assam_pay=findViewById(R.id.assam_pay); + orphanage_web=findViewById(R.id.orphanage_web); + orphanage_pay=findViewById(R.id.orphanage_pay); + assam = findViewById(R.id.assam); + bihar = findViewById(R.id.bihar); + orphanage = findViewById(R.id.orphanage); + military = findViewById(R.id.military); + orphanage.setOnClickListener(this); + assam.setOnClickListener(this); + bihar.setOnClickListener(this); + military.setOnClickListener(this); + bihar_web.setOnClickListener(this); + military_web.setOnClickListener(this); + assam_web.setOnClickListener(this); + orphanage_web.setOnClickListener(this); + bihar_pay.setOnClickListener(this); + assam_pay.setOnClickListener(this); + military_pay.setOnClickListener(this); + orphanage_pay.setOnClickListener(this); + ct1.setOnClickListener(this); + ipay.setOnClickListener(this); + ct2.setOnClickListener(this); + ct3.setOnClickListener(this); + ct4.setOnClickListener(this); + ipay_coro.setOnClickListener(this); + ipay_assam.setOnClickListener(this); + ipay_bihar.setOnClickListener(this); + map.setOnClickListener(this); + + } + + + + + @Override + public void onClick(View v) { + if(v == map){ + Intent mapy = new Intent(this,Map.class); + startActivity(mapy); + } + if(v == ct3){ + String url="https://www.pmcares.gov.in/en/"; + Intent i=new Intent(this,Webview.class); + i.putExtra("url",url); + startActivity(i); + } + if(v == ct2){ + String url="https://cm.assam.gov.in/relieffund.php"; + Intent i=new Intent(this,Webview.class); + i.putExtra("url",url); + startActivity(i); + } + if(v == ct4){ + String url="http://www.cmrf.bih.nic.in/users/home.aspx"; + Intent i=new Intent(this,Webview.class); + i.putExtra("url",url); + startActivity(i); + } + if(v == orphanage_web){ + String url="https://agaram.in/"; + Intent i=new Intent(this,Webview.class); + i.putExtra("url",url); + startActivity(i); + } + if(v == ct1){ + String url="https://agaram.in/"; + Intent i=new Intent(this,Webview.class); + i.putExtra("url",url); + startActivity(i); + } + + + if(v == ipay_coro){ + Uri uri = + new Uri.Builder() + .scheme("upi") + .authority("pay") + .appendQueryParameter("pa", "pmcares@sbi") + .appendQueryParameter("pn", "Test Merchant") + .appendQueryParameter("mc", "1234") + .appendQueryParameter("tr", "123456789") + .appendQueryParameter("tn", "Little help") + .appendQueryParameter("am", pass) + .appendQueryParameter("cu", "INR") + .appendQueryParameter("url", "https://gpay.app.goo.gl/31gzbM") + .build(); + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(uri); + intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME); + startActivityForResult(intent, GOOGLE_TEZ_REQUEST_CODE); + + } + if(v == ipay_assam){ + Uri uri = + new Uri.Builder() + .scheme("upi") + .authority("pay") + .appendQueryParameter("pa", "cmrfassam@sbi") + .appendQueryParameter("pn", "Test Merchant") + .appendQueryParameter("mc", "1234") + .appendQueryParameter("tr", "123456789") + .appendQueryParameter("tn", "Little Help") + .appendQueryParameter("am", pass) + .appendQueryParameter("cu", "INR") + .appendQueryParameter("url", "https://gpay.app.goo.gl/ypFRwR") + .build(); + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(uri); + intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME); + startActivityForResult(intent, GOOGLE_TEZ_REQUEST_CODE); + + } + if(v == ipay_bihar){ + Uri uri = + new Uri.Builder() + .scheme("upi") + .authority("pay") + .appendQueryParameter("pa", "cmrfbihar@idbi") + .appendQueryParameter("pn", "Test Merchant") + .appendQueryParameter("mc", "1234") + .appendQueryParameter("tr", "123456789") + .appendQueryParameter("tn", "Little help") + .appendQueryParameter("am", pass) + .appendQueryParameter("cu", "INR") + .appendQueryParameter("url", "https://gpay.app.goo.gl/31gzbM") + .build(); + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(uri); + intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME); + startActivityForResult(intent, GOOGLE_TEZ_REQUEST_CODE); + + } + if(v == ipay){ + Uri uri = + new Uri.Builder() + .scheme("upi") + .authority("pay") + .appendQueryParameter("pa", "test@axisbank") + .appendQueryParameter("pn", "Test Merchant") + .appendQueryParameter("mc", "1234") + .appendQueryParameter("tr", "123456789") + .appendQueryParameter("tn", "test transaction note") + .appendQueryParameter("am", "10.01") + .appendQueryParameter("cu", "INR") + .appendQueryParameter("url", "https://test.merchant.website") + .build(); + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(uri); + intent.setPackage(GOOGLE_TEZ_PACKAGE_NAME); + startActivityForResult(intent, GOOGLE_TEZ_REQUEST_CODE); + + } + } + +} \ No newline at end of file