I have been implementing the code of login and registration app from http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
I copy pasted the code along with following the instructions but I am still getting the registration error : null
in the log cat on pressing the register button.
The php files(ex: register.php)
are displaying {"error":true,"error_msg":"Required parameters (name, email or password) is missing!"}
, that means they are working fine.
I am using xampp and have kept the files in htdocs. I have checked various url in Appconfig.java
such as 127.0.0.1, 10.0.2.2:8080, 10.0.2.2:80
, and the ip of my computer system from ipconfig cmd, but still getting same error.
Here is the code of Appconfig.java.
package com.urjapawar.hackathon1;
public class AppConfig {
// Server user login url
public static String URL_LOGIN ="http://192.168.2.5/android_login_api/login.php";
// Server user register url
public static String URL_REGISTER = "http://192.168.2.5/android_login_api/register.php";
}
and here is the code of Android manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.urjapawar.hackathon1" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="com.urjapawar.hackathon1.AppController"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".LoginActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop" />
<activity
android:name=".RegisterActivity"
android:label="@string/title_activity_register"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" >
</activity>
</application>
Also I have checked correctly username and password in config.php, Please help.