NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io























///////////
data
/////////
[Volley]
(insert.php)
<?php
$conn=mysqli_connect("localhost","root","","android_db");

$name=$_POST['t1'];
$uname=$_POST['t2'];
$pwd=$_POST['t3'];

$qry="INSERT INTO `tbl_user` (`id`, `name`, `username`, `password`) VALUES (NULL, '$name', '$uname', '$pwd')";
mysqli_query($conn,$qry);

echo "Inserted Successfully";

?>

private void Jsondatainsert() {

StringRequest request=new StringRequest(Request.Method.POST, webView.getUrl(), new Response.Listener<String>() {
@Override
public void onResponse(String response) {

}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
error.printStackTrace();
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> stringMap=new HashMap<String,String>();
stringMap.put("name","value");
stringMap.put("namse","valuess");
return stringMap;
}
};
RequestQueue requestQueue= Volley.newRequestQueue(getApplicationContext());
requestQueue.add(request);
}

(Select.php)
<?php
$conn
$result=array();
$result['data']=array();
$qry="select*from table";
$resp=mysqli_query($conn,$qry);
while($row=mysqli_fetch_array($resp))
{
$index['id']=$row['0'];
[''name]=['1'];
array_push($result['$data'],$index);

}
$result["success"]="1"
echo json_encode[$result];
?>

TextView mTextViewResult;
private RequestQueue mQueue;
StringRequest request;
String url = "http://192.168.0.103/PhpProject1/retrive.php";

ListView lstv;
ArrayList<String> list;
lstv = findViewById(R.id.lstv);
registerForContextMenu(lstv);

private void Showdata() {

request = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {

try {

JSONObject object = new JSONObject(response);
//Arraylist
list = new ArrayList<String>();
JSONArray jsonArray = object.getJSONArray("data");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject employee = jsonArray.getJSONObject(i);

String id = employee.getString("id");
String name = employee.getString("name");
String contact = employee.getString("contact");

list.add(id + "," + name + "," + contact);
// mTextViewResult.append(id + ", " + name + ", " + contact + "nn");
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1, list);
lstv.setAdapter(adapter);

} catch (JSONException e) {
e.printStackTrace();

}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
error.printStackTrace();
}
});
mQueue.add(request);
}

