In this tutorial we are going code back-end for the Android App we build in other tutorial. For this we will use Android Volley to send request on server. Fortunately, Android studio does most of this part too. We only need to send the request for the login authentication or sign up from our android app.
- Removed the Async Class as the android volley automatically send the network requests in threads. Android Studio add the async class for the network operations as no network operation can be performed in the main thread.
- Remove all the relevant code to the async class.
- Paste the url of your server in string.xml and also change the file name accordingly in the java files. You can make your laptop a server using xampp. Follow the tutorial here for further instructions if you get troubled.
- Add the uses-permission in Android Manifest file.
<uses-permission android:name="android.permission.INTERNET"/>
- Add the dependency for Android Volley in build.gradle (Module: app).
compile 'com.android.volley:volley:1.0.0'
- Write the code to send request to server for login or sign up.
- Write the server side code. For this tutorial I am just sending success from the server for both login.php and signup.php.
<?php echo "success"; ?>
And that all. You are done with the Android App for Login and Sign Up. You can get the complete android app code with back-end at Github Repository. Or you can get the code below in this post for login and sign up classes.
LoginActivity.java
SignUp.java
In case of error
If you get some error, the first thing you should check is permissions in android androidManifest.xml and build.gradle. If you still get the error feel free to comment below or contact me at farooqahmadkhan003@gmail.com.
What i do not realize is in fact how you're now not actually much more well-appreciated than you might be now. You're very intelligent. You understand thus considerably with regards to this subject, produced me personally consider it from a lot of numerous angles. Its like men and women don't seem to be fascinated except it is one thing to accomplish with Lady gaga! Your own stuffs great. All the time deal with it up! How To Create A Mobile App From Scratch
ReplyDeleteI like what you guys are usually up too. Such clever work and coverage! Keep up the awesome works guys I've included you guys to our blogroll. How To Make A Mobile Game App
ReplyDeleteHello there! I just want to give you a big thumbs up for your great information you have got right here on this post. I am coming back to your site for more soon. How To Create An App Without Coding For Free
ReplyDeleteI don't even know the way I stopped up here, however I assumed this publish was once great. I don't understand who you're but definitely you are going to a well-known blogger if you are not already. Cheers! How Do I Make An App To Sell
ReplyDeleteIt's actually very complex in this full of activity life to listen news on TV, therefore I just use world wide web for that reason, and take the most up-to-date news. Create An App Make Money
ReplyDeleteThis Date Calculator app will allow you to calculate the duration like total days, total years, total weeks and total hours between any two given dates which makes the process in a easy and simple way. count number of days
ReplyDelete