Create app to save all passwords, protected using voice key
2. Apart from main.xml, add three new pages, list.xml, add.xml, password.xml.
3. In main.xml/MainActivity:
i. add two TextViews: textview1 and textview2.
ii. Add following components: Intent i, SpeechToText spttxt, and SharedPreferences sp:sp.
iii. In onCreate event, if some password is saved in SharedPreferences, make textview2 GONE, and set textview1 to empty.
iv. In textview1 onClick event, if saved password is '-none' use Intent to move to ListActivity, else set SpeechToText start listening.
v. In the event SpeechToText: onSpeechResponse, if result equals saved password, or if result equals 'ON' and no password is saved, use Intent to move to ListActivity, else FinishActivity.
vi. In the event SpeechToText: onSpeechError, FinishActivity.
4. In Image Manager add images ic_add_white and ic_settings_white.
5. Create a new CustomView items.xml. Here add textview1 for site, textview2 for username, textview3 for password, and textview4 for more details.
6. In list.xml/ListActivity:
i. Add a linear1 and inside that add listview1. Change background colour of linear1.
ii. Add following components: Intent intent, and SharedPreferences sp:sp.
iii. Add a Map variable map and a List Map maplist.
iv. In onCreate event, if SharedPreferences key 'all' is not empty, get data from SharedPreferences key 'all' to maplist, and display it in listview1.
v. In onStart event, if SharedPreferences key 'new' is not empty; get data from SharedPreferences key 'new' to map, and add map to maplist. After that save maplist in SharedPreferences key 'all' and display maplist in listview1.
vi. In ListView onBindCustomView event, display data from maplist in TextViews of CustomView.
vii. Add a More block deletes(position), and here delete the position in maplist, save maplist in SharedPreferences and display maplist in ListView.
viii. Add another More block extra, and here create an OptionsMenu with two items; ADD and PASSWORD. Then add onOptionsItemSelected method to move to AddActivity when ADD is selected and move to PasswordActivity when PASSWORD is selected.
Code in first add source directly block:
}
private static final int ADD = 1;
private static final int PASSWORD = 2;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(Menu.NONE, ADD, 0, "Add items").setIcon(R.drawable.ic_add_white).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
menu.add(Menu.NONE, PASSWORD, 0, "Change Password").setIcon(R.drawable.ic_settings_white).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case ADD:
Code in centre add source directly block:
return true;
case PASSWORD:
Code in last add source directly block:
return true;
default: return false; }
ix. In the event ListView onItemClicked, create an PopupMenu with two items; Delete and Edit. Then setOnMenuItemClickListener method. When 'Delete' is clicked, use more block deletes(position), and when 'Edit' is clicked, save the position and the data at that position of maplist and move to AddActivity.
Code in first add source directly block:
PopupMenu popup = new PopupMenu(ListActivity.this, listview1);
Menu menu = popup.getMenu();
menu.add("Delete");
menu.add("Edit");
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener(){
@Override
public boolean onMenuItemClick(MenuItem item){
switch (item.getTitle().toString()){
case "Delete":
Code in centre add source directly block:
break;
case "Edit":
Code in last add source directly block:
break;}
return true;
}
});
popup.show();
7. In add.xml/AddActivity:
i. Add four EditText and a Button as shown in image below.
ii. Add following components: SharedPreferences sp:sp.
iii. Add a Map variable map.
iv. In onCreate event, use blocks to get data to be edited in case edit was clicked, and display it in the EditText fields.
v. In Button onClick event, create a new Map and add data from EditText fields to the Map variable. Save the Map in SharedPreferences using key 'new' and FinishActivity.
8. In password.xml/PasswordActivity:
i. Add a TextView textview1, an EditText edittext1, a CheckBox checkbox1, and a Button button1.
ii. Add following components: SharedPreferences sp:sp, and SpeechToText sptt.
iii. In textview1 onClick event, set SpeechToText start listening.
iv. In the event SpeechToText: onSpeechResponse, set text of edittext1 to result and set checkbox1 setChecked false.
v. In the event checkbox1 onCheckChanged, if checkbox1 is checked, make edittext1 empty.
vi. In the event button1 onClick, if checkbox1 is checked, set SharedPreferences key 'password' to '-none', else set SharedPreferences key 'password' to the text in edittext1. After that FinishActivity.
9. Save and run the project.
10. Initial speak 'ON' to move to ListActivity. After that the password can be changed by clicking on the settings symbol on top.
Download the app here:
https://play.google.com/store/apps/details?id=com.sk.password.locker
Unbeliveable
ReplyDeleteشكرا لك شروØاتك كلها Øسنة
ReplyDeleteنعم يا صديقي
DeleteThis comment has been removed by the author.
ReplyDeleteIn the beginning you have to say 'ON' to enter the app. Check this https://youtu.be/PzbCkZUg58E
DeleteSir how to create custom view event in list view
DeleteSir please upload video about google firebase authentication for phone...
ReplyDeleteLogin/ signup with using mobile number with OTP ..
Still now, No one video available for that..you r one of the best developer so please please uploaddd itttt..
And your toturial date picker also not working getting an error plz check it..
Tutorial sketchware Indonesia klik di sini
ReplyDeleteCan You Help Me About How To Set If Block To If A Widget Is Visible Or Not. I wanna set it Visible if it's invisible and invisible if it's Visible, how can I do that?
ReplyDeleteHow to fix err_unknown_url_scheme intent://,whatsapp:// etc in Android WebView ?
ReplyDeleteHow to create app for
ReplyDeleteFab button on phone home screen
How to change layout shape
ReplyDeletePlease make a video on how to badge firebase data in list view by specific value.
ReplyDeleteWhere does the extra block go
ReplyDeleteThis comment has been removed by the author.
DeleteThe post is written in very a good manner and it contains many useful information for me. https://www.buyyoutubesubscribers.in/
ReplyDeleteExellent your post. i reaching daily on your blogs. thanks for sharing this informative information.
ReplyDeleteBuy YouTube Views
Buy YouTube Subscribers