(delete.php)
<?php
$connection = mysqli_connect("localhost","id11477192_arsltech","12345678","id11477192_employee_management_system");
$id = $_POST["id"];
$sql = "DELETE FROM data WHERE id='$id'";
$result = mysqli_query($connection,$sql);
if($result){echo "Data Deleted";}
?>
private void deleteData(final String id) {

StringRequest request = new StringRequest(Request.Method.POST, "https://arsltechmysql.000webhostapp.com/delete.php",
new Response.Listener<String>() {
@Override
public void onResponse(String response) {

if(response.equalsIgnoreCase("Data Deleted")){
Toast.makeText(MainActivity.this, "Data Deleted Successfully", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(MainActivity.this, "Data Not Deleted", Toast.LENGTH_SHORT).show();
}


}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(MainActivity.this, error.getMessage(), Toast.LENGTH_SHORT).show();
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {

Map<String,String> params = new HashMap<String,String>();
params.put("id", id);
return params;
}
};

RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(request);


}

(update.php)

<?php

$connection = mysqli_connect("localhost","id11477192_arsltech","12345678","id11477192_employee_management_system");
$id = $_POST["id"];
$name = $_POST["name"];
$email = $_POST["email"];
$contact = $_POST["contact"];
$address = $_POST["address"];

$sql = "UPDATE data SET name = '$name', email = '$email', contact = '$contact', address = '$address' WHERE id = '$id' ";
$result = mysqli_query($connection,$sql);
if($result){echo "Data Updated";}
?>

StringRequest request = new StringRequest(Request.Method.POST, "https://arsltechmysql.000webhostapp.com/update.php",
new Response.Listener<String>() {
@Override
public void onResponse(String response) {

Toast.makeText(Edit_Activity.this, response, Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(),MainActivity.class));
finish();
progressDialog.dismiss();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {

Toast.makeText(Edit_Activity.this, error.getMessage(), Toast.LENGTH_SHORT).show();
progressDialog.dismiss();

}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {

Map<String,String> params = new HashMap<String,String>();

params.put("id",id);
params.put("name",name);
params.put("email",email);
params.put("contact",contact);
params.put("address",address);

return params;
}
};

RequestQueue requestQueue = Volley.newRequestQueue(Edit_Activity.this);
requestQueue.add(request);

}
==================================================================================================================
[TelephonyManager]
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
-----------------------------------------------------------------------
tele =(TextView) findViewById(R.id.tele);

TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

String IMEINumber = tm.getDeviceId();
String subscriberID = tm.getDeviceId();
String SIMSerialNumber = tm.getSimSerialNumber();
String networkCountryISO = tm.getNetworkCountryIso();
String SIMCountryISO = tm.getSimCountryIso();
String softwareVersion = tm.getDeviceSoftwareVersion();
String voiceMailNumber = tm.getVoiceMailNumber();

String strphoneType="";

int phoneType=tm.getPhoneType();

switch (phoneType)
{
case (TelephonyManager.PHONE_TYPE_CDMA):
strphoneType="CDMA";
break;
case (TelephonyManager.PHONE_TYPE_GSM):
strphoneType="GSM";
break;
case (TelephonyManager.PHONE_TYPE_NONE):
strphoneType="NONE";
break;
}

boolean isRoaming=tm.isNetworkRoaming();

String info="Phone Details:n";
info+="n IMEI Number:"+IMEINumber;
info+="n SubscriberID:"+subscriberID;
info+="n Sim Serial Number:"+SIMSerialNumber;
info+="n Network Country ISO:"+networkCountryISO;
info+="n SIM Country ISO:"+SIMCountryISO;
info+="n Software Version:"+softwareVersion;
info+="n Voice Mail Number:"+voiceMailNumber;
info+="n Phone Network Type:"+strphoneType;
info+="n In Roaming? :"+isRoaming;

tele.setText(info);

[NOtification]
private void ControlInitialization()
{
btnNotification =(Button) findViewById(R.id.btnNotification);
btnNotification.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext())
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setContentTitle("Notification Demo")
.setContentText("This is notification demo")
.setAutoCancel(true)
.setPriority(NotificationCompat.PRIORITY_DEFAULT);

Intent objIntent = new Intent(getApplicationContext(),NotificationViewActivity.class);
objIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
objIntent.putExtra("message","Hello...Good Morning Everyone");

PendingIntent pi = PendingIntent.getActivity(getApplicationContext(),0,objIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(pi);

NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(0,builder.build());
}
});
}
[Downloadmanager]
btnDown=findViewById(R.id.btnDownload);


if(ActivityCompat.checkSelfPermission(ActivityDownloadFile.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
|| ActivityCompat.checkSelfPermission(ActivityDownloadFile.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){

// this will request for permission when user has not granted permission for the app
ActivityCompat.requestPermissions(ActivityDownloadFile.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
}

else{
DownloadManager downloadmanager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
Uri uri = Uri.parse("http://utu.ac.in/bmiit/download/2021-22/Sem7/060010715_LP.pdf");
DownloadManager.Request request = new DownloadManager.Request(uri);
request.setTitle("My File");
request.setDescription("Downloading");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationUri(Uri.parse("file://Download/myfile.mp3"));
downloadmanager.enqueue(request);
}

[Contactprovider]
<uses-permission android:name="android.permission.READ_CONTACTS"/>
ListView list;
ArrayList list1;

list=findViewById(R.id.qwe1);
list1=new ArrayList();

//run time permission
if(ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS)!= PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.READ_CONTACTS},0);
}
else
{
Cursor phone=getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,null,null,null);
while(phone.moveToNext())
{
String name=phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String no=phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));

