Question: Hello, I am trying to add a permanent database using SQLite to my android studio gps code using api 2 7 can you please help
Hello, I am trying to add a permanent database using SQLite to my android studio gps code using api can you please help me make the database helper java class and tell me how to add it into my code with steps. I am very new to android studio so please make it easy for meI dont want to change my code. My gps app works but the information doesnt store permenantly so please tell me how i can do it Please make it very simple. here is a section of my code mainactivity.java so you can help adapt to it
private void showInputDialogString locationText
AlertDialog.Builder builder new AlertDialog.Builderthis;
LayoutInflater inflater getLayoutInflater;
View dialogView inflater.inflateRlayout.dialoginput, null;
EditText countryInput dialogView.findViewByIdRidcountryInput;
RatingBar ratingBar dialogView.findViewByIdRidratingBar;
builder.setViewdialogView
setTitleAdd Location Details"
setPositiveButtonSavedialog which
String country countryInput.getTexttoString;
float rating ratingBar.getRating;
if country.isEmpty
String entry locationText Country: country Rating: rating stars";
locationList.addentry;
adapter.notifyDataSetChanged;
Toast.makeTextthis "Location saved!", Toast.LENGTHSHORTshow;
else
Toast.makeTextthis "Please enter a country.", Toast.LENGTHSHORTshow;
setNegativeButtonCanceldialog which dialog.dismiss
create
show;
The full code is way to big to send so please try to use what you can. After the app records your ip it will save it with the rating and location name but when you close the app, all the data is gone which is why you need a sqlite permenant database to save all the information. Please use what you can and make it very simple and easy for me to understand
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
