Android - MySQL - 02 - Add data into MySQL Database
Why Stack Overflow recommends it
Stack Overflow users mostly appear as askers who followed this tutorial and then got stuck when inserts did not reach their MySQL database, so it is a widely used (and widely debugged) starting point.
Recommended by 2 people across 2 different months, 2015 to 2018.
What it is
A 2015 tutorial by PRABEESH R K, part 2 of a series, showing how to send data from an Android app to a MySQL database. It walks through an AsyncTask with HttpURLConnection posting to a server-side script, aimed at beginners building register and login features.
What people said
Recommends Shiyu Lian · 2016-04 · Stack Overflow · on “Can't insert data to the MySQL database using android studio”
I am a beginner with Android Studio. I want to build a project that user can register and then login using their own accounts. I follow the Prabeesh tutorial Android - MySQL - 02 - Add data into MySQL Database, [this video] . Every time click register, which should insert data to the MySQL data, MySQL database doesn't update. Here is the code: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void userReg(View view){ startActivity(new Intent(this, Register.class)); } public void userLogin(View view){ } } Here is the code for register activity: pub
Recommends Necati · 2016-08 · Stack Overflow · on “Inserting data with MYSQL but nothing happens”
I'm trying to insert data from my app to the MYSQL database. Im using HttpURLConnection to open a connection and writing it with a BufferedWriter . Everything works (nothing catches any exception) but somehow no data is being inserted into the table. (Im following this [this video] tutorial). I'm using the AsyncTask to do the networking in the background. As shown below I've created a new class who's extending from AsyncTask . public class BackgroundTask extends AsyncTask<String, Void, String> { Context ctx; BackgroundTask(Context ctx) { this.ctx = ctx; } This is the doInBackground method. @Override protected String doInBackground(String... strings) { String registerUrl = " [LINK] "; String metho
Cites Daim Shahzad · 2015-07 · Stack Overflow · on “android app unfortunately stopped ( database connection )”
I am trying to develop a single login registeration page. After following a couple of tutorials i finally found the only tutorial for API 22 because the http post methods used in other tutorials are deprecated. >> [this video] I haven't followed the whole tutorial because i am stuck at trying to store data into database. My app runs perfectly but when it come to the signup process it says that my app has "unfortunately stopped". I am new to android so please be polite. Below is my signup.java and backgroundtask.java files. i have hosted a free sql database at 000webhost public class Signup extends Activity{ Button signupbutt; EditText name , username , userpass , dob , email ; @Override protected
Cites Nisarg · 2016-08 · Stack Overflow · on “Android - Send login information to MySQL Database”
@tadman Thank you very much for letting me know about this, I will definitely work on fixing these problems. I just posted my own answer, where I included the new code I'm using (not from the tutorial - see the reference link) and things seem to be working fine now. Here is the link to the tutorial I was following before: [this video] Should I look for another tutorial? Please let me know what you think. I really appreciate your help.
Cites Konstantinos Archimandritis · 2017-09 · Stack Overflow · on “Android app doen't save data in WAMP database”
The user must add a marker by tapping the map. My goal is to send the Name, Category, Latitude and Longitude to a SQL database. I followed this tutorial: [this video] . The app works, it even gets a toast that the "Registration Succeeded!" but the database is still empty . Also , maybe there is something wrong with the communication between my app and the WampServer. I wonder if the connection URL is correct. I found on the Internet that the default WAMP localhost IP is 10.0.2.2 or it can work with my PC's local IP. Both of them didn't work. See the code: AddShopActivity.java public class AddShopActivity extends MainScreen implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, Google
Cites Shane Monks O'Byrne · 2018-01 · Stack Overflow · on “Writing GPS coords to an SQL server in a loop”
I am trying to send coordinates to a local SQL server I have set up. On the device, the user has a track recorded, which consists of tuples of lat/lon, else... They can click upload to send to server. In the code below, I am trying to write to the server with BufferedWriter in a loop, looping through each lat/lon tuple. However when I view what has actually been sent to the server, only a single entry has been sent, even though I loop X times. It appears I may be continuously overwriting BufferedWriter. Any help on how to send all data would be appreciated! I have been following this tutorial: [this video] try { URL url = new URL(upload_track_url); HttpURLConnection httpURLConnection = (HttpURLCo