//To store number and name we declare arraylist

list1.add(name+"n"+no);

}

//Use ARRAYadapter

ArrayAdapter adapter=new ArrayAdapter(MainActivity.this, android.R.layout.simple_list_item_1,list1);
list.setAdapter(adapter);
}

[Database sqlite]
(DBhelper.class)
public class DBhelper extends SQLiteOpenHelper {
public DBhelper(@Nullable Context context) {
super(context, "Userdata.db", null, 1);
}

@Override
public void onCreate(SQLiteDatabase DB) {
DB.execSQL("create Table Userdetails(txtEdit TEXT primary key, txtEmail TEXT)");
}

@Override
public void onUpgrade(SQLiteDatabase DB, int i, int i1) {
DB.execSQL("drop Table if exists Userdetails");
}

public Boolean insertuserdata(String txtEdit, String txtEmail)
{
SQLiteDatabase DB = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put("txtEdit", txtEdit);
contentValues.put("txtEmail", txtEmail);
long result=DB.insert("Userdetails", null, contentValues);
if(result==-1){
return false;
}else{
return true;
}
}


public Boolean updateuserdata(String txtEdit, String txtEmail) {
SQLiteDatabase DB = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put("txtEmail", txtEmail);
Cursor cursor = DB.rawQuery("Select * from Userdetails where txtEdit = ?", new String[]{txtEdit});
if (cursor.getCount() > 0) {
long result = DB.update("Userdetails", contentValues, "txtEdit=?", new String[]{txtEdit});
if (result == -1) {
return false;
} else {
return true;
}
} else {
return false;
}}


public Boolean deletedata (String txtEdit)
{
SQLiteDatabase DB = this.getWritableDatabase();
Cursor cursor = DB.rawQuery("Select * from Userdetails where txtEdit = ?", new String[]{txtEdit});
if (cursor.getCount() > 0) {
long result = DB.delete("Userdetails", "txtEdit=?", new String[]{txtEdit});
if (result == -1) {
return false;
} else {
return true;
}
} else {
return false;
}

}

public Cursor getdata ()
{
SQLiteDatabase DB = this.getWritableDatabase();
Cursor cursor = DB.rawQuery("Select * from Userdetails", null);
return cursor;

}
}
(mainactivity)
Button insert,update,select,delete;
DBhelper db;

db=new DBhelper(this);
insert.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String nameTXT=txtEdit.getText().toString();
String emailTXT=txtEmail.getText().toString();

Boolean aBoolean=db.insertuserdata(nameTXT,emailTXT);
if(aBoolean=true)
{
Toast.makeText(getApplicationContext(), "insert Success", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "problem", Toast.LENGTH_SHORT).show();
}
}
});
update.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String nameTXT=txtEdit.getText().toString();
String emailTXT=txtEmail.getText().toString();

Boolean updateaBoolean=db.updateuserdata(nameTXT,emailTXT);
if(updateaBoolean=true)
{
Toast.makeText(getApplicationContext(), "Updated Success", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "Updated problem", Toast.LENGTH_SHORT).show();
}
}
});
delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String nameTXT=txtEdit.getText().toString();


Boolean checkdeletedata=db.deletedata(nameTXT);
if(checkdeletedata=true)
{
Toast.makeText(getApplicationContext(), "Deleted Success", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "Deleted problem", Toast.LENGTH_SHORT).show();
}
}
});
select.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Cursor res=db.getdata();
if(res.getCount()==0)
{
Toast.makeText(getApplicationContext(), "NOentry exists", Toast.LENGTH_SHORT).show();
return;
}
StringBuffer buffer=new StringBuffer();

while (res.moveToNext())
{
buffer.append(res.getString(0)+"n");
buffer.append(res.getString(1)+"n");
}
AlertDialog.Builder builder=new AlertDialog.Builder(MainActivity.this);
builder.setCancelable(true);
builder.setMessage(buffer.toString());
builder.show();
}
});
//////////////////////////////////
[spineer]
(Dropdown menu)
<Spinner
android:id="@+id/dropdown"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spinnerMode="dropdown" />

String[] items;
String dropdownvaluess;
items=new String[]{"First","Second","Last"};

ArrayAdapter<String> adapter=new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item,items);
dropdown.setAdapter(adapter);

dropdown.setOnItemSelectedListener(this);

dropdownvaluess=adapterView.getItemAtPosition(i).toString();

switch (i)
{
case 0:
Toast.makeText(getApplicationContext(), "First Item selected", Toast.LENGTH_SHORT).show();
break;
case 1:
Toast.makeText(getApplicationContext(), "Second Item selected", Toast.LENGTH_SHORT).show();
break;
case 2:
Toast.makeText(getApplicationContext(), "Last Item selected", Toast.LENGTH_SHORT).show();
break;
}

---------
[radio Button]
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioGroup
android:id="@+id/radiogrp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/radiobtn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Male" />
<RadioButton
android:id="@+id/radiobtn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Female" />
</RadioGroup>
</LinearLayout>

if(radiogrp!=null)
{
radiogrp.setOnCheckedChangeListener(this);
}

@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
text="You selected:";
text +=(R.id.radiobtn1==i) ?"Male":"Female";
Toast.makeText(getApplicationContext(), text, Toast.LENGTH_SHORT).show();

}

------------
[WebView]
webView.setWebViewClient(new MYBrowser());
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadsImagesAutomatically(true);
webView.loadUrl(txtEdit.getText().toString());

private static class MYBrowser extends WebViewClient {

@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
return super.shouldOverrideUrlLoading(view, request);
}
}
----------
[Serachview]
String[] demos;
demos=getResources().getStringArray(R.array.data);
adapter1=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,demos);

views.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
return false;
}

@Override
public boolean onQueryTextChange(String s) {
adapter1.getFilter().filter(s);
return false;
}
});
------------
[Context menu]
<TextView
android:layout_marginTop="500dp"
android:id="@+id/menus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Menu Context" />

registerForContextMenu(menus);
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Chose one");
menu.add(0,v.getId(),0,"Yellow");
menu.add(0,v.getId(),0,"Blue");
}

@Override
public boolean onContextItemSelected(@NonNull MenuItem item) {
if(item.getTitle()=="Yellow")
{
layout.setBackgroundColor(Color.YELLOW);
}
else if(item.getTitle()=="Blue")
{
layout.setBackgroundColor(Color.BLUE);
}
return true;

}
-----------
[internal storage]
private void internalstorage() {
String Filename="MyFile.txt";

try {
FileOutputStream stream=openFileOutput(Filename,MODE_APPEND);
OutputStreamWriter writer=new OutputStreamWriter(stream);
writer.write(txtEdit.getText().toString());
writer.flush();
writer.close();
Toast.makeText(getApplicationContext(), "Success File input", Toast.LENGTH_SHORT).show();
}
catch (FileNotFoundException e)
{

}
catch (Exception e){

}
}
private void ReadDataformStorage() {
String line,FileContact="";

try {
FileInputStream stream=openFileInput("MyFile.txt");
BufferedReader reader=new BufferedReader(new InputStreamReader(stream));
while((line=reader.readLine())!=null)
{
FileContact+=line;
txtEmail.setText(FileContact);
Toast.makeText(getApplicationContext(), "retrive data", Toast.LENGTH_SHORT).show();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

}
------------------
[Gallery]
<Gallery
android:id="@+id/languagesGallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:animationDuration="2000"
android:padding="10dp"
android:spacing="5dp"
android:unselectedAlpha="50" />

<ImageView
android:id="@+id/imageView"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:scaleType="fitXY" />
public class CustomizedGalleryAdapter extends BaseAdapter {
private Context context;
private int[] images;

public CustomizedGalleryAdapter(Context c, int[] images) {
context = c;
this.images = images;
}

public int getCount() {
return images.length;
}

public Object getItem(int position) {
return position;
}

public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {

ImageView imageView = new ImageView(context);

imageView.setImageResource(images[position]);

imageView.setLayoutParams(new Gallery.LayoutParams(200, 200));
return imageView;
}
}

Gallery simpleGallery;
CustomizedGalleryAdapter customGalleryAdapter;
ImageView selectedImageView;

//to store image
int[] images = {R.drawable.img1,
R.drawable.img2, R.drawable.img3, R.drawable.img4, R.drawable.img5};


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);

simpleGallery = findViewById(R.id.languagesGallery);
selectedImageView = findViewById(R.id.imageView);

//make new java file and extended baseadapter
customGalleryAdapter = new CustomizedGalleryAdapter(getApplicationContext(),images);
simpleGallery.setAdapter(customGalleryAdapter);

//to create setonclicklistener
simpleGallery.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
selectedImageView.setImageResource(images[position]);
}
});
------------
[permission]
if(ActivityCompat.checkSelfPermission(getApplicationContext(),Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, 1);
}
---------
[shape]
setContentView(new shape1(this));

public class shape1 extends View {
public shape1(Context context) {
super(context);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int x = canvas.getWidth()/2;
int y = canvas.getHeight()/2;
Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);
p.setColor(Color.WHITE);
canvas.drawColor(Color.GRAY);
Paint blackEar = new Paint(Paint.ANTI_ALIAS_FLAG);
Paint blackLine = new Paint(Paint.FAKE_BOLD_TEXT_FLAG);
blackLine.setStrokeWidth(10);
blackLine.setColor(Color.BLACK);

canvas.drawCircle(x,y,450,p);
canvas.drawCircle(x-350,y-350,150,blackEar);
canvas.drawCircle(x+350,y-350,150,blackEar);
canvas.drawLine(x,y,x-50,y+150,blackLine);
canvas.drawLine(x,y,x+50,y+150,blackLine);
canvas.drawLine(x-50,y+150,x+50,y+150,blackLine);

canvas.drawRect(x-175,y-150,x-150,y-100,blackLine);
canvas.drawRect(x+175,y-150,x+150,y-100,blackLine);
canvas.drawArc(new RectF(x-250,y+100,x+250,y+350),0,180,false,blackLine);

}
}
--------
[Validation]
if (email.getText().toString().isEmpty()) {
emailError.setError(getResources().getString(R.string.email_error));
isEmailValid = false;
}
else if (!Patterns.EMAIL_ADDRESS.matcher(email.getText().toString()).matches()) {
emailError.setError(getResources().getString(R.string.error_invalid_email));
isEmailValid = false;
}

else if(!Pattern.matches("^[6-9]\d{9}$",phone.getText().toString()))
{
phoneError.setError(getResources().getString(R.string.phone_error));
isPhoneValid = false;

}
--------------------------
[SharedPrefrences]
EditText txtEmail,txtPassword;
Button btnLogin;
SharedPreferences sharedPreferences;

String Email=txtEmail.getText().toString();
String Password=txtPassword.getText().toString();

sharedPreferences=getSharedPreferences("MyPreferences",MODE_PRIVATE);
btnLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(Email.equalsIgnoreCase("[email protected]") && (Password.equalsIgnoreCase("12345"))) {
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("email", Email);
editor.commit();
Intent intent = new Intent(getApplicationContext(), MainActivity8.class);
startActivity(intent);
}
else
{
Toast.makeText(MainActivity7.this, "Wrong Input", Toast.LENGTH_SHORT).show();
}

}
});
btnLogout = findViewById(R.id.btnLogout);

sh = getSharedPreferences("MyPreferences", MODE_PRIVATE);
if (sh.contains("email")) {
text1.setText(sh.getString("email",""));
}
btnLogout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sh.edit();

editor.putString("email", "");
editor.commit();
finish();

}
});
---------------------------------------------
=============================================
https://buildcoding.com/android-tutorial-for-crud-operations-with-retrofit/
